WARPXM v1.10.0
|
Provides an abstract interface for message based communication between different processes. More...
#include <wxmsgbase.h>
Provides an abstract interface for message based communication between different processes.
Classes | |
struct | WxMsgContainer |
Public Types | |
typedef WxTypeMap< WxDataTypes_t, WxMsgContainer > | WxMsgTypeMap_t |
Public Member Functions | |
virtual | ~WxMsgBase () |
Destructor. | |
virtual int | rank () const =0 |
Rank of process. | |
virtual unsigned | numProcs () const =0 |
Number of processes taking part in messaging. | |
WxMsgBase * | parent () const |
Get parent communicating processor group. | |
virtual WxMsgBase * | createSubComm (const std::vector< int > &ranks)=0 |
Split communicator into a child communicator. | |
virtual WxMsgBase * | splitComm (int color, int order)=0 |
See MPI_Comm_split. | |
virtual void | barrier () const =0 |
Block till all processes hit this barrier. | |
template<typename T > | |
void | send (const std::vector< T > &array, unsigned recvRank, int tag=-1) const |
Send a std::vector to another rank. | |
template<typename T > | |
void | send (unsigned num, const T *array, unsigned recvRank, int tag=-1) const |
Send an array to another rank. | |
template<typename T > | |
WxMsgStatus | startSend (const std::vector< T > &vec, unsigned recvRank, int tag=-1) const |
Send an vector to another rank. | |
template<typename T > | |
WxMsgStatus | startSend (unsigned num, const T *arr, unsigned recvRank, int tag=-1) const |
Send an array to another rank. | |
virtual void | finishSend (WxMsgStatus ms) const =0 |
Finish the send started by startSend. | |
template<typename T > | |
void | recv (int num, std::vector< T > &array, unsigned sendRank, int tag=-1) const |
Receive a std::vector from another rank. | |
template<typename T > | |
void | recv (unsigned num, T *array, unsigned sendRank, int tag=-1) const |
Receive an array from another rank. | |
template<typename T > | |
WxMsgStatus | startRecv (unsigned num, unsigned sendRank, int tag=-1) const |
Receive an array from another rank. | |
template<typename T > | |
WxMsgStatus | startRecv (unsigned num, T *arr, unsigned sendRank, int tag=-1) const |
Receive an array from another rank. | |
template<typename T > | |
WxMsgStatus | startRecv (std::vector< T > &vec, unsigned sendRank, int tag=-1) const |
Receive an array from another rank. | |
virtual void * | finishRecv (WxMsgStatus ms) const =0 |
Finish the receive started by startRecv and return a pointer to the data recieved. | |
virtual bool | checkRecv (WxMsgStatus ms) const =0 |
Check status of recieve started by a startRecv. | |
template<typename T > | |
void | allReduce (unsigned num, T *sendBuff, T *recvBuff, MPI_Op op) const |
Reduce data to all ranks. | |
template<typename T > | |
std::vector< T > | allReduce (std::vector< T > sendBuff, MPI_Op op) const |
Reduce data to all ranks (vector form) | |
template<typename T > | |
void | broadcast (unsigned num, T *buffer, int root) const |
Public Attributes | |
WxMsgTypeMap_t | _msgTypeMap |
Protected Member Functions | |
WxMsgBase (int sendTag=0, int recvTag=0, WxMsgBase *parent=0) | |
Constructor. | |
template<typename T > | |
void | addMsg (WxMsgTmpl< T > *b) |
Add a new messager : the derived class should call this to setup WxMsgBase properly. | |
|
inlinevirtual |
Destructor.
|
inlineprotected |
Constructor.
This is protected so only children can make instances.
|
inlineprotected |
Add a new messager : the derived class should call this to setup WxMsgBase properly.
|
inline |
Reduce data to all ranks (vector form)
sendBuff | buffer to reduce |
op | operation to perform. |
|
inline |
Reduce data to all ranks.
num | Number of elements being reduced |
sendBuff | buffer to reduce |
recvBuff | buffer to recieve reduced data |
op | operation to perform. |
|
pure virtual |
Block till all processes hit this barrier.
Implemented in WxMpiMsg.
|
inline |
|
pure virtual |
Check status of recieve started by a startRecv.
If this call returns true then finishRecv can be called to immediately recieve the data.
ms | message status object returned by startRecv |
Implemented in WxMpiMsg.
|
pure virtual |
Split communicator into a child communicator.
ranks | list of processors in old communicator which are to be in the new communicator |
Implemented in WxMpiMsg.
|
pure virtual |
Finish the receive started by startRecv and return a pointer to the data recieved.
The calling function owns the pointer and is resposible for freeing it.
ms | message status object returned by startRecv |
Implemented in WxMpiMsg.
|
pure virtual |
Finish the send started by startSend.
ms | message status object returned by startSend |
Implemented in WxMpiMsg.
|
pure virtual |
|
inline |
Get parent communicating processor group.
|
pure virtual |
|
inline |
Receive a std::vector from another rank.
num | number of elements to receive |
array | array that is filled with received values |
tag | identifier for data transaction |
sendRank | rank that sent array |
|
inline |
Receive an array from another rank.
num | number of elements to receive |
array | array that is filled with received values |
tag | identifier for data transaction |
sendRank | rank that sent array |
|
inline |
Send a std::vector to another rank.
array | std::vector of data being sent |
recvRank | rank that will receive array |
tag | identifier for data transaction |
|
inline |
Send an array to another rank.
num | number of elements to send |
array | array of length 'num' of data being sent |
recvRank | rank that will receive array |
tag | identifier for data transaction |
|
pure virtual |
See MPI_Comm_split.
Implemented in WxMpiMsg.
|
inline |
Receive an array from another rank.
This is a non-blocking call.
This call uses the arr pointer for the recieved data
vec | vector of elements to receive |
sendRank | rank we want to receive from |
tag | identifier for data transaction |
|
inline |
Receive an array from another rank.
This is a non-blocking call.
This call uses the arr pointer for the recieved data
num | number of elements to receive |
arr | array to fill with received value |
sendRank | rank we want to receive from |
tag | identifier for data transaction |
|
inline |
Receive an array from another rank.
This is a non-blocking call.
This call allocates a dataspace within WxMsgStatus for the recieved data
num | number of elements to receive |
sendRank | rank we want to receive from |
tag | identifier for data transaction |
|
inline |
Send an vector to another rank.
This is a non-blocking call.
vec | vector to send |
recvRank | rank that will receive array |
tag | identifier for data transaction |
|
inline |
Send an array to another rank.
This is a non-blocking call.
num | number of elements to send |
arr | array that is filled with values to send |
recvRank | rank that sent array |
tag | identifier for data transaction |
WxMsgTypeMap_t WxMsgBase::_msgTypeMap |