-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor/petsc openmpi fix #1064
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Remove default imports. Add imports to functions. rc option still supported.
This is used to test when OpenMPI is used with the executor. PETSc must not be imported globally, or nested MPI
jmlarson1
approved these changes
Aug 22, 2023
Unit tests for openmpi are failing because MPI being imported - anywhere in unit test dir - does not matter which test.
|
I dont like that automatic tools dictate lines that go together have been separated. I would prefer the "petsc" line was right under the gen_funcs line, as it originally was. import libensemble.gen_funcs
# Import libEnsemble items for this test
from libensemble.libE import libE
from libensemble.sim_funcs.six_hump_camel import six_hump_camel as sim_f
libensemble.gen_funcs.rc.aposmm_optimizers = "petsc" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The catch-22 is that when running with mpi4py you must have PETSc import globally, and when running with openMPI (and using the executor) it must NOT import globally, making a one size fits all solution non-trivial.
The default imports are removed, and rc options are retained. The imports are also added to the functions. If already globally imported (by the rc option), these will not do anything.
Note: The reason OpenMPI must not import globally (when using executor), is that PETSc imports mpi4py, and if that is done globally, it creates a nested comms, which openMPI does not support.
Note2: As the imports are in the functions, an alternative to the rc line for global import is to just import the package in the user calling script.