Home‎ > ‎How To's‎ > ‎Saving/Retrieving Data‎ > ‎

Saving/Restarting Warp Simulations

Full data from a Warp simulation, including all user defined variables and functions, can be saved by making a binary format "dump" of the simulation using:

dump()

By default, the dump file is created in the run directory and named top.runid (python script name if runid is not set) with the step number "iii" and ".dump" suffix appended to the name (in the parallel version the proccessorid will be also saved in the filename). To restart, simply load Warp in python and execute:

restart("runidiii.dump")

This restores Warp to the state where the dump was made and the simulation and/or analysis of results can continue from the time where the dump was made. However, the counter in the name of the cgm graphics output file of the restarted simulation will be incremented by one from the last value within the directory that the simulation is run. For example, if script.py produces script.000.cgm, then the restarted run will send subsequent output to script.001.cgm.  

Dumps from successive Warp runs can be read in to make overlay plots by reading in saved dump files from the runs before (overlay) plotting the desired case from a controlling Warp simulation. Alternative techniques to make overlay plots saving limited data are described in Saving Warp Data.

Saving simulation data long-term with full dumps can encounter problems if the compiled version of the code changes significantly from the version where the data was saved; particularly when variable names and array dimensions change.

Dumps can also be made to save a limited amount of data rather than the full simulation by passing a list of all attribute or group names to save using the attr option in dump. For example, to save history data only:

dump(attr="Hist")

Generally, this procedure is not recommended. When saving limited amounts of data for extended time, it is is preferable to use binary and ascii text save options outlined in Saving Warp Data.

Changing the dump file name/directory

The file name for a dump can be changed by using the prefix and suffix options. For example

dump(prefix="dumps/",suffix="_target")

will create the file dumps/runid008000_target.dump. This way files can also be saved in other directories. To restart you would then use:

restart("dumps/runid008000_target.dump")

See documentation in dump() and restart() for information on options. 

Comments