chrono::synchrono::SynMPICommunicator Class Reference

Description

Derived communicator used to establish and facilitate communication between nodes.

Uses the Message Passing Interface (MPI) standard

#include <SynMPICommunicator.h>

Inheritance diagram for chrono::synchrono::SynMPICommunicator:
Collaboration diagram for chrono::synchrono::SynMPICommunicator:

Public Member Functions

 SynMPICommunicator (int argc, char **argv)
 Default constructor. More...
 
virtual ~SynMPICommunicator ()
 Destructor. More...
 
virtual void Initialize () override
 Initialization method typically responsible for establishing a connection. More...
 
virtual void Synchronize () override
 This method is responsible for continuous synchronization steps This method, depending on it's implementation, could be blocking or non-blocking. More...
 
virtual void Barrier () override
 This method is responsible for blocking until an action is received or done. More...
 
virtual SynMessageList & GetMessages () override
 Get the messages received by the communicator. More...
 
virtual int GetRank () const
 Get the rank for the attached process. More...
 
virtual unsigned int GetNumRanks () const
 Get the number of ranks in the MPI world. More...
 
- Public Member Functions inherited from chrono::synchrono::SynCommunicator
 SynCommunicator ()
 Default constructor. More...
 
virtual ~SynCommunicator ()
 Destructor. More...
 
void Reset ()
 Reset the communicator Will clear out message buffers. More...
 
void AddOutgoingMessages (SynMessageList &messages)
 Add the messages to the outgoing message buffer. More...
 
void AddQuitMessage ()
 Adds a quit message to the queue telling other nodes to end the simulation.
 
void AddIncomingMessages (SynMessageList &messages)
 Add the messages to the incoming message buffer. More...
 
void ProcessBuffer (std::vector< uint8_t > &data)
 Process a data buffer by passing it to the underlying FlatBuffersManager. More...
 

Additional Inherited Members

- Protected Attributes inherited from chrono::synchrono::SynCommunicator
bool m_initialized
 whether the communicator has been initialized
 
SynMessageList m_incoming_messages
 Incoming messages.
 
SynFlatBuffersManager m_flatbuffers_manager
 flatbuffer manager for this rank
 

Constructor & Destructor Documentation

◆ SynMPICommunicator()

chrono::synchrono::SynMPICommunicator::SynMPICommunicator ( int  argc,
char **  argv 
)

Default constructor.

◆ ~SynMPICommunicator()

chrono::synchrono::SynMPICommunicator::~SynMPICommunicator ( )
virtual

Destructor.

Member Function Documentation

◆ Barrier()

virtual void chrono::synchrono::SynMPICommunicator::Barrier ( )
inlineoverridevirtual

This method is responsible for blocking until an action is received or done.

For example, a process may call Barrier to wait until another process has established certain classes and initialized certain quantities. This functionality should be implemented in this method.

Implements chrono::synchrono::SynCommunicator.

◆ GetMessages()

SynMessageList & chrono::synchrono::SynMPICommunicator::GetMessages ( )
overridevirtual

Get the messages received by the communicator.

Returns
SynMessageList the received messages

Reimplemented from chrono::synchrono::SynCommunicator.

◆ GetNumRanks()

virtual unsigned int chrono::synchrono::SynMPICommunicator::GetNumRanks ( ) const
inlinevirtual

Get the number of ranks in the MPI world.

◆ GetRank()

virtual int chrono::synchrono::SynMPICommunicator::GetRank ( ) const
inlinevirtual

Get the rank for the attached process.

◆ Initialize()

virtual void chrono::synchrono::SynMPICommunicator::Initialize ( )
inlineoverridevirtual

Initialization method typically responsible for establishing a connection.

Although not mandatory, this method should handle initial peer-to-peer communication. This could mean a simple handshake or an actual exchange of information used during the simulation.

Reimplemented from chrono::synchrono::SynCommunicator.

◆ Synchronize()

void chrono::synchrono::SynMPICommunicator::Synchronize ( )
overridevirtual

This method is responsible for continuous synchronization steps This method, depending on it's implementation, could be blocking or non-blocking.

As in, depending on the derived class implementation, this method could use synchronous or asynchronous method calls to implement a communication interface.

Synchronize will serialize the underlying message buffer if it hasn't yet

Implements chrono::synchrono::SynCommunicator.


The documentation for this class was generated from the following files:
  • /builds/uwsbel/chrono/src/chrono_synchrono/communication/mpi/SynMPICommunicator.h
  • /builds/uwsbel/chrono/src/chrono_synchrono/communication/mpi/SynMPICommunicator.cpp