Pack Info class template for lattice Boltzmann PDF fields.
Relies on a code-generated class providing kernel implementations for packing, unpacking and local copying of data.
This template relies on a PackingKernels implementation generated by lbmpy_walberla.packing_kernels. The code generated part provides the kernels for transferring data between communication buffers and fields. The iteration slices are constructed by this class.
The code-generated substructure enables the usage of arbitrary, in particular in-place streaming patterns.
PackingKernels_T | Type of a PackingKernels implementation generated using lbmpy_walberla.generate_packing_kernels . |
#include <UniformGeneratedPdfPackInfo.h>
Public Types | |
using | LatticeStorageSpecification_T = typename PdfField_T::LatticeStorageSpecification |
using | PackingKernels_T = typename LatticeStorageSpecification_T::PackKernels |
using | Stencil = typename LatticeStorageSpecification_T::Stencil |
Public Member Functions | |
UniformGeneratedPdfPackInfo (const BlockDataID pdfFieldID, cell_idx_t cellLayersToSend=1, bool sendAll=false) | |
Constructor. More... | |
bool | constantDataExchange () const override |
Should return true if the amount of data that is packed for a given block in direction "dir" is guaranteed to remain constant over time. More... | |
bool | threadsafeReceiving () const override |
Must return false if calling unpackData and/or communicateLocal is not thread-safe. More... | |
void | unpackData (IBlock *receiver, Direction dir, mpi::RecvBuffer &buffer) override |
void | communicateLocal (const IBlock *sender, IBlock *receiver, Direction dir) override |
![]() | |
UniformPackInfo ()=default | |
virtual | ~UniformPackInfo ()=default |
void | packData (const IBlock *sender, stencil::Direction dir, mpi::SendBuffer &buffer) const |
Packs data from a block into a send buffer. More... | |
virtual void | unpackData (IBlock *receiver, stencil::Direction dir, mpi::RecvBuffer &buffer)=0 |
Unpacks received Data. More... | |
virtual void | communicateLocal (const IBlock *sender, IBlock *receiver, stencil::Direction dir)=0 |
Function to copy data from one local block to another local block. More... | |
virtual void | beforeStartCommunication () |
This function is called once before the communication is started by the UniformBufferedScheme. More... | |
virtual void | afterStartCommunication () |
This function is called once after the communication has been started by the UniformBufferedScheme. More... | |
virtual void | beforeWait () |
This function is called once before the UniformBufferedScheme waits for the communication to finish. More... | |
virtual void | afterWait () |
This function is called once after the communication has been finished by the UniformBufferedScheme. More... | |
Protected Member Functions | |
void | packDataImpl (const IBlock *sender, Direction dir, mpi::SendBuffer &buffer) const override |
![]() | |
virtual void | packDataImpl (const IBlock *sender, stencil::Direction dir, mpi::SendBuffer &buffer) const =0 |
Packs data from a block into a send buffer. More... | |
Private Attributes | |
const BlockDataID | pdfFieldID_ |
internal::UniformPackingKernelsWrapper< PdfField_T, LatticeStorageSpecification_T::inplace > | kernels_ |
cell_idx_t | ghostLayersToSend_ |
bool | sendAll_ |
Additional Inherited Members | |
![]() | |
std::map< const IBlock *, std::map< stencil::Direction, size_t > > | bufferSize_ |
using walberla::lbm_generated::UniformGeneratedPdfPackInfo< PdfField_T >::LatticeStorageSpecification_T = typename PdfField_T::LatticeStorageSpecification |
using walberla::lbm_generated::UniformGeneratedPdfPackInfo< PdfField_T >::PackingKernels_T = typename LatticeStorageSpecification_T::PackKernels |
using walberla::lbm_generated::UniformGeneratedPdfPackInfo< PdfField_T >::Stencil = typename LatticeStorageSpecification_T::Stencil |
|
inline |
Constructor.
pdfFieldID | ID of the associated walberla::lbm::PdfField |
cellLayersToSend | The amount of cell layers that should be communicated |
sendAll | If true, instead of only those populations streaming in subdirections of the communication direction, all populations will always be communicated. |
|
override |
|
inlineoverridevirtual |
Should return true if the amount of data that is packed for a given block in direction "dir" is guaranteed to remain constant over time.
False otherwise. If you are not sure what to return, return false! Returning false is always save. Falsely return true will lead to errors! However, if the data can be guaranteed to remain constant over time, returning true enables performance optimizations during the communication.
Implements walberla::communication::UniformPackInfo.
|
overrideprotected |
|
inlineoverridevirtual |
Must return false if calling unpackData and/or communicateLocal is not thread-safe.
True otherwise. If you are not sure what to return, return false! Returning false is always save. Falsely return true will most likely lead to errors! However, if both unpackData AND communicateLocal are thread-safe, returning true can lead to performance improvements.
Implements walberla::communication::UniformPackInfo.
|
override |
|
private |
|
private |
|
private |
|
private |