Checkpoints
The checkpoint feature gives Linux users the ability to save the state of a discrete event simulation at a specific point and later restart the simulation from that point. After restart, the simulation runs exactly as if it had not been checkpointed (same number of events, same results, and so on). The only difference in a checkpointed simulation is some slow-down while checkpoints are taken.
This feature can save time in several situations. For example:
- During development, lengthy simulations that crash late in the run can be checkpointed shortly before the crash. You then can restart the simulation as often as needed to locate the problem without having to re-run the initial, working part of the simulation.
- During production, simulations with a lengthy initialization phase can be checkpointed at time 0, after the initialization is complete. You can then run as many production simulations as needed without waiting for initialization each time.
Note the following restrictions on checkpoint/restart:
- Only sequential simulations running on a single Linux computer are supported.
- All simulation files must be opened and closed using Riverbed APIs, not
fopen()orfclose(). - Memory paging is disabled automatically when checkpointing is turned on.
- At the first checkpoint in a simulation run, the checkpoints from previous runs are deleted.
- Appropriate licenses are needed to restart a simulation.
The checkpoint feature is based on Berkeley Lab Checkpoint/Restart (BLCR), developed by the Future Technologies Group at Berkeley Lab Computing Sciences. You can find additional details about this implementation at http://ftg.lbl.gov/CheckpointRestart/CheckpointRestart.shtml.
Preparing to Use Checkpoints
Before using the checkpoint feature, BLCR software (version 0.6 or later) must be installed on the computer running Modeler, as follows.
Procedure 185: Installing BLCR Software
-
Download BLCR version 0.6.1 (blcr-0.6.1.tar.gz) from the BLCR website at http://ftg.lbl.gov/CheckpointRestart/CheckpointDownloads.shtml.
-
Install BLCR on your computer using the instructions given at http://mantis.lbl.gov/blcr/doc/html/BLCR_Admin_Guide.html. The basic steps are as follows:
2.1 Install the software:
% tar zxvf blcr-0.6.1.tar.gz % cd blcr-0.6.1 % su root # ./configure # make # make install2.2 Load the kernel modules:
# /sbin/insmod /usr/local/lib/blcr/<kernel_version>/ blcr_imports.o # /sbin/insmod /usr/local/lib/blcr/<kernel_version>/ blcr_vmadump.o # /sbin/insmod /usr/local/lib/blcr/<kernel_version>/ blcr.oNote: You must reload the kernel modules after any reboot.
Checkpointing a Simulation
To checkpoint a simulation, enable checkpointing on the Checkpoint page of the Configure/Run DES dialog box and configure the feature as desired. Options include the following:
- Periodic checkpoints
- At event n
- Every n events
- At simulation time n (before entering time)
- At simulation time n (leaving time)
- Every n simulation seconds (before entering time)
- Every n simulation seconds (leaving time)
- On low memory
- Number of checkpoints to keep
- Stop or continue the simulation after taking a checkpoint
You can use checkpoints when running a simulation from the command line. To do so, use the following preferences:
- “des.checkpoint.enabled” – Set to TRUE to enable checkpointing.
- “des.checkpoint.autogen” – Specifies when periodic checkpoints should be taken.
- “des.checkpoint.continue” – When FALSE, terminates the simulation after taking a checkpoint.
- “des.checkpoint.keep_last” – Specifies how many checkpoints to keep. Set to 0 to keep all.
- “des.checkpoint.lowmem” – When TRUE, specifies that a checkpoint should be taken when a memory allocation fails.
- “des.checkpoint.verbose” – When TRUE, specifies that detailed checkpoint messages should be generated.
You can programmatically force a checkpoint to be taken with op_sim_checkpoint().
Restarting a Simulation
You can restart a checkpointed simulation from the GUI or the command line.
Procedure 186: Restarting from the GUI
- Choose DES > Restart Discrete Event Simulation.
- Select the desired checkpoint from the list of checkpoints for the current scenario and click OK.
- If desired, enter a new random seed, then click OK.
Procedure 187: Restarting from the Command Line
-
At a command prompt, enter:
op_sim_restart <checkpoint_directory>where
<checkpoint_directory>is of the form<project>-<scenario>-c<#>.i1.desckpt.dir