Gromacs
2021-beta2-UNCHECKED
|
#include <gromacs/domdec/gpuhaloexchange.h>
Manages GPU Halo Exchange object.
Classes | |
class | Impl |
Impl class stub. More... | |
Public Member Functions | |
GpuHaloExchange (gmx_domdec_t *dd, int dimIndex, MPI_Comm mpi_comm_mysim, const DeviceContext &deviceContext, const DeviceStream &streamLocal, const DeviceStream &streamNonLocal, int pulse, gmx_wallcycle *wcycle) | |
Creates GPU Halo Exchange object. More... | |
GpuHaloExchange (GpuHaloExchange &&source) noexcept | |
GpuHaloExchange & | operator= (GpuHaloExchange &&source) noexcept |
void | reinitHalo (DeviceBuffer< RVec > d_coordinateBuffer, DeviceBuffer< RVec > d_forcesBuffer) |
Initialization for GPU halo exchange of coordinates buffer. More... | |
void | communicateHaloCoordinates (const matrix box, GpuEventSynchronizer *coordinatesReadyOnDeviceEvent) |
GPU halo exchange of coordinates buffer. More... | |
void | communicateHaloForces (bool accumulateForces) |
GPU halo exchange of force buffer. More... | |
GpuEventSynchronizer * | getForcesReadyOnDeviceEvent () |
Get the event synchronizer for the forces ready on device. More... | |
gmx::GpuHaloExchange::GpuHaloExchange | ( | gmx_domdec_t * | dd, |
int | dimIndex, | ||
MPI_Comm | mpi_comm_mysim, | ||
const DeviceContext & | deviceContext, | ||
const DeviceStream & | streamLocal, | ||
const DeviceStream & | streamNonLocal, | ||
int | pulse, | ||
gmx_wallcycle * | wcycle | ||
) |
Creates GPU Halo Exchange object.
Constructor stub.
Coordinate Halo exchange will be performed in StreamNonLocal
, and the communicateHaloCoordinates
method must be called before any subsequent operations that access non-local parts of the coordinate buffer (such as the non-local non-bonded kernels). It also must be called after the local coordinates buffer operations (where the coordinates are copied to the device and hence the coordinatesReadyOnDeviceEvent
is recorded). Force Halo exchange will be performed in streamNonLocal
(also potentally with buffer clearing in streamLocal
)and the communicateHaloForces
method must be called after the non-local buffer operations, after the local force buffer has been copied to the GPU (if CPU forces are present), and before the local buffer operations. The force halo exchange does not yet support virial steps.
[in,out] | dd | domdec structure |
[in] | dimIndex | the dimension index for this instance |
[in] | mpi_comm_mysim | communicator used for simulation |
[in] | deviceContext | GPU device context |
[in] | streamLocal | local NB CUDA stream. |
[in] | streamNonLocal | non-local NB CUDA stream. |
[in] | pulse | the communication pulse for this instance |
[in] | wcycle | The wallclock counter |
void gmx::GpuHaloExchange::communicateHaloCoordinates | ( | const matrix | box, |
GpuEventSynchronizer * | coordinatesReadyOnDeviceEvent | ||
) |
GPU halo exchange of coordinates buffer.
apply X halo exchange stub.
Must be called after local setCoordinates (which records an event when the coordinate data has been copied to the device).
[in] | box | Coordinate box (from which shifts will be constructed) |
[in] | coordinatesReadyOnDeviceEvent | event recorded when coordinates have been copied to device |
void gmx::GpuHaloExchange::communicateHaloForces | ( | bool | accumulateForces | ) |
GPU halo exchange of force buffer.
apply F halo exchange stub.
[in] | accumulateForces | True if forces should accumulate, otherwise they are set |
GpuEventSynchronizer * gmx::GpuHaloExchange::getForcesReadyOnDeviceEvent | ( | ) |
Get the event synchronizer for the forces ready on device.
get forces ready on device event stub.
void gmx::GpuHaloExchange::reinitHalo | ( | DeviceBuffer< RVec > | d_coordinateBuffer, |
DeviceBuffer< RVec > | d_forcesBuffer | ||
) |
Initialization for GPU halo exchange of coordinates buffer.
init halo exhange stub.
[in] | d_coordinateBuffer | pointer to coordinates buffer in GPU memory |
[in] | d_forcesBuffer | pointer to coordinates buffer in GPU memory |