for (int pulse = cr.dd->gpuHaloExchange[d].size(); pulse < cr.dd->comm->cd[d].numPulses(); pulse++)
{
cr.dd->gpuHaloExchange[d].push_back(std::make_unique<gmx::GpuHaloExchange>(
- cr.dd,
- d,
- cr.mpi_comm_mygroup,
- deviceStreamManager.context(),
- deviceStreamManager.stream(gmx::DeviceStreamType::NonBondedLocal),
- deviceStreamManager.stream(gmx::DeviceStreamType::NonBondedNonLocal),
- pulse,
- wcycle));
+ cr.dd, d, cr.mpi_comm_mygroup, deviceStreamManager.context(), pulse, wcycle));
}
}
}
}
}
-void communicateGpuHaloCoordinates(const t_commrec& cr,
- const matrix box,
- GpuEventSynchronizer* coordinatesReadyOnDeviceEvent)
+GpuEventSynchronizer* communicateGpuHaloCoordinates(const t_commrec& cr,
+ const matrix box,
+ GpuEventSynchronizer* dependencyEvent)
{
+ GpuEventSynchronizer* eventPtr = dependencyEvent;
for (int d = 0; d < cr.dd->ndim; d++)
{
for (int pulse = 0; pulse < cr.dd->comm->cd[d].numPulses(); pulse++)
{
- cr.dd->gpuHaloExchange[d][pulse]->communicateHaloCoordinates(box, coordinatesReadyOnDeviceEvent);
+ eventPtr = cr.dd->gpuHaloExchange[d][pulse]->communicateHaloCoordinates(box, eventPtr);
}
}
+ return eventPtr;
}
-void communicateGpuHaloForces(const t_commrec& cr, bool accumulateForces)
+void communicateGpuHaloForces(const t_commrec& cr,
+ bool accumulateForces,
+ gmx::FixedCapacityVector<GpuEventSynchronizer*, 2>* dependencyEvents)
{
for (int d = cr.dd->ndim - 1; d >= 0; d--)
{
for (int pulse = cr.dd->comm->cd[d].numPulses() - 1; pulse >= 0; pulse--)
{
- cr.dd->gpuHaloExchange[d][pulse]->communicateHaloForces(accumulateForces);
+ cr.dd->gpuHaloExchange[d][pulse]->communicateHaloForces(accumulateForces, dependencyEvents);
+ dependencyEvents->push_back(cr.dd->gpuHaloExchange[d][pulse]->getForcesReadyOnDeviceEvent());
}
}
}