walberla::mpi::internal::AbstractCommunication< RecvBuffer_T, SendBuffer_T > Class Template Referenceabstract

#include <BufferSystemHelper.h>

+ Inheritance diagram for walberla::mpi::internal::AbstractCommunication< RecvBuffer_T, SendBuffer_T >:

Classes

struct  ReceiveInfo
 

Public Member Functions

 AbstractCommunication (const MPI_Comm &communicator, int tag=0)
 
virtual ~AbstractCommunication ()=default
 
virtual void send (MPIRank rank, const SendBuffer_T &sendBuffer)=0
 Send buffer content to receiver using MPI_ISend, request is stored internally -> see waitForSends() More...
 
virtual void waitForSends ()=0
 Wait for all sends to complete. More...
 
virtual void scheduleReceives (std::map< MPIRank, ReceiveInfo > &recvInfos)=0
 Executes MPI_Irecv calls, with the recvInfos as target memory. More...
 
virtual MPIRank waitForNextReceive (std::map< MPIRank, ReceiveInfo > &recvInfos)=0
 Waits for the next receive to complete and returns. More...
 
virtual int getTag () const
 
virtual MPI_Comm getCommunicator () const
 

Protected Attributes

MPI_Comm communicator_
 
int tag_
 

Constructor & Destructor Documentation

◆ AbstractCommunication()

template<typename RecvBuffer_T , typename SendBuffer_T >
walberla::mpi::internal::AbstractCommunication< RecvBuffer_T, SendBuffer_T >::AbstractCommunication ( const MPI_Comm &  communicator,
int  tag = 0 
)
inline

◆ ~AbstractCommunication()

template<typename RecvBuffer_T , typename SendBuffer_T >
virtual walberla::mpi::internal::AbstractCommunication< RecvBuffer_T, SendBuffer_T >::~AbstractCommunication ( )
virtualdefault

Member Function Documentation

◆ getCommunicator()

template<typename RecvBuffer_T , typename SendBuffer_T >
virtual MPI_Comm walberla::mpi::internal::AbstractCommunication< RecvBuffer_T, SendBuffer_T >::getCommunicator ( ) const
inlinevirtual

◆ getTag()

template<typename RecvBuffer_T , typename SendBuffer_T >
virtual int walberla::mpi::internal::AbstractCommunication< RecvBuffer_T, SendBuffer_T >::getTag ( ) const
inlinevirtual

◆ scheduleReceives()

template<typename RecvBuffer_T , typename SendBuffer_T >
virtual void walberla::mpi::internal::AbstractCommunication< RecvBuffer_T, SendBuffer_T >::scheduleReceives ( std::map< MPIRank, ReceiveInfo > &  recvInfos)
pure virtual

Executes MPI_Irecv calls, with the recvInfos as target memory.

Parameters
recvInfosMap that has entries for all ranks where messages are expected. The KnownSizeCommunication also expects the size field to be valid ( defining the expected message size) Do not change/read the recvInfos after scheduleReceive() call and before waitForNextReceive() is completed

Implemented in walberla::mpi::internal::NoMPICommunication< RecvBuffer_T, SendBuffer_T >, walberla::mpi::internal::NoMPICommunication< walberla::gpu::communication::CustomMemoryBuffer, walberla::gpu::communication::CustomMemoryBuffer >, walberla::mpi::internal::NoMPICommunication< RecvBuffer, SendBuffer >, walberla::mpi::internal::UnknownSizeCommunicationIProbe< RecvBuffer_T, SendBuffer_T >, walberla::mpi::internal::UnknownSizeCommunicationIProbe< walberla::gpu::communication::CustomMemoryBuffer, walberla::gpu::communication::CustomMemoryBuffer >, walberla::mpi::internal::UnknownSizeCommunicationIProbe< RecvBuffer, SendBuffer >, walberla::mpi::internal::UnknownSizeCommunication< RecvBuffer_T, SendBuffer_T >, walberla::mpi::internal::UnknownSizeCommunication< walberla::gpu::communication::CustomMemoryBuffer, walberla::gpu::communication::CustomMemoryBuffer >, walberla::mpi::internal::UnknownSizeCommunication< RecvBuffer, SendBuffer >, walberla::mpi::internal::KnownSizeCommunication< RecvBuffer_T, SendBuffer_T >, walberla::mpi::internal::KnownSizeCommunication< walberla::gpu::communication::CustomMemoryBuffer, walberla::gpu::communication::CustomMemoryBuffer >, and walberla::mpi::internal::KnownSizeCommunication< RecvBuffer, SendBuffer >.

◆ send()

template<typename RecvBuffer_T , typename SendBuffer_T >
virtual void walberla::mpi::internal::AbstractCommunication< RecvBuffer_T, SendBuffer_T >::send ( MPIRank  rank,
const SendBuffer_T &  sendBuffer 
)
pure virtual

◆ waitForNextReceive()

template<typename RecvBuffer_T , typename SendBuffer_T >
virtual MPIRank walberla::mpi::internal::AbstractCommunication< RecvBuffer_T, SendBuffer_T >::waitForNextReceive ( std::map< MPIRank, ReceiveInfo > &  recvInfos)
pure virtual

Waits for the next receive to complete and returns.

Parameters
recvInfosthe same receive info that was passed to scheduleReceives()
Returns
The rank where the data was received -> recvInfos[rank] is now valid INVALID_RANK if all messages were received.

Implemented in walberla::mpi::internal::NoMPICommunication< RecvBuffer_T, SendBuffer_T >, walberla::mpi::internal::NoMPICommunication< walberla::gpu::communication::CustomMemoryBuffer, walberla::gpu::communication::CustomMemoryBuffer >, walberla::mpi::internal::NoMPICommunication< RecvBuffer, SendBuffer >, walberla::mpi::internal::UnknownSizeCommunicationIProbe< RecvBuffer_T, SendBuffer_T >, walberla::mpi::internal::UnknownSizeCommunicationIProbe< walberla::gpu::communication::CustomMemoryBuffer, walberla::gpu::communication::CustomMemoryBuffer >, walberla::mpi::internal::UnknownSizeCommunicationIProbe< RecvBuffer, SendBuffer >, walberla::mpi::internal::UnknownSizeCommunication< RecvBuffer_T, SendBuffer_T >, walberla::mpi::internal::UnknownSizeCommunication< walberla::gpu::communication::CustomMemoryBuffer, walberla::gpu::communication::CustomMemoryBuffer >, walberla::mpi::internal::UnknownSizeCommunication< RecvBuffer, SendBuffer >, walberla::mpi::internal::KnownSizeCommunication< RecvBuffer_T, SendBuffer_T >, walberla::mpi::internal::KnownSizeCommunication< walberla::gpu::communication::CustomMemoryBuffer, walberla::gpu::communication::CustomMemoryBuffer >, and walberla::mpi::internal::KnownSizeCommunication< RecvBuffer, SendBuffer >.

◆ waitForSends()

Member Data Documentation

◆ communicator_

template<typename RecvBuffer_T , typename SendBuffer_T >
MPI_Comm walberla::mpi::internal::AbstractCommunication< RecvBuffer_T, SendBuffer_T >::communicator_
protected

◆ tag_

template<typename RecvBuffer_T , typename SendBuffer_T >
int walberla::mpi::internal::AbstractCommunication< RecvBuffer_T, SendBuffer_T >::tag_
protected

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