OMNeT++ Parallel Simulation Support  6.0.3
cParsimPartition Class Reference

#include <cparsimpartition.h>

Description

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.

Inheritance diagram for cParsimPartition:
cObject 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
 

Constructor & Destructor Documentation

◆ cParsimPartition()

Constructor.

◆ ~cParsimPartition()

virtual ~cParsimPartition ( )
inlinevirtual

Virtual destructor.

Member Function Documentation

◆ lifecycleEvent()

virtual void lifecycleEvent ( SimulationLifecycleEventType  eventType,
cObject details 
)
overrideprotectedvirtual

A cISimulationLifecycleListener method. Delegates to startRun(), endRun() and shutdown(); override if needed.

Implements cISimulationLifecycleListener.

◆ setContext()

void setContext ( cSimulation sim,
cParsimCommunications comm,
cParsimSynchronizer synch 
)

Pass cParsimPartition the objects it has to cooperate with.

◆ startRun()

void startRun ( )

Called at the beginning of a simulation run. Fills in remote gate addresses of all cProxyGate's in the current partition.

◆ endRun()

void endRun ( )

Called at the end of a simulation run.

◆ shutdown()

void shutdown ( )

Shut down the parallel simulation system.

◆ processOutgoingMessage()

virtual void processOutgoingMessage ( cMessage msg,
const SendOptions options,
int  procId,
int  moduleId,
int  gateId,
void *  data 
)
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).

◆ processReceivedBuffer()

virtual void processReceivedBuffer ( cCommBuffer buffer,
int  tag,
int  sourceProcId 
)
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).

◆ processReceivedMessage()

virtual void processReceivedMessage ( cMessage msg,
const SendOptions options,
int  destModuleId,
int  destGateId,
int  sourceProcId 
)
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.

◆ broadcastTerminationException()

virtual void broadcastTerminationException ( cTerminationException e)
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.)

◆ broadcastException()

virtual void broadcastException ( std::exception &  e)
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.)


The documentation for this class was generated from the following file: