OPAL (Object Oriented Parallel Accelerator Library)  2021.1.99
OPAL
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
CommMPI Class Reference

#include <CommMPI.h>

Inheritance diagram for CommMPI:
Inheritance graph
[legend]
Collaboration diagram for CommMPI:
Collaboration graph
[legend]

Public Member Functions

 CommMPI (int &argc, char **&argv, int procs=(-1), bool mpiinit=true, MPI_Comm mpicomm=MPI_COMM_WORLD)
 
virtual ~CommMPI (void)
 
virtual const char * name () const
 
virtual void cleanupMessage (void *)
 
virtual bool raw_send (void *, int size, int node, int tag)
 
virtual MPI_Request raw_isend (void *, int size, int node, int tag)
 
virtual MPI_Request raw_ireceive (char *buf, int size, int node, int tag)
 
virtual int raw_receive (char *, int size, int &node, int &tag)
 
virtual int raw_probe_receive (char *&, int &node, int &tag)
 
- Public Member Functions inherited from Communicate
 Communicate (int argc=0, char **argv=NULL, int procs=(-1))
 
virtual ~Communicate (void)
 
int getNodes () const
 
int getContexts (const int n) const
 
int getProcesses (const int n, const int c) const
 
int myNode () const
 
int getError () const
 
int getReceived () const
 
bool send (Message *, int node, int tag, bool delmsg=true)
 
Messagereceive (int &node, int &tag)
 
Messagereceive_block (int &node, int &tag)
 
virtual int broadcast_all (Message *, int)
 
virtual int broadcast_others (Message *, int, bool delmsg=true)
 
void barrier (void)
 
- Public Member Functions inherited from TagMaker
 TagMaker (void)
 
virtual ~TagMaker (void)
 
int next_tag (int t, int s=1000)
 
int current_tag (int t, int s=1000)
 
int reset_tag (int t, int s=1000)
 

Protected Member Functions

virtual bool mysend (Message *, int node, int utag, int etag)
 
virtual Messagemyreceive (int &node, int &tag, int etag)
 
virtual void mybarrier (void)
 
virtual bool resend (void *buf, int size, int node, int etag)
 
- Protected Member Functions inherited from Communicate
bool add_msg (Message *, int, int)
 
Messagefind_msg (int &, int &)
 
int find_msg_length (Message &)
 
void fill_msg_buffer (void *, Message &, int, int, int)
 
Messageunpack_message (int &node, int &tag, void *pos)
 
void add_to_send_cache (void *pos, MsgNum_t mnum, int size, int node)
 
void request_retransmission (int node, MsgNum_t mnum)
 
void perform_resend (MsgNum_t mnum)
 
void unpack_retransmission_request (int nitems, void *pos)
 
void send_ok_message (int node, MsgNum_t mnum)
 
void clear_ok_messages (int nitems, void *pos)
 
void remove_single_ok_message (MsgNum_t mnum)
 
void process_resend_requests ()
 

Private Member Functions

void * pack_message (Message *msg, int tag, int &buffsize, int node)
 

Private Attributes

MPI_Comm communicator
 
bool weInitialized
 

Additional Inherited Members

- Public Types inherited from Communicate
enum  CommErrors { COMM_NOERROR , COMM_ERROR , COMM_NOSEND , COMM_NORECEIVE }
 
enum  CommTags { COMM_HOSTS_TAG = 32000 , COMM_DIE_TAG , COMM_SEND_TAG }
 
enum  CommCodes { COMM_ANY_NODE = (-1) , COMM_ANY_TAG = (-1) }
 
- Protected Types inherited from Communicate
typedef long MsgNum_t
 
typedef std::map< MsgNum_t, CommSendInfoSentCache_t
 
- Static Protected Member Functions inherited from Communicate
static void * makebuffer (int size)
 
static void freebuffer (void *buf)
 
static unsigned int wordround (int size)
 
static void addwordround (void *&pos, int size)
 
static void pack (void *packdata, void *&pos, int size)
 
static void unpack (void *&pos, void *packdata, int size)
 
- Protected Attributes inherited from Communicate
std::vector< MessageDatarecMsgList
 
int TotalNodes
 
int myHost
 
int ErrorStatus
 
std::vector< int > Contexts
 
std::vector< std::vector< int > > Processes
 
MsgNum_t nextMsgNum
 
SentCache_t sentMsgCache
 
std::vector< MsgNum_tresendList
 
std::vector< MsgNum_tsentOKList
 
std::vector< std::pair< int, MsgNum_t > > informOKList
 
std::vector< std::pair< int, MsgNum_t > > requestList
 

Detailed Description

Definition at line 28 of file CommMPI.h.

Constructor & Destructor Documentation

◆ CommMPI()

CommMPI::CommMPI ( int &  argc,
char **&  argv,
int  procs = (-1),
bool  mpiinit = true,
MPI_Comm  mpicomm = MPI_COMM_WORLD 
)

Definition at line 67 of file CommMPI.cpp.

References IpplInfo::abort(), communicator, ERRORMSG, INFOMSG, Communicate::myHost, Communicate::TotalNodes, and weInitialized.

Here is the call graph for this function:

◆ ~CommMPI()

CommMPI::~CommMPI ( void  )
virtual

Member Function Documentation

◆ cleanupMessage()

void CommMPI::cleanupMessage ( void *  d)
virtual

Reimplemented from Communicate.

Definition at line 544 of file CommMPI.cpp.

References Communicate::freebuffer().

Referenced by mysend().

Here is the call graph for this function:

◆ mybarrier()

void CommMPI::mybarrier ( void  )
protectedvirtual

Reimplemented from Communicate.

Definition at line 502 of file CommMPI.cpp.

References communicator.

◆ myreceive()

Message * CommMPI::myreceive ( int &  node,
int &  tag,
int  etag 
)
protectedvirtual

Reimplemented from Communicate.

Definition at line 413 of file CommMPI.cpp.

References communicator, endl(), ERRORMSG, MAX_MPI_ERRS, and Communicate::TotalNodes.

Referenced by ~CommMPI().

Here is the call graph for this function:

◆ mysend()

bool CommMPI::mysend ( Message msg,
int  node,
int  utag,
int  etag 
)
protectedvirtual

◆ name()

virtual const char* CommMPI::name ( ) const
inlinevirtual

Reimplemented from Communicate.

Definition at line 41 of file CommMPI.h.

◆ pack_message()

void * CommMPI::pack_message ( Message msg,
int  tag,
int &  buffsize,
int  node 
)
private

Definition at line 289 of file CommMPI.cpp.

References Communicate::find_msg_length(), Communicate::makebuffer(), and PACKSIZE.

Referenced by mysend().

Here is the call graph for this function:

◆ raw_ireceive()

MPI_Request CommMPI::raw_ireceive ( char *  buf,
int  size,
int  node,
int  tag 
)
virtual

Reimplemented from Communicate.

Definition at line 586 of file CommMPI.cpp.

References Communicate::COMM_ANY_NODE, Communicate::COMM_ANY_TAG, and communicator.

◆ raw_isend()

MPI_Request CommMPI::raw_isend ( void *  data,
int  size,
int  node,
int  tag 
)
virtual

Reimplemented from Communicate.

Definition at line 559 of file CommMPI.cpp.

References communicator, IpplMessageCounter::getInstance(), and IpplMessageCounter::registerMessage().

Here is the call graph for this function:

◆ raw_probe_receive()

int CommMPI::raw_probe_receive ( char *&  data,
int &  node,
int &  tag 
)
virtual

Reimplemented from Communicate.

Definition at line 599 of file CommMPI.cpp.

References Communicate::COMM_ANY_NODE, Communicate::COMM_ANY_TAG, and communicator.

◆ raw_receive()

int CommMPI::raw_receive ( char *  data,
int  size,
int &  node,
int &  tag 
)
virtual

Reimplemented from Communicate.

Definition at line 569 of file CommMPI.cpp.

References Communicate::COMM_ANY_NODE, Communicate::COMM_ANY_TAG, and communicator.

◆ raw_send()

bool CommMPI::raw_send ( void *  data,
int  size,
int  node,
int  tag 
)
virtual

Reimplemented from Communicate.

Definition at line 551 of file CommMPI.cpp.

References communicator, IpplMessageCounter::getInstance(), and IpplMessageCounter::registerMessage().

Here is the call graph for this function:

◆ resend()

bool CommMPI::resend ( void *  buf,
int  size,
int  node,
int  etag 
)
protectedvirtual

Reimplemented from Communicate.

Definition at line 511 of file CommMPI.cpp.

References communicator, IpplMessageCounter::getInstance(), Communicate::myNode(), PInsist, and IpplMessageCounter::registerMessage().

Here is the call graph for this function:

Member Data Documentation

◆ communicator

MPI_Comm CommMPI::communicator
private

◆ weInitialized

bool CommMPI::weInitialized
private

Definition at line 99 of file CommMPI.h.

Referenced by CommMPI(), and ~CommMPI().


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