From ce0423db6705dc264e58fd983e55468274040604 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Szil=C3=A1rd=20P=C3=A1ll?= Date: Tue, 17 Dec 2019 13:43:00 +0100 Subject: [PATCH] Comment the use of waitCoordinatesCopiedToDevice 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 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/gromacs/mdrun/md.cpp b/src/gromacs/mdrun/md.cpp index db8fb0bdf8..97c3afa664 100644 --- a/src/gromacs/mdrun/md.cpp +++ b/src/gromacs/mdrun/md.cpp @@ -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); } } -- 2.22.0