Previous: Interactive mode, Up: Tips


7.2 Scripting

Long simulations. Q: If I have a simulation that is supposed to run infinitely, deadlock-free, with the cycle command how do I check it non-interactively? (By now you've figured out that in interactive mode, you can interrupt the simulation with Ctrl-C to give you back the command prompt, or equivalently, send the process a SIGINT signal.)

A: Instead of cycle, use advance or step or step-event to run for a finite time. Upon completion of the command, however, one typically wants to verify that the system did not deadlock. assert-queue will error out if the event queue is empty.

Checkpointing. You can manually save a checkpoint at any time using the save command, and restore to using the load command. You can also have the simulator automatically take a checkpoint upon exit, regardless of the exit status by using:

     autosave on FILENAME

This is particularly useful for analyzing failed simulations that stop in some unexpected manner. After a failed run, you have a checkpoint that takes you right to the moment of failure for further examination.