waLBerla 7.2
Loading...
Searching...
No Matches
walberla::lbm::CombinedInPlaceCpuPackInfo< EvenPackInfo, OddPackInfo > Class Template Reference

#include <CombinedInPlaceCpuPackInfo.h>

+ Inheritance diagram for walberla::lbm::CombinedInPlaceCpuPackInfo< EvenPackInfo, OddPackInfo >:

Public Member Functions

template<typename... Args>
 CombinedInPlaceCpuPackInfo (std::shared_ptr< lbm::TimestepTracker > &tracker, Args &&... args)
 
 ~CombinedInPlaceCpuPackInfo () override=default
 
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.
 
bool threadsafeReceiving () const override
 Must return false if calling unpackData and/or communicateLocal is not thread-safe.
 
void unpackData (IBlock *receiver, stencil::Direction dir, mpi::RecvBuffer &buffer) override
 Unpack received Data.
 
void communicateLocal (const IBlock *sender, IBlock *receiver, stencil::Direction dir) override
 Copy data from one local block to another local block.
 
void packDataImpl (const IBlock *sender, stencil::Direction dir, mpi::SendBuffer &outBuffer) const override
 Pack data from a block into a send buffer.
 
void pack (stencil::Direction dir, unsigned char *buffer, IBlock *block) const
 
void unpack (stencil::Direction dir, unsigned char *buffer, IBlock *block) const
 
uint_t size (stencil::Direction dir, IBlock *block) const
 
- Public Member Functions inherited from walberla::communication::UniformPackInfo
 UniformPackInfo ()=default
 
virtual ~UniformPackInfo ()=default
 
void packData (const IBlock *sender, stencil::Direction dir, mpi::SendBuffer &buffer) const
 Pack data from a block into a send buffer.
 
virtual void beforeStartCommunication ()
 This function is called once before the communication is started by the UniformBufferedScheme.
 
virtual void afterStartCommunication ()
 This function is called once after the communication has been started by the UniformBufferedScheme.
 
virtual void beforeWait ()
 This function is called once before the UniformBufferedScheme waits for the communication to finish.
 
virtual void afterWait ()
 This function is called once after the communication has been finished by the UniformBufferedScheme.
 

Private Attributes

const std::shared_ptr< lbm::TimestepTracker > & tracker_
 
EvenPackInfo evenPackInfo_
 
OddPackInfo oddPackInfo_
 

Additional Inherited Members

- Protected Member Functions inherited from walberla::communication::UniformPackInfo
- Protected Attributes inherited from walberla::communication::UniformPackInfo
std::map< const IBlock *, std::map< stencil::Direction, size_t > > bufferSize_
 

Constructor & Destructor Documentation

◆ CombinedInPlaceCpuPackInfo()

template<typename EvenPackInfo , typename OddPackInfo >
template<typename... Args>
walberla::lbm::CombinedInPlaceCpuPackInfo< EvenPackInfo, OddPackInfo >::CombinedInPlaceCpuPackInfo ( std::shared_ptr< lbm::TimestepTracker > & tracker,
Args &&... args )
inline

◆ ~CombinedInPlaceCpuPackInfo()

template<typename EvenPackInfo , typename OddPackInfo >
walberla::lbm::CombinedInPlaceCpuPackInfo< EvenPackInfo, OddPackInfo >::~CombinedInPlaceCpuPackInfo ( )
overridedefault

Member Function Documentation

◆ communicateLocal()

template<typename EvenPackInfo , typename OddPackInfo >
void walberla::lbm::CombinedInPlaceCpuPackInfo< EvenPackInfo, OddPackInfo >::communicateLocal ( const IBlock * sender,
IBlock * receiver,
stencil::Direction dir )
inlineoverridevirtual

Copy data from one local block to another local block.

Both blocks are allocated on the current process. If NOT thread-safe, threadsafeReceiving must return false!

Parameters
senderid of block where the data should be copied from
receiverid of block where the data should be copied to
dirthe direction of the communication ( from sender to receiver )

Implements walberla::communication::UniformPackInfo.

◆ constantDataExchange()

template<typename EvenPackInfo , typename OddPackInfo >
bool walberla::lbm::CombinedInPlaceCpuPackInfo< EvenPackInfo, OddPackInfo >::constantDataExchange ( ) const
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 safe. Falsely returning 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.

◆ pack()

template<typename EvenPackInfo , typename OddPackInfo >
void walberla::lbm::CombinedInPlaceCpuPackInfo< EvenPackInfo, OddPackInfo >::pack ( stencil::Direction dir,
unsigned char * buffer,
IBlock * block ) const
inline

◆ packDataImpl()

template<typename EvenPackInfo , typename OddPackInfo >
void walberla::lbm::CombinedInPlaceCpuPackInfo< EvenPackInfo, OddPackInfo >::packDataImpl ( const IBlock * sender,
stencil::Direction dir,
mpi::SendBuffer & buffer ) const
inlineoverridevirtual

Pack data from a block into a send buffer.

Must be thread-safe!

Implementations must reserve extra space and advance the send buffer pointer according to the alignment of the ghost layer data type! The buffer is char-aligned.

Parameters
senderthe block whose data should be packed into a buffer
dirpack data for neighbor in this direction
bufferbuffer for writing the data into

Implements walberla::communication::UniformPackInfo.

◆ size()

template<typename EvenPackInfo , typename OddPackInfo >
uint_t walberla::lbm::CombinedInPlaceCpuPackInfo< EvenPackInfo, OddPackInfo >::size ( stencil::Direction dir,
IBlock * block ) const
inline

◆ threadsafeReceiving()

template<typename EvenPackInfo , typename OddPackInfo >
bool walberla::lbm::CombinedInPlaceCpuPackInfo< EvenPackInfo, OddPackInfo >::threadsafeReceiving ( ) const
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 safe. Falsely returning 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.

◆ unpack()

template<typename EvenPackInfo , typename OddPackInfo >
void walberla::lbm::CombinedInPlaceCpuPackInfo< EvenPackInfo, OddPackInfo >::unpack ( stencil::Direction dir,
unsigned char * buffer,
IBlock * block ) const
inline

◆ unpackData()

template<typename EvenPackInfo , typename OddPackInfo >
void walberla::lbm::CombinedInPlaceCpuPackInfo< EvenPackInfo, OddPackInfo >::unpackData ( IBlock * receiver,
stencil::Direction dir,
mpi::RecvBuffer & buffer )
inlineoverridevirtual

Unpack received Data.

If NOT thread-safe, threadsafeReceiving must return false!

Implementations must reserve extra space and advance the send buffer pointer according to the alignment of the ghost layer data type! The buffer is char-aligned.

Parameters
receiverthe block where the unpacked data should be stored into
dirreceive data from neighbor in this direction
bufferbuffer for reading the data from

Implements walberla::communication::UniformPackInfo.

Member Data Documentation

◆ evenPackInfo_

template<typename EvenPackInfo , typename OddPackInfo >
EvenPackInfo walberla::lbm::CombinedInPlaceCpuPackInfo< EvenPackInfo, OddPackInfo >::evenPackInfo_
private

◆ oddPackInfo_

template<typename EvenPackInfo , typename OddPackInfo >
OddPackInfo walberla::lbm::CombinedInPlaceCpuPackInfo< EvenPackInfo, OddPackInfo >::oddPackInfo_
private

◆ tracker_

template<typename EvenPackInfo , typename OddPackInfo >
const std::shared_ptr< lbm::TimestepTracker >& walberla::lbm::CombinedInPlaceCpuPackInfo< EvenPackInfo, OddPackInfo >::tracker_
private

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