waLBerla 7.2
Loading...
Searching...
No Matches
walberla::lbm_generated::NonuniformGeneratedGPUPdfPackInfo< PdfField_T > Class Template Reference

#include <NonuniformGeneratedGPUPdfPackInfo.h>

+ Inheritance diagram for walberla::lbm_generated::NonuniformGeneratedGPUPdfPackInfo< PdfField_T >:

Public Types

using LatticeStorageSpecification_T = typename PdfField_T::LatticeStorageSpecification
 
using Stencil = typename LatticeStorageSpecification_T::Stencil
 
using CommunicationStencil = typename LatticeStorageSpecification_T::CommunicationStencil
 
using CommData_T = NonuniformGPUCommData< LatticeStorageSpecification_T >
 
using value_type = typename PdfField_T::value_type
 

Public Member Functions

 NonuniformGeneratedGPUPdfPackInfo (const uint64_t meshLevels, const BlockDataID pdfFieldID, const BlockDataID commDataID)
 
void init (const uint64_t meshLevels)
 
void sync () override
 
 ~NonuniformGeneratedGPUPdfPackInfo ()
 
bool constantDataExchange () const override
 
bool threadsafeReceiving () const override
 
void unpackDataEqualLevel (Block *receiver, Direction dir, GpuBuffer_T &buffer, gpuStream_t stream) override
 Equal Level.
 
void addForLocalEqualLevelComm (const Block *sender, Block *receiver, stencil::Direction dir) override
 
void communicateLocalEqualLevel (uint64_t level, uint8_t timestep, gpuStream_t stream) override
 
void communicateLocalEqualLevel (const Block *sender, Block *receiver, stencil::Direction dir, gpuStream_t stream) override
 
void unpackDataCoarseToFine (Block *fineReceiver, const BlockID &coarseSender, stencil::Direction dir, GpuBuffer_T &buffer, gpuStream_t stream) override
 Coarse to Fine.
 
void communicateLocalCoarseToFine (const Block *coarseSender, Block *fineReceiver, stencil::Direction dir, gpuStream_t stream) override
 
void communicateLocalCoarseToFine (const Block *coarseSender, Block *fineReceiver, stencil::Direction dir, GpuBuffer_T &buffer, gpuStream_t stream) override
 
void prepareCoalescence (Block *coarseReceiver, gpuStream_t gpuStream=nullptr)
 Fine to Coarse.
 
void unpackDataFineToCoarse (Block *coarseReceiver, const BlockID &fineSender, stencil::Direction dir, GpuBuffer_T &buffer, gpuStream_t stream) override
 
void communicateLocalFineToCoarse (const Block *fineSender, Block *coarseReceiver, stencil::Direction dir, gpuStream_t stream) override
 
void communicateLocalFineToCoarse (const Block *fineSender, Block *coarseReceiver, stencil::Direction dir, GpuBuffer_T &buffer, gpuStream_t stream) override
 
uint_t sizeEqualLevelSend (const Block *sender, stencil::Direction dir) const override
 
uint_t sizeCoarseToFineSend (const Block *coarseSender, const BlockID &fineReceiver, stencil::Direction dir) const override
 
uint_t sizeCoarseToFineReceive (Block *fineReceiver, stencil::Direction dir) const override
 
uint_t sizeFineToCoarseSend (const Block *fineSender, stencil::Direction dir) const override
 
- Public Member Functions inherited from walberla::gpu::GeneratedNonUniformGPUPackInfo
 GeneratedNonUniformGPUPackInfo ()=default
 
virtual ~GeneratedNonUniformGPUPackInfo ()=default
 
void packDataEqualLevel (const Block *sender, stencil::Direction dir, GpuBuffer_T &buffer, gpuStream_t stream=nullptr) const
 
virtual void unpackDataEqualLevel (Block *receiver, stencil::Direction dir, GpuBuffer_T &buffer, gpuStream_t stream)=0
 
void packDataCoarseToFine (const Block *coarseSender, const BlockID &fineReceiver, stencil::Direction dir, GpuBuffer_T &buffer, gpuStream_t stream=nullptr) const
 
void packDataFineToCoarse (const Block *fineSender, const BlockID &coarseReceiver, stencil::Direction dir, GpuBuffer_T &buffer, gpuStream_t stream=nullptr) const
 
void clearBufferSizeCheckMap ()
 

Public Attributes

const BlockDataID commDataID_
 

Protected Member Functions

void packDataEqualLevelImpl (const Block *sender, stencil::Direction dir, GpuBuffer_T &buffer, gpuStream_t stream) const override
 
void packDataCoarseToFineImpl (const Block *coarseSender, const BlockID &fineReceiver, stencil::Direction dir, GpuBuffer_T &buffer, gpuStream_t stream) const override
 
void packDataFineToCoarseImpl (const Block *fineSender, const BlockID &coarseReceiver, stencil::Direction dir, GpuBuffer_T &buffer, gpuStream_t stream) const override
 

Private Member Functions

Vector3< cell_idx_tgetNeighborShift (const BlockID &fineBlock, stencil::Direction dir) const
 Helper Functions As in PdfFieldPackInfo.h.
 
bool areNeighborsInDirection (const Block *block, const BlockID &neighborID, Vector3< cell_idx_t > dirVec) const
 Checks whether or not the block with ID neighborID is a neighbor of block in direction dir.
 
CellInterval intervalHullInDirection (const CellInterval &ci, Vector3< cell_idx_t > tangentialDir, cell_idx_t width) const
 Returns the part of a cell interval's hull of given width in direction dirVec.
 
bool skipsThroughCoarseBlock (const Block *block, Direction dir) const
 For edge or corner directions, checks if a coarser block is part of the respective edge or corner intersection.
 
void getCoarseBlockCommIntervals (const BlockID &fineBlockID, Direction dir, const PdfField_T *field, std::vector< std::pair< Direction, CellInterval > > &intervals) const
 For coarse-to-fine and fine-to-coarse communication, returns a list of pairs (Direction, CellInterval) mapping sub-directions of the communication direction to cell intervals on the coarse block interior whose data must be communicated as if communicating in those sub-directions.
 
void getFineBlockCommIntervals (const BlockID &fineBlockID, Direction dir, const PdfField_T *field, std::vector< std::pair< Direction, CellInterval > > &intervals) const
 For coarse-to-fine and fine-to-coarse communication, returns a list of pairs (Direction, CellInterval) mapping sub-directions of the communication direction to cell intervals on the fine block whose data must be communicated as if communicating in those sub-directions.
 
CellInterval getCoarseBlockCoalescenceInterval (const Block *coarseBlock, const BlockID &fineBlockID, Direction dir, const PdfField_T *field) const
 

Private Attributes

const BlockDataID pdfFieldID_
 
internal::NonuniformGPUPackingKernelsWrapper< PdfField_T, LatticeStorageSpecification_T::inplace > kernels_
 
std::array< int64_t, 4 > strides
 
std::vector< std::unordered_map< Vector3< int64_t >, std::vector< value_type * > > > equalCommSRC
 
std::vector< std::unordered_map< Vector3< int64_t >, std::vector< value_type * > > > equalCommDST
 
std::vector< std::unordered_map< Vector3< int64_t >, value_type ** > > equalCommSRCGPU
 
std::vector< std::unordered_map< Vector3< int64_t >, value_type ** > > equalCommDSTGPU
 

Additional Inherited Members

- Protected Attributes inherited from walberla::gpu::GeneratedNonUniformGPUPackInfo
std::map< const Block *, std::map< stencil::Direction, std::map< uint_t, size_t > > > bufferSize_
 

Member Typedef Documentation

◆ CommData_T

◆ CommunicationStencil

template<typename PdfField_T >
using walberla::lbm_generated::NonuniformGeneratedGPUPdfPackInfo< PdfField_T >::CommunicationStencil = typename LatticeStorageSpecification_T::CommunicationStencil

◆ LatticeStorageSpecification_T

template<typename PdfField_T >
using walberla::lbm_generated::NonuniformGeneratedGPUPdfPackInfo< PdfField_T >::LatticeStorageSpecification_T = typename PdfField_T::LatticeStorageSpecification

◆ Stencil

template<typename PdfField_T >
using walberla::lbm_generated::NonuniformGeneratedGPUPdfPackInfo< PdfField_T >::Stencil = typename LatticeStorageSpecification_T::Stencil

◆ value_type

Constructor & Destructor Documentation

◆ NonuniformGeneratedGPUPdfPackInfo()

template<typename PdfField_T >
walberla::lbm_generated::NonuniformGeneratedGPUPdfPackInfo< PdfField_T >::NonuniformGeneratedGPUPdfPackInfo ( const uint64_t meshLevels,
const BlockDataID pdfFieldID,
const BlockDataID commDataID )
inline

◆ ~NonuniformGeneratedGPUPdfPackInfo()

Member Function Documentation

◆ addForLocalEqualLevelComm()

template<typename PdfField_T >
void walberla::lbm_generated::NonuniformGeneratedGPUPdfPackInfo< PdfField_T >::addForLocalEqualLevelComm ( const Block * sender,
Block * receiver,
stencil::Direction dir )
overridevirtual

◆ areNeighborsInDirection()

template<typename PdfField_T >
bool walberla::lbm_generated::NonuniformGeneratedGPUPdfPackInfo< PdfField_T >::areNeighborsInDirection ( const Block * block,
const BlockID & neighborID,
Vector3< cell_idx_t > dirVec ) const
private

Checks whether or not the block with ID neighborID is a neighbor of block in direction dir.

◆ communicateLocalCoarseToFine() [1/2]

template<typename PdfField_T >
void walberla::lbm_generated::NonuniformGeneratedGPUPdfPackInfo< PdfField_T >::communicateLocalCoarseToFine ( const Block * coarseSender,
Block * fineReceiver,
stencil::Direction dir,
GpuBuffer_T & buffer,
gpuStream_t stream )
overridevirtual

◆ communicateLocalCoarseToFine() [2/2]

template<typename PdfField_T >
void walberla::lbm_generated::NonuniformGeneratedGPUPdfPackInfo< PdfField_T >::communicateLocalCoarseToFine ( const Block * coarseSender,
Block * fineReceiver,
stencil::Direction dir,
gpuStream_t stream )
overridevirtual

◆ communicateLocalEqualLevel() [1/2]

template<typename PdfField_T >
void walberla::lbm_generated::NonuniformGeneratedGPUPdfPackInfo< PdfField_T >::communicateLocalEqualLevel ( const Block * sender,
Block * receiver,
stencil::Direction dir,
gpuStream_t stream )
overridevirtual

◆ communicateLocalEqualLevel() [2/2]

template<typename PdfField_T >
void walberla::lbm_generated::NonuniformGeneratedGPUPdfPackInfo< PdfField_T >::communicateLocalEqualLevel ( uint64_t level,
uint8_t timestep,
gpuStream_t stream )
overridevirtual

◆ communicateLocalFineToCoarse() [1/2]

template<typename PdfField_T >
void walberla::lbm_generated::NonuniformGeneratedGPUPdfPackInfo< PdfField_T >::communicateLocalFineToCoarse ( const Block * fineSender,
Block * coarseReceiver,
stencil::Direction dir,
GpuBuffer_T & buffer,
gpuStream_t stream )
overridevirtual

◆ communicateLocalFineToCoarse() [2/2]

template<typename PdfField_T >
void walberla::lbm_generated::NonuniformGeneratedGPUPdfPackInfo< PdfField_T >::communicateLocalFineToCoarse ( const Block * fineSender,
Block * coarseReceiver,
stencil::Direction dir,
gpuStream_t stream )
overridevirtual

◆ constantDataExchange()

template<typename PdfField_T >
bool walberla::lbm_generated::NonuniformGeneratedGPUPdfPackInfo< PdfField_T >::constantDataExchange ( ) const
inlineoverridevirtual

◆ getCoarseBlockCoalescenceInterval()

template<typename PdfField_T >
CellInterval walberla::lbm_generated::NonuniformGeneratedGPUPdfPackInfo< PdfField_T >::getCoarseBlockCoalescenceInterval ( const Block * coarseBlock,
const BlockID & fineBlockID,
Direction dir,
const PdfField_T * field ) const
private

◆ getCoarseBlockCommIntervals()

template<typename PdfField_T >
void walberla::lbm_generated::NonuniformGeneratedGPUPdfPackInfo< PdfField_T >::getCoarseBlockCommIntervals ( const BlockID & fineBlockID,
Direction dir,
const PdfField_T * field,
std::vector< std::pair< Direction, CellInterval > > & intervals ) const
inlineprivate

For coarse-to-fine and fine-to-coarse communication, returns a list of pairs (Direction, CellInterval) mapping sub-directions of the communication direction to cell intervals on the coarse block interior whose data must be communicated as if communicating in those sub-directions.

Parameters
fineBlockIDID of the fine block
dirDirection from the coarse to the fine block
fieldPointer to the PDF field on the coarse block
intervalsVector that will be filled with the computed intervals

◆ getFineBlockCommIntervals()

template<typename PdfField_T >
void walberla::lbm_generated::NonuniformGeneratedGPUPdfPackInfo< PdfField_T >::getFineBlockCommIntervals ( const BlockID & fineBlockID,
Direction dir,
const PdfField_T * field,
std::vector< std::pair< Direction, CellInterval > > & intervals ) const
inlineprivate

For coarse-to-fine and fine-to-coarse communication, returns a list of pairs (Direction, CellInterval) mapping sub-directions of the communication direction to cell intervals on the fine block whose data must be communicated as if communicating in those sub-directions.

Parameters
fineBlockIDID of the fine block
dirDirection from the fine to the coarse block
fieldPointer to the PDF Field on the fine block
intervalsVector that will be filled with the computed intervals

◆ getNeighborShift()

template<typename PdfField_T >
Vector3< cell_idx_t > walberla::lbm_generated::NonuniformGeneratedGPUPdfPackInfo< PdfField_T >::getNeighborShift ( const BlockID & fineBlock,
stencil::Direction dir ) const
inlineprivate

Helper Functions As in PdfFieldPackInfo.h.

◆ init()

template<typename PdfField_T >
void walberla::lbm_generated::NonuniformGeneratedGPUPdfPackInfo< PdfField_T >::init ( const uint64_t meshLevels)
inline

◆ intervalHullInDirection()

template<typename PdfField_T >
CellInterval walberla::lbm_generated::NonuniformGeneratedGPUPdfPackInfo< PdfField_T >::intervalHullInDirection ( const CellInterval & ci,
Vector3< cell_idx_t > tangentialDir,
cell_idx_t width ) const
inlineprivate

Returns the part of a cell interval's hull of given width in direction dirVec.

Parameters
ciThe original cell interval
dirVecDirection Vector
widthWidth of the hull
Returns
Interval forming the part of the hull

◆ packDataCoarseToFineImpl()

template<typename PdfField_T >
void walberla::lbm_generated::NonuniformGeneratedGPUPdfPackInfo< PdfField_T >::packDataCoarseToFineImpl ( const Block * coarseSender,
const BlockID & fineReceiver,
stencil::Direction dir,
GpuBuffer_T & buffer,
gpuStream_t stream ) const
overrideprotectedvirtual

◆ packDataEqualLevelImpl()

template<typename PdfField_T >
void walberla::lbm_generated::NonuniformGeneratedGPUPdfPackInfo< PdfField_T >::packDataEqualLevelImpl ( const Block * sender,
stencil::Direction dir,
GpuBuffer_T & buffer,
gpuStream_t stream ) const
overrideprotectedvirtual

◆ packDataFineToCoarseImpl()

template<typename PdfField_T >
void walberla::lbm_generated::NonuniformGeneratedGPUPdfPackInfo< PdfField_T >::packDataFineToCoarseImpl ( const Block * fineSender,
const BlockID & coarseReceiver,
stencil::Direction dir,
GpuBuffer_T & buffer,
gpuStream_t stream ) const
overrideprotectedvirtual

◆ prepareCoalescence()

template<typename PdfField_T >
void walberla::lbm_generated::NonuniformGeneratedGPUPdfPackInfo< PdfField_T >::prepareCoalescence ( Block * coarseReceiver,
gpuStream_t gpuStream = nullptr )

Fine to Coarse.

◆ sizeCoarseToFineReceive()

template<typename PdfField_T >
uint_t walberla::lbm_generated::NonuniformGeneratedGPUPdfPackInfo< PdfField_T >::sizeCoarseToFineReceive ( Block * fineReceiver,
stencil::Direction dir ) const
overridevirtual

◆ sizeCoarseToFineSend()

template<typename PdfField_T >
uint_t walberla::lbm_generated::NonuniformGeneratedGPUPdfPackInfo< PdfField_T >::sizeCoarseToFineSend ( const Block * coarseSender,
const BlockID & fineReceiver,
stencil::Direction dir ) const
overridevirtual

◆ sizeEqualLevelSend()

template<typename PdfField_T >
uint_t walberla::lbm_generated::NonuniformGeneratedGPUPdfPackInfo< PdfField_T >::sizeEqualLevelSend ( const Block * sender,
stencil::Direction dir ) const
overridevirtual

◆ sizeFineToCoarseSend()

template<typename PdfField_T >
uint_t walberla::lbm_generated::NonuniformGeneratedGPUPdfPackInfo< PdfField_T >::sizeFineToCoarseSend ( const Block * fineSender,
stencil::Direction dir ) const
overridevirtual

◆ skipsThroughCoarseBlock()

template<typename PdfField_T >
bool walberla::lbm_generated::NonuniformGeneratedGPUPdfPackInfo< PdfField_T >::skipsThroughCoarseBlock ( const Block * block,
Direction dir ) const
inlineprivate

For edge or corner directions, checks if a coarser block is part of the respective edge or corner intersection.

Parameters
blockThe local block
dirThe direction to check
Returns
true if dir is an edge or corner direction skipping through a coarser block.

◆ sync()

◆ threadsafeReceiving()

template<typename PdfField_T >
bool walberla::lbm_generated::NonuniformGeneratedGPUPdfPackInfo< PdfField_T >::threadsafeReceiving ( ) const
inlineoverridevirtual

◆ unpackDataCoarseToFine()

template<typename PdfField_T >
void walberla::lbm_generated::NonuniformGeneratedGPUPdfPackInfo< PdfField_T >::unpackDataCoarseToFine ( Block * fineReceiver,
const BlockID & coarseSender,
stencil::Direction dir,
GpuBuffer_T & buffer,
gpuStream_t stream )
overridevirtual

Coarse to Fine.

Implements walberla::gpu::GeneratedNonUniformGPUPackInfo.

◆ unpackDataEqualLevel()

template<typename PdfField_T >
void walberla::lbm_generated::NonuniformGeneratedGPUPdfPackInfo< PdfField_T >::unpackDataEqualLevel ( Block * receiver,
Direction dir,
GpuBuffer_T & buffer,
gpuStream_t stream )
override

Equal Level.

◆ unpackDataFineToCoarse()

template<typename PdfField_T >
void walberla::lbm_generated::NonuniformGeneratedGPUPdfPackInfo< PdfField_T >::unpackDataFineToCoarse ( Block * coarseReceiver,
const BlockID & fineSender,
stencil::Direction dir,
GpuBuffer_T & buffer,
gpuStream_t stream )
overridevirtual

Member Data Documentation

◆ commDataID_

◆ equalCommDST

template<typename PdfField_T >
std::vector<std::unordered_map<Vector3<int64_t>,std::vector<value_type*> > > walberla::lbm_generated::NonuniformGeneratedGPUPdfPackInfo< PdfField_T >::equalCommDST
private

◆ equalCommDSTGPU

template<typename PdfField_T >
std::vector<std::unordered_map<Vector3<int64_t>,value_type **> > walberla::lbm_generated::NonuniformGeneratedGPUPdfPackInfo< PdfField_T >::equalCommDSTGPU
private

◆ equalCommSRC

template<typename PdfField_T >
std::vector<std::unordered_map<Vector3<int64_t>,std::vector<value_type*> > > walberla::lbm_generated::NonuniformGeneratedGPUPdfPackInfo< PdfField_T >::equalCommSRC
private

◆ equalCommSRCGPU

template<typename PdfField_T >
std::vector<std::unordered_map<Vector3<int64_t>,value_type **> > walberla::lbm_generated::NonuniformGeneratedGPUPdfPackInfo< PdfField_T >::equalCommSRCGPU
private

◆ kernels_

template<typename PdfField_T >
internal::NonuniformGPUPackingKernelsWrapper< PdfField_T, LatticeStorageSpecification_T::inplace > walberla::lbm_generated::NonuniformGeneratedGPUPdfPackInfo< PdfField_T >::kernels_
private

◆ pdfFieldID_

◆ strides

template<typename PdfField_T >
std::array<int64_t, 4> walberla::lbm_generated::NonuniformGeneratedGPUPdfPackInfo< PdfField_T >::strides
private

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