chrono::synchrono::SynChronoManager Class Reference

Description

Base class responsible for handling agents and synchronizing states between nodes.

#include <SynChronoManager.h>

Public Member Functions

 SynChronoManager (SynNodeID nid, SynAgentNum num_nodes, std::shared_ptr< SynCommunicator > communicator=nullptr)
 Class constructor.
 
 ~SynChronoManager ()
 Class destructor.
 
bool AddAgent (std::shared_ptr< SynAgent > agent)
 Add an agent to the SynChrono manager Cannot be called after Initialize is called. More...
 
bool AddZombie (std::shared_ptr< SynAgent > zombie, SynAgentID aid)
 Add a zombie to the SynChrono manager with the passed id Cannot be called after Initialize is called. More...
 
bool SetCommunicator (std::shared_ptr< SynCommunicator > communicator)
 Sets the underlying communicator. More...
 
bool Initialize (ChSystem *system)
 Initialize all the added agents. More...
 
void Synchronize (double time)
 Synchronize data across nodes. More...
 
void UpdateAgents ()
 Update the underlying agents Agents typically will update their state messages.
 
void QuitSimulation ()
 If our simulation is still running, sends a quit message to everyone else to exit as well Needed specifically for MPI where we don't wait for timeouts.
 
std::map< SynAgentID, std::shared_ptr< SynAgent > > & GetAgents ()
 Get the agents list. More...
 
void SetHeartbeat (double heartbeat)
 Set the heartbeat for the rate at which SynChrono synchronization occurs. More...
 
bool IsOk ()
 Should the simulation still be running?
 
void PrintStepStatistics (std::ostream &os) const
 Print timing information (over last step and cumulative)
 

Member Function Documentation

◆ AddAgent()

bool chrono::synchrono::SynChronoManager::AddAgent ( std::shared_ptr< SynAgent agent)

Add an agent to the SynChrono manager Cannot be called after Initialize is called.

Unique id is a single integer where the last digit is the order of which it is added to the node TODO: Right now, a node can have a maximum of 10 agents (0 through 9 digits)

Parameters
agentThe agent that should be added to the SynChrono world

◆ AddZombie()

bool chrono::synchrono::SynChronoManager::AddZombie ( std::shared_ptr< SynAgent zombie,
SynAgentID  aid 
)

Add a zombie to the SynChrono manager with the passed id Cannot be called after Initialize is called.

Parameters
zombieThe zombie that should be added to the SynChrono world
aidThe id of the added zombie

◆ GetAgents()

std::map<SynAgentID, std::shared_ptr<SynAgent> >& chrono::synchrono::SynChronoManager::GetAgents ( )
inline

Get the agents list.

◆ Initialize()

bool chrono::synchrono::SynChronoManager::Initialize ( ChSystem system)

Initialize all the added agents.

Communicator must be added before calling this function. Locks the agent list so new agents cannot be added.

Parameters
systemThe chrono system with which the sensor manager is associated. Used for zombie initialization.

◆ SetCommunicator()

bool chrono::synchrono::SynChronoManager::SetCommunicator ( std::shared_ptr< SynCommunicator communicator)

Sets the underlying communicator.

Parameters
communicatorthe communicator to use for internode communication

◆ SetHeartbeat()

void chrono::synchrono::SynChronoManager::SetHeartbeat ( double  heartbeat)
inline

Set the heartbeat for the rate at which SynChrono synchronization occurs.

◆ Synchronize()

void chrono::synchrono::SynChronoManager::Synchronize ( double  time)

Synchronize data across nodes.

This method essentially calls the underlying communicator to perform the work. The communicator will send and block until all messages are received. The manager is then responsible for distributing messages to each agent.

A manager is responsible for maintaining time and space coherence, so each node and it's agent should be at the same time within the simulation

Parameters
timetimestamp to synchronize each node at

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