Represents one partition in a parallel simulation. Knows about partitions and the links between this partition and its neighbors.
Interconnections are stored not directly inside this object, but in cProxyGate's of cPlaceholderModule's. The remote address fields of cProxyGate's are filled out here in the connectRemoteGates() method.
This layer also handles generic (synchronization-independent part of) communication with other partitions:
This layer is communication library independent (e.g. it contains no MPI calls) – it builds on the abstraction layer provided by cParsimCommunications.
Inherits cObject, and cISimulationLifecycleListener.
Public Member Functions | |
cParsimPartition () | |
virtual | ~cParsimPartition () |
void | setContext (cSimulation *sim, cParsimCommunications *comm, cParsimSynchronizer *synch) |
void | startRun () |
void | endRun () |
void | shutdown () |
virtual void | processOutgoingMessage (cMessage *msg, const SendOptions &options, int procId, int moduleId, int gateId, void *data) |
virtual void | processReceivedBuffer (cCommBuffer *buffer, int tag, int sourceProcId) |
virtual void | processReceivedMessage (cMessage *msg, const SendOptions &options, int destModuleId, int destGateId, int sourceProcId) |
virtual void | broadcastTerminationException (cTerminationException &e) |
virtual void | broadcastException (std::exception &e) |
Protected Member Functions | |
virtual void | lifecycleEvent (SimulationLifecycleEventType eventType, cObject *details) override |
cParsimPartition | ( | ) |
Constructor.
|
inlinevirtual |
Virtual destructor.
|
overrideprotectedvirtual |
A cISimulationLifecycleListener method. Delegates to startRun(), endRun() and shutdown(); override if needed.
void setContext | ( | cSimulation * | sim, |
cParsimCommunications * | comm, | ||
cParsimSynchronizer * | synch | ||
) |
Pass cParsimPartition the objects it has to cooperate with.
void startRun | ( | ) |
Called at the beginning of a simulation run. Fills in remote gate addresses of all cProxyGate's in the current partition.
void endRun | ( | ) |
Called at the end of a simulation run.
void shutdown | ( | ) |
Shut down the parallel simulation system.
|
virtual |
A hook called from cProxyGate::deliver() when an outgoing cMessage arrives at partition boundary. We just pass it up to the synchronization layer (see similar method in cParsimSynchronizer).
|
virtual |
Process messages coming from other partitions. This method is called from the synchronization layer (see cParsimSynchronizer), after it has processed all tags that it understands (namely, cMessages (tag=TAG_CMESSAGE) and all tags used by the synchronization protocol).
|
virtual |
Process cMessages received from other partitions. This method is called from the synchronization layer (see cParsimSynchronizer) when it received a message from other partitions. This method checks that the destination module/gate still exists, sets the source module/gate to the appropriate placeholder module, and inserts the message into the FES.
|
virtual |
Called when a cTerminationException occurs (i.e. the simulation is about to be finished normally), this methods notifies other partitions about the exception.
This methods "eats" exceptions that occur during broadcast. (We're not interested in cascading exceptions.)
|
virtual |
Called when an exception occurs (i.e. the simulation is about to be stopped with an error), this methods notifies other partitions about the exception.
This methods "eats" exceptions that occur during broadcast. (We're not interested in cascading exceptions.)