|
Doing RestartsTable of contents
GeneralTo achieve an exact restart of a simulation, one must preserve all the state variables of the system. In practice, this translates into preserving coordinates, velocities, and energy components in high precision. Most of the discussion below addresses how to restart a crashed simulation in GROMACS 3.x. GROMACS 4.x is much simpler and can be dealt with first. Version 4.x (and later)With the introduction of checkpointing, the instructions given below for 3.x are partly obsolete. They should still work, but the simple cases of breaking up a long Before doing anything, back up your files! Then use mdrun -s topol.tpr -cpi state.cpt This command will continue the simulation from the point when the checkpoint file was written. Unless the In version 4.0 appending the new output files onto the old ones was not the default, so you should add the mdrun -s topol.tpr -cpi state.cpt -append And since there were no checksums, you need to make sure you append to the correct, unmodified files. If you need to generate a new Note that mdrun will write state.cpt and state_prev.cpt files. As you can see from their time stamps, one was written approximately at the checkpoint interval before the other (15 mins by default). Or you can use gmxcheck to see what is in them. Version 3.xIn GROMACS version 3.x, there are two methods for restarting a simulation. One uses grompp and requires an .mdp file and a coordinate file (just for the atom names), and the other uses tpbconv and requires a .tpr file. To achieve a restart that preserves a simulation ensemble, both of these also require a full-precision trajectory (i.e. .trr file), and when using pressure coupling or Nosé-Hoover temperature coupling both also require an .edr file. Note that when switching from a constant-volume ensemble to a constant-pressure ensemble, you should not supply the .edr file, since the old one doesn't have the relevant terms in it, and the presence of the file on the command line means GROMACS expects such terms. Note that you will need a trajectory frame with both coordinates and velocities (and possibly energies) in order to do a restart, so consider that when choosing your Using gromppWith grompp, you need to reconsider the contents of .mdp file options like Using tpbconvWith tpbconv, use the -t and -e options to supply information from the end of your simulation, and either -extend or -until options appropriately. Read the man page! tpbconv will preserve all of the parameters in the original run input file, and things like the number of processors that were requested on the original grompp command line for the simulation. Note that the For those who are worried about the For those who are worried about the fact that their input .tpr file has velocities, as well as their input trajectory file, fear not... tpbconv creates a continuation of your run, not some bizarre hybrid with new positions and old velocities. After a crashYou will need to restart from a .trr frame with both positions and velocities, and if necessary an .edr frame from the same time. Whether this is possible will depend on your choices of the above .mdp file parameters. You can use gmxcheck to see which frame gives you the latest good restart. Planning for a crashWhile you'd prefer not to have one, it makes sense to choose your parameters so that you get the best value for your computer time and disk space. The first thing to ensure is that you have energies every time you have full-precision positions and velocities. The latter combination are usually fairly expensive to store, and so if you need frequent positions for analysis, you should be using Under GROMACS 4.x, checkpointing takes care of this issue, but you may wish to choose your checkpoint interval on the command line to mdrun. |