Comment the use of waitCoordinatesCopiedToDevice
authorSzilárd Páll <pall.szilard@gmail.com>
Tue, 17 Dec 2019 12:43:00 +0000 (13:43 +0100)
committerArtem Zhmurov <zhmurov@gmail.com>
Tue, 17 Dec 2019 20:52:09 +0000 (21:52 +0100)
Tthis is to note that we are only using a barrier a mechanism to sync
with GPU tasks rather than to preventing a race between the copy and
other CPU tasks.

Change-Id: I8d432f7ef3e87e56beffa7f58230e50bcd59a666

src/gromacs/mdrun/md.cpp

index db8fb0bdf8e8afe4d74d0c147557531897c80aac..97c3afa6644eeaf35d7a615a08194e50a6a01508 100644 (file)
@@ -1424,6 +1424,9 @@ void gmx::LegacySimulator::do_md()
                     if (useGpuForUpdate)
                     {
                         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
+                        // (not because of a race on state->x being modified on the CPU while H2D is in progress).
                         stateGpu->waitCoordinatesCopiedToDevice(AtomLocality::Local);
                     }
                 }