OPAL (Object Oriented Parallel Accelerator Library)
2021.1.99
OPAL
|
#include <Communicate.h>
Classes | |
struct | MessageData |
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) |
Message * | receive (int &node, int &tag) |
Message * | receive_block (int &node, int &tag) |
virtual bool | raw_send (void *, int, int, int) |
virtual MPI_Request | raw_isend (void *, int, int, int) |
virtual int | raw_receive (char *, int, int &, int &) |
virtual MPI_Request | raw_ireceive (char *, int, int, int) |
virtual int | raw_probe_receive (char *&, int &, int &) |
virtual int | broadcast_all (Message *, int) |
virtual int | broadcast_others (Message *, int, bool delmsg=true) |
void | barrier (void) |
virtual void | cleanupMessage (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 Types | |
typedef long | MsgNum_t |
typedef std::map< MsgNum_t, CommSendInfo > | SentCache_t |
Protected Member Functions | |
bool | add_msg (Message *, int, int) |
Message * | find_msg (int &, int &) |
virtual bool | mysend (Message *, int node, int utag, int etag) |
virtual Message * | myreceive (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) |
Message * | unpack_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 | |
std::vector< MessageData > | recMsgList |
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_t > | resendList |
std::vector< MsgNum_t > | sentOKList |
std::vector< std::pair< int, MsgNum_t > > | informOKList |
std::vector< std::pair< int, MsgNum_t > > | requestList |
Definition at line 112 of file Communicate.h.
|
protected |
Definition at line 269 of file Communicate.h.
|
protected |
Definition at line 275 of file Communicate.h.
Enumerator | |
---|---|
COMM_ANY_NODE | |
COMM_ANY_TAG |
Definition at line 125 of file Communicate.h.
Enumerator | |
---|---|
COMM_NOERROR | |
COMM_ERROR | |
COMM_NOSEND | |
COMM_NORECEIVE |
Definition at line 117 of file Communicate.h.
Enumerator | |
---|---|
COMM_HOSTS_TAG | |
COMM_DIE_TAG | |
COMM_SEND_TAG |
Definition at line 120 of file Communicate.h.
Communicate::Communicate | ( | int | argc = 0 , |
char ** | argv = NULL , |
||
int | procs = (-1) |
||
) |
Definition at line 69 of file Communicate.cpp.
References COMM_NOERROR, Contexts, ErrorStatus, myHost, Processes, and TotalNodes.
|
virtual |
Definition at line 84 of file Communicate.cpp.
References sentMsgCache.
|
protected |
Definition at line 97 of file Communicate.cpp.
References recMsgList.
Referenced by broadcast_all(), CommMPI::mysend(), receive(), receive_block(), and send().
|
protected |
Definition at line 688 of file Communicate.cpp.
References endl(), ERRORMSG, sentMsgCache, and value_type().
Referenced by fill_msg_buffer().
|
inlinestaticprotected |
Definition at line 358 of file Communicate.h.
References wordround().
Referenced by clear_ok_messages(), pack(), unpack(), unpack_message(), and unpack_retransmission_request().
void Communicate::barrier | ( | void | ) |
Definition at line 439 of file Communicate.cpp.
References mybarrier().
Referenced by AmrYtWriter::AmrYtWriter(), ParallelCyclotronTracker::bunchMode_m(), H5PartWrapper::close(), MGPoissonSolver::computePotential(), H5PartWrapper::copyFile(), ParallelTTracker::doBinaryRepartition(), ParallelCyclotronTracker::finalizeTracking_m(), Monitor::initialise(), MultiBunchHandler::injectBunch(), main(), ParallelCyclotronTracker::MtsTracker(), ParticleSpatialLayout< T, Dim, Mesh, CachingPolicy >::new_swap_particles(), pap(), DiscField< Dim >::read(), ParallelCyclotronTracker::repartition(), run_opal(), LossDataSink::save(), ParallelCyclotronTracker::singleParticleDump(), spap(), BoxParticleCachingPolicy< T, Dim, Mesh >::updateGhostParticles(), DiscField< Dim >::write(), DiscParticle::write(), AmrYtWriter::writeBunch(), AmrYtWriter::writeFields(), Distribution::writeOutFileEmission(), and LossDataSink::~LossDataSink().
|
virtual |
Definition at line 384 of file Communicate.cpp.
References add_msg(), COMM_SEND_TAG, getNodes(), myNode(), and mysend().
Referenced by BcastCuts(), and H5PartWrapper::sendFailureMessage().
|
virtual |
Definition at line 413 of file Communicate.cpp.
References COMM_SEND_TAG, getNodes(), myNode(), and mysend().
Referenced by FieldLayout< Dim >::FieldLayout(), BareField< T, Dim >::getsingle(), BareField< T, Dim >::getsingle_bc(), pap(), DiscConfig::parse_config(), FieldLayout< Dim >::read(), ParticleSpatialLayout< T, Dim, Mesh, CachingPolicy >::rebuild_layout(), reduce(), reduce_masked(), spap(), ParticleCashedLayout< T, Dim, Mesh >::update(), and ParticleInteractLayout< T, Dim, Mesh >::update().
|
virtual |
Reimplemented in CommMPI.
Definition at line 451 of file Communicate.cpp.
|
protected |
Definition at line 801 of file Communicate.cpp.
References addwordround(), endl(), INFORM_ALL_NODES, PInsist, and sentOKList.
Referenced by unpack_message().
|
protected |
Definition at line 483 of file Communicate.cpp.
References add_to_send_cache(), ADDIPPLSTAT, crc(), Message::MsgItem::data(), IPPL_MSG_OK_TAG, IPPL_RETRANSMIT_TAG, Message::item(), myNode(), nextMsgNum, Message::MsgItem::numBytes(), Message::MsgItem::numElems(), pack(), IpplInfo::retransmit(), Message::size(), and IpplInfo::useChecksums().
|
protected |
Definition at line 110 of file Communicate.cpp.
References COMM_ANY_NODE, COMM_ANY_TAG, and recMsgList.
Referenced by receive(), and receive_block().
|
protected |
Definition at line 456 of file Communicate.cpp.
References Message::item(), Message::MsgItem::numBytes(), Message::size(), IpplInfo::useChecksums(), and wordround().
Referenced by CommMPI::pack_message().
|
inlinestaticprotected |
Definition at line 343 of file Communicate.h.
Referenced by CommMPI::cleanupMessage(), and CommMPI::mysend().
|
inline |
Definition at line 147 of file Communicate.h.
References Contexts, and Hypervolume::n.
|
inline |
Definition at line 159 of file Communicate.h.
References ErrorStatus.
|
inline |
Definition at line 143 of file Communicate.h.
References TotalNodes.
Referenced by broadcast_all(), broadcast_others(), CalcBinaryRepartition(), reduce(), reduce_masked(), scatter(), send(), and IpplParticleBase< PLayout >::setup().
|
inline |
Definition at line 151 of file Communicate.h.
References Physics::c, Hypervolume::n, and Processes.
|
inline |
Definition at line 163 of file Communicate.h.
References recMsgList.
|
inlinestaticprotected |
Definition at line 339 of file Communicate.h.
Referenced by CommMPI::mysend(), and CommMPI::pack_message().
|
protectedvirtual |
|
inline |
Definition at line 155 of file Communicate.h.
References myHost.
Referenced by broadcast_all(), broadcast_others(), CalcBinaryRepartition(), FieldLayout< Dim >::FieldLayout(), fill_msg_buffer(), perform_resend(), receive(), receive_block(), reduce(), reduce_masked(), CommMPI::resend(), scatter(), send(), IpplParticleBase< PLayout >::setup(), and CommMPI::~CommMPI().
|
protectedvirtual |
Reimplemented in CommMPI.
Definition at line 148 of file Communicate.cpp.
Referenced by receive(), and receive_block().
|
protectedvirtual |
Reimplemented in CommMPI.
Definition at line 138 of file Communicate.cpp.
Referenced by broadcast_all(), broadcast_others(), and send().
|
inlinevirtual |
|
inlinestaticprotected |
Definition at line 364 of file Communicate.h.
References addwordround().
Referenced by fill_msg_buffer().
|
protected |
Definition at line 764 of file Communicate.cpp.
References COMM_SEND_TAG, endl(), ERRORMSG, myNode(), PInsist, resend(), and sentMsgCache.
Referenced by process_resend_requests().
|
protected |
Definition at line 865 of file Communicate.cpp.
References endl(), INFORM_ALL_NODES, informOKList, perform_resend(), remove_single_ok_message(), request_retransmission(), requestList, resendList, send_ok_message(), and sentOKList.
Referenced by receive(), and receive_block().
|
inlinevirtual |
Reimplemented in CommMPI.
Definition at line 204 of file Communicate.h.
|
inlinevirtual |
Reimplemented in CommMPI.
Definition at line 196 of file Communicate.h.
Referenced by ParallelTTracker::evenlyDistributeParticles(), ParticleSpatialLayout< T, Dim, Mesh, CachingPolicy >::new_swap_particles(), BoxLibLayout< T, Dim >::update(), and BoxParticleCachingPolicy< T, Dim, Mesh >::updateGhostParticles().
|
inlinevirtual |
Reimplemented in CommMPI.
Definition at line 208 of file Communicate.h.
Referenced by ParallelTTracker::evenlyDistributeParticles(), ParticleSpatialLayout< T, Dim, Mesh, CachingPolicy >::new_swap_particles(), BoxLibLayout< T, Dim >::update(), BoxParticleCachingPolicy< T, Dim, Mesh >::updateGhostParticles(), and Distribution::writeOutFileEmission().
|
inlinevirtual |
Reimplemented in CommMPI.
Definition at line 200 of file Communicate.h.
Referenced by Distribution::writeOutFileEmission().
|
inlinevirtual |
Reimplemented in CommMPI.
Definition at line 192 of file Communicate.h.
Referenced by Distribution::writeOutFileEmission().
Message * Communicate::receive | ( | int & | node, |
int & | tag | ||
) |
Definition at line 240 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(), and process_resend_requests().
Referenced by DiscField< Dim >::write().
Message * Communicate::receive_block | ( | int & | node, |
int & | tag | ||
) |
Definition at line 300 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(), and IpplInfo::retransmit().
Referenced by BareField< T, Dim >::accumGuardCells(), ParallelPeriodicFace< T, D, M, C >::apply(), ParallelInterpolationFace< T, D, M, C >::apply(), assign(), DiscField< Dim >::distribute_offsets(), FieldLayout< Dim >::FieldLayout(), FieldDataSource< T, Dim, M, C >::gather_data(), BareField< T, Dim >::getsingle(), BareField< T, Dim >::getsingle_bc(), IndexedReceive(), pap(), DiscConfig::parse_config(), FieldDebugPrint< T, Dim >::print(), FieldPrint< T, Dim >::print(), FieldLayout< Dim >::read(), DiscField< Dim >::read(), DiscField< Dim >::read_meta(), DiscParticle::read_meta(), ParticleSpatialLayout< T, Dim, Mesh, CachingPolicy >::rebuild_layout(), H5PartWrapper::receiveFailureMessage(), reduce(), reduce_masked(), IpplParticleBase< PLayout >::resetID(), LossDataSink::saveASCII(), scatter(), ParticleSpatialLayout< T, Dim, Mesh, CachingPolicy >::short_swap_particles(), ParallelCyclotronTracker::singleParticleDump(), spap(), ParticleCashedLayout< T, Dim, Mesh >::swap_ghost_particles(), ParticleInteractLayout< T, Dim, Mesh >::swap_ghost_particles(), ParticleSpatialLayout< T, Dim, Mesh, CachingPolicy >::swap_particles(), ParticleCashedLayout< T, Dim, Mesh >::update(), ParticleInteractLayout< T, Dim, Mesh >::update(), ParticleUniformLayout< T, Dim >::update(), and DiscParticle::write().
|
protected |
Definition at line 839 of file Communicate.cpp.
References endl(), ERRORMSG, INFORM_ALL_NODES, and sentMsgCache.
Referenced by process_resend_requests().
|
protected |
Definition at line 720 of file Communicate.cpp.
References endl(), INFORM_ALL_NODES, IPPL_RETRANSMIT_TAG, Message::put(), and send().
Referenced by process_resend_requests().
|
protectedvirtual |
Reimplemented in CommMPI.
Definition at line 170 of file Communicate.cpp.
Referenced by perform_resend().
bool Communicate::send | ( | Message * | msg, |
int | node, | ||
int | tag, | ||
bool | delmsg = true |
||
) |
Definition at line 181 of file Communicate.cpp.
References add_msg(), COMM_ERROR, COMM_NOERROR, COMM_NOSEND, COMM_SEND_TAG, endl(), ERRORMSG, ErrorStatus, getNodes(), myNode(), and mysend().
Referenced by BareField< T, Dim >::accumGuardCells(), ParallelPeriodicFace< T, D, M, C >::apply(), ParallelInterpolationFace< T, D, M, C >::apply(), assign(), DiscField< Dim >::distribute_offsets(), FieldDataSource< T, Dim, M, C >::gather_data(), IndexedSend(), BareField< T1, D >::notifyUserOfDelete(), pap(), DiscConfig::parse_config(), FieldDebugPrint< T, Dim >::print(), FieldPrint< T, Dim >::print(), DiscField< Dim >::read(), DiscField< Dim >::read_meta(), DiscParticle::read_meta(), ParticleSpatialLayout< T, Dim, Mesh, CachingPolicy >::rebuild_layout(), reduce(), reduce_masked(), request_retransmission(), IpplParticleBase< PLayout >::resetID(), LossDataSink::saveASCII(), scatter(), send_ok_message(), ParticleSpatialLayout< T, Dim, Mesh, CachingPolicy >::short_swap_particles(), spap(), ParticleCashedLayout< T, Dim, Mesh >::swap_ghost_particles(), ParticleInteractLayout< T, Dim, Mesh >::swap_ghost_particles(), ParticleSpatialLayout< T, Dim, Mesh, CachingPolicy >::swap_particles(), ParticleCashedLayout< T, Dim, Mesh >::update(), ParticleInteractLayout< T, Dim, Mesh >::update(), ParticleUniformLayout< T, Dim >::update(), DiscField< Dim >::write(), and DiscParticle::write().
|
protected |
Definition at line 785 of file Communicate.cpp.
References endl(), INFORM_ALL_NODES, IPPL_MSG_OK_TAG, Message::put(), and send().
Referenced by process_resend_requests().
|
inlinestaticprotected |
Definition at line 371 of file Communicate.h.
References addwordround().
|
protected |
Definition at line 555 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(), unpack_retransmission_request(), and IpplInfo::useChecksums().
Referenced by CommMPI::mysend().
|
protected |
Definition at line 738 of file Communicate.cpp.
References addwordround(), endl(), INFORM_ALL_NODES, PInsist, and resendList.
Referenced by unpack_message().
|
inlinestaticprotected |
Definition at line 350 of file Communicate.h.
Referenced by addwordround(), and find_msg_length().
|
protected |
Definition at line 264 of file Communicate.h.
Referenced by Communicate(), and getContexts().
|
protected |
Definition at line 263 of file Communicate.h.
Referenced by Communicate(), getError(), receive(), receive_block(), and send().
|
protected |
Definition at line 285 of file Communicate.h.
Referenced by process_resend_requests(), and unpack_message().
|
protected |
Definition at line 262 of file Communicate.h.
Referenced by CommMPI::CommMPI(), Communicate(), and myNode().
|
protected |
Definition at line 270 of file Communicate.h.
Referenced by fill_msg_buffer().
|
protected |
Definition at line 265 of file Communicate.h.
Referenced by Communicate(), and getProcesses().
|
protected |
Definition at line 258 of file Communicate.h.
Referenced by add_msg(), find_msg(), and getReceived().
|
protected |
Definition at line 288 of file Communicate.h.
Referenced by process_resend_requests(), and unpack_message().
|
protected |
Definition at line 279 of file Communicate.h.
Referenced by process_resend_requests(), and unpack_retransmission_request().
|
protected |
Definition at line 276 of file Communicate.h.
Referenced by add_to_send_cache(), perform_resend(), remove_single_ok_message(), and ~Communicate().
|
protected |
Definition at line 282 of file Communicate.h.
Referenced by clear_ok_messages(), and process_resend_requests().
|
protected |
Definition at line 261 of file Communicate.h.
Referenced by CommMPI::CommMPI(), Communicate(), getNodes(), CommMPI::myreceive(), and CommMPI::~CommMPI().