Remove excessive H2D and D2H copies of forces when update is offloaded
authorArtem Zhmurov <zhmurov@gmail.com>
Thu, 17 Oct 2019 13:36:09 +0000 (15:36 +0200)
committerBerk Hess <hess@kth.se>
Thu, 31 Oct 2019 07:16:42 +0000 (08:16 +0100)
commit7f2e863648b8c21d8037dbc0e5fe3aa701d73712
tree32e8c9822efc48e6665e2a9bb5864d73b0f5d580
parentb9c466ab068f40fc6549385570d99aff10c58d66
Remove excessive H2D and D2H copies of forces when update is offloaded

Forces are copied H2D only on steps when force buffer ops is not
offloaded to the GPU (e.g. steps when virials are computed).

The D2H copy is issued:
- after force buffer ops if the update is not offloaded or if the
  forces are needed on CPU by seprate PME rank force reduction or
  for vsites force spreading.
- for the force output if update is offloaded and forces were not copied
  yet.

Also added note regarding the need for the latter copy to ensure forces
are ready using the same mechanism as used for synchronizing update on
the availability of forces.

Change-Id: Ied74638d35e74a8970427df712501cd63e0aa0ab
src/gromacs/mdlib/sim_util.cpp
src/gromacs/mdrun/md.cpp