waLBerla 7.2
|
Communication scheme for buffered communication in uniform block grids.
Synchronize a set of GPUField between GPU devices. Communication between fields on the same process: use direct copy via GeneratedGPUPackInfo::communicateLocal. Communication between different processes: use a buffered communication scheme; when multiple fields have been changed they can be synchronized at once, using one MPI message per communication partner.
This scheme sends one message per communication step and neighbor device. Therefore all contents that have to be sent are packed into a single buffer. Multiple GeneratedGPUPackInfo can be registered to send their contents in a single step.
When running multiple UniformGPUScheme concurrently, different MPI tags have to be used for the schemes: the tag can be passed in the constructor.
#include <UniformGPUScheme.h>
Classes | |
struct | Header |
Public Member Functions | |
UniformGPUScheme (const weak_ptr< StructuredBlockForest > &bf, const bool sendDirectlyFromGPU=false, const bool useLocalCommunication=true, const int tag=5432) | |
UniformGPUScheme (const weak_ptr< StructuredBlockForest > &bf, const Set< SUID > &requiredBlockSelectors, const Set< SUID > &incompatibleBlockSelectors, const bool sendDirectlyFromGPU=false, const bool useLocalCommunication=true, const int tag=5432) | |
UniformGPUScheme (const UniformGPUScheme &)=delete | |
void | addPackInfo (const shared_ptr< GeneratedGPUPackInfo > &pi) |
void | startCommunication () |
void | wait () |
void | operator() () |
void | communicate () |
std::function< void()> | getCommunicateFunctor () |
std::function< void()> | getStartCommunicateFunctor () |
std::function< void()> | getWaitFunctor () |
Private Types | |
using | CpuBuffer_T = gpu::communication::PinnedMemoryBuffer |
using | GpuBuffer_T = gpu::communication::GPUMemoryBuffer |
Private Member Functions | |
void | setupCommunication () |
Private Attributes | |
weak_ptr< StructuredBlockForest > | blockForest_ |
uint_t | forestModificationStamp_ |
bool | setupBeforeNextCommunication_ |
bool | communicationInProgress_ |
const bool | sendFromGPU_ |
const bool | useLocalCommunication_ |
mpi::GenericBufferSystem< CpuBuffer_T, CpuBuffer_T > | bufferSystemCPU_ |
mpi::GenericBufferSystem< GpuBuffer_T, GpuBuffer_T > | bufferSystemGPU_ |
std::vector< shared_ptr< GeneratedGPUPackInfo > > | packInfos_ |
std::map< mpi::MPIRank, std::vector< Header > > | headers_ |
Set< SUID > | requiredBlockSelectors_ |
Set< SUID > | incompatibleBlockSelectors_ |
std::array< StreamRAII, Stencil::Q > | streams_ |
|
private |
|
private |
|
explicit |
|
explicit |
|
delete |
void walberla::gpu::communication::UniformGPUScheme< Stencil >::addPackInfo | ( | const shared_ptr< GeneratedGPUPackInfo > & | pi | ) |
|
inline |
std::function< void()> walberla::gpu::communication::UniformGPUScheme< Stencil >::getCommunicateFunctor | ( | ) |
std::function< void()> walberla::gpu::communication::UniformGPUScheme< Stencil >::getStartCommunicateFunctor | ( | ) |
std::function< void()> walberla::gpu::communication::UniformGPUScheme< Stencil >::getWaitFunctor | ( | ) |
|
inline |
|
private |
void walberla::gpu::communication::UniformGPUScheme< Stencil >::startCommunication | ( | ) |
void walberla::gpu::communication::UniformGPUScheme< Stencil >::wait | ( | ) |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |