Skip to content

Fix duplicate micro simulations for macro-points on rank boundaries #102#220

Open
AdityaGupta716 wants to merge 3 commits intoprecice:developfrom
AdityaGupta716:p1
Open

Fix duplicate micro simulations for macro-points on rank boundaries #102#220
AdityaGupta716 wants to merge 3 commits intoprecice:developfrom
AdityaGupta716:p1

Conversation

@AdityaGupta716
Copy link

@AdityaGupta716 AdityaGupta716 commented Feb 23, 2026

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

@AdityaGupta716 AdityaGupta716 changed the title Fix duplicate assignment of boundary points in domain decomposition Fix duplicate assignment of boundary points in domain decomposition #102 Feb 23, 2026
@AdityaGupta716 AdityaGupta716 changed the title Fix duplicate assignment of boundary points in domain decomposition #102 Fix duplicate micro simulations for macro-points on rank boundaries #102 Feb 23, 2026
@AdityaGupta716
Copy link
Author

AdityaGupta716 commented Feb 23, 2026

@MakisH @IshaanDesai Plz review

@MakisH MakisH added the GSoC Contributed in the context of the Google Summer of Code label Feb 25, 2026
@precice-bot
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

GSoC Contributed in the context of the Google Summer of Code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Duplicate micro-simulations on interior boundaries of macro-domain decomposition

3 participants