Skip to content

add mpi in neighbor_search#7537

Open
19hello wants to merge 4 commits into
deepmodeling:developfrom
19hello:parallel_neighlist
Open

add mpi in neighbor_search#7537
19hello wants to merge 4 commits into
deepmodeling:developfrom
19hello:parallel_neighlist

Conversation

@19hello

@19hello 19hello commented Jun 30, 2026

Copy link
Copy Markdown
Collaborator

Summary

This PR adds MPI-aware domain decomposition to NeighborSearch and wires the LJ esolver path to use it when MPI is enabled.

Changes include:

  • add a NeighborSearch::init(..., mpi_rank, mpi_size) overload that partitions central atoms across MPI ranks
  • add span-aware MPI decomposition so zero-span directions are not split across ranks
  • generate rank-local inside atoms plus cutoff-relevant ghost/image atoms through a halo-based local member setup
  • keep the existing single-rank NeighborSearch interface available for non-MPI callers
  • update LJ neighbor-list construction to use MPI rank and size under __MPI
  • extend neighbor search unit tests for decomposition and serial-vs-local coverage behavior
  • add neighbor_search_mpi_benchmark.cpp and register an MPI ctest target for a 4-rank benchmark run

Motivation

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 16
  • env 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-failure

The MPI benchmark ctest passed with 4 ranks.

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