-
Notifications
You must be signed in to change notification settings - Fork 189
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Efficient search for interacting particles #4399
Comments
@stekajack @jhossbach @pm-blanco If you like, you can work on this, tomorrow. |
I can tinker with this, but probably don't manage to get to it today. |
stekajack
referenced
this issue
in stekajack/espresso_patched
Dec 14, 2021
kodiakhq bot
added a commit
that referenced
this issue
May 19, 2022
Fixes #4399, fixes #4438 Description of changes: - `CellStructure.cpp`: Added the `CellStructure::run_on_particle_short_range_neighbors()` method which runs a kernel function over all particles inside the cell and its neighbors of a given particle - `cells.hpp`: Added the `mpi_get_short_range_neighbors()` function to execute a parallel search - can be called from the Python interface via `system.cell_system.get_neighbors.get_neighbors(p, distance)` - `energy.hpp`: Added the `compute_non_bonded_pair_energy()` function which returns both the short-range Coulomb interactions plus the non-bonded energy contributions of two particles - can be called from the Python interface via `system.analysis.particle_energy(p)` - Reaction methods can use the new neighbor search algorithm with constructor argument `search_algorithm="parallel"` (default is `search_algorithm="order_n"`); on 1 MPI rank the original order N algorithm is faster since the parallel algorithm introduces some overhead due to the ghost update (this overhead is negligible with 2 or more MPI ranks)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Currently the search for (short-range) interacting particles, e.g., in the reaction ensemble, is n-square, as all other particles in the system are considered. This is not necessary when the cell system is a regular domain decomposition.
Objectives:
CellStructure
that can execute a given kernel function on all particles within the short-range interaction range of a given particle p.Implement
CellStructure::run_on_particle_short_range_neighbors
This should take a kernel and a particle, i.e.,
Steps:
particle_to_cell
(It might be necessary to use the position at the last resort, which is also in p.r).nullptr
is returned, the particle should not be on the mpi rank. Returnfalse
cell.particles()
Cell.hpp
). Iterate over the particles in those neighboring cellskernel(p)
true
Implement
get_short_range_neighbors(const Particle& p)
in cells.cpp/hppstd::vector<int>
to store the particle ids.CellStrucutre.run_on_particle_short_range_neighbors()
, use a lambda[&result_vector](const Particle& p)
which appends the particle id to the result vector. See the get_pairs code incells.cpp
for inspirationImplement
particle_short_range_energy_contribution(const Particle& p)
in energy.cpp/hppSame as above, but
[&result, &p](const Particle& q)
add_non_bonded_pair_energy()
(energy_inline.hpp
) to the resultPython interface
mpi_...
boost::optional
)See
get_particle_data_local
, correspondingREGISTER_CALLBACK_ONE_RANK
and the mpi call inget_particle_data()
(below where it says "cache miss") FOR INSPIRATIONThe text was updated successfully, but these errors were encountered: