Simpatico
v1.10
|
2.9 Run-Time Options (Prev) 2.11 Multi-System Simulations (Next)
All simpatico simulation programs can be restarted from a binary restart file, if such a restart files was output periodically during the original simulation. The option to restart is designed to allow a user to either recover from a failure (caused, e.g., by a hardware failure or a wall-clock limit on a queue) or to continue a simulation that completed successfully.
A restart file preserves the full internal state of a simulation. This includes a great deal of information that is not preserved in a configuration file, including the internal state of statistical accumulators used by on-the-fly analyzers, the internal state of some MD integrators that are based on an extended dynamical system (e.g., Nose-Hoover), and the state of the random number generator. It is designed to allow the simulation to continue as if had not been interrupted.
For a simulation to be restartable, the original run periodically write a restart file. Each time a restart file is written, the previous version of the file is overwritten, so that only the most recent verion is available at any instant. The interval (number of time steps) between subsequent file writes is given in the parameter file by an integer parameter named "saveInterval". Output of the restart file may be completely suppressed by setting this parameter to zero. If saveInterval is not zero, the name of the output file is given by a string parameter "saveFileName."
In parameter files for mcSim or mdSim simulations, the parameters "saveInterval" and (if present) "saveFileName" are the last parameters in main block of the parameter file. They appear just before the closing bracket of the main block, and just after the closing bracket of the AnalyzerManager block. For example, an mcSim or mdSim parameter file that requires the restart file to be written every 10000 time steps to a file named "restart" would thus look in part like this
where ellipses (...)indicate omitted parts of the file. If saveInterval is set to 0, output of restart file is suppressed. In this case, the "saveFileName" parameter must be omitted. The parameter file for an mdSim simulation with no restart file output would thus look like this:
In parameter files for ddSim simulations, the parameters saveInterval and (if present) saveFileName appear within the integrator parameter file block. For example, the relevant part of the parameter file for a simulation that write a file named restart.rst every 10000 steps, using a DdMd::NveIntegator, would look like this:
As for mcSim and mdSim simulations, writing of restart files may be suppressed by setting saveInterval to 0 and omitting the saveFileName parameter.
When a simulation is restarted, it first reads the restart (*.rst) file to recreate the internal state of the simulation, and then begins reading a separate command file. The name of the command file for a restarted simulation must begin with the same base name as the corresponding *.rst restart file, followed by a file extension ".cmd" (for "command"). For example, these two files might be named "restart.rst" and "commands.rst". Because the paths to the restart (*.rst) file and command (*.cmd) file can only differ by the file extension, they must be in the same directory. For either single-processor or parallel MD simulations of a single system, both files are normally in the directory from which the program is executed.
The first line of command file for a restarted simulation must contain a RESTART command. The RESTART takes an integer argument, which is the desired final value of the step counter. This command causes the simulation to re-enter the main simulation loop at the point at which the restart file was written, with the step counter set to the value it had when that file was written, and then run until the counter reaches the final value given as an argument to RESTART command. The RESTART command may be followed by any number of other commands. As in any command file, the last command must be a "FINISH" command, which terminates execution.
For example, command file required to restart a simulation and continue until the step counter reaches 150000, and then terminate, would thus look like this:
Other commands may also appear before the initial RESTART command and the final FINISH command, in order to, e.g., write the final configuration to a configuration file, or change parameters and run another simulation.
The RESTART command is only valid in a simulation that was executed using the -r command line option, in which case it must be the first line of the command file.
To restart a simulation, one must thus invoke the mcSim, mdSim, or ddSim executable with the -r option, passing it the name of a restart file as an argument. The name of the command file is passed as an argument to the -c option, as usual. Thus, for example, if a previous mcSim MC simulation were run using a base name of "restart" for the saveFileName, and the restart command file is named commands.rst, one could type
to restart the simulation. In the above example, the -r option would cause the program to read a file named restart.rst to initialize the simulation, and then execute the commands in a file named commands.rst. The same command line syntax is used for all three programs.
To restart a ddSim simulation, one must, of course, also launch an MPI environment. To continue simulation that uses 8 processors, using a restart named restart and and command file named commands.rst, one might thus enter:
To continue a ddSim simulation, the number of processors must be the same as that used in the original simulation.
The -r option may be combined with the -e option. This causes parameters that would normally be read from the parameter file to be echoed to standard output as they are read from the restart file.
2.9 Run-Time Options (Prev) 2 User Guide (Up) 2.11 Multi-System Simulations (Next)