Repository navigation
Add MPI support to the Python API - #429
Draft
LourensVeen wants to merge 3 commits into
Draft
LourensVeen wants to merge 3 commits into
LourensVeen wants to merge 3 commits into
Conversation
This moves the checks for MPI from Instance down into the MPITcpBarrier class, where they're much less in the way.
Collaborator
|
Had a quick look at the changes, and this looks much cleaner and easier than the previous Let me know if/when you'd like a more in-depth review! |
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
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.
This adds MPI support to the Python API, addressing #375.
I started with refactoring the C++ implementation a bit, before translating it to Python. I didn't have much MPI experience when I made it, and I've since learnt that with MPI-optional code it's easier to assume MPI and take the non-MPI version as the exception rather than the other way around.
That leads to pushing the MPI-specific stuff down the call hierarchy as much as possible, and there's some ordinary refactoring there as well, which simplifies everything nicely.
For the Python API, I've decided to add a keyword-only
mpi=Trueargument toInstancewhich must be passed if you're using MPI. In C++, there's a preprocessor define and linking with the MPI version of the library for that, but that's not how Python works. Ifmpi=Trueis passed, then libmuscle will requirempi4pyand run in MPI mode. Withmpi=Falseor unspecified,mpi4pyis not required and everything works as before.(The Python side is still to be implemented, but I wanted to make sure the CI works with what I've got so far, hence the draft PR.)