Communicate Class Reference

#include <Communicate.h>

Inheritance diagram for Communicate:

Inheritance graph
[legend]
Collaboration diagram for Communicate:

Collaboration graph
[legend]
List of all members.

Public Types

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) }

Public Member Functions

 Communicate (int argc=0, char **argv=NULL, int procs=(-1))
virtual ~Communicate (void)
virtual const char * name () const
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)
virtual void cleanupMessage (void *)

Protected Types

typedef long MsgNum_t
typedef map< MsgNum_t, CommSendInfoSentCache_t

Protected Member Functions

bool add_msg (Message *, int, int)
Messagefind_msg (int &, int &)
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)
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 ()

Static Protected Member Functions

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

vector< MessageDatarecMsgList
int TotalNodes
int myHost
int ErrorStatus
vector< int > Contexts
vector< vector< int > > Processes
MsgNum_t nextMsgNum
SentCache_t sentMsgCache
vector< MsgNum_tresendList
vector< MsgNum_tsentOKList
vector< pair< int, MsgNum_t > > informOKList
vector< pair< int, MsgNum_t > > requestList

Classes

struct  MessageData

Detailed Description

Definition at line 107 of file Communicate.h.


Member Typedef Documentation

typedef long Communicate::MsgNum_t [protected]
 

Definition at line 218 of file Communicate.h.

typedef map<MsgNum_t, CommSendInfo> Communicate::SentCache_t [protected]
 

Definition at line 224 of file Communicate.h.


Member Enumeration Documentation

enum Communicate::CommCodes
 

Enumerator:
COMM_ANY_NODE 
COMM_ANY_TAG 

Definition at line 120 of file Communicate.h.

enum Communicate::CommErrors
 

Enumerator:
COMM_NOERROR 
COMM_ERROR 
COMM_NOSEND 
COMM_NORECEIVE 

Definition at line 112 of file Communicate.h.

enum Communicate::CommTags
 

Enumerator:
COMM_HOSTS_TAG 
COMM_DIE_TAG 
COMM_SEND_TAG 

Definition at line 115 of file Communicate.h.


Constructor & Destructor Documentation

Communicate::Communicate int  argc = 0,
char **  argv = NULL,
int  procs = (-1)
 

Definition at line 72 of file Communicate.cpp.

References COMM_NOERROR, Contexts, ErrorStatus, myHost, Processes, TAU_MESSAGE, TAU_PROFILE, and TotalNodes.

Communicate::~Communicate void   )  [virtual]
 

Definition at line 89 of file Communicate.cpp.

References sentMsgCache, TAU_MESSAGE, and TAU_PROFILE.


Member Function Documentation

bool Communicate::add_msg Message ,
int  ,
int 
[protected]
 

Definition at line 102 of file Communicate.cpp.

References recMsgList, TAU_MESSAGE, and TAU_PROFILE.

Referenced by CommSHMEMPI::mysend(), CommMPI::mysend(), receive(), receive_block(), and send().

void Communicate::add_to_send_cache void *  pos,
MsgNum_t  mnum,
int  size,
int  node
[protected]
 

Definition at line 669 of file Communicate.cpp.

References endl(), ERRORMSG, sentMsgCache, TAU_MESSAGE, and TAU_PROFILE.

Here is the call graph for this function:

static void Communicate::addwordround void *&  pos,
int  size
[inline, static, protected]
 

Definition at line 308 of file Communicate.h.

References wordround().

Referenced by clear_ok_messages(), pack(), unpack(), unpack_message(), and unpack_retransmission_request().

Here is the call graph for this function:

void Communicate::barrier void   ) 
 

Definition at line 436 of file Communicate.cpp.

References mybarrier(), TAU_MESSAGE, and TAU_PROFILE.

Referenced by pap(), and FieldBlock< T, Dim, Mesh, Centering >::write().

Here is the call graph for this function:

int Communicate::broadcast_all Message ,
int 
[virtual]
 

Definition at line 381 of file Communicate.cpp.

References COMM_SEND_TAG, getNodes(), myNode(), mysend(), TAU_MESSAGE, and TAU_PROFILE.

Here is the call graph for this function:

int Communicate::broadcast_others Message ,
int  ,
bool  delmsg = true
[virtual]
 

Definition at line 410 of file Communicate.cpp.

References COMM_SEND_TAG, getNodes(), myNode(), mysend(), TAU_MESSAGE, and TAU_PROFILE.

Referenced by IpplInfo::abortAllNodes(), PawsDataConnect::barrier(), IpplInfo::exitAllNodes(), pap(), spap(), ParticleSpatialLayout< T, Dim, Mesh >::update(), and ParticleInteractLayout< T, Dim, Mesh >::update().

Here is the call graph for this function:

void Communicate::cleanupMessage void *   )  [virtual]
 

Reimplemented in CommACLMPL, CommMPI, CommPM, and CommSHMEMPI.

Definition at line 448 of file Communicate.cpp.

Referenced by Message::~Message().

void Communicate::clear_ok_messages int  nitems,
void *  pos
[protected]
 

Definition at line 783 of file Communicate.cpp.

References addwordround(), endl(), INFORM_ALL_NODES, PInsist, and sentOKList.

Referenced by unpack_message().

Here is the call graph for this function:

void Communicate::fill_msg_buffer void *  ,
Message ,
int  ,
int  ,
int 
[protected]
 

Definition at line 482 of file Communicate.cpp.

References Message::item(), myNode(), nextMsgNum, pack(), Message::size(), TAU_MESSAGE, TAU_PROFILE, and IpplInfo::useChecksums().

Referenced by CommPM::mysend().

Here is the call graph for this function:

Message * Communicate::find_msg int &  ,
int & 
[protected]
 

Definition at line 118 of file Communicate.cpp.

References COMM_ANY_NODE, COMM_ANY_TAG, recMsgList, TAU_MESSAGE, and TAU_PROFILE.

Referenced by receive(), and receive_block().

int Communicate::find_msg_length Message  )  [protected]
 

Definition at line 453 of file Communicate.cpp.

References Message::item(), Message::size(), TAU_MESSAGE, TAU_PROFILE, IpplInfo::useChecksums(), and wordround().

Referenced by CommPM::mysend().

Here is the call graph for this function:

static void Communicate::freebuffer void *  buf  )  [inline, static, protected]
 

Definition at line 290 of file Communicate.h.

Referenced by CommSHMEMPI::cleanupMessage(), CommPM::cleanupMessage(), CommMPI::cleanupMessage(), CommSHMEMPI::mysend(), and CommMPI::mysend().

int Communicate::getContexts const int  n  )  const [inline]
 

Definition at line 135 of file Communicate.h.

References Contexts.

Referenced by IpplInfo::getContexts().

int Communicate::getError  )  const [inline]
 

Definition at line 138 of file Communicate.h.

References ErrorStatus.

int Communicate::getNodes  )  const [inline]
 

Definition at line 134 of file Communicate.h.

References TotalNodes.

Referenced by broadcast_all(), broadcast_others(), CalcBinaryRepartition(), operator<<(), scatter(), send(), and VnodeMultiRepartition().

int Communicate::getProcesses const int  n,
const int  c
const [inline]
 

Definition at line 136 of file Communicate.h.

References Processes.

Referenced by IpplInfo::getProcesses().

int Communicate::getReceived  )  const [inline]
 

Definition at line 139 of file Communicate.h.

References recMsgList.

Referenced by operator<<().

static void* Communicate::makebuffer int  size  )  [inline, static, protected]
 

Definition at line 289 of file Communicate.h.

Referenced by CommACLMPL::CommACLMPL(), CommSHMEMPI::myreceive(), CommPM::myreceive(), CommMPI::myreceive(), CommSHMEMPI::mysend(), and CommMPI::mysend().

void Communicate::mybarrier void   )  [protected, virtual]
 

Reimplemented in CommACLMPL, CommMPI, CommPM, CommPVM, and CommSHMEMPI.

Definition at line 170 of file Communicate.cpp.

References TAU_MESSAGE, and TAU_PROFILE.

Referenced by barrier().

int Communicate::myNode  )  const [inline]
 

Definition at line 137 of file Communicate.h.

References myHost.

Referenced by broadcast_all(), broadcast_others(), CalcBinaryRepartition(), FieldLayout< Dim >::FieldLayout(), fill_msg_buffer(), operator<<(), perform_resend(), receive(), receive_block(), reduce_masked(), CommMPI::resend(), CommACLMPL::resend(), and send().

Message * Communicate::myreceive int &  node,
int &  tag,
int  etag
[protected, virtual]
 

Reimplemented in CommACLMPL, CommMPI, CommPM, CommPVM, and CommSHMEMPI.

Definition at line 158 of file Communicate.cpp.

References TAU_MESSAGE, and TAU_PROFILE.

Referenced by receive(), and receive_block().

bool Communicate::mysend Message ,
int  node,
int  utag,
int  etag
[protected, virtual]
 

Reimplemented in CommACLMPL, CommMPI, CommPM, CommPVM, and CommSHMEMPI.

Definition at line 146 of file Communicate.cpp.

References TAU_MESSAGE, and TAU_PROFILE.

Referenced by broadcast_all(), broadcast_others(), and send().

virtual const char* Communicate::name  )  const [inline, virtual]
 

Reimplemented in CommACLMPL, CommMPI, CommPM, CommPVM, and CommSHMEMPI.

Definition at line 131 of file Communicate.h.

Referenced by operator<<().

static void Communicate::pack void *  packdata,
void *&  pos,
int  size
[inline, static, protected]
 

Definition at line 313 of file Communicate.h.

References addwordround().

Referenced by CommACLMPL::CommACLMPL(), and fill_msg_buffer().

Here is the call graph for this function:

void Communicate::perform_resend MsgNum_t  mnum  )  [protected]
 

Definition at line 746 of file Communicate.cpp.

References COMM_SEND_TAG, endl(), ERRORMSG, myNode(), PInsist, resend(), and sentMsgCache.

Here is the call graph for this function:

void Communicate::process_resend_requests  )  [protected]
 

Definition at line 843 of file Communicate.cpp.

References endl(), INFORM_ALL_NODES, resendList, and sentOKList.

Referenced by receive(), and receive_block().

Here is the call graph for this function:

Message * Communicate::receive int &  node,
int &  tag
 

Definition at line 252 of file Communicate.cpp.

References add_msg(), COMM_ANY_NODE, COMM_ANY_TAG, COMM_NOERROR, COMM_NORECEIVE, COMM_SEND_TAG, ErrorStatus, find_msg(), myNode(), myreceive(), process_resend_requests(), TAU_MESSAGE, and TAU_PROFILE.

Referenced by PawsDataConnect::barrier().

Here is the call graph for this function:

Message * Communicate::receive_block int &  node,
int &  tag
 

Definition at line 305 of file Communicate.cpp.

References add_msg(), COMM_ANY_NODE, COMM_ANY_TAG, COMM_NOERROR, COMM_NORECEIVE, COMM_SEND_TAG, ErrorStatus, find_msg(), myNode(), myreceive(), PInsist, process_resend_requests(), IpplInfo::retransmit(), TAU_MESSAGE, TAU_PROFILE, TAU_PROFILE_START, TAU_PROFILE_STOP, TAU_PROFILE_TIMER, and TAU_TYPE_STRING.

Referenced by IndexedReceive(), pap(), ParticleBase< PLayout >::resetID(), ParticleUniformLayout< T, Dim >::update(), ParticleSpatialLayout< T, Dim, Mesh >::update(), ParticleInteractLayout< T, Dim, Mesh >::update(), and DiscParticle::write().

Here is the call graph for this function:

void Communicate::remove_single_ok_message MsgNum_t  mnum  )  [protected]
 

Definition at line 820 of file Communicate.cpp.

References endl(), ERRORMSG, INFORM_ALL_NODES, and sentMsgCache.

Here is the call graph for this function:

void Communicate::request_retransmission int  node,
MsgNum_t  mnum
[protected]
 

Definition at line 702 of file Communicate.cpp.

References endl(), INFORM_ALL_NODES, IPPL_RETRANSMIT_TAG, Message::put(), and send().

Here is the call graph for this function:

bool Communicate::resend void *  buf,
int  size,
int  node,
int  etag
[protected, virtual]
 

Reimplemented in CommACLMPL, and CommMPI.

Definition at line 182 of file Communicate.cpp.

References TAU_MESSAGE, and TAU_PROFILE.

Referenced by perform_resend().

bool Communicate::send Message ,
int  node,
int  tag,
bool  delmsg = true
 

Definition at line 195 of file Communicate.cpp.

References add_msg(), COMM_ERROR, COMM_NOERROR, COMM_NOSEND, COMM_SEND_TAG, endl(), ERRORMSG, ErrorStatus, getNodes(), myNode(), mysend(), TAU_MESSAGE, and TAU_PROFILE.

Referenced by PawsDataConnect::barrier(), FieldDataSource< T, Dim, M, C >::gather_data(), pap(), FieldBlock< T, Dim, Mesh, Centering >::read(), reduce_masked(), request_retransmission(), send_ok_message(), ParticleUniformLayout< T, Dim >::update(), ParticleSpatialLayout< T, Dim, Mesh >::update(), ParticleInteractLayout< T, Dim, Mesh >::update(), ACLVISParticleBaseDataSource< PLayout >::update(), FieldBlock< T, Dim, Mesh, Centering >::write(), and BareField< T, Dim >::write().

Here is the call graph for this function:

void Communicate::send_ok_message int  node,
MsgNum_t  mnum
[protected]
 

Definition at line 767 of file Communicate.cpp.

References endl(), INFORM_ALL_NODES, IPPL_MSG_OK_TAG, Message::put(), and send().

Here is the call graph for this function:

static void Communicate::unpack void *&  pos,
void *  packdata,
int  size
[inline, static, protected]
 

Definition at line 319 of file Communicate.h.

References addwordround().

Referenced by CommACLMPL::CommACLMPL().

Here is the call graph for this function:

Message * Communicate::unpack_message int &  node,
int &  tag,
void *  pos
[protected]
 

Definition at line 550 of file Communicate.cpp.

References ADDIPPLSTAT, addwordround(), clear_ok_messages(), crc(), endl(), ERRORMSG, informOKList, IPPL_ABORT_TAG, IPPL_EXIT_TAG, IPPL_MSG_OK_TAG, IPPL_RETRANSMIT_TAG, IpplInfo::myNode(), PInsist, Message::putmsg(), requestList, IpplInfo::retransmit(), Message::setCopy(), Message::setDelete(), TAU_MESSAGE, TAU_PROFILE, unpack_retransmission_request(), and IpplInfo::useChecksums().

Referenced by CommSHMEMPI::myreceive(), CommPM::myreceive(), CommMPI::myreceive(), CommACLMPL::myreceive(), CommSHMEMPI::mysend(), and CommMPI::mysend().

Here is the call graph for this function:

void Communicate::unpack_retransmission_request int  nitems,
void *  pos
[protected]
 

Definition at line 720 of file Communicate.cpp.

References addwordround(), endl(), INFORM_ALL_NODES, PInsist, and resendList.

Referenced by unpack_message().

Here is the call graph for this function:

static unsigned int Communicate::wordround int  size  )  [inline, static, protected]
 

Definition at line 300 of file Communicate.h.

Referenced by addwordround(), CommACLMPL::CommACLMPL(), and find_msg_length().


Member Data Documentation

vector<int> Communicate::Contexts [protected]
 

Definition at line 213 of file Communicate.h.

Referenced by Communicate(), and getContexts().

int Communicate::ErrorStatus [protected]
 

Definition at line 212 of file Communicate.h.

Referenced by Communicate(), getError(), receive(), receive_block(), and send().

vector<pair<int,MsgNum_t> > Communicate::informOKList [protected]
 

Definition at line 234 of file Communicate.h.

Referenced by unpack_message().

int Communicate::myHost [protected]
 

Definition at line 211 of file Communicate.h.

Referenced by CommACLMPL::CommACLMPL(), CommMPI::CommMPI(), CommPM::CommPM(), CommPVM::CommPVM(), CommSHMEMPI::CommSHMEMPI(), Communicate(), myNode(), and CommPM::mysend().

MsgNum_t Communicate::nextMsgNum [protected]
 

Definition at line 219 of file Communicate.h.

Referenced by fill_msg_buffer().

vector< vector<int> > Communicate::Processes [protected]
 

Definition at line 214 of file Communicate.h.

Referenced by Communicate(), and getProcesses().

vector<MessageData> Communicate::recMsgList [protected]
 

Definition at line 207 of file Communicate.h.

Referenced by add_msg(), find_msg(), and getReceived().

vector<pair<int,MsgNum_t> > Communicate::requestList [protected]
 

Definition at line 237 of file Communicate.h.

Referenced by unpack_message().

vector<MsgNum_t> Communicate::resendList [protected]
 

Definition at line 228 of file Communicate.h.

Referenced by process_resend_requests(), and unpack_retransmission_request().

SentCache_t Communicate::sentMsgCache [protected]
 

Definition at line 225 of file Communicate.h.

Referenced by add_to_send_cache(), perform_resend(), remove_single_ok_message(), and ~Communicate().

vector<MsgNum_t> Communicate::sentOKList [protected]
 

Definition at line 231 of file Communicate.h.

Referenced by clear_ok_messages(), and process_resend_requests().

int Communicate::TotalNodes [protected]
 

Definition at line 210 of file Communicate.h.

Referenced by CommACLMPL::CommACLMPL(), CommMPI::CommMPI(), CommPM::CommPM(), CommPVM::CommPVM(), CommSHMEMPI::CommSHMEMPI(), Communicate(), getNodes(), CommSHMEMPI::myreceive(), CommMPI::myreceive(), CommACLMPL::myreceive(), CommACLMPL::~CommACLMPL(), CommMPI::~CommMPI(), CommPM::~CommPM(), CommPVM::~CommPVM(), and CommSHMEMPI::~CommSHMEMPI().


The documentation for this class was generated from the following files:
Generated on Mon Jan 16 14:35:43 2006 for IPPL by  doxygen 1.4.6