Fix for force copy dependency of GPU force reduction
authorAlan Gray <alangray3@gmail.com>
Fri, 16 Oct 2020 11:15:41 +0000 (11:15 +0000)
committerArtem Zhmurov <zhmurov@gmail.com>
Fri, 16 Oct 2020 11:15:41 +0000 (11:15 +0000)
Fixes issue #3729

src/gromacs/mdlib/sim_util.cpp

index 47b6baac1bf0ef2fddddae85a59d91230af4e361..e788c6b66b2d2d5237d0f005f4aad8795402a016 100644 (file)
@@ -1089,8 +1089,10 @@ static void setupGpuForceReductions(gmx::MdrunScheduleWorkload* runScheduleWork,
     if ((runScheduleWork->domainWork.haveCpuLocalForceWork || havePPDomainDecomposition(cr))
         && !runScheduleWork->simulationWork.useGpuHaloExchange)
     {
+        auto forcesReadyLocality = havePPDomainDecomposition(cr) ? AtomLocality::Local : AtomLocality::All;
+        const bool useGpuForceBufferOps = true;
         fr->gpuForceReduction[gmx::AtomLocality::Local]->addDependency(
-                stateGpu->getForcesReadyOnDeviceEvent(AtomLocality::Local, true));
+                stateGpu->getForcesReadyOnDeviceEvent(forcesReadyLocality, useGpuForceBufferOps));
     }
 
     if (runScheduleWork->simulationWork.useGpuHaloExchange)