Skip to content

feature: detect MPI desynchronizations#4091

Draft
kdrienCG wants to merge 13 commits into
developfrom
feature/kdrienCG/detectMPIDesync
Draft

feature: detect MPI desynchronizations#4091
kdrienCG wants to merge 13 commits into
developfrom
feature/kdrienCG/detectMPIDesync

Conversation

@kdrienCG

Copy link
Copy Markdown
Contributor

The goal of this PR is to add a way to detect MPI desynchronizations.

MPI desynchronizations occur when an MPI operation is not called on all ranks (for example, due to an if condition or a for loop). When this happens, subsequent MPI operations may become non-blocking, potentially leading to incorrect results.

Identifying whether a desynchronization has occurred, and locating it, can be long.

This PR proposes mechanism to detect such desynchronizations. It also outputs the current stack trace when such desynchronization occurs.


Implementation

The current approach adds a barrier (which should remain blocking even if a desynchronization occurs) after every collective MPI call, combined with a timeout() to detect infinite hangs. If the timeout is exceeded (there is an infinite hang), it indicates that not every ranks of the current communicator participated in the collective MPI operation we are monitoring, indicating a desynchronization.


Compile option

This feature is currently behind a compile option (-DGEOS_ENABLE_MPI_DESYNC_DETECTION=ON).
All code related to the detection is behind guards, and doesn't get compiled if GEOS is not built with the compile option.

I am not anchored on this choice, neither for the implementation. I'm open to any proposition.

@kdrienCG kdrienCG self-assigned this Jun 25, 2026
@kdrienCG kdrienCG marked this pull request as draft June 25, 2026 08:20
@kdrienCG kdrienCG added type: feature New feature or request flag: no rebaseline Does not require rebaseline labels Jun 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

flag: no rebaseline Does not require rebaseline type: feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant