Fix duplicate micro simulations for macro-points on rank boundaries #102#220
Open
AdityaGupta716 wants to merge 3 commits intoprecice:developfrom
Open
Fix duplicate micro simulations for macro-points on rank boundaries #102#220AdityaGupta716 wants to merge 3 commits intoprecice:developfrom
AdityaGupta716 wants to merge 3 commits intoprecice:developfrom
Conversation
Author
|
@MakisH @IshaanDesai Plz review |
|
This pull request has been mentioned on preCICE Forum on Discourse. There might be relevant details there: https://precice.discourse.group/t/gsoc-2026-aditya-gupta/2773/1 |
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.
Closes #102
Problem:
When running the Micro Manager in parallel, each MPI rank is assigned a bounding box. Macro-points lying exactly on the boundary between two ranks were being included in both, causing the Micro Manager to create duplicate micro simulations for the same point. This led to:
Incorrect results in preCICE, which accumulates both outputs
Wasted computation from running identical micro simulations
Potentially different outputs with local adaptivity
Fix:
In get_local_sims_and_macro_coords, added an is_upper_boundary check per axis. A rank now uses <= for its upper bound only if that bound coincides with the global domain boundary — otherwise < is used. This ensures every boundary point is assigned to exactly one rank.
Changes:
micro_manager/domain_decomposition.py: Fixed boundary condition logic in get_local_sims_and_macro_coords
tests/unit/test_domain_decomposition.py: Added test_no_duplicate_coords_on_boundary_2d to verify no point is double-counted across ranks