-
Notifications
You must be signed in to change notification settings - Fork 919
Support for MPI communicators which are provided externally #1180
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
Conversation
pcarruscag
left a comment
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.
Thank you for opening the PR!
Delete line 470 of mpi_structure.hpp please.
No worries. It took a while to get it going due to some issues on my side catching up with 7.1.0 (in particular, compiling against MPICH). Regarding the deletion of the dummy |
|
Add a method to the MPI wrappers to get the global communicator or something equivalent, the only way to make this kind of change future-compatible is to break compilation. |
|
I merged #1178 earlier and fixed the old and new conflicts, some MPI_COMM_WORLD's will have been re-introduced in CFVMFlowSolverBase.hpp and .inl because in my previous 2 PR's I moved a lot of code. |
|
I've removed the dummy Now, the |
| /* Set the default MPI Communicator */ | ||
| #ifdef HAVE_MPI | ||
| CBaseMPIWrapper::Comm CBaseMPIWrapper::currentComm = MPI_COMM_WORLD; | ||
| #else | ||
| CBaseMPIWrapper::Comm CBaseMPIWrapper::currentComm = 0; // dummy value | ||
| #endif |
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 like this solution.
The rank and size are updated by the SetComm function so everything should work ok when creating a driver from scratch.
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.
Glad to hear that. Is anything still missing ? Not sure how to go about the failing check for code complexity ...
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.
Not for me, I'll ask around the developers meeting tomorrow if anyone else has comments, codefactor glitches out sometimes no need to do anything.
By the way would you like to be added to su2code? You can then have branches here instead of in your fork, makes it simpler to manage future PR's you might open.
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.
Yes, I suppose it would be more convenient that way. Thanks !
Proposed Changes
Replace references to the global MPI communicator
MPI_COMM_WORLDwithSU2_MPI::GetComm()where appropriate.This prevents deadlocking in cases where SU2 is given an MPI communicator other than
MPI_COMM_WORLD, for example when creating an instance ofCDriverthrough the Python interface.Related Work
Issue #1179
PR Checklist