PPL Logo

sim Class Reference

Poser wrapper base class. More...

#include <sim.h>

Inheritance diagram for sim:

Inheritance graph
[legend]
Collaboration diagram for sim:

Collaboration graph
[legend]

Public Member Functions

 sim (void)
 Basic Constructor.
 sim (CkMigrateMessage *)
virtual ~sim ()
 Destructor.
void pup (PUP::er &p)
 Pack/unpack/sizing operator.
void Step ()
 Start a forward execution step on myStrat.
void Step (prioMsg *m)
 Start a prioritized forward execution step on myStrat.
void CheckpointStep (eventMsg *m)
 Start a forward execution step on myStrat after a checkpoint (sequential mode only).
void Status ()
 Report safe time to PVT branch.
void Commit ()
 Commit events based on new GVT estimate.
void CheckpointCommit ()
 Commit all possible events before a checkpoint to disk.
void Cancel (cancelMsg *m)
 Add m to cancellation list.
void ReportLBdata ()
 Report load information to local load balancer.
void Migrate (destMsg *m)
 Migrate this poser to processor indicated in m.
void Terminate ()
 Terminate this poser, when everyone is terminated we exit.
void SeqBeginCheckpoint ()
 In sequential mode, begin checkpoint after reaching quiescence.
void SeqResumeAfterCheckpoint ()
 In sequential mode, resume after checkpointing or restarting.
void invokeStopEvent ()
 Implement this for posers that will need to execute events when POSE reaches quiescence.
void setSimulationStartGVT (POSE_TimeType startGVT)
 Set simulationStartGVT in the rep.
int PVTindex ()
 Return this poser's unique index on PVT branch.
int IsActive ()
 Test active flag.
void Activate ()
 Set active flag.
void Deactivate ()
 Unset active flag.
virtual void ResolveFn (int fnIdx, void *msg)
 Invoke an event on this poser according to fnIdx and pass it msg.
virtual void ResolveCommitFn (int fnIdx, void *msg)
 Invoke the commit version of an event to handle special behaviors.
void registerSent (POSE_TimeType timestamp)
 Notify the PVT of a message send.
void CommitPrintf (const char *Fmt,...)
 Used for buffered output.
void CommitError (const char *Fmt,...)
 Used for buffered output of error messages.
void ResumeFromSync (void)
void dump ()
 Dump all data fields.

Data Fields

eventQueueeq
 This poser's event queue.
stratmyStrat
 This poser's synchronization strategy.
repobjID
 This poser's user representation.
CancelList cancels
 List of incoming cancellations for this poser.
PVTlocalPVT
 The local PVT to report to.
int myPVTidx
 Unique global ID for this object on PVT branch.
int myLBidx
 Unique global ID for this object in load balancing data structures.
int DOs
 Number of forward execution steps.
int UNDOs
 Number of undone events.
int sync
 Synchronization strategy type (optimistic or conservative).
intsrVector
 Number of sends/recvs per PE.
POSE_TimeType lastGVT
 Most recent GVT estimate.
double st
 Relative start time, end time, and current time.
double et
double ct
localStatlocalStats
 The local statistics collector.
POSE_TimeType dop_override_evt
 Used to manually override the value of evt for DOP calculations.
long long basicStats [2]
 Used to count the number of commits (in [0]) and rollbacks (in [1]).
LBgrouplocalLBG
 The local load balancer.

Protected Attributes

int active
 Flag to indicate that a Step message is scheduled.

Private Member Functions

void InternalCommitPrintf (const char *Fmt, va_list ap)
 Used by buffered print functions.

Detailed Description

Poser wrapper base class.

The poser base class: all user posers are translated to classes that inherit from this class, and act as wrappers around the actual user object's representation to control the simulation behavior. These objects are plugged into the POSE_objects array which is of this type.

Definition at line 191 of file sim.h.


Constructor & Destructor Documentation

sim::sim ( void   ) 

Basic Constructor.

Definition at line 13 of file sim.C.

References active, basicStats, CkLocalBranch(), Converse::CkMyPe(), Converse::CkNumPes(), DOs, eq, int, lastGVT, POSE_Config::lb_on, localLBG, localPVT, localStats, malloc(), myStrat, objID, pose_config, srVector, POSE_Config::stats, TheLBG, theLocalStats, ThePVT, and UNDOs.

Here is the call graph for this function:

sim::sim ( CkMigrateMessage  )  [inline]

Definition at line 250 of file sim.h.

sim::~sim (  )  [virtual]

Destructor.

Definition at line 38 of file sim.C.

References active, eq, POSE_Config::lb_on, localLBG, localPVT, myLBidx, myPVTidx, myStrat, objID, LBgroup::objRemove(), PVT::objRemove(), and pose_config.

Here is the call graph for this function:


Member Function Documentation

void sim::pup ( PUP::er p  ) 

void sim::Step (  ) 

Start a forward execution step on myStrat.

Definition at line 95 of file sim.C.

References active, CmiWallTimer(), localStats, myStrat, pose_config, POSE_Config::stats, strat::Step(), strat::STRAT_T, localStat::SwitchTimer(), localStat::TimerRunning(), localStat::TimerStart(), localStat::TimerStop(), POSE_Config::trace, and traceUserBracketEvent().

Referenced by Commit().

Here is the call graph for this function:

Here is the caller graph for this function:

void sim::Step ( prioMsg m  ) 

Start a prioritized forward execution step on myStrat.

Definition at line 143 of file sim.C.

References active, CkFreeMsg(), localStats, myStrat, pose_config, POSE_Config::stats, strat::Step(), localStat::SwitchTimer(), localStat::TimerRunning(), localStat::TimerStart(), and localStat::TimerStop().

Here is the call graph for this function:

void sim::CheckpointStep ( eventMsg m  ) 

Start a forward execution step on myStrat after a checkpoint (sequential mode only).

Definition at line 171 of file sim.C.

References active, CkFreeMsg(), localStats, myStrat, pose_config, POSE_Config::stats, strat::Step(), strat::STRAT_T, localStat::SwitchTimer(), localStat::TimerRunning(), localStat::TimerStart(), and localStat::TimerStop().

Here is the call graph for this function:

void sim::Status (  )  [inline]

Report safe time to PVT branch.

Definition at line 262 of file sim.h.

References localPVT, myPVTidx, myStrat, objID, PVT::objUpdateOVT(), rep::OVT(), and strat::SafeTime().

Referenced by spec::Step(), opt3::Step(), opt2::Step(), opt::Step(), adapt5::Step(), adapt4::Step(), adapt3::Step(), adapt2::Step(), and adapt::Step().

Here is the call graph for this function:

Here is the caller graph for this function:

void sim::Commit (  ) 

void sim::CheckpointCommit (  ) 

Commit all possible events before a checkpoint to disk.

Definition at line 252 of file sim.C.

References active, CmiWallTimer(), eventQueue::CommitEvents(), eq, PVT::getGVT(), lastGVT, localPVT, localStats, pose_config, POSE_Config::stats, localStat::SwitchTimer(), localStat::TimerRunning(), localStat::TimerStart(), localStat::TimerStop(), POSE_Config::trace, and traceUserBracketEvent().

Here is the call graph for this function:

void sim::Cancel ( cancelMsg m  ) 

void sim::ReportLBdata (  ) 

Report load information to local load balancer.

Definition at line 289 of file sim.C.

References Converse::CkNumPes(), eventQueue::currentPtr, DOs, eq, POSE_Config::lb_on, localLBG, myLBidx, Event::next, objID, LBgroup::objUpdate(), rep::ovt, pose_config, POSE_UnsetTS, srVector, Event::timestamp, and UNDOs.

Here is the call graph for this function:

void sim::Migrate ( destMsg m  )  [inline]

Migrate this poser to processor indicated in m.

Definition at line 274 of file sim.h.

References destMsg::destPE.

void sim::Terminate (  )  [inline]

Terminate this poser, when everyone is terminated we exit.

Definition at line 276 of file sim.h.

References basicStats, objID, POSE_prepExit(), CkReduction::sum_int, and rep::terminus().

Referenced by Commit().

Here is the call graph for this function:

Here is the caller graph for this function:

void sim::SeqBeginCheckpoint (  ) 

In sequential mode, begin checkpoint after reaching quiescence.

Definition at line 368 of file sim.C.

References cb, CkStartCheckpoint(), CmiWallTimer(), seqCheckpointInProgress, seqLastCheckpointGVT, and seqStartTime.

Here is the call graph for this function:

void sim::SeqResumeAfterCheckpoint (  ) 

void sim::invokeStopEvent (  )  [inline]

Implement this for posers that will need to execute events when POSE reaches quiescence.

Definition at line 290 of file sim.h.

void sim::setSimulationStartGVT ( POSE_TimeType  startGVT  )  [inline]

Set simulationStartGVT in the rep.

Definition at line 292 of file sim.h.

References objID, and rep::setSimulationStartGVT().

Here is the call graph for this function:

int sim::PVTindex (  )  [inline]

Return this poser's unique index on PVT branch.

Definition at line 296 of file sim.h.

References myPVTidx.

int sim::IsActive (  )  [inline]

Test active flag.

Definition at line 298 of file sim.h.

References active.

Referenced by pvtObjectNode::sanitize().

Here is the caller graph for this function:

void sim::Activate (  )  [inline]

Set active flag.

Definition at line 300 of file sim.h.

References active.

Referenced by strat::Step().

Here is the caller graph for this function:

void sim::Deactivate (  )  [inline]

Unset active flag.

Definition at line 302 of file sim.h.

References active.

Referenced by strat::Step().

Here is the caller graph for this function:

virtual void sim::ResolveFn ( int  fnIdx,
void *  msg 
) [inline, virtual]

Invoke an event on this poser according to fnIdx and pass it msg.

ResolveFn is generated along with the rest of the wrapper object and should handle all possible events on a poser.

Definition at line 306 of file sim.h.

Referenced by opt::Rollback(), strat::Step(), spec::Step(), seq::Step(), opt3::Step(), opt2::Step(), opt::Step(), con::Step(), adapt5::Step(), adapt4::Step(), adapt3::Step(), adapt2::Step(), and adapt::Step().

Here is the caller graph for this function:

virtual void sim::ResolveCommitFn ( int  fnIdx,
void *  msg 
) [inline, virtual]

Invoke the commit version of an event to handle special behaviors.

This invokes the <fn>_commit method that user provides. It can be used to perform special activities, statistics gathering, output, or whatever the user wishes.

Definition at line 311 of file sim.h.

Referenced by eventQueue::CommitEvents().

Here is the caller graph for this function:

void sim::registerSent ( POSE_TimeType  timestamp  )  [inline]

Notify the PVT of a message send.

Definition at line 313 of file sim.h.

References localPVT, and PVT::objUpdate().

Referenced by rep::registerTimestamp(), and chpt< StateType >::registerTimestamp().

Here is the call graph for this function:

Here is the caller graph for this function:

void sim::CommitPrintf ( const char *  Fmt,
  ... 
) [inline]

Used for buffered output.

Output is only printed when the event is committed

Definition at line 318 of file sim.h.

References InternalCommitPrintf().

Here is the call graph for this function:

void sim::CommitError ( const char *  Fmt,
  ... 
) [inline]

Used for buffered output of error messages.

Output is only printed when the event is committed

Definition at line 326 of file sim.h.

References Event::commitErr, strat::currentEvent, InternalCommitPrintf(), and myStrat.

Here is the call graph for this function:

void sim::ResumeFromSync ( void   ) 

Definition at line 424 of file sim.C.

void sim::dump (  ) 

Dump all data fields.

Definition at line 431 of file sim.C.

References active, cancels, CancelList::dump(), eventQueue::dump(), rep::dump(), eq, myPVTidx, objID, and sync.

Here is the call graph for this function:

void sim::InternalCommitPrintf ( const char *  Fmt,
va_list  ap 
) [inline, private]

Used by buffered print functions.

Definition at line 338 of file sim.h.

References CkExit(), Event::commitBfr, Event::commitBfrLen, strat::currentEvent, free(), malloc(), and myStrat.

Referenced by CommitError(), and CommitPrintf().

Here is the call graph for this function:

Here is the caller graph for this function:


Field Documentation

int sim::active [protected]

Flag to indicate that a Step message is scheduled.

Need to re-evaluate the need/function of this... also, how is it used during load balancing...

Definition at line 196 of file sim.h.

Referenced by Activate(), CheckpointCommit(), CheckpointStep(), Commit(), Deactivate(), dump(), IsActive(), pup(), sim(), Step(), and ~sim().

This poser's event queue.

Definition at line 199 of file sim.h.

Referenced by chpt< StateType >::checkpoint(), CheckpointCommit(), Commit(), dump(), pup(), ReportLBdata(), SeqResumeAfterCheckpoint(), sim(), rep::update(), and ~sim().

This poser's user representation.

Definition at line 203 of file sim.h.

Referenced by eventQueue::CommitEvents(), dump(), ReportLBdata(), SeqResumeAfterCheckpoint(), setSimulationStartGVT(), sim(), Status(), Terminate(), and ~sim().

The local PVT to report to.

Definition at line 207 of file sim.h.

Referenced by Cancel(), CheckpointCommit(), Commit(), pup(), registerSent(), sim(), Status(), and ~sim().

Unique global ID for this object on PVT branch.

Definition at line 209 of file sim.h.

Referenced by dump(), pup(), PVTindex(), Status(), and ~sim().

Unique global ID for this object in load balancing data structures.

Definition at line 211 of file sim.h.

Referenced by pup(), ReportLBdata(), and ~sim().

Number of forward execution steps.

Is this needed/used? This is load balancing data...

Definition at line 214 of file sim.h.

Referenced by pup(), ReportLBdata(), sim(), and con::Step().

Number of undone events.

Is this needed/used? This is load balancing data...

Definition at line 217 of file sim.h.

Referenced by pup(), ReportLBdata(), opt::Rollback(), and sim().

Synchronization strategy type (optimistic or conservative).

Definition at line 219 of file sim.h.

Referenced by dump(), seq::initSync(), opt::initSync(), con::initSync(), and pup().

Number of sends/recvs per PE.

Definition at line 221 of file sim.h.

Referenced by ReportLBdata(), and sim().

Most recent GVT estimate.

Definition at line 223 of file sim.h.

Referenced by CheckpointCommit(), Commit(), and sim().

double sim::st

Relative start time, end time, and current time.

Used to calculate degree of parallelism

Definition at line 226 of file sim.h.

Referenced by SeqResumeAfterCheckpoint().

double sim::et

Definition at line 226 of file sim.h.

double sim::ct

Definition at line 226 of file sim.h.

Referenced by SeqResumeAfterCheckpoint().

The local statistics collector.

Definition at line 229 of file sim.h.

Referenced by Cancel(), CheckpointCommit(), CheckpointStep(), Commit(), pup(), SeqResumeAfterCheckpoint(), sim(), and Step().

Used to manually override the value of evt for DOP calculations.

Definition at line 239 of file sim.h.

long long sim::basicStats[2]

Used to count the number of commits (in [0]) and rollbacks (in [1]).

Definition at line 245 of file sim.h.

Referenced by eventQueue::CommitEvents(), pup(), opt::Rollback(), sim(), adapt5::Step(), and Terminate().

The local load balancer.

Definition at line 247 of file sim.h.

Referenced by pup(), ReportLBdata(), sim(), and ~sim().


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

Generated on Mon Sep 21 08:29:55 2020 for Charm++ by  doxygen 1.5.5