From: Szilárd Páll Date: Tue, 17 Dec 2019 12:43:00 +0000 (+0100) Subject: Comment the use of waitCoordinatesCopiedToDevice X-Git-Url: http://biod.pnpi.spb.ru/gitweb/?a=commitdiff_plain;h=ce0423db6705dc264e58fd983e55468274040604;p=alexxy%2Fgromacs.git 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 --- 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); } }