Add optional comm parameter for custom MPI communicators#19
Open
williamjameshandley wants to merge 1 commit intoanderkve:mainfrom
Open
Add optional comm parameter for custom MPI communicators#19williamjameshandley wants to merge 1 commit intoanderkve:mainfrom
williamjameshandley wants to merge 1 commit intoanderkve:mainfrom
Conversation
Add optional `comm` parameter to BinMinMPI, BinMinBottomUp, and all interface functions to allow users to pass custom MPI communicators instead of always using MPI.COMM_WORLD. This enables running binminpy on a subset of MPI ranks or integrating it into larger MPI applications that need to partition communicators. The change is fully backward compatible - when `comm` is not specified (or is None), the default MPI.COMM_WORLD is used. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
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.
Summary
commparameter toBinMinMPI,BinMinBottomUp, and all interface functionsMPI.COMM_WORLDChanges
BinMinMPI.__init__(): Addedcomm=Noneparameter, store asself.commBinMinBottomUp.__init__(): Addedcomm=Noneparameter, store asself.commminimize,differential_evolution, etc.): Addedcomm=Noneparameter_run_optimizer(): Passcommthrough toBinMinMPIconstructorBackward Compatibility
Fully backward compatible - when
commis not specified (or isNone), defaults toMPI.COMM_WORLD.Example Usage
Test plan
tests/test_custom_comm.py- TestsBinMinMPIwith explicitCOMM_WORLDand subcommunicatorstests/test_custom_comm_bottomup.py- TestsBinMinBottomUpwith explicitCOMM_WORLDmpiexec -np 4 python tests/test_custom_comm.pympiexec -np 4 python tests/test_custom_comm_bottomup.py🤖 Generated with Claude Code