-
Notifications
You must be signed in to change notification settings - Fork 175
Enable user to take ownership of MPI #722
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
Open
otbrown
wants to merge
27
commits into
QuEST-Kit:devel
Choose a base branch
from
otbrown:mpi-update
base: devel
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
1c87a3c
Added ENABLE_SUBCOMM build option
otbrown 19ac320
Moved from MPI_COMM_WORLD to mpiQuestComm
otbrown 95415b7
Decided passing *MPI_Comm was probably overly cautious, and updated f…
otbrown 0699e58
environment.cpp: added methods to reset rank and numNodes, and report…
otbrown bfec279
comm_config.hpp/cpp: added comm_setMpiComm
otbrown 3a3bdff
CMakeLists.txt: PUBLIC MPI::MPI_CXX turned out to be unhelpful, even …
otbrown 3358581
Added new custom QuESTEnv initialiser which allow user to positively …
otbrown 6a093d0
validation.cpp: updated comm_end call
otbrown 727d1bc
Merge branch 'devel' into mpi-update
otbrown 588b636
comm_config.hpp: added config.h include so COMPILE_MPI is actually de…
otbrown 7c6caac
subcommunicator.h/cpp: implemented QuESTEnv initialiser with custom M…
otbrown e6628e4
CMake: added subcommunicator.cpp
otbrown bb2d5f2
comm_config.hpp: added missing config.h include...
otbrown 7c30b8c
comm_config.cpp: explicitly initialise mpiCommQuest to MPI_COMM_NULL,…
otbrown 7512e67
Merge branch 'mpi-update' of github.com:otbrown/QuEST into mpi-update
otbrown cb72846
quest.h: added subcommunicator header
otbrown 7ff2a2e
CMake: added MPI to application binaries when SUBCOMM is enabled
otbrown 13769be
Merge branch 'devel' into mpi-update
otbrown 68e435b
comm_routines.cpp: post Irecv before Isend which probably won't do an…
otbrown f15def4
tests: added new env test for initCustomMpiQuESTEnv
otbrown dbe2b1e
Added error throws to comm_config to cover new scenarios of badness w…
otbrown bf62480
subcommunicator.cpp: updated var names to match QuEST style
otbrown f26ae47
Merge branch 'devel' into mpi-update
otbrown 6edbd1c
Merge branch devel
otbrown ea23f30
tests/unit/initialisations.cpp: slightly modified setQuregAmps test t…
otbrown 142db02
Updated validation in comm_setMpiComm
otbrown d9d2369
userOwnsMpi int->bool
otbrown File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| #ifndef SUBCOMMUNICATOR_H | ||
| #define SUBCOMMUNICATOR_H | ||
|
|
||
| #include "quest/include/config.h" | ||
|
|
||
| #if COMPILE_MPI && COMPILE_SUBCOMM | ||
|
|
||
| #include <mpi.h> | ||
|
|
||
| #ifdef __cplusplus | ||
| extern "C" { | ||
| #endif | ||
|
|
||
| void initCustomMpiCommQuESTEnv(MPI_Comm questComm, int useGpuAccel, int useMultithread); | ||
|
|
||
| #ifdef __cplusplus | ||
| } | ||
| #endif | ||
|
|
||
| #endif | ||
|
|
||
| #endif |
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -12,6 +12,7 @@ target_sources(QuEST | |
| operations.cpp | ||
| paulis.cpp | ||
| qureg.cpp | ||
| subcommunicator.cpp | ||
| trotterisation.cpp | ||
| types.cpp | ||
| ) | ||
| ) | ||
This file contains hidden or 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
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| #include "quest/include/config.h" | ||
| #include "quest/include/environment.h" | ||
| #include "quest/include/subcommunicator.h" | ||
|
|
||
| #include "quest/src/comm/comm_config.hpp" | ||
|
|
||
| #if COMPILE_MPI && COMPILE_SUBCOMM | ||
|
|
||
| #include <mpi.h> | ||
|
|
||
| void initCustomMpiCommQuESTEnv(MPI_Comm userQuestComm, int useGpuAccel, int useMultithread) { | ||
| // useDistrib and userOwnsMpi are implied by the user of this initialiser | ||
| const int useDistrib = 1; | ||
| const int userOwnsMpi = 1; | ||
|
|
||
| // set mpiCommQuest to user provided communicator | ||
| comm_setMpiComm(userQuestComm); | ||
|
|
||
| // initialise QuEST around that communicator | ||
| initCustomMpiQuESTEnv(useDistrib, userOwnsMpi, useGpuAccel, useMultithread); | ||
|
|
||
| return; | ||
| } | ||
|
|
||
| #endif | ||
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think there is a problem with the order of operations or you must ensure MPI is initialized:
initCustomMpiCommQuESTEnv()duplicates the user communicator before verifying that the MPI runtime exists at all.In the case were MPI is not being initialized, the guard will be skiped