next up previous contents
Next: SUNTANS Examples Up: SUNTANS User Guide Stanford Previous: Specifying heat flux   Contents

Restarting Runs

It is always a good idea to design production-scale runs so that at any point in time if your job crashes you can restart it without having lost too much data. At the end of a run, SUNTANS outputs the restart file specified by StoreFile in suntans.dat. To restart a run using this restart file, you need to copy this file into the file specified by StartFile in suntans.dat. This reads the data required to continue a run. For example, at the end of a two-processor run in which the StoreFile variable is set to store.dat, two restart files are created for each processor, namely store.dat.0 and store.dat.1. To restart this run, set the entry for StartFile in suntans.dat to start.dat and copy StoreFile to StartFile for each processor, i.e. copy the contents of store.dat.0 to start.dat.0 and store.dat.1 to start.dat.1.

Since the new output data from the restart run will overwrite any existing data from a previous run, it is a good idea to create a new directory for each restart run and copy the restart files into that directory. Each run requires the suntans.dat file as well as other files for the grid as well, but rather than copy these over to the new directory, it is best to create links to the already existing files in order to save disk space. In order for the restart run to proceed, links must be created for each of these files (or copies):

where np corresponds to each processor id. Considering the previous example, to restart a run one might create a new directory called run2. Then links could be made to the existing files with
ln -s suntans.dat run2/suntans.dat
ln -s celldata.dat.0 run2/celldata.dat.0
ln -s celldata.dat.1 run2/celldata.dat.1
ln -s edgedata.dat.0 run2/edgedata.dat.0
ln -s edgedata.dat.1 run2/edgedata.dat.1
ln -s topology.dat.0 run2/topology.dat.0
ln -s topology.dat.1 run2/topology.dat.1
ln -s vertspace.dat run2/vertspace.dat
and then restarting SUNTANS (after copying the store files into run2) with
mpirun -np 2 sun -s -r --datadir=./run2
where the r flag indicates a restart run. An alternative method to perform a restart is to create a new directory and then alter the entries in suntans.dat so that the output files are specified by their full rather than relative paths. For example, to set the output directory so that SUNTANS outputs the free surface to the new directory run2, the entry for FreeSurfaceFile in suntans.dat could be changed from
FreeSurfaceFile   	fs.dat
FreeSurfaceFile   	run2/fs.dat

next up previous contents
Next: SUNTANS Examples Up: SUNTANS User Guide Stanford Previous: Specifying heat flux   Contents