add mpi in neighbor_search#7537
Open
19hello wants to merge 4 commits into
Open
Conversation
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
This PR adds MPI-aware domain decomposition to
NeighborSearchand wires the LJ esolver path to use it when MPI is enabled.Changes include:
NeighborSearch::init(..., mpi_rank, mpi_size)overload that partitions central atoms across MPI ranksNeighborSearchinterface available for non-MPI callers__MPIneighbor_search_mpi_benchmark.cppand register an MPI ctest target for a 4-rank benchmark runMotivation
The previous neighbor search path built the full expanded atom set per caller, which did not let MPI ranks own disjoint subsets of central atoms. This change lets each rank build only its local central atoms and the halo atoms needed for cutoff checks, reducing duplicated neighbor-search work in MPI runs while preserving the existing non-MPI behavior.
Validation
cmake --build /tmp/abacus-neigh-build --target MODULE_CELL_NEIGHBOR_neighbor_search_mpi_benchmark -j 16env LD_PRELOAD=/usr/lib/x86_64-linux-gnu/openblas-openmp/libopenblas.so.0 ctest --test-dir /tmp/abacus-neigh-build -R ^MODULE_CELL_NEIGHBOR_neighbor_search_mpi_benchmark_np4$ --output-on-failureThe MPI benchmark ctest passed with 4 ranks.