26.08.2013 Views

3.1 MB - Evernote

3.1 MB - Evernote

3.1 MB - Evernote

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

66<br />

Implementation<br />

provisional simulation end. In this case no future rollback could occur that can undo the<br />

provisional simulation end, which is therefore guaranteed. If the GVT calculation<br />

confirms a simulation end then no GVT is send back to the LPs but instead the<br />

Simulation Controller calls the method endOfSimulationByTransaction() of all LPs as<br />

shown in Figure 15 of section 5.2.3.<br />

5.3.3 State Saving and Rollbacks<br />

Optimistic synchronisation algorithms execute all local events without guarantee that<br />

additional events received later will not violate the causal order of events already<br />

execute. In order to correct such causal violations they have to provide means to restore<br />

a past state before the causal violation occurred so that the new event can be inserted<br />

into the event chain and the events be executed again in the correct order. A common<br />

technique to allow the restoration of past states is called State Saving or State<br />

Checkpointing where an LP saves the state of the simulation into a list of simulation<br />

states each time the state changes or in defined intervals.<br />

The parallel simulator implemented employs a relatively simple state saving scheme.<br />

Each time the simulation time is incremented the LP serialises the state of the<br />

Simulation Engine and saves it together with the corresponding simulation time into a<br />

state list. Each state record therefore describes the simulation state at the beginning of<br />

that time, i.e. before any Transactions were moved. To keep the complexity of this<br />

solution low the standard object serialisation functionality provided by Java is used to<br />

serialise and deserialise the state to and from a Stream object that is then stored in the<br />

state list. The state list keeps all states sorted by their time. The saving of the state is<br />

implemented in the method saveCurrentState() of the LogicalProcess class.<br />

The purpose of saving the simulation state is to allow LPs to rollback to past simulation<br />

states if required. The functionality to rollback to a past simulation state is implemented<br />

in the method rollbackState(). Using the example shown in Figure 22 the principle of<br />

rolling back to a past simulation state is briefly explained.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!