#include <chpt.h>
Public Member Functions | |
chpt () | |
Basic Constructor. | |
virtual | ~chpt () |
Destructor. | |
void | registerTimestamp (int idx, eventMsg *m, POSE_TimeType offset) |
Timestamps event message, sets priority, and records in spawned list. | |
void | checkpoint (StateType *data) |
Checkpoint the state. | |
void | restore (StateType *data) |
Restore the state from a checkpoint. | |
virtual void | pup (PUP::er &p) |
Pack/unpack/sizing operator. | |
virtual void | dump () |
Dump all data fields. | |
Data Fields | |
int | sinceLast |
This class makes it possible for optimistic synchronization strategies to automatically checkpoint objects of classes derived from this type.
Definition at line 9 of file chpt.h.
void chpt< StateType >::registerTimestamp | ( | int | idx, | |
eventMsg * | m, | |||
POSE_TimeType | offset | |||
) | [inline, virtual] |
Timestamps event message, sets priority, and records in spawned list.
Reimplemented from rep.
Definition at line 33 of file chpt.h.
References eventMsg::evID, rep::myStrat, rep::ovt, rep::parent, POSE_TimeMax, sim::registerSent(), eventMsg::setPriority(), eventMsg::timestamp, and eventMsg::Timestamp().
void chpt< StateType >::checkpoint | ( | StateType * | data | ) | [inline] |
Checkpoint the state.
Definition at line 43 of file chpt.h.
References CkLocalBranch(), CmiAbort(), Event::cpData, strat::currentEvent, sim::eq, eventQueue::front(), rep::localTimePool, sim::myStrat, rep::myStrat, rep::parent, Event::prev, Event::serialCPdata, Event::serialCPdataSz, chpt< StateType >::sinceLast, PUP::mem::size(), PUP::sizer::size(), POSE_Config::stats, localStat::SwitchTimer(), theLocalStats, Event::timestamp, TimePool::tmp_alloc(), and rep::usesAntimethods().
void chpt< StateType >::restore | ( | StateType * | data | ) | [inline] |
Restore the state from a checkpoint.
Used during a rollback by the Undo method: if the event being undone is not the final destination, we simply remove the checkpointed data; if the event is the final target for the rollback, then we restore the data, and remove the checkpointed data for it (it will be regenerated when the target event gets re-executed).
Definition at line 95 of file chpt.h.
References CmiAbort(), Event::cpData, strat::currentEvent, rep::localTimePool, rep::myStrat, Event::serialCPdata, Event::serialCPdataSz, PUP::mem::size(), strat::targetEvent, Event::timestamp, TimePool::tmp_free(), and rep::usesAntimethods().
Pack/unpack/sizing operator.
Derived classes must provide pup
Reimplemented from rep.
Definition at line 26 of file chpt.h.
References rep::pup().
virtual void chpt< StateType >::dump | ( | ) | [inline, virtual] |
Dump all data fields.
Reimplemented from rep.
Definition at line 27 of file chpt.h.
References rep::dump().