PPL Logo

eventQueue Class Reference

The event queue. More...

#include <evq.h>

Collaboration diagram for eventQueue:

Collaboration graph
[legend]

Public Member Functions

 eventQueue ()
 Basic Constructor.
 ~eventQueue ()
 Destructor.
void InsertEvent (Event *e)
 Insert e in the queue in timestamp order.
void InsertEventDeterministic (Event *e)
 Insert e in the queue in timestamp order.
Eventfront ()
 Return front pointer.
Eventback ()
 Return back pointer.
void ShiftEvent ()
 Move currentPtr to next event in queue.
void CommitEvents (sim *obj, POSE_TimeType ts)
 Commit (delete) events before target timestamp ts.
void CommitAll (sim *obj)
 Commit (delete) all events.
void CommitDoneEvents (sim *obj)
 Commit (delete) all events that are done (used in sequential mode).
void SetCurrentPtr (Event *e)
 Change currentPtr to point to event e.
void DeleteEvent (Event *ev)
 Delete event and reconnect surrounding events in queue.
const eventIDCurrentEventID ()
 Return the event ID of the event pointed to by currentPtr.
void AddSpawnToCurrent (int id, eventID e, POSE_TimeType ts)
 Add id, e and ts as an entry in currentPtr's spawned list.
SpawnedEventGetNextCurrentSpawn ()
 Return the first entry in currentPtr's spawned list and remove it.
void FindLargest ()
 Find the largest timestamp of the unexecuted events.
void SetRBevent (Event *e)
 Set rollback point to event e.
void dump ()
 Dump the event queue.
char * dumpString ()
 Dump the event queue to a string.
void pup (PUP::er &p)
 Pack/unpack/sizing operator.
void sanitize ()
 Check validity of data fields.

Data Fields

EventfrontPtr
 Sentinel nodes.
EventbackPtr
EventcurrentPtr
 Pointer to next unexecuted event.
EventRBevent
 Event to rollback to.
EqHeapeqh
 Heap of unexecuted events.
POSE_TimeType largest
 Largest unexecuted event timestamp in queue.
unsigned int eventCount
 number of unexecuted events in the queue
POSE_TimeType tsOfLastInserted
 Timestamp of the last event inserted in the queue.
unsigned int mem_usage
 Coarse memory usage.
POSE_TimeType lastLoggedVT
 Keep track of last logged VT for this object so no duplicates are logged.
int recentAvgEventSparsity
 Average sparsity of recently committed events (in GVT ticks / event).
POSE_TimeType sparsityStartTime
 Timestamp of the first event for the sparsity calculation.
int sparsityCalcCount
 Sparsity calculation counter.
int tsDiffCount
 Counts the differences examined; used for timeleash calculation in adapt5.
POSE_TimeType lastCommittedTS
 The timestamp of the last committed event.
POSE_TimeType tsCommitDiffs [DIFFS_TO_STORE]
 The largest timestamp differences at commit time; used for timeleash calculation in adapt5.
TimePoollocalTimePool

Private Member Functions

void CommitStatsHelper (sim *obj, Event *commitPtr)
 This helper method cleans up all the commit code by removing the stats.

Detailed Description

The event queue.

Doubly-linked list with front and back sentinels and a heap of unexecuted events

Definition at line 10 of file evq.h.


Constructor & Destructor Documentation

eventQueue::eventQueue (  ) 

Basic Constructor.

Queue of executed and unexecuted events on a poser.

Creates front and back sentinel nodes, connects them, and inits pointers and heap.

Basic Constructor

Definition at line 5 of file evq.C.

References backPtr, CkLocalBranch(), Event::commitBfr, Event::commitBfrLen, currentPtr, Event::done, eqh, eventCount, Event::fnIdx, frontPtr, largest, lastCommittedTS, lastLoggedVT, localTimePool, mem_usage, Event::msg, Event::next, POSE_UnsetTS, Event::prev, RBevent, recentAvgEventSparsity, sanitize(), sparsityCalcCount, sparsityStartTime, Event::spawnedList, TempMemID, Event::timestamp, tsCommitDiffs, tsDiffCount, and tsOfLastInserted.

Here is the call graph for this function:

eventQueue::~eventQueue (  ) 

Destructor.

Definition at line 58 of file evq.C.

References eqh, free(), frontPtr, and Event::next.

Here is the call graph for this function:


Member Function Documentation

void eventQueue::CommitStatsHelper ( sim obj,
Event commitPtr 
) [private]

This helper method cleans up all the commit code by removing the stats.

Definition at line 157 of file evq.C.

References CkLocalBranch(), localStat::Commit(), POSE_Config::dop, Event::ert, Event::evt, int, lastCommittedTS, lastLoggedVT, sim::myStrat, pose_config, recentAvgEventSparsity, localStat::SetMaximums(), sparsityCalcCount, sparsityStartTime, Event::srt, POSE_Config::stats, strat::STRAT_T, Event::svt, theLocalStats, Event::timestamp, tsCommitDiffs, tsDiffCount, and localStat::WriteDopData().

Referenced by CommitEvents().

Here is the call graph for this function:

Here is the caller graph for this function:

void eventQueue::InsertEvent ( Event e  ) 

Insert e in the queue in timestamp order.

If executed events with same timestamp exist, insert e at the back of these, returns 0 if rollback necessary, 1 otherwise.

Definition at line 71 of file evq.C.

References backPtr, currentPtr, POSE_Config::deterministic, Event::done, eqh, eventCount, Event::evID, EqHeap::InsertEvent(), InsertEventDeterministic(), largest, Event::next, pose_config, Event::prev, sanitize(), SetRBevent(), Event::timestamp, and tsOfLastInserted.

Here is the call graph for this function:

void eventQueue::InsertEventDeterministic ( Event e  ) 

Insert e in the queue in timestamp order.

If executed events with same timestamp exist, sort e into them based on eventID, returns 0 if rollback necessary, 1 otherwise.

If executed events with same timestamp exist, sort e into them based on eventID

Definition at line 118 of file evq.C.

References backPtr, currentPtr, Event::done, eqh, eventCount, Event::evID, EqHeap::InsertEvent(), largest, Event::next, Event::prev, sanitize(), SetRBevent(), and Event::timestamp.

Referenced by InsertEvent().

Here is the call graph for this function:

Here is the caller graph for this function:

Event* eventQueue::front (  )  [inline]

Return front pointer.

Definition at line 62 of file evq.h.

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

Here is the caller graph for this function:

Event* eventQueue::back (  )  [inline]

Return back pointer.

Definition at line 64 of file evq.h.

Referenced by con::CancelEvents(), and opt::Rollback().

Here is the caller graph for this function:

void eventQueue::ShiftEvent (  )  [inline]

Move currentPtr to next event in queue.

If no more events, take one from heap

Definition at line 67 of file evq.h.

Referenced by con::CancelEvents(), 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:

void eventQueue::CommitEvents ( sim obj,
POSE_TimeType  ts 
)

Commit (delete) events before target timestamp ts.

Commit (delete) all events

Commit (delete) all events that are done (used in sequential mode)

Change currentPtr to point to event e

Delete event and reconnect surrounding events in queue

Dump the event queue

Dump the event queue to a string

Pack/unpack/sizing operator

Check validity of data fields

Definition at line 230 of file evq.C.

References backPtr, sim::basicStats, CmiAbort(), CommitAll(), Event::commitBfr, Event::commitBfrLen, CommitDoneEvents(), Event::commitErr, CommitStatsHelper(), Event::cpData, currentPtr, DeleteEvent(), Event::done, EqHeap::dump(), eventID::dump(), dump(), EqHeap::dumpString(), dumpString(), TimePool::empty_recycle_bin(), eqh, eventCount, Event::evID, FindLargest(), Event::fnIdx, frontPtr, EqHeap::GetAndRemoveTopEvent(), eventID::getPE(), eventID::id, PUP::er::isUnpacking(), largest, localTimePool, mem_usage, Event::msg, Event::next, sim::objID, p, POSE_endtime, POSE_UnsetTS, Event::prev, EqHeap::pup(), Event::pup(), pup(), RBevent, recentAvgEventSparsity, sim::ResolveCommitFn(), EqHeap::sanitize(), Event::sanitize(), sanitize(), Event::serialCPdata, TimePool::set_min_time(), SetCurrentPtr(), snprintf(), sparsityCalcCount, sparsityStartTime, Event::spawnedList, Event::timestamp, TimePool::tmp_free(), EqHeap::top, tsOfLastInserted, and rep::usesAntimethods().

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

Here is the call graph for this function:

Here is the caller graph for this function:

void eventQueue::CommitAll ( sim obj  ) 

Commit (delete) all events.

Referenced by CommitEvents().

Here is the caller graph for this function:

void eventQueue::CommitDoneEvents ( sim obj  ) 

Commit (delete) all events that are done (used in sequential mode).

Referenced by CommitEvents(), and seq::Step().

Here is the caller graph for this function:

void eventQueue::SetCurrentPtr ( Event e  ) 

Change currentPtr to point to event e.

Be very very careful with this -- avoid using if possible

Referenced by CommitEvents(), and opt::Rollback().

Here is the caller graph for this function:

void eventQueue::DeleteEvent ( Event ev  ) 

Delete event and reconnect surrounding events in queue.

Referenced by con::CancelEvents(), CommitEvents(), and opt::Rollback().

Here is the caller graph for this function:

const eventID& eventQueue::CurrentEventID (  )  [inline]

Return the event ID of the event pointed to by currentPtr.

Definition at line 102 of file evq.h.

void eventQueue::AddSpawnToCurrent ( int  id,
eventID  e,
POSE_TimeType  ts 
) [inline]

Add id, e and ts as an entry in currentPtr's spawned list.

The poser e was sent to is id

Definition at line 105 of file evq.h.

Referenced by opt::AddSpawnedEvent().

Here is the caller graph for this function:

SpawnedEvent* eventQueue::GetNextCurrentSpawn (  )  [inline]

Return the first entry in currentPtr's spawned list and remove it.

Definition at line 112 of file evq.h.

References SpawnedEvent::next.

void eventQueue::FindLargest (  )  [inline]

Find the largest timestamp of the unexecuted events.

Definition at line 118 of file evq.h.

References POSE_UnsetTS.

Referenced by CommitEvents(), and opt::Rollback().

Here is the caller graph for this function:

void eventQueue::SetRBevent ( Event e  )  [inline]

Set rollback point to event e.

Definition at line 125 of file evq.h.

References POSE_Config::deterministic, Event::evID, pose_config, and Event::timestamp.

Referenced by InsertEvent(), and InsertEventDeterministic().

Here is the caller graph for this function:

void eventQueue::dump (  ) 

Dump the event queue.

Referenced by CommitEvents(), and sim::dump().

Here is the caller graph for this function:

char* eventQueue::dumpString (  ) 

Dump the event queue to a string.

Referenced by CommitEvents().

Here is the caller graph for this function:

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

Pack/unpack/sizing operator.

Referenced by CommitEvents(), and sim::pup().

Here is the caller graph for this function:

void eventQueue::sanitize (  ) 

Check validity of data fields.

Referenced by CommitEvents(), eventQueue(), InsertEvent(), and InsertEventDeterministic().

Here is the caller graph for this function:


Field Documentation

Sentinel nodes.

Definition at line 15 of file evq.h.

Referenced by CommitEvents(), eventQueue(), and ~eventQueue().

Definition at line 15 of file evq.h.

Referenced by CommitEvents(), eventQueue(), InsertEvent(), and InsertEventDeterministic().

Heap of unexecuted events.

Definition at line 21 of file evq.h.

Referenced by con::CancelEvents(), CommitEvents(), eventQueue(), InsertEvent(), InsertEventDeterministic(), opt::Rollback(), and ~eventQueue().

Largest unexecuted event timestamp in queue.

Definition at line 23 of file evq.h.

Referenced by CommitEvents(), eventQueue(), InsertEvent(), and InsertEventDeterministic().

number of unexecuted events in the queue

Definition at line 25 of file evq.h.

Referenced by CommitEvents(), eventQueue(), InsertEvent(), InsertEventDeterministic(), and opt::Rollback().

Timestamp of the last event inserted in the queue.

Definition at line 27 of file evq.h.

Referenced by CommitEvents(), eventQueue(), InsertEvent(), and seq::Step().

Keep track of last logged VT for this object so no duplicates are logged.

Definition at line 31 of file evq.h.

Referenced by CommitStatsHelper(), and eventQueue().

Average sparsity of recently committed events (in GVT ticks / event).

Definition at line 33 of file evq.h.

Referenced by CommitEvents(), CommitStatsHelper(), and eventQueue().

Timestamp of the first event for the sparsity calculation.

Definition at line 35 of file evq.h.

Referenced by CommitEvents(), CommitStatsHelper(), and eventQueue().

Sparsity calculation counter.

Definition at line 37 of file evq.h.

Referenced by CommitEvents(), CommitStatsHelper(), and eventQueue().

Counts the differences examined; used for timeleash calculation in adapt5.

Definition at line 39 of file evq.h.

Referenced by CommitStatsHelper(), and eventQueue().

The timestamp of the last committed event.

Definition at line 41 of file evq.h.

Referenced by CommitStatsHelper(), and eventQueue().

The largest timestamp differences at commit time; used for timeleash calculation in adapt5.

Definition at line 43 of file evq.h.

Referenced by CommitStatsHelper(), and eventQueue().

Definition at line 45 of file evq.h.

Referenced by CommitEvents(), and eventQueue().


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

Generated on Mon Sep 21 08:23:27 2020 for Charm++ by  doxygen 1.5.5