walberla::blockforest::communication::NonUniformBufferedScheme< Stencil > Class Template Reference

#include <NonUniformBufferedScheme.h>

Public Types

enum  INDEX { EQUAL_LEVEL = 0, COARSE_TO_FINE = 1, FINE_TO_COARSE = 2 }
 
typedef mpi::SendBuffer SendBuffer
 
typedef mpi::RecvBuffer RecvBuffer
 
typedef shared_ptr< blockforest::communication::NonUniformPackInfoPackInfo
 
typedef std::function< void()> VoidFunction
 
typedef std::function< void(SendBuffer &buffer)> SendBufferFunction
 

Public Member Functions

LocalCommunicationMode localMode () const
 
void setLocalMode (const LocalCommunicationMode &mode)
 
Construction & Destruction
 NonUniformBufferedScheme (weak_ptr< StructuredBlockForest > bf, const int baseTag=778)
 
 NonUniformBufferedScheme (weak_ptr< StructuredBlockForest > bf, const Set< SUID > &requiredBlockSelectors, const Set< SUID > &incompatibleBlockSelectors, const int baseTag=778)
 
 ~NonUniformBufferedScheme ()
 
Pack Info Registration
void addPackInfo (const PackInfo &packInfo)
 
Synchronous Communication
void operator() ()
 
void communicateEqualLevel ()
 
void communicateCoarseToFine ()
 
void communicateFineToCoarse ()
 
void communicateEqualLevel (const uint_t level)
 
void communicateCoarseToFine (const uint_t fineLevel)
 
void communicateFineToCoarse (const uint_t fineLevel)
 
Asynchronous Communication
void startCommunication ()
 
std::function< void()> getStartCommunicateFunctor ()
 
void startCommunicateEqualLevel ()
 
void startCommunicateCoarseToFine ()
 
void startCommunicateFineToCoarse ()
 
void startCommunicateEqualLevel (const uint_t level)
 
void startCommunicateCoarseToFine (const uint_t fineLevel)
 
void startCommunicateFineToCoarse (const uint_t fineLevel)
 
void wait ()
 
std::function< void() > getWaitFunctor ()
 
void waitCommunicateEqualLevel ()
 
void waitCommunicateCoarseToFine ()
 
void waitCommunicateFineToCoarse ()
 
void waitCommunicateEqualLevel (const uint_t level)
 
void waitCommunicateCoarseToFine (const uint_t fineLevel)
 
void waitCommunicateFineToCoarse (const uint_t fineLevel)
 

Protected Member Functions

void init ()
 
void refresh ()
 
void startCommunicationEqualLevel (const uint_t index, std::set< uint_t > &participatingLevels)
 
void startCommunicationCoarseToFine (const uint_t index, const uint_t coarsestLevel, const uint_t finestLevel)
 
void startCommunicationFineToCoarse (const uint_t index, const uint_t coarsestLevel, const uint_t finestLevel)
 
void resetBufferSystem (shared_ptr< mpi::OpenMPBufferSystem > &bufferSystem)
 
void start (const INDEX i, const uint_t j)
 
void wait (const INDEX i, const uint_t j)
 
void receive (RecvBuffer &buffer)
 
void localBufferPacking (const INDEX i, const uint_t j, const uint_t bufferIndex, const PackInfo &packInfo, const Block *sender, const Block *receiver, const stencil::Direction &dir)
 
void localBufferUnpacking (const INDEX i, const uint_t j, const uint_t bufferIndex, const PackInfo &packInfo, Block *receiver, const Block *sender, const stencil::Direction &dir)
 
bool isAnyCommunicationInProgress () const
 

Static Protected Member Functions

static void writeHeader (SendBuffer &buffer, const BlockID &sender, const BlockID &receiver, const stencil::Direction &dir)
 
static void readHeader (RecvBuffer &buffer, BlockID &sender, BlockID &receiver, stencil::Direction &dir)
 
static void send (SendBuffer &buffer, std::vector< SendBufferFunction > &functions)
 

Protected Attributes

weak_ptr< StructuredBlockForestblockForest_
 
uint_t forestModificationStamp_
 
std::vector< PackInfopackInfos_
 
LocalCommunicationMode localMode_
 
int baseTag_
 
std::vector< std::vector< shared_ptr< mpi::OpenMPBufferSystem > > > bufferSystem_
 
std::vector< std::vector< std::vector< VoidFunction > > > localCommunication_
 
std::vector< std::vector< std::vector< VoidFunction > > > threadsafeLocalCommunication_
 
std::vector< std::vector< std::vector< VoidFunction > > > localCommunicationUnpack_
 
std::vector< std::vector< std::vector< VoidFunction > > > threadsafeLocalCommunicationUnpack_
 
std::vector< std::vector< std::vector< SendBuffer > > > localBuffers_
 
std::vector< std::vector< char > > setupBeforeNextCommunication_
 
std::vector< std::vector< bool > > communicationInProgress_
 
Set< SUID > requiredBlockSelectors_
 
Set< SUID > incompatibleBlockSelectors_
 

Member Typedef Documentation

template<typename Stencil>
typedef std::function<void ( SendBuffer & buffer )> walberla::blockforest::communication::NonUniformBufferedScheme< Stencil >::SendBufferFunction
template<typename Stencil>
typedef std::function<void ()> walberla::blockforest::communication::NonUniformBufferedScheme< Stencil >::VoidFunction

Member Enumeration Documentation

Enumerator
EQUAL_LEVEL 
COARSE_TO_FINE 
FINE_TO_COARSE 

Constructor & Destructor Documentation

template<typename Stencil >
walberla::blockforest::communication::NonUniformBufferedScheme< Stencil >::NonUniformBufferedScheme ( weak_ptr< StructuredBlockForest bf,
const int  baseTag = 778 
)
explicit
template<typename Stencil >
walberla::blockforest::communication::NonUniformBufferedScheme< Stencil >::NonUniformBufferedScheme ( weak_ptr< StructuredBlockForest bf,
const Set< SUID > &  requiredBlockSelectors,
const Set< SUID > &  incompatibleBlockSelectors,
const int  baseTag = 778 
)

Member Function Documentation

template<typename Stencil >
void walberla::blockforest::communication::NonUniformBufferedScheme< Stencil >::addPackInfo ( const PackInfo packInfo)
inline
template<typename Stencil >
void walberla::blockforest::communication::NonUniformBufferedScheme< Stencil >::communicateCoarseToFine ( )
inline
template<typename Stencil >
void walberla::blockforest::communication::NonUniformBufferedScheme< Stencil >::communicateCoarseToFine ( const uint_t  fineLevel)
inline
template<typename Stencil >
void walberla::blockforest::communication::NonUniformBufferedScheme< Stencil >::communicateEqualLevel ( )
inline
template<typename Stencil >
void walberla::blockforest::communication::NonUniformBufferedScheme< Stencil >::communicateEqualLevel ( const uint_t  level)
inline
template<typename Stencil >
void walberla::blockforest::communication::NonUniformBufferedScheme< Stencil >::communicateFineToCoarse ( )
inline
template<typename Stencil >
void walberla::blockforest::communication::NonUniformBufferedScheme< Stencil >::communicateFineToCoarse ( const uint_t  fineLevel)
inline
template<typename Stencil>
std::function<void()> walberla::blockforest::communication::NonUniformBufferedScheme< Stencil >::getStartCommunicateFunctor ( )
inline
template<typename Stencil>
std::function<void() > walberla::blockforest::communication::NonUniformBufferedScheme< Stencil >::getWaitFunctor ( )
inline
template<typename Stencil >
void walberla::blockforest::communication::NonUniformBufferedScheme< Stencil >::init ( )
protected
template<typename Stencil >
bool walberla::blockforest::communication::NonUniformBufferedScheme< Stencil >::isAnyCommunicationInProgress ( ) const
protected
template<typename Stencil >
void walberla::blockforest::communication::NonUniformBufferedScheme< Stencil >::localBufferPacking ( const INDEX  i,
const uint_t  j,
const uint_t  bufferIndex,
const PackInfo packInfo,
const Block sender,
const Block receiver,
const stencil::Direction dir 
)
protected
template<typename Stencil >
void walberla::blockforest::communication::NonUniformBufferedScheme< Stencil >::localBufferUnpacking ( const INDEX  i,
const uint_t  j,
const uint_t  bufferIndex,
const PackInfo packInfo,
Block receiver,
const Block sender,
const stencil::Direction dir 
)
protected
template<typename Stencil>
LocalCommunicationMode walberla::blockforest::communication::NonUniformBufferedScheme< Stencil >::localMode ( ) const
inline
template<typename Stencil>
void walberla::blockforest::communication::NonUniformBufferedScheme< Stencil >::operator() ( )
inline
template<typename Stencil >
void walberla::blockforest::communication::NonUniformBufferedScheme< Stencil >::readHeader ( RecvBuffer buffer,
BlockID sender,
BlockID receiver,
stencil::Direction dir 
)
staticprotected
template<typename Stencil >
void walberla::blockforest::communication::NonUniformBufferedScheme< Stencil >::receive ( RecvBuffer buffer)
protected
template<typename Stencil >
void walberla::blockforest::communication::NonUniformBufferedScheme< Stencil >::refresh ( )
protected
template<typename Stencil >
void walberla::blockforest::communication::NonUniformBufferedScheme< Stencil >::resetBufferSystem ( shared_ptr< mpi::OpenMPBufferSystem > &  bufferSystem)
protected
template<typename Stencil >
void walberla::blockforest::communication::NonUniformBufferedScheme< Stencil >::send ( SendBuffer buffer,
std::vector< SendBufferFunction > &  functions 
)
staticprotected
template<typename Stencil >
void walberla::blockforest::communication::NonUniformBufferedScheme< Stencil >::setLocalMode ( const LocalCommunicationMode mode)
inline
template<typename Stencil >
void walberla::blockforest::communication::NonUniformBufferedScheme< Stencil >::start ( const INDEX  i,
const uint_t  j 
)
protected
template<typename Stencil >
void walberla::blockforest::communication::NonUniformBufferedScheme< Stencil >::startCommunicateCoarseToFine ( )
inline
template<typename Stencil >
void walberla::blockforest::communication::NonUniformBufferedScheme< Stencil >::startCommunicateCoarseToFine ( const uint_t  fineLevel)
inline
template<typename Stencil >
void walberla::blockforest::communication::NonUniformBufferedScheme< Stencil >::startCommunicateEqualLevel ( )
inline
template<typename Stencil >
void walberla::blockforest::communication::NonUniformBufferedScheme< Stencil >::startCommunicateEqualLevel ( const uint_t  level)
inline
template<typename Stencil >
void walberla::blockforest::communication::NonUniformBufferedScheme< Stencil >::startCommunicateFineToCoarse ( )
inline
template<typename Stencil >
void walberla::blockforest::communication::NonUniformBufferedScheme< Stencil >::startCommunicateFineToCoarse ( const uint_t  fineLevel)
inline
template<typename Stencil>
void walberla::blockforest::communication::NonUniformBufferedScheme< Stencil >::startCommunication ( )
inline
template<typename Stencil >
void walberla::blockforest::communication::NonUniformBufferedScheme< Stencil >::startCommunicationCoarseToFine ( const uint_t  index,
const uint_t  coarsestLevel,
const uint_t  finestLevel 
)
protected
template<typename Stencil >
void walberla::blockforest::communication::NonUniformBufferedScheme< Stencil >::startCommunicationEqualLevel ( const uint_t  index,
std::set< uint_t > &  participatingLevels 
)
protected
template<typename Stencil >
void walberla::blockforest::communication::NonUniformBufferedScheme< Stencil >::startCommunicationFineToCoarse ( const uint_t  index,
const uint_t  coarsestLevel,
const uint_t  finestLevel 
)
protected
template<typename Stencil>
void walberla::blockforest::communication::NonUniformBufferedScheme< Stencil >::wait ( )
inline
template<typename Stencil >
void walberla::blockforest::communication::NonUniformBufferedScheme< Stencil >::wait ( const INDEX  i,
const uint_t  j 
)
protected
template<typename Stencil >
void walberla::blockforest::communication::NonUniformBufferedScheme< Stencil >::waitCommunicateCoarseToFine ( )
inline
template<typename Stencil >
void walberla::blockforest::communication::NonUniformBufferedScheme< Stencil >::waitCommunicateCoarseToFine ( const uint_t  fineLevel)
inline
template<typename Stencil >
void walberla::blockforest::communication::NonUniformBufferedScheme< Stencil >::waitCommunicateEqualLevel ( )
inline
template<typename Stencil >
void walberla::blockforest::communication::NonUniformBufferedScheme< Stencil >::waitCommunicateEqualLevel ( const uint_t  level)
inline
template<typename Stencil >
void walberla::blockforest::communication::NonUniformBufferedScheme< Stencil >::waitCommunicateFineToCoarse ( )
inline
template<typename Stencil >
void walberla::blockforest::communication::NonUniformBufferedScheme< Stencil >::waitCommunicateFineToCoarse ( const uint_t  fineLevel)
inline
template<typename Stencil >
void walberla::blockforest::communication::NonUniformBufferedScheme< Stencil >::writeHeader ( SendBuffer buffer,
const BlockID sender,
const BlockID receiver,
const stencil::Direction dir 
)
staticprotected

Member Data Documentation

template<typename Stencil>
int walberla::blockforest::communication::NonUniformBufferedScheme< Stencil >::baseTag_
protected
template<typename Stencil>
weak_ptr<StructuredBlockForest> walberla::blockforest::communication::NonUniformBufferedScheme< Stencil >::blockForest_
protected
template<typename Stencil>
std::vector< std::vector< shared_ptr< mpi::OpenMPBufferSystem > > > walberla::blockforest::communication::NonUniformBufferedScheme< Stencil >::bufferSystem_
protected
template<typename Stencil>
std::vector< std::vector< bool > > walberla::blockforest::communication::NonUniformBufferedScheme< Stencil >::communicationInProgress_
protected
template<typename Stencil>
uint_t walberla::blockforest::communication::NonUniformBufferedScheme< Stencil >::forestModificationStamp_
protected
template<typename Stencil>
Set<SUID> walberla::blockforest::communication::NonUniformBufferedScheme< Stencil >::incompatibleBlockSelectors_
protected
template<typename Stencil>
std::vector< std::vector< std::vector< SendBuffer > > > walberla::blockforest::communication::NonUniformBufferedScheme< Stencil >::localBuffers_
protected
template<typename Stencil>
std::vector< std::vector< std::vector< VoidFunction > > > walberla::blockforest::communication::NonUniformBufferedScheme< Stencil >::localCommunication_
protected
template<typename Stencil>
std::vector< std::vector< std::vector< VoidFunction > > > walberla::blockforest::communication::NonUniformBufferedScheme< Stencil >::localCommunicationUnpack_
protected
template<typename Stencil>
LocalCommunicationMode walberla::blockforest::communication::NonUniformBufferedScheme< Stencil >::localMode_
protected
template<typename Stencil>
std::vector< PackInfo > walberla::blockforest::communication::NonUniformBufferedScheme< Stencil >::packInfos_
protected
template<typename Stencil>
Set<SUID> walberla::blockforest::communication::NonUniformBufferedScheme< Stencil >::requiredBlockSelectors_
protected
template<typename Stencil>
std::vector< std::vector< char > > walberla::blockforest::communication::NonUniformBufferedScheme< Stencil >::setupBeforeNextCommunication_
protected
template<typename Stencil>
std::vector< std::vector< std::vector< VoidFunction > > > walberla::blockforest::communication::NonUniformBufferedScheme< Stencil >::threadsafeLocalCommunication_
protected
template<typename Stencil>
std::vector< std::vector< std::vector< VoidFunction > > > walberla::blockforest::communication::NonUniformBufferedScheme< Stencil >::threadsafeLocalCommunicationUnpack_
protected

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