Gromacs  2027.0-dev-20261113-fb41eee
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
List of all members | Public Member Functions
gmx::PmePpCommGpu::Impl Class Reference

#include <gromacs/ewald/pme_pp_comm_gpu_impl.h>

Description

Class with interfaces and data for GPU version of PME-PP Communication.

Impl class stub.

Public Member Functions

 Impl (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)
 Pull force buffer directly from GPU memory on PME rank to either GPU or CPU memory on PP task using GPU Memory copy or GPU-aware MPI. More...
 
std::optional< DeviceBuffer
< Float3 > > 
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 contributions expected from its PME-only rank, return pointer to event recorded when forces are ready.
 
DeviceBuffer< uint64_t > getGpuForcesSyncObj ()
 Return pointer to NVSHMEM sync object used for staging PME force on GPU.
 
void sendCoordinatesToPmeDirectGpu (const Float3 *sendPtr, int sendSize, bool sendCoordinatesFromGpu, GpuEventSynchronizer *coordinatesReadyOnDeviceEvent)
 Push coordinates buffer directly to GPU memory on PME task, from either GPU or CPU memory on PP task using GPU Memory copy. This method is used with Thread-MPI. More...
 
void sendCoordinatesToPmeGpuAwareMpi (const Float3 *sendPtr, int sendSize, GpuEventSynchronizer *coordinatesReadyOnDeviceEvent, bool receivePmeForceToGpu)
 Push coordinates buffer directly to GPU memory on PME task, from either GPU or CPU memory on PP task using GPU-aware MPI. This method is used with process-MPI. 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...
 

Constructor & Destructor Documentation

gmx::PmePpCommGpu::Impl::Impl ( MPI_Comm  comm,
int  pmeRank,
const DeviceContext &  deviceContext,
const DeviceStream &  deviceStream,
bool  useNvshmem 
)

Creates PME-PP GPU communication object.

Parameters
[in]commCommunicator used for simulation
[in]pmeRankRank of PME task
[in]deviceContextGPU context.
[in]deviceStreamDevice stream.
[in]useNvshmemNVSHMEM enable/disable for GPU comm.

Member Function Documentation

void gmx::PmePpCommGpu::Impl::receiveForceFromPme ( bool  recvPmeForceToGpu)

Pull force buffer directly from GPU memory on PME rank to either GPU or CPU memory on PP task using GPU Memory copy or GPU-aware MPI.

If receiving to GPU, this method should be called before the local GPU buffer operations. If receiving to CPU it should be called before forces are reduced with the other force contributions on the CPU. It will automatically wait for remote PME force data to be ready.

Parameters
[in]recvPmeForceToGpuWhether receive is to GPU, otherwise CPU
void gmx::PmePpCommGpu::Impl::reinit ( ArrayRef< RVec >  pmeCpuForceReceiveBuffer)

Perform steps required when buffer size changes.

Parameters
[in]pmeCpuForceReceiveBufferCPU buffer to potentially receive PME force data
void gmx::PmePpCommGpu::Impl::sendCoordinatesToPmeDirectGpu ( const Float3 *  sendPtr,
int  sendSize,
bool  sendCoordinatesFromGpu,
GpuEventSynchronizer *  coordinatesReadyOnDeviceEvent 
)

Push coordinates buffer directly to GPU memory on PME task, from either GPU or CPU memory on PP task using GPU Memory copy. This method is used with Thread-MPI.

Parameters
[in]sendPtrBuffer with coordinate data
[in]sendSizeNumber of elements to send
[in]sendCoordinatesFromGpuDescribes the location of sendPtr
[in]coordinatesReadyOnDeviceEventEvent recorded when coords available on device
void gmx::PmePpCommGpu::Impl::sendCoordinatesToPmeGpuAwareMpi ( const Float3 *  sendPtr,
int  sendSize,
GpuEventSynchronizer *  coordinatesReadyOnDeviceEvent,
bool  receivePmeForceToGpu 
)

Push coordinates buffer directly to GPU memory on PME task, from either GPU or CPU memory on PP task using GPU-aware MPI. This method is used with process-MPI. 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.

Parameters
[in]sendPtrBuffer with coordinate data
[in]sendSizeNumber of elements to send
[in]coordinatesReadyOnDeviceEventEvent recorded when coords available on device
[in]receivePmeForceToGpuWhether PME forces will be received to GPU

The documentation for this class was generated from the following files: