Skip to content

MPI: hash MPIMemorySpace without the raw communicator handle - #789

Open
AnnaLena77 wants to merge 1 commit into
JuliaParallel:masterfrom
AnnaLena77:pr/a0a-mpi-space-hash
Open

AnnaLena77 wants to merge 1 commit into
JuliaParallel:masterfrom
AnnaLena77:pr/a0a-mpi-space-hash

Conversation

@AnnaLena77

Copy link
Copy Markdown

hash(::MPIMemorySpace) includes space.comm.val. In MPICH that value is a small integer that is equal on every rank; in Open MPI it is a pointer and differs in every process. The uniformity check hashes a Vector{MemorySpace} on each rank and compares the results, so ranks that agree reported "Non-uniform value".

On the Fulda cluster, unchanged master with Open MPI gave 19 such failures at 2 ranks x 4 threads and 47 at 2 x 2 in test/mpi. With this change there are none.

The fix leaves the handle out of the hash. == still distinguishes communicators, and a coarser hash is allowed.

The change is 5 lines in ext/MPIExt.jl. I have not added a test: the failure only appears with an MPI implementation whose communicator handles differ between processes, so the existing MPI suite under Open MPI is the check.

AI disclosure: I prepared this change with the help of Claude (Anthropic) and reviewed it myself.
🤖 Generated with Claude Code

The hash included space.comm.val. In MPICH that is a small integer, equal on
every rank; in Open MPI it is a pointer, different in every process. The
uniformity check hashes a Vector{MemorySpace} on each rank and compares, so
ranks that agreed reported 'Non-uniform value' (19 failures at 2 ranks x 4
threads and 47 at 2 x 2 on the Fulda cluster, on unchanged master). Leave the
handle out: == still distinguishes communicators and a coarser hash is allowed.

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant