WARPXM v1.10.0
Loading...
Searching...
No Matches
WxMpiMsgTmpl< T > Class Template Reference

#include <wxmpimsgtmpl.h>

Inheritance diagram for WxMpiMsgTmpl< T >:
WxMsgTmpl< T >

Public Member Functions

 WxMpiMsgTmpl (MPI_Comm comm)
 
void send (unsigned num, const T *arr, unsigned recvRank, int tag) const override
 Send an array to another rank.
 
void finishSend (WxMsgStatus ms) const override
 Finish the send started by startSend.
 
WxMsgStatus startSend (unsigned num, const T *arr, unsigned recvRank, int tag) const override
 Send an array to another rank.
 
void recv (unsigned num, std::vector< T > &array, unsigned sendRank, int tag) const override
 Receive an array from another rank.
 
void recv (unsigned num, T *array, unsigned sendRank, int tag) const override
 Receive an array from another rank.
 
WxMsgStatus startRecv (unsigned num, unsigned sendRank, int tag) const override
 Receive an array from another rank.
 
WxMsgStatus startRecv (unsigned num, T *arr, unsigned sendRank, int tag) const override
 Receive an array from another rank.
 
void allReduce (unsigned num, T *sendBuff, T *recvBuff, MPI_Op op) const override
 Reduce data to all ranks.
 
void broadcast (unsigned num, T *buffer, int root) const override
 
- Public Member Functions inherited from WxMsgTmpl< T >
virtual ~WxMsgTmpl ()
 Destructor.
 
virtual void send (unsigned num, const T *array, unsigned recvRank, int tag) const =0
 Send an array to another rank.
 
virtual void finishSend (WxMsgStatus ms) const =0
 Finish the send started by startSend.
 
virtual WxMsgStatus startSend (unsigned num, const T *arr, unsigned recvRank, int tag) const =0
 Send an array to another rank.
 
virtual void recv (unsigned num, std::vector< T > &array, unsigned sendRank, int tag) const =0
 Receive an array from another rank.
 
virtual void recv (unsigned num, T *array, unsigned sendRank, int tag) const =0
 Receive an array from another rank.
 
virtual WxMsgStatus startRecv (unsigned num, unsigned sendRank, int tag=-1) const =0
 Receive an array from another rank.
 
virtual WxMsgStatus startRecv (unsigned num, T *arr, unsigned sendRank, int tag=-1) const =0
 Receive an array from another rank.
 
virtual void allReduce (unsigned num, T *sendBuff, T *recvBuff, MPI_Op op) const =0
 Reduce data to all ranks.
 
virtual void broadcast (unsigned num, T *buffer, int root) const =0
 

Additional Inherited Members

- Protected Member Functions inherited from WxMsgTmpl< T >
 WxMsgTmpl ()
 Protected so only children can make instances.
 
void resizeArray (T *&array, unsigned &numElem, unsigned reqNumElem) const
 Resizes a array.
 
void resizeSendBuff (unsigned reqSize)
 Checks the buffer and resizes it if necessary.
 
void resizeRecvBuff (unsigned reqSize)
 Checks the buffer and resizes it if necessary.
 
- Protected Attributes inherited from WxMsgTmpl< T >
unsigned _sendSize
 
T * _sendBuff
 
unsigned _recvSize
 
T * _recvBuff
 

Constructor & Destructor Documentation

◆ WxMpiMsgTmpl()

template<typename T >
WxMpiMsgTmpl< T >::WxMpiMsgTmpl ( MPI_Comm  comm)
inline

Member Function Documentation

◆ allReduce()

template<typename T >
void WxMpiMsgTmpl< T >::allReduce ( unsigned  num,
T *  sendBuff,
T *  recvBuff,
MPI_Op  op 
) const
overridevirtual

Reduce data to all ranks.

Parameters
numNumber of elements being reduced
sendBuffbuffer to reduce
recvBuffbuffer to recieve reduced data
opoperation to perform.

Implements WxMsgTmpl< T >.

◆ broadcast()

template<typename T >
void WxMpiMsgTmpl< T >::broadcast ( unsigned  num,
T *  buffer,
int  root 
) const
overridevirtual

Implements WxMsgTmpl< T >.

◆ finishSend()

template<typename T >
void WxMpiMsgTmpl< T >::finishSend ( WxMsgStatus  ms) const
overridevirtual

Finish the send started by startSend.

Parameters
msmessage status object returned by startSend

Implements WxMsgTmpl< T >.

◆ recv() [1/2]

template<typename T >
void WxMpiMsgTmpl< T >::recv ( unsigned  num,
std::vector< T > &  array,
unsigned  sendRank,
int  tag 
) const
overridevirtual

Receive an array from another rank.

Parameters
numnumber of elements to reciev
arrayarray that is filled with received values
sendRankrank that sent array

Implements WxMsgTmpl< T >.

◆ recv() [2/2]

template<typename T >
void WxMpiMsgTmpl< T >::recv ( unsigned  num,
T *  array,
unsigned  sendRank,
int  tag 
) const
overridevirtual

Receive an array from another rank.

Parameters
numnumber of elements to receive
arrayarray that is filled with received values
sendRankrank that sent array

Implements WxMsgTmpl< T >.

◆ send()

template<typename T >
void WxMpiMsgTmpl< T >::send ( unsigned  num,
const T *  arr,
unsigned  recvRank,
int  tag 
) const
overridevirtual

Send an array to another rank.

@parem num number of elements to send

Parameters
arrarray of length 'num' of data being sent
recvRankrank that will receive array

Implements WxMsgTmpl< T >.

◆ startRecv() [1/2]

template<typename T >
WxMsgStatus WxMpiMsgTmpl< T >::startRecv ( unsigned  num,
T *  arr,
unsigned  sendRank,
int  tag 
) const
overridevirtual

Receive an array from another rank.

This is a non-blocking call.

Parameters
numnumber of elements to receive
arrarray to recieve data
sendRankrank that sent array
tagidentifier for data transaction
Returns
message status

Implements WxMsgTmpl< T >.

◆ startRecv() [2/2]

template<typename T >
WxMsgStatus WxMpiMsgTmpl< T >::startRecv ( unsigned  num,
unsigned  sendRank,
int  tag 
) const
overridevirtual

Receive an array from another rank.

This is a non-blocking call.

Parameters
numnumber of elements to receive
sendRankrank that sent array
tagidentifier for data transaction
Returns
message status

Implements WxMsgTmpl< T >.

◆ startSend()

template<typename T >
WxMsgStatus WxMpiMsgTmpl< T >::startSend ( unsigned  num,
const T *  arr,
unsigned  recvRank,
int  tag 
) const
overridevirtual

Send an array to another rank.

This is a non-blocking call.

Parameters
numnumber of elements to send
arrarray that is filled with values to send
recvRankrank that sent array
tagidentifier for data transaction
Returns
message status

Implements WxMsgTmpl< T >.


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