Fix incorrect event dependency of GPU update
authorSzilárd Páll <pall.szilard@gmail.com>
Sat, 28 Aug 2021 21:32:26 +0000 (23:32 +0200)
committerSzilárd Páll <pall.szilard@gmail.com>
Thu, 23 Sep 2021 16:49:44 +0000 (16:49 +0000)
commit4d38a0d65839f951bf275e465f8fb65a35b60b8d
treeb581c25de5fb3e178185f2dffc273f87c997a016
parent29984ebe842aef8fe35f9fca21139a12f50b65e3
Fix incorrect event dependency of GPU update

With separate PME ranks, staged communication and GPU update, the final
forces are produced on the CPU and re-uploaded to the GPU prior to
update. This upload was done on a "All" locality leading to an incorrect
dependency on an event corresponding to the GPU reduction.
This leads ot a logic error and incorrect synchronization, but not
incorrect results as the "All" locality copy is done on the update
stream, hence implicit dependency applies.

This change moves this special case copy to the same locality used in
other force host to device copies to eliminate the bug.

Fixes #4130
src/gromacs/mdrun/md.cpp