cNullMessageProtocol Class Reference

Parallel Simulation API: cNullMessageProtocol Class Reference
Parallel Simulation API
cNullMessageProtocol Class Reference
Inheritance diagram for cNullMessageProtocol:
[legend]

Public Member Functions

 cNullMessageProtocol ()
virtual ~cNullMessageProtocol ()
virtual void setContext (cSimulation *sim, cParsimPartition *seg, cParsimCommunications *co) override
void setLaziness (double d)
double getLaziness ()
virtual void startRun () override
virtual void endRun () override
virtual cEvent * takeNextEvent () override
virtual void putBackEvent (cEvent *event) override
virtual void processOutgoingMessage (cMessage *msg, const SendOptions &options, int procId, int moduleId, int gateId, void *data) override
Public Member Functions inherited from cParsimProtocolBase
 cParsimProtocolBase ()
virtual ~cParsimProtocolBase ()
Public Member Functions inherited from cParsimSynchronizer
 cParsimSynchronizer ()
virtual ~cParsimSynchronizer ()
virtual std::string str () const override
virtual cEvent * guessNextEvent () override

Description

Implements the "null message algorithm". Lookahead calculation is encapsulated into a separate object, subclassed from cNMPLookahead.

Constructor & Destructor Documentation

◆ cNullMessageProtocol()

Constructor.

◆ ~cNullMessageProtocol()

virtual ~cNullMessageProtocol ( )
virtual

Destructor.

Member Function Documentation

◆ setContext()

virtual void setContext ( cSimulation * sim,
cParsimPartition * seg,
cParsimCommunications * co )
overridevirtual

Redefined beacause we have to pass the same data to the lookahead calculator object (cNMPLookahead) too.

Reimplemented from cParsimSynchronizer.

◆ setLaziness()

void setLaziness ( double d)
inline

Sets null message resend laziness. Value is between 0 and 1 – 0.0 means eager resend, 1.0 means lazy resend.

(Probably should never be 1.0, otherwise floating point rounding errors may cause obscure EIT-deadlocks on receiving side.)

◆ getLaziness()

double getLaziness ( )
inline

Get laziness of null message resend.

◆ startRun()

virtual void startRun ( )
overridevirtual

Called at the beginning of a simulation run.

Implements cParsimSynchronizer.

Reimplemented in cISPEventLogger.

◆ endRun()

virtual void endRun ( )
overridevirtual

Called at the end of a simulation run.

Implements cParsimSynchronizer.

Reimplemented in cISPEventLogger.

◆ takeNextEvent()

virtual cEvent * takeNextEvent ( )
overridevirtual

Scheduler function. The null message algorithm is embedded here.

Implements cParsimSynchronizer.

Reimplemented in cISPEventLogger.

◆ putBackEvent()

virtual void putBackEvent ( cEvent * event)
overridevirtual

Undo takeNextEvent() – it comes from the cScheduler interface.

Reimplemented in cISPEventLogger.

◆ processOutgoingMessage()

virtual void processOutgoingMessage ( cMessage * msg,
const SendOptions & options,
int procId,
int moduleId,
int gateId,
void * data )
overridevirtual

In addition to its normal task (sending out the cMessage to the given partition), it also does lookahead calculation and optional piggybacking of null message on the cMessage.

Reimplemented from cParsimProtocolBase.

Reimplemented in cISPEventLogger.