walberla::mpi::GenericOpenMPBufferSystem< RecvBuffer_T, SendBuffer_T > Class Template Reference

Detailed Description

template<typename RecvBuffer_T, typename SendBuffer_T>
class walberla::mpi::GenericOpenMPBufferSystem< RecvBuffer_T, SendBuffer_T >

Wrapper around BufferSystem for OpenMP parallel MPI communication.

Manages a set of sending (packing) and receiving (unpacking) functions for all communication partners. These functions are executed in parallel and are not allowed to influence each other.

When running multiple BufferSystems concurrently different MPI tags have to be used for the systems: the tag can be passed in the constructor.

#include <OpenMPBufferSystem.h>

Public Member Functions

 GenericOpenMPBufferSystem (const MPI_Comm &communicator, int tag=0, bool _serialSends=false, bool _serialRecvs=false)
 
void enforceSerialSends (bool val)
 
void enforceSerialRecvs (bool val)
 
void setReceiverInfo (bool _sizeChangesEverytime)
 
bool isSizeCommunicatedInNextStep () const
 
void addReceivingFunction (MPIRank rank, const std::function< void(RecvBuffer_T &buf) > &recvFunction)
 
void addSendingFunction (MPIRank rank, const std::function< void(SendBuffer_T &buf) > &sendFunction)
 
void clearReceivingFunctions ()
 
void clearSendingFunctions ()
 
void startCommunication ()
 
void wait ()
 
bool sizeChangesEverytime () const
 
bool serialSends () const
 
bool serialRecvs () const
 

Private Member Functions

void setupBufferSystem ()
 
void startCommunicationOpenMP ()
 
void startCommunicationSerial ()
 
void waitOpenMP ()
 
void waitSerial ()
 

Private Attributes

GenericBufferSystem< RecvBuffer_T, SendBuffer_T > bs_
 
bool dirty_
 
bool serialSends_
 
bool serialRecvs_
 
bool sizeChangesEverytime_
 
std::map< MPIRank, std::function< void(RecvBuffer_T &)> > recvFunctions_
 
std::vector< MPIRank > sendRanks_
 
std::vector< std::function< void(SendBuffer_T &)> > sendFunctions_
 

Constructor & Destructor Documentation

◆ GenericOpenMPBufferSystem()

template<typename Rb , typename Sb >
walberla::mpi::GenericOpenMPBufferSystem< Rb, Sb >::GenericOpenMPBufferSystem ( const MPI_Comm &  communicator,
int  tag = 0,
bool  _serialSends = false,
bool  _serialRecvs = false 
)

Member Function Documentation

◆ addReceivingFunction()

template<typename RecvBuffer_T , typename SendBuffer_T >
void walberla::mpi::GenericOpenMPBufferSystem< Rb, Sb >::addReceivingFunction ( MPIRank  rank,
const std::function< void(RecvBuffer_T &buf) > &  recvFunction 
)

◆ addSendingFunction()

template<typename RecvBuffer_T , typename SendBuffer_T >
void walberla::mpi::GenericOpenMPBufferSystem< Rb, Sb >::addSendingFunction ( MPIRank  rank,
const std::function< void(SendBuffer_T &buf) > &  sendFunction 
)

◆ clearReceivingFunctions()

template<typename RecvBuffer_T , typename SendBuffer_T >
void walberla::mpi::GenericOpenMPBufferSystem< RecvBuffer_T, SendBuffer_T >::clearReceivingFunctions ( )
inline

◆ clearSendingFunctions()

template<typename RecvBuffer_T , typename SendBuffer_T >
void walberla::mpi::GenericOpenMPBufferSystem< RecvBuffer_T, SendBuffer_T >::clearSendingFunctions ( )
inline

◆ enforceSerialRecvs()

template<typename RecvBuffer_T , typename SendBuffer_T >
void walberla::mpi::GenericOpenMPBufferSystem< RecvBuffer_T, SendBuffer_T >::enforceSerialRecvs ( bool  val)
inline

◆ enforceSerialSends()

template<typename RecvBuffer_T , typename SendBuffer_T >
void walberla::mpi::GenericOpenMPBufferSystem< RecvBuffer_T, SendBuffer_T >::enforceSerialSends ( bool  val)
inline

◆ isSizeCommunicatedInNextStep()

template<typename RecvBuffer_T , typename SendBuffer_T >
bool walberla::mpi::GenericOpenMPBufferSystem< RecvBuffer_T, SendBuffer_T >::isSizeCommunicatedInNextStep ( ) const
inline

◆ serialRecvs()

template<typename RecvBuffer_T , typename SendBuffer_T >
bool walberla::mpi::GenericOpenMPBufferSystem< RecvBuffer_T, SendBuffer_T >::serialRecvs ( ) const
inline

◆ serialSends()

template<typename RecvBuffer_T , typename SendBuffer_T >
bool walberla::mpi::GenericOpenMPBufferSystem< RecvBuffer_T, SendBuffer_T >::serialSends ( ) const
inline

◆ setReceiverInfo()

template<typename RecvBuffer_T , typename SendBuffer_T >
void walberla::mpi::GenericOpenMPBufferSystem< RecvBuffer_T, SendBuffer_T >::setReceiverInfo ( bool  _sizeChangesEverytime)
inline

◆ setupBufferSystem()

template<typename Rb , typename Sb >
void walberla::mpi::GenericOpenMPBufferSystem< Rb, Sb >::setupBufferSystem
private

◆ sizeChangesEverytime()

template<typename RecvBuffer_T , typename SendBuffer_T >
bool walberla::mpi::GenericOpenMPBufferSystem< RecvBuffer_T, SendBuffer_T >::sizeChangesEverytime ( ) const
inline

◆ startCommunication()

template<typename Rb , typename Sb >
void walberla::mpi::GenericOpenMPBufferSystem< Rb, Sb >::startCommunication

◆ startCommunicationOpenMP()

template<typename Rb , typename Sb >
void walberla::mpi::GenericOpenMPBufferSystem< Rb, Sb >::startCommunicationOpenMP
private

◆ startCommunicationSerial()

template<typename Rb , typename Sb >
void walberla::mpi::GenericOpenMPBufferSystem< Rb, Sb >::startCommunicationSerial
private

◆ wait()

template<typename Rb , typename Sb >
void walberla::mpi::GenericOpenMPBufferSystem< Rb, Sb >::wait

◆ waitOpenMP()

template<typename Rb , typename Sb >
void walberla::mpi::GenericOpenMPBufferSystem< Rb, Sb >::waitOpenMP
private

◆ waitSerial()

template<typename Rb , typename Sb >
void walberla::mpi::GenericOpenMPBufferSystem< Rb, Sb >::waitSerial
private

Member Data Documentation

◆ bs_

template<typename RecvBuffer_T , typename SendBuffer_T >
GenericBufferSystem<RecvBuffer_T, SendBuffer_T> walberla::mpi::GenericOpenMPBufferSystem< RecvBuffer_T, SendBuffer_T >::bs_
private

◆ dirty_

template<typename RecvBuffer_T , typename SendBuffer_T >
bool walberla::mpi::GenericOpenMPBufferSystem< RecvBuffer_T, SendBuffer_T >::dirty_
private

◆ recvFunctions_

template<typename RecvBuffer_T , typename SendBuffer_T >
std::map<MPIRank, std::function<void ( RecvBuffer_T & )> > walberla::mpi::GenericOpenMPBufferSystem< RecvBuffer_T, SendBuffer_T >::recvFunctions_
private

◆ sendFunctions_

template<typename RecvBuffer_T , typename SendBuffer_T >
std::vector< std::function<void ( SendBuffer_T & )> > walberla::mpi::GenericOpenMPBufferSystem< RecvBuffer_T, SendBuffer_T >::sendFunctions_
private

◆ sendRanks_

template<typename RecvBuffer_T , typename SendBuffer_T >
std::vector<MPIRank> walberla::mpi::GenericOpenMPBufferSystem< RecvBuffer_T, SendBuffer_T >::sendRanks_
private

◆ serialRecvs_

template<typename RecvBuffer_T , typename SendBuffer_T >
bool walberla::mpi::GenericOpenMPBufferSystem< RecvBuffer_T, SendBuffer_T >::serialRecvs_
private

◆ serialSends_

template<typename RecvBuffer_T , typename SendBuffer_T >
bool walberla::mpi::GenericOpenMPBufferSystem< RecvBuffer_T, SendBuffer_T >::serialSends_
private

◆ sizeChangesEverytime_

template<typename RecvBuffer_T , typename SendBuffer_T >
bool walberla::mpi::GenericOpenMPBufferSystem< RecvBuffer_T, SendBuffer_T >::sizeChangesEverytime_
private

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