waLBerla 7.2
|
Data packing/unpacking for ghost layer based communication of a GPUField.
Encapsulate information on how to extract data from blocks that should be communicated to neighboring blocks (see pack()) and how to inject this data in a receiving block (see unpack()). This involves a memory buffer and two memory copy operations.
A special method exists for communication between two blocks which are allocated on the same process (see communicateLocal()). In this case the data does not have be communicated via a buffer, but can be copied directly.
Data that is packed in direction "dir" at one block is unpacked in direction "stencil::inverseDir[dir]" at the neighboring block. This behavior must be implemented in communicateLocal()!
#include <GeneratedGPUPackInfo.h>
Public Member Functions | |
GeneratedGPUPackInfo ()=default | |
virtual | ~GeneratedGPUPackInfo ()=default |
virtual void | pack (stencil::Direction dir, unsigned char *buffer, IBlock *block, gpuStream_t stream)=0 |
Pack data from a block into a send buffer. | |
virtual void | communicateLocal (stencil::Direction dir, const IBlock *sender, IBlock *receiver, gpuStream_t stream)=0 |
Copy data from one local block to another local block. | |
virtual void | unpack (stencil::Direction dir, unsigned char *buffer, IBlock *block, gpuStream_t stream)=0 |
Unpack data from a receive buffer into a block. | |
virtual uint_t | size (stencil::Direction dir, IBlock *block)=0 |
|
default |
|
virtualdefault |
|
pure virtual |
Copy data from one local block to another local block.
Both blocks are allocated on the same MPI rank.
dir | the direction of the communication (from sender to receiver) |
sender | id of block where the data should be copied from |
receiver | id of block where the data should be copied to |
stream | GPU stream |
Implemented in walberla::gpu::communication::MemcpyPackInfo< GPUFieldType >, and walberla::lbm_generated::UniformGeneratedGPUPdfPackInfo< PdfField_T >.
|
pure virtual |
Pack data from a block into a send buffer.
dir | pack data for neighbor in this direction |
buffer | buffer for writing the data into |
block | the block whose data should be packed into a buffer |
stream | GPU stream |
Implemented in walberla::gpu::communication::MemcpyPackInfo< GPUFieldType >, walberla::lbm::CombinedInPlaceGpuPackInfo< EvenPackInfo, OddPackInfo >, and walberla::lbm_generated::UniformGeneratedGPUPdfPackInfo< PdfField_T >.
|
pure virtual |
|
pure virtual |
Unpack data from a receive buffer into a block.
dir | receive data from neighbor in this direction |
buffer | buffer for reading the data from |
block | the block where the unpacked data should be stored into |
stream | GPU stream |
Implemented in walberla::gpu::communication::MemcpyPackInfo< GPUFieldType >, walberla::lbm::CombinedInPlaceGpuPackInfo< EvenPackInfo, OddPackInfo >, and walberla::lbm_generated::UniformGeneratedGPUPdfPackInfo< PdfField_T >.