Balance event consumption for GPU update code path
[alexxy/gromacs.git] / src / gromacs / mdrun / md.cpp
index 0a59a4f2535bca973a34366ef336b2dce519ee23..3898e07d3af54303c6059984bfc88b8a3e7a430f 100644 (file)
@@ -1707,6 +1707,8 @@ void gmx::LegacySimulator::do_md()
                     // TODO: The special case of removing CM motion should be dealt more gracefully
                     if (useGpuForUpdate)
                     {
+                        // Issue #3988, #4106.
+                        stateGpu->resetCoordinatesCopiedToDeviceEvent(AtomLocality::Local);
                         stateGpu->copyCoordinatesToGpu(state->x, AtomLocality::Local);
                         // Here we block until the H2D copy completes because event sync with the
                         // force kernels that use the coordinates on the next steps is not implemented