strat Class Reference

Base synchronization strategy class. More...

#include <strat.h>

Inheritance diagram for strat:

Inheritance graph
[legend]
Collaboration diagram for strat:

Collaboration graph
[legend]

Public Member Functions

 strat ()
 Basic Constructor.
virtual ~strat ()
 Destructor.
void init (eventQueue *q, rep *obj, sim *p, int pIdx)
 Initializer.
virtual void initSync ()
 Initialize synchronization strategy type (optimistic or conservative).
virtual void Step ()
 Code here MUST be overridden, but this gives a basic idea of how a forward execution step should go.
virtual void Rollback ()
 Strategy-specific rollback.
virtual void CancelEvents ()
 Strategy-specific event cancellation.
virtual POSE_TimeType SafeTime ()
 Calculate safe time (earliest time at which object can generate events).

Data Fields

int STRAT_T
 Type of strategy; see defines above.
EventtargetEvent
 Used by strategy to denote point in event queue to 1) rollback to 2) checkpoint up to etc.
EventcurrentEvent
 Current event being executed.

Protected Attributes

localStatlocalStats
PVTlocalPVT
 Local PVT branch.
eventQueueeq
 Pointer to the eventQueue in the poser wrapper.
repuserObj
 Pointer to the representation object in the poser wrapper.
simparent
 Pointer to the poser wrapper.

Detailed Description

Base synchronization strategy class.

Definition at line 20 of file strat.h.


Constructor & Destructor Documentation

strat::strat (  ) 

Basic Constructor.

Definition at line 5 of file strat.C.

References CkLocalBranch(), currentEvent, eq, localPVT, localStats, parent, pose_config, POSE_Config::stats, STRAT_T, targetEvent, theLocalStats, ThePVT, and userObj.

virtual strat::~strat (  )  [inline, virtual]

Destructor.

Definition at line 46 of file strat.h.


Member Function Documentation

void strat::init ( eventQueue q,
rep obj,
sim p,
int  pIdx 
)

Initializer.

Definition at line 22 of file strat.C.

References eq, initSync(), p, parent, and userObj.

virtual void strat::initSync (  )  [inline, virtual]

Initialize synchronization strategy type (optimistic or conservative).

Reimplemented in con, opt, and seq.

Definition at line 50 of file strat.h.

Referenced by init().

void strat::Step (  )  [virtual]

Code here MUST be overridden, but this gives a basic idea of how a forward execution step should go.

Strategies must determine if it is safe to execute an event.

Reimplemented in adapt, adapt2, adapt3, adapt4, con, opt, opt2, opt3, seq, and spec.

Definition at line 28 of file strat.C.

References sim::Activate(), currentEvent, eventQueue::currentPtr, sim::Deactivate(), Event::done, eq, Event::fnIdx, Event::msg, parent, POSE_Objects, sim::ResolveFn(), eventQueue::ShiftEvent(), and Event::timestamp.

Referenced by sim::Cancel(), and sim::Step().

virtual void strat::Rollback (  )  [inline, virtual]

Strategy-specific rollback.

Reimplemented in opt.

Definition at line 57 of file strat.h.

virtual void strat::CancelEvents (  )  [inline, virtual]

Strategy-specific event cancellation.

Reimplemented in con, and opt.

Definition at line 59 of file strat.h.

virtual POSE_TimeType strat::SafeTime (  )  [inline, virtual]

Calculate safe time (earliest time at which object can generate events).

Reimplemented in con, and opt.

Definition at line 61 of file strat.h.

References rep::OVT(), and userObj.

Referenced by sim::Status().


Field Documentation

localStat* strat::localStats [protected]

Definition at line 24 of file strat.h.

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

PVT* strat::localPVT [protected]

Local PVT branch.

Definition at line 27 of file strat.h.

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

eventQueue* strat::eq [protected]

Pointer to the eventQueue in the poser wrapper.

Definition at line 29 of file strat.h.

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

rep* strat::userObj [protected]

Pointer to the representation object in the poser wrapper.

Definition at line 31 of file strat.h.

Referenced by init(), opt::Rollback(), SafeTime(), opt::SafeTime(), con::SafeTime(), seq::Step(), adapt4::Step(), and strat().

sim* strat::parent [protected]

Pointer to the poser wrapper.

Definition at line 33 of file strat.h.

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

int strat::STRAT_T

Type of strategy; see defines above.

Definition at line 36 of file strat.h.

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

Event* strat::targetEvent

Used by strategy to denote point in event queue to 1) rollback to 2) checkpoint up to etc.

Definition at line 40 of file strat.h.

Referenced by chpt< StateType >::restore(), opt::Rollback(), and strat().

Event* strat::currentEvent

Current event being executed.

Definition at line 42 of file strat.h.

Referenced by chpt< StateType >::checkpoint(), sim::CommitError(), sim::InternalCommitPrintf(), chpt< StateType >::restore(), opt::Rollback(), Step(), spec::Step(), seq::Step(), opt3::Step(), opt2::Step(), opt::Step(), con::Step(), adapt4::Step(), adapt3::Step(), adapt2::Step(), adapt::Step(), and strat().


The documentation for this class was generated from the following files:
Generated on Sun Jun 29 13:35:18 2008 for Charm++ by  doxygen 1.5.1