OpenM++ runtime library (libopenm)
openm::IMsgExec Class Referenceabstract

public interface for message passing More...

Inheritance diagram for openm::IMsgExec:

Public Member Functions

virtual ~IMsgExec (void) noexcept=0
 cleanup message passing resources. More...
 
bool isRoot (void) const
 if root process then true (root process rank == 0)
 
virtual int worldSize (void) const =0
 return total number of processes in world communicator. More...
 
virtual int rank (void) const =0
 return current process rank. More...
 
virtual int groupRank (void) const =0
 return rank in modeling group. More...
 
virtual void setCleanExit (bool i_isClean=false)=0
 set clean exit flag for normal shutdown of message passing interface. More...
 
virtual void createGroups (int i_groupSize, int i_groupCount)=0
 create groups for parallel run of modeling task. More...
 
virtual void bcastValue (int i_groupOne, const type_info &i_type, void *io_value)=0
 broadcast value from root to all other processes. More...
 
void bcastInt (int i_groupOne, void *io_value)
 broadcast integer value from root to all other processes. More...
 
virtual void bcastSend (int i_groupOne, const type_info &i_type, size_t i_size, void *io_valueArr)=0
 send broadcast value array from root to all other processes. More...
 
virtual void bcastReceive (int i_groupOne, const type_info &i_type, size_t i_size, void *io_valueArr)=0
 receive broadcasted value array from root process. More...
 
virtual void bcastSendPacked (int i_groupOne, IRowBaseVec &io_rowVec, const IPackedAdapter &i_adapter)=0
 send broadcast vector of db rows from root to all other processes. More...
 
virtual void bcastReceivePacked (int i_groupOne, IRowBaseVec &io_rowVec, const IPackedAdapter &i_adapter)=0
 receive broadcasted vector of db rows from root. More...
 
virtual void startSend (int i_sendTo, MsgTag i_msgTag, const type_info &i_type, size_t i_size, void *i_valueArr)=0
 start non-blocking send of value array to i_sendTo process. More...
 
virtual void startSendPacked (int i_sendTo, const IRowBaseVec &i_rowVec, const IPackedAdapter &i_adapter)=0
 pack and start non-blocking send of vector of db rows to i_sendTo process. More...
 
virtual bool tryReceive (int i_recvFrom, MsgTag i_msgTag, const type_info &i_type, size_t i_size, void *io_valueArr) const =0
 try to non-blocking receive value array, return true if completed. More...
 
virtual bool tryReceive (int i_recvFrom, IRowBaseVec &io_resultRowVec, const IPackedAdapter &i_adapter) const =0
 try to non-blocking receive and unpack vector of db rows, return true if completed. More...
 
virtual void waitSendAll (void)=0
 wait for non-blocking send to be completed
 

Static Public Member Functions

static IMsgExeccreate (int argc, char **argv, IFinalState *i_final)
 create new message passing interface. More...
 

Static Public Attributes

static const int rootRank = 0
 root process rank, always zero
 

Detailed Description

public interface for message passing

Constructor & Destructor Documentation

◆ ~IMsgExec()

IMsgExec::~IMsgExec ( void  )
pure virtualnoexcept

cleanup message passing resources.

Member Function Documentation

◆ bcastInt()

void openm::IMsgExec::bcastInt ( int  i_groupOne,
void *  io_value 
)
inline

broadcast integer value from root to all other processes.

Parameters
[in]i_groupOneif zero then worldwide else one-based group number
[in,out]io_valueinteger value to send or output value to receive

◆ bcastReceive()

virtual void openm::IMsgExec::bcastReceive ( int  i_groupOne,
const type_info &  i_type,
size_t  i_size,
void *  io_valueArr 
)
pure virtual

receive broadcasted value array from root process.

Parameters
[in]i_groupOneif zero then worldwide else one-based group number
[in]i_typevalue type
[in]i_sizesize of array
[in,out]io_valueArrvalue array to send or output buffer to receive

Implemented in openm::MsgEmptyExec, and openm::MpiExec.

◆ bcastReceivePacked()

virtual void openm::IMsgExec::bcastReceivePacked ( int  i_groupOne,
IRowBaseVec io_rowVec,
const IPackedAdapter i_adapter 
)
pure virtual

receive broadcasted vector of db rows from root.

Parameters
[in]i_groupOneif zero then worldwide else one-based group number
[in,out]io_rowVecvector of db rows to send or vector to push back received db rows
[in]i_adapteradapter to pack and unpack db rows

Implemented in openm::MsgEmptyExec, and openm::MpiExec.

◆ bcastSend()

virtual void openm::IMsgExec::bcastSend ( int  i_groupOne,
const type_info &  i_type,
size_t  i_size,
void *  io_valueArr 
)
pure virtual

send broadcast value array from root to all other processes.

Parameters
[in]i_groupOneif zero then worldwide else one-based group number
[in]i_typevalue type
[in]i_sizesize of array
[in,out]io_valueArrvalue array to send or output buffer to receive

Implemented in openm::MsgEmptyExec, and openm::MpiExec.

◆ bcastSendPacked()

virtual void openm::IMsgExec::bcastSendPacked ( int  i_groupOne,
IRowBaseVec io_rowVec,
const IPackedAdapter i_adapter 
)
pure virtual

send broadcast vector of db rows from root to all other processes.

Parameters
[in]i_groupOneif zero then worldwide else one-based group number
[in,out]io_rowVecvector of db rows to send or vector to push back received db rows
[in]i_adapteradapter to pack and unpack db rows

Implemented in openm::MsgEmptyExec, and openm::MpiExec.

◆ bcastValue()

virtual void openm::IMsgExec::bcastValue ( int  i_groupOne,
const type_info &  i_type,
void *  io_value 
)
pure virtual

broadcast value from root to all other processes.

Parameters
[in]i_groupOneif zero then worldwide else one-based group number
[in]i_typevalue type
[in,out]io_valuevalue to send or output value to receive

Implemented in openm::MsgEmptyExec, and openm::MpiExec.

◆ create()

IMsgExec * IMsgExec::create ( int  argc,
char **  argv,
IFinalState i_final 
)
static

create new message passing interface.

Parameters
[in]argcmain argc to pass to MPI_Init
[in]argvmain argv to pass to MPI_Init
[in]IFinalStatefinal model run state interface

◆ createGroups()

virtual void openm::IMsgExec::createGroups ( int  i_groupSize,
int  i_groupCount 
)
pure virtual

create groups for parallel run of modeling task.

Parameters
[in]i_groupSizenumber of processes in each group
[in]i_groupCountnumber of groups

Implemented in openm::MsgEmptyExec, and openm::MpiExec.

◆ groupRank()

virtual int openm::IMsgExec::groupRank ( void  ) const
pure virtual

return rank in modeling group.

Implemented in openm::MsgEmptyExec, and openm::MpiExec.

◆ rank()

virtual int openm::IMsgExec::rank ( void  ) const
pure virtual

return current process rank.

Implemented in openm::MsgEmptyExec, and openm::MpiExec.

◆ setCleanExit()

virtual void openm::IMsgExec::setCleanExit ( bool  i_isClean = false)
pure virtual

set clean exit flag for normal shutdown of message passing interface.

Implemented in openm::MsgEmptyExec, and openm::MpiExec.

◆ startSend()

virtual void openm::IMsgExec::startSend ( int  i_sendTo,
MsgTag  i_msgTag,
const type_info &  i_type,
size_t  i_size,
void *  i_valueArr 
)
pure virtual

start non-blocking send of value array to i_sendTo process.

Parameters
[in]i_sendToreceiver proccess rank
[in]i_msgTagtag to identify message content (parameter or output data)
[in]i_typevalue type
[in]i_sizesize of array
[in]i_valueArrvalue array to send

Implemented in openm::MsgEmptyExec, and openm::MpiExec.

◆ startSendPacked()

virtual void openm::IMsgExec::startSendPacked ( int  i_sendTo,
const IRowBaseVec i_rowVec,
const IPackedAdapter i_adapter 
)
pure virtual

pack and start non-blocking send of vector of db rows to i_sendTo process.

Parameters
[in]i_sendToreceiver proccess rank
[in]i_rowVecvector of db rows to send
[in]i_adapteradapter to pack db rows

Implemented in openm::MsgEmptyExec, and openm::MpiExec.

◆ tryReceive() [1/2]

virtual bool openm::IMsgExec::tryReceive ( int  i_recvFrom,
MsgTag  i_msgTag,
const type_info &  i_type,
size_t  i_size,
void *  io_valueArr 
) const
pure virtual

try to non-blocking receive value array, return true if completed.

Parameters
[in]i_recvFromsender proccess rank
[in]i_msgTagtag to identify message content (parameter or output data)
[in]i_typevalue type
[in]i_sizesize of array
[in,out]io_valueArrallocated buffer to recieve value array

Implemented in openm::MsgEmptyExec, and openm::MpiExec.

◆ tryReceive() [2/2]

virtual bool openm::IMsgExec::tryReceive ( int  i_recvFrom,
IRowBaseVec io_resultRowVec,
const IPackedAdapter i_adapter 
) const
pure virtual

try to non-blocking receive and unpack vector of db rows, return true if completed.

Parameters
[in]i_recvFromsender proccess rank
[in,out]io_resultRowVecvector to push back received db rows
[in]i_adapteradapter to unpack db rows

Implemented in openm::MsgEmptyExec, and openm::MpiExec.

◆ worldSize()

virtual int openm::IMsgExec::worldSize ( void  ) const
pure virtual

return total number of processes in world communicator.

Implemented in openm::MsgEmptyExec, and openm::MpiExec.


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