Point-2-Point communicator for exchange messages between processes. More...

#include <p2pcommunicator.hh>

Inheritance diagram for Dune::Point2PointCommunicator< MsgBuffer >:
Inheritance graph

Classes

class  DataHandleInterface
 

Public Types

typedef MPIHelper::MPICommunicator MPICommunicator
 type of MPI communicator, either MPI_Comm or NoComm as defined in MPIHelper More...
 
typedef MsgBuffer MessageBufferType
 type of message buffer used More...
 

Public Member Functions

 Point2PointCommunicator (const MPICommunicator &mpiComm=MPIHelper::getCommunicator())
 constructor taking mpi communicator More...
 
 Point2PointCommunicator (const BaseType &comm)
 constructor taking collective communication More...
 
void insertRequest (const std::set< int > &sendLinks, const std::set< int > &recvLinks)
 insert communication request with a set os ranks to send to and a set of ranks to receive from More...
 
int sendLinks () const
 return number of processes we will send data to More...
 
int recvLinks () const
 return number of processes we will receive data from More...
 
const vector_trecvBufferSizes () const
 return vector containing possible recv buffer sizes More...
 
int sendLink (const int rank) const
 return send link number for a given send rank number More...
 
int recvLink (const int rank) const
 return recv link number for a given recv rank number More...
 
const std::vector< int > & sendDest () const
 return vector containing all process numbers we will send to More...
 
const std::vector< int > & recvSource () const
 return vector containing all process numbers we will receive from More...
 
void removeLinkage ()
 remove stored linkage More...
 
virtual std::vector< MessageBufferTypeexchange (const std::vector< MessageBufferType > &) const
 exchange message buffers with peers defined by inserted linkage More...
 
virtual void exchange (DataHandleInterface &) const
 exchange data with peers, handle defines pack and unpack of data More...
 
virtual void exchangeCached (DataHandleInterface &) const
 exchange data with peers, handle defines pack and unpack of data, if receive buffers are known from previous run and have not changed communication could be faster More...
 

Protected Types

using BaseType = Dune::Communication< MPICommunicator >
 
typedef Point2PointCommunicator< MessageBufferTypeThisType
 
typedef std::map< int, int > linkage_t
 
typedef std::vector< int > vector_t
 

Protected Member Functions

void computeDestinations (const linkage_t &linkage, vector_t &dest)
 
int getMessageTag (const unsigned int increment) const
 
int getMessageTag () const
 

Protected Attributes

linkage_t sendLinkage_
 
linkage_t recvLinkage_
 
vector_t sendDest_
 
vector_t recvSource_
 
vector_t _recvBufferSizes
 
bool _recvBufferSizesComputed
 

Static Protected Attributes

static const int messagetag = 234
 

Detailed Description

template<class MsgBuffer>
class Dune::Point2PointCommunicator< MsgBuffer >

Point-2-Point communicator for exchange messages between processes.

Member Typedef Documentation

◆ BaseType

template<class MsgBuffer >
using Dune::Point2PointCommunicator< MsgBuffer >::BaseType = Dune::Communication<MPICommunicator>
protected

◆ linkage_t

template<class MsgBuffer >
typedef std::map< int, int > Dune::Point2PointCommunicator< MsgBuffer >::linkage_t
protected

◆ MessageBufferType

template<class MsgBuffer >
typedef MsgBuffer Dune::Point2PointCommunicator< MsgBuffer >::MessageBufferType

type of message buffer used

◆ MPICommunicator

template<class MsgBuffer >
typedef MPIHelper::MPICommunicator Dune::Point2PointCommunicator< MsgBuffer >::MPICommunicator

type of MPI communicator, either MPI_Comm or NoComm as defined in MPIHelper

◆ ThisType

template<class MsgBuffer >
typedef Point2PointCommunicator< MessageBufferType > Dune::Point2PointCommunicator< MsgBuffer >::ThisType
protected

◆ vector_t

template<class MsgBuffer >
typedef std::vector< int > Dune::Point2PointCommunicator< MsgBuffer >::vector_t
protected

Constructor & Destructor Documentation

◆ Point2PointCommunicator() [1/2]

template<class MsgBuffer >
Dune::Point2PointCommunicator< MsgBuffer >::Point2PointCommunicator ( const MPICommunicator mpiComm = MPIHelper::getCommunicator())
inline

constructor taking mpi communicator

References Dune::Point2PointCommunicator< MsgBuffer >::removeLinkage().

◆ Point2PointCommunicator() [2/2]

template<class MsgBuffer >
Dune::Point2PointCommunicator< MsgBuffer >::Point2PointCommunicator ( const BaseType comm)
inline

constructor taking collective communication

References Dune::Point2PointCommunicator< MsgBuffer >::removeLinkage().

Member Function Documentation

◆ computeDestinations()

template<class MsgBuffer >
void Dune::Point2PointCommunicator< MsgBuffer >::computeDestinations ( const linkage_t linkage,
vector_t dest 
)
inlineprotected

◆ exchange() [1/2]

template<class MsgBuffer >
std::vector< MsgBuffer > Dune::Point2PointCommunicator< MsgBuffer >::exchange ( const std::vector< MessageBufferType > &  in) const
inlinevirtual

exchange message buffers with peers defined by inserted linkage

References Dune::NonBlockingExchangeImplementation< P2PCommunicator >::receiveImpl().

◆ exchange() [2/2]

template<class MsgBuffer >
void Dune::Point2PointCommunicator< MsgBuffer >::exchange ( DataHandleInterface handle) const
inlinevirtual

exchange data with peers, handle defines pack and unpack of data

References Dune::NonBlockingExchangeImplementation< P2PCommunicator >::exchange().

◆ exchangeCached()

template<class MsgBuffer >
void Dune::Point2PointCommunicator< MsgBuffer >::exchangeCached ( DataHandleInterface handle) const
inlinevirtual

exchange data with peers, handle defines pack and unpack of data, if receive buffers are known from previous run and have not changed communication could be faster

References Dune::NonBlockingExchangeImplementation< P2PCommunicator >::exchange().

◆ getMessageTag() [1/2]

template<class MsgBuffer >
int Dune::Point2PointCommunicator< MsgBuffer >::getMessageTag ( ) const
inlineprotected

◆ getMessageTag() [2/2]

template<class MsgBuffer >
int Dune::Point2PointCommunicator< MsgBuffer >::getMessageTag ( const unsigned int  increment) const
inlineprotected

◆ insertRequest()

template<class MsgBuffer >
void Dune::Point2PointCommunicator< MsgBuffer >::insertRequest ( const std::set< int > &  sendLinks,
const std::set< int > &  recvLinks 
)
inline

insert communication request with a set os ranks to send to and a set of ranks to receive from

◆ recvBufferSizes()

template<class MsgBuffer >
const vector_t & Dune::Point2PointCommunicator< MsgBuffer >::recvBufferSizes ( ) const
inline

return vector containing possible recv buffer sizes

References Dune::Point2PointCommunicator< MsgBuffer >::_recvBufferSizes.

◆ recvLink()

template<class MsgBuffer >
int Dune::Point2PointCommunicator< MsgBuffer >::recvLink ( const int  rank) const
inline

return recv link number for a given recv rank number

References Dune::Point2PointCommunicator< MsgBuffer >::recvLinkage_.

◆ recvLinks()

template<class MsgBuffer >
int Dune::Point2PointCommunicator< MsgBuffer >::recvLinks ( ) const
inline

return number of processes we will receive data from

References Dune::Point2PointCommunicator< MsgBuffer >::recvLinkage_.

◆ recvSource()

template<class MsgBuffer >
const std::vector< int > & Dune::Point2PointCommunicator< MsgBuffer >::recvSource ( ) const
inline

return vector containing all process numbers we will receive from

References Dune::Point2PointCommunicator< MsgBuffer >::recvSource_.

◆ removeLinkage()

template<class MsgBuffer >
void Dune::Point2PointCommunicator< MsgBuffer >::removeLinkage
inline

◆ sendDest()

template<class MsgBuffer >
const std::vector< int > & Dune::Point2PointCommunicator< MsgBuffer >::sendDest ( ) const
inline

return vector containing all process numbers we will send to

References Dune::Point2PointCommunicator< MsgBuffer >::sendDest_.

◆ sendLink()

template<class MsgBuffer >
int Dune::Point2PointCommunicator< MsgBuffer >::sendLink ( const int  rank) const
inline

return send link number for a given send rank number

References Dune::Point2PointCommunicator< MsgBuffer >::sendLinkage_.

◆ sendLinks()

template<class MsgBuffer >
int Dune::Point2PointCommunicator< MsgBuffer >::sendLinks ( ) const
inline

return number of processes we will send data to

References Dune::Point2PointCommunicator< MsgBuffer >::sendLinkage_.

Member Data Documentation

◆ _recvBufferSizes

template<class MsgBuffer >
vector_t Dune::Point2PointCommunicator< MsgBuffer >::_recvBufferSizes
mutableprotected

◆ _recvBufferSizesComputed

template<class MsgBuffer >
bool Dune::Point2PointCommunicator< MsgBuffer >::_recvBufferSizesComputed
mutableprotected

◆ messagetag

template<class MsgBuffer >
const int Dune::Point2PointCommunicator< MsgBuffer >::messagetag = 234
staticprotected

◆ recvLinkage_

◆ recvSource_

template<class MsgBuffer >
vector_t Dune::Point2PointCommunicator< MsgBuffer >::recvSource_
protected

◆ sendDest_

template<class MsgBuffer >
vector_t Dune::Point2PointCommunicator< MsgBuffer >::sendDest_
protected

◆ sendLinkage_


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