Add new search algorithm#7337
Merged
Merged
Conversation
added 12 commits
May 13, 2026 19:08
There was a problem hiding this comment.
Pull request overview
This PR introduces a new neighbor-list based search implementation under module_neighlist and wires it into the Lennard-Jones (LJ) ESolver path, alongside new unit tests and build-system integration.
Changes:
- Added
module_neighlist(neighbor search + binning + neighbor list allocator) and corresponding unit tests. - Introduced an
IAtomProviderinterface and madeUnitCellimplement it. - Switched
ESolver_LJ::runnerfrom the existingmodule_neighborsearch path to the newNeighborSearchpath.
Reviewed changes
Copilot reviewed 20 out of 20 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| source/source_md/test/CMakeLists.txt | Adds new neighlist sources to MD test dependencies. |
| source/source_esolver/esolver_lj.h | Declares UnitCellPlus conversion helper used by the new neighbor search path. |
| source/source_esolver/esolver_lj.cpp | Replaces old grid-based neighbor search with NeighborSearch usage in LJ runner. |
| source/source_cell/unitcell.h | Makes UnitCell implement IAtomProvider for neighbor search consumption. |
| source/source_cell/module_neighlist/unitcell_plus.h | Adds a lightweight test-friendly IAtomProvider implementation. |
| source/source_cell/module_neighlist/unitcell_interface.h | Adds IAtomProvider abstraction for atom/lattice queries. |
| source/source_cell/module_neighlist/neighbor_search.h | Declares the new neighbor search API and data members. |
| source/source_cell/module_neighlist/neighbor_search.cpp | Implements neighbor search initialization, expansion, and neighbor building. |
| source/source_cell/module_neighlist/neighbor_list.h | Adds a simple page allocator + neighbor list storage type. |
| source/source_cell/module_neighlist/neighbor_atom.h | Adds NeighborAtom and InputAtoms structures used by the algorithm. |
| source/source_cell/module_neighlist/bin_manager.h | Declares binning and neighbor construction helper. |
| source/source_cell/module_neighlist/bin_manager.cpp | Implements bin construction, binning, and neighbor list building. |
| source/source_cell/module_neighlist/CMakeLists.txt | Adds neighbor_search object library and conditional tests subdir. |
| source/source_cell/module_neighlist/test/CMakeLists.txt | Adds new test targets for neighlist components. |
| source/source_cell/module_neighlist/test/neighbor_search_test.cpp | Adds unit tests for NeighborSearch behavior/branches. |
| source/source_cell/module_neighlist/test/neighbor_list_test.cpp | Adds unit tests for PageAllocator and NeighborList. |
| source/source_cell/module_neighlist/test/bin_manager_test.cpp | Adds unit tests for BinManager behavior and edge cases. |
| source/source_cell/CMakeLists.txt | Adds module_neighlist subdirectory to the cell build. |
| source/Makefile.Objects | Adds neighlist objects to Makefile-based build. |
| CMakeLists.txt | Links the new neighbor_search object library into the main target. |
Comments suppressed due to low confidence (1)
source/source_cell/module_neighlist/neighbor_search.cpp:65
NeighborSearch::inithard-codesmpi_size = 1while still acceptingmpi_rank. Formpi_rank != 0this produces invalid (x,y,z) decomposition and incorrect inside/ghost selection. Either passmpi_sizeintoinit(or query it from an MPI communicator) and validate0 <= mpi_rank < mpi_size, or remove the MPI-rank parameters until multi-rank decomposition is actually supported.
int mpi_size = 1;
int nx, ny, nz;
decompose(mpi_size, nx, ny, nz);
z = mpi_rank / (nx * ny);
y = (mpi_rank % (nx * ny)) / nx;
x = mpi_rank % (nx * ny) % nx;
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
mohanchen
approved these changes
May 13, 2026
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.
Reminder
Linked Issue
Fix #...
Unit Tests and/or Case Tests for my changes
What's changed?
Any changes of core modules? (ignore if not applicable)