Skip to content
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

Eliminate the need for a ghost force reduction #4556

Open
6 tasks
RudolfWeeber opened this issue Aug 23, 2022 · 2 comments · May be fixed by #4777
Open
6 tasks

Eliminate the need for a ghost force reduction #4556

RudolfWeeber opened this issue Aug 23, 2022 · 2 comments · May be fixed by #4777

Comments

@RudolfWeeber
Copy link
Contributor

Currently, Es calculates forces/energies in the RegularDecomposition as follows:
\

  • Iterate over all local (not ghost) cells
  • For each of them consider all upper/right/back neighbor cells (i.e. some 14 of the 27), including ghost cells, and calculate forces. Forces are added to the particles on both sides. I.e. a force contribution is added to particles in local cells AND to particles in ghost cells
  • At the end, a reduction is carried out across mpi node boundaries: the forces of physical particels on one node and the forces on the corresponding ghost particles on other nodes are accumulated, so that the total force from all interactiosn (including thos frome other mpi nodes) is available on the physical particle

The drawback of this scheme is the need for an additional communication step, i.e., the ghost force reduction. This is assumed to be one of the main obstacles to Espresso's scaleability, as all nodes have to wait for each other in the communicaiot step of the reduction.
The aim of this project is to gradually remove the need for this ghost force reducion.

[ ] Phase 1: Short-range non-bonded forces

At the end of this step, an LJ fluid should run without ghost force reduciotn. Other featuers such as bonds and vitual sites will break.

  1. Add a flag to the constructor of the RegularDecomposition without_ghost_force_reduction
  2. Support it in the Python interface. See the additional parameters of the HybridDecomposition for inspiration.
  3. If the flag is true, the local cells neighboring ghost cells ON ALL SIDES have to be added to the ghost cells red_neighbors. This is done in RegularDecomposition::init_cell_interactions()
  4. If the flag is true, omit the ghost force reduction by returning an emtyp GhostCommunicator from RegularDecomopsition::collect_ghost_forces_comm()
  5. Expose the flag via an interface function in the ParticleDecomposition class hierarchy (via a a virtual function returning false in the ParticleDecomposition base class). For the RegularDecomposition override it, returning the actual value of the flag.
  6. In CellStructure::linked_cell(), query the without_ghost_force_reudciont flag of the decomposition stored in CellStructure::m_decomposition via the interface function added in the previous step. If true, run the algorithm::linked_cell() on the m_ghost_cells in addition to the current call on m_local_cells. You'll have to replicate the construciotn of fisrt/last the way it's done for m_local_cells.
@RudolfWeeber
Copy link
Contributor Author

@pkreissl can you please read through this and check, whether it aligns with your understanding of the cell system?

@pkreissl
Copy link
Contributor

I concur with your description the cell system, this is also my understanding of how it currently works in ESPResSo.

@jngrad jngrad added the Core label Jul 25, 2023
@capomav capomav linked a pull request Aug 22, 2023 that will close this issue
@RudolfWeeber RudolfWeeber added this to the ESPResSo 4.3.0 milestone Jul 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants