espresso icon indicating copy to clipboard operation
espresso copied to clipboard

Use separate cutoff for bonded and non-bonded interactions

Open fweik opened this issue 4 years ago • 2 comments

Because espresso finds bond partners by an index, and not by spatial neighbor search it is sufficient for bond partners to be present (real or ghost) on the node where a bond is evaluated. Hence the cutoff for bonds needs only to be considered for the halo size, not for the cell size. This can lead to considerable performance increase: e.g. currently adding a dihedral bond doubles the cutoff, and hence the cell size. This causes an 8-fold increase in the number of pairs that are considered in the short range pair finding. It would actually be sufficient die just use a two-cell halo and leave the cell size as is, which would not affect the performance of the hot loop.

This is also required to be able to handle multi-body bonds without the need of a reduction after the force calculation, because by selecting an appropriate halo size for the bond types present (1, 2 or 3) allows for evaluating bonds on ghost particles without influencing the performance of the pair loop.

fweik avatar Apr 22 '20 10:04 fweik

Furthermore the bonded cutoff can then be ignored on a single node and for the n^2 cell system, because in either case all particles are always present.

fweik avatar Apr 28 '20 12:04 fweik

Several points have already been addressed in the upcoming 4.2.0 release, while the cell size remains an issue:

  • the bonded cutoff and non-bonded cutoff are now treated separately in the short-range loop https://github.com/espressomd/espresso/blob/ef9f4979ee3ab753f44e803147fb9ae75ace2ffc/src/core/short_range_loop.hpp#L47-L53
  • the bonded cutoff is now ignored on 1 MPI rank https://github.com/espressomd/espresso/blob/ef9f4979ee3ab753f44e803147fb9ae75ace2ffc/src/core/interactions.cpp#L59-L63
  • the bonded cutoff is still used for the skin, and hence for the cell size via mpi_set_skin() and cells_re_init() https://github.com/espressomd/espresso/blob/ef9f4979ee3ab753f44e803147fb9ae75ace2ffc/src/core/integrate.cpp#L448-L451

jngrad avatar Jun 09 '22 18:06 jngrad