|
Gromacs
2027.0-dev-20260904-8b74e934
|
#include <gromacs/ewald/pme_pp_comm_gpu.h>
Manages communication related to GPU buffers between this PP rank and its PME rank.
Note that the coordinates and forces are transferred between each on each step, even from empty domains. However the long-range forces only participate in the subsequent reduction phase when the domain has particles.
Public Member Functions | |
| PmePpCommGpu (MPI_Comm comm, int pmeRank, const DeviceContext &deviceContext, const DeviceStream &deviceStream, bool useNvshmem) | |
| Creates PME-PP GPU communication object. More... | |
| void | reinit (ArrayRef< RVec > pmeCpuForceReceiveBuffer) |
| Perform steps required when buffer size changes. More... | |
| void | receiveForceFromPme (bool recvPmeForceToGpu) |
| Receive forces from PME GPU. More... | |
| void | sendCoordinatesToPmeFromGpu (DeviceBuffer< RVec > sendPtr, int sendSize, GpuEventSynchronizer *coordinatesReadyOnDeviceEvent, bool receiveForcesToGpu) |
| Push coordinates buffer directly to GPU memory on PME task Note that, when using GPU-aware MPI with staged communication and not using NVSHMEM for GPU force receives, this method also posts a non-blocking force receive request to overlap communication with computation. More... | |
| void | sendCoordinatesToPmeFromCpu (const RVec *sendPtr, int sendSize, bool receiveForcesToGpu) |
| Push coordinates buffer from host memory directly to GPU memory on PME task. More... | |
|
std::optional< DeviceBuffer < RVec > > | getGpuForceStagingPtr () |
| When this PP rank has particles with PME force contributions expected from its PME-only rank, return pointer to buffer used for staging PME force on GPU. | |
|
std::optional < GpuEventSynchronizer * > | getForcesReadySynchronizer () |
| When this thread-MPI rank has particles with PME force contribtions expected from its PME-only rank, return pointer to event recorded when forces are ready. | |
| DeviceBuffer< uint64_t > | getGpuForcesSyncObj () |
| Return pointer to force synchronization NVSHMEM object. | |
| gmx::PmePpCommGpu::PmePpCommGpu | ( | MPI_Comm | comm, |
| int | pmeRank, | ||
| const DeviceContext & | deviceContext, | ||
| const DeviceStream & | deviceStream, | ||
| bool | useNvshmem | ||
| ) |
Creates PME-PP GPU communication object.
Constructor stub.
| [in] | comm | Communicator used for simulation |
| [in] | pmeRank | Rank of PME task |
| [in] | deviceContext | GPU context. |
| [in] | deviceStream | GPU stream. |
| [in] | useNvshmem | NVSHMEM enable/disable for GPU comm. |
| void gmx::PmePpCommGpu::receiveForceFromPme | ( | bool | recvPmeForceToGpu | ) |
Receive forces from PME GPU.
| [in] | recvPmeForceToGpu | Whether receive is to GPU, otherwise CPU |
Perform steps required when buffer size changes.
init PME-PP GPU communication stub
| [in] | pmeCpuForceReceiveBuffer | CPU buffer to potentially receive PME force data |
| void gmx::PmePpCommGpu::sendCoordinatesToPmeFromCpu | ( | const RVec * | sendPtr, |
| int | sendSize, | ||
| bool | receiveForcesToGpu | ||
| ) |
Push coordinates buffer from host memory directly to GPU memory on PME task.
| [in] | sendPtr | Buffer with coordinate data |
| [in] | sendSize | Number of elements to send |
| [in] | receiveForcesToGpu | Whether PME forces will be received to GPU |
| void gmx::PmePpCommGpu::sendCoordinatesToPmeFromGpu | ( | DeviceBuffer< RVec > | sendPtr, |
| int | sendSize, | ||
| GpuEventSynchronizer * | coordinatesReadyOnDeviceEvent, | ||
| bool | receiveForcesToGpu | ||
| ) |
Push coordinates buffer directly to GPU memory on PME task Note that, when using GPU-aware MPI with staged communication and not using NVSHMEM for GPU force receives, this method also posts a non-blocking force receive request to overlap communication with computation.
| [in] | sendPtr | Buffer with coordinate data |
| [in] | sendSize | Number of elements to send |
| [in] | coordinatesReadyOnDeviceEvent | Event recorded when coords available on device |
| [in] | receiveForcesToGpu | Whether PME forces will be received to GPU |
1.8.5