walberla::blockforest::DirectionBasedReduceScheme< dir_ > Class Template Reference

Detailed Description

template<stencil::Direction dir_>
class walberla::blockforest::DirectionBasedReduceScheme< dir_ >

Communication Scheme class for ghost layer based communication with the direction neighbors.

Most common use case: Reduce a GhostLayerField with all processes in one direction, e.g. summing up all values in one direction

  • when multiple fields have been changed they can be synchronized at once, using one MPI message per communication partner
    DirectionBasedReduceScheme<stencil::N> scheme; // the direction defines the communication direction, here from S to N
    scheme.addPackInfo( make_shared<ReduceFieldPackInfo<std::plus,real_t,1> >( idOfFirstField ) ); // field is of type real_t with F_SIZE = 1 and reduce operation = plus
    scheme.addPackInfo( make_shared<ReduceFieldPackInfo<std::plus,real_t,3> >( idOfSecondField ) ); // field is of type real_t with F_SIZE = 3 and reduce operation = plus
    // synchronous communication...
    scheme();

#include <DirectionBasedReduceScheme.h>

Public Member Functions

Construction & Destruction
 DirectionBasedReduceScheme (const shared_ptr< StructuredBlockForest > &bf)
 
 DirectionBasedReduceScheme (const shared_ptr< StructuredBlockForest > &bf, const shared_ptr< mpi::BufferSystem > &bs)
 
Pack Info Registration
size_t addPackInfo (const shared_ptr< walberla::communication::ReducePackInfo > &pi)
 

Synchronous Communication

shared_ptr< StructuredBlockForestblockForest_
 
shared_ptr< mpi::BufferSystembufferSystem_
 
std::vector< shared_ptr< walberla::communication::ReducePackInfo > > packInfos_
 
std::vector< Block * > localBlocks_
 
std::vector< std::vector< Block * > > localCopy_
 
std::vector< std::vector< BlockID > > remoteSend_
 
void operator() ()
 
void communicate ()
 
void copyIntoMPIBuffers ()
 Uses PackInfo's of the given step to copy data into the MPI Buffers. More...
 
void mpiCommunication ()
 Communicates data from MPI buffers using a BufferSystem. More...
 
void copyFromMPIBuffers ()
 Copies received data back into own ghost layers. More...
 
void readHeader (mpi::RecvBuffer &buf, BlockID &id) const
 
void writeHeader (mpi::SendBuffer &buf, const BlockID &id) const
 
void init ()
 

Constructor & Destructor Documentation

◆ DirectionBasedReduceScheme() [1/2]

template<stencil::Direction dir_>
walberla::blockforest::DirectionBasedReduceScheme< dir_ >::DirectionBasedReduceScheme ( const shared_ptr< StructuredBlockForest > &  bf)
inlineexplicit

◆ DirectionBasedReduceScheme() [2/2]

template<stencil::Direction dir_>
walberla::blockforest::DirectionBasedReduceScheme< dir_ >::DirectionBasedReduceScheme ( const shared_ptr< StructuredBlockForest > &  bf,
const shared_ptr< mpi::BufferSystem > &  bs 
)
inlineexplicit

Member Function Documentation

◆ addPackInfo()

template<stencil::Direction dir_>
size_t walberla::blockforest::DirectionBasedReduceScheme< dir_ >::addPackInfo ( const shared_ptr< walberla::communication::ReducePackInfo > &  pi)

◆ communicate()

template<stencil::Direction dir_>
void walberla::blockforest::DirectionBasedReduceScheme< dir_ >::communicate
inline

◆ copyFromMPIBuffers()

template<stencil::Direction dir_>
void walberla::blockforest::DirectionBasedReduceScheme< dir_ >::copyFromMPIBuffers
protected

Copies received data back into own ghost layers.

◆ copyIntoMPIBuffers()

template<stencil::Direction dir_>
void walberla::blockforest::DirectionBasedReduceScheme< dir_ >::copyIntoMPIBuffers
protected

Uses PackInfo's of the given step to copy data into the MPI Buffers.

◆ init()

template<stencil::Direction dir_>
void walberla::blockforest::DirectionBasedReduceScheme< dir_ >::init
private

◆ mpiCommunication()

template<stencil::Direction dir_>
void walberla::blockforest::DirectionBasedReduceScheme< dir_ >::mpiCommunication ( )
inlineprotected

Communicates data from MPI buffers using a BufferSystem.

◆ operator()()

template<stencil::Direction dir_>
void walberla::blockforest::DirectionBasedReduceScheme< dir_ >::operator() ( )
inline

◆ readHeader()

template<stencil::Direction dir_>
void walberla::blockforest::DirectionBasedReduceScheme< dir_ >::readHeader ( mpi::RecvBuffer buf,
BlockID id 
) const
inlineprotected

◆ writeHeader()

template<stencil::Direction dir_>
void walberla::blockforest::DirectionBasedReduceScheme< dir_ >::writeHeader ( mpi::SendBuffer buf,
const BlockID id 
) const
inlineprotected

Member Data Documentation

◆ blockForest_

template<stencil::Direction dir_>
shared_ptr<StructuredBlockForest> walberla::blockforest::DirectionBasedReduceScheme< dir_ >::blockForest_
protected

◆ bufferSystem_

template<stencil::Direction dir_>
shared_ptr<mpi::BufferSystem> walberla::blockforest::DirectionBasedReduceScheme< dir_ >::bufferSystem_
protected

◆ localBlocks_

template<stencil::Direction dir_>
std::vector< Block* > walberla::blockforest::DirectionBasedReduceScheme< dir_ >::localBlocks_
protected

◆ localCopy_

template<stencil::Direction dir_>
std::vector< std::vector< Block* > > walberla::blockforest::DirectionBasedReduceScheme< dir_ >::localCopy_
protected

◆ packInfos_

template<stencil::Direction dir_>
std::vector< shared_ptr<walberla::communication::ReducePackInfo> > walberla::blockforest::DirectionBasedReduceScheme< dir_ >::packInfos_
protected

◆ remoteSend_

template<stencil::Direction dir_>
std::vector< std::vector< BlockID > > walberla::blockforest::DirectionBasedReduceScheme< dir_ >::remoteSend_
protected

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