Teach mdrun about explicit -append - Redmine #1777
In all cases below, I run
gmx mdrun -deffnm first -nsteps 100
gmx convert-tpr -s first -extend 1 -o second
as the sole preparation for mdrun in an empty directory (but I repeat those commands for clarity):
gmx mdrun -deffnm first -nsteps 100
gmx convert-tpr -s first -extend 1 -o second
gmx mdrun -s second -deffnm second
writes second.* output files starting from step 0, which is fine
gmx mdrun -deffnm first -nsteps 100
gmx convert-tpr -s first -extend 1 -o second
gmx mdrun -s second -deffnm second -append
does the same as 1), which is not necessarily fine. Presumably this is
because -append
is the default and we haven’t taught mdrun how to know
that the user explicitly asked for appending. mdrun can’t tell whether
the use of -deffnm
or -append
(or missing files) is the error, so we
should kick that decision back to the user.
gmx mdrun -deffnm first -nsteps 100
gmx convert-tpr -s first -extend 1 -o second
gmx mdrun -s second -deffnm second -cpi first
writes second.* output files, starting from step 100, which is fine
gmx mdrun -deffnm first -nsteps 100
gmx convert-tpr -s first -extend 1 -o second
gmx mdrun -s second -deffnm second -cpi first -append
does the same as 3), which is not necessarily fine. Similarly, mdrun
can’t tell whether the use of -deffnm
, -cpi
or -append
(or missing
files) is the error, so we should kick that decision back to the user.
gmx mdrun -deffnm first -nsteps 100
gmx convert-tpr -s first -extend 1 -o second
gmx mdrun -s second -append
writes output files with default names, starting from step 0, again not fine because mdrun doesn’t know where the error happened
gmx mdrun -deffnm first -nsteps 100
gmx convert-tpr -s first -extend 1 -o second
gmx mdrun -s second -cpi first -append
writes output files with default names, starting from step 100, again not fine because mdrun doesn’t know where the error happened
At https://mailman-1.sys.kth.se/pipermail/gromacs.org_gmx-users/2015-July/099153.html, a new user tried to do 6), and expected the output to be appended to first.*.
gmx mdrun -deffnm first -nsteps 100
gmx convert-tpr -s first -extend 1 -o second
gmx mdrun -s second -deffnm second -cpi first -nsteps 100
gmx mdrun -s second -deffnm second -cpi second -append
starts from step 200 and appends to the existing second.* files, which is fine
gmx mdrun -deffnm first -nsteps 100
gmx convert-tpr -s first -extend 1 -o second
gmx mdrun -s second -deffnm second -cpi first -nsteps 100
gmx mdrun -s second -deffnm second -append
starts from step 0 and replaces the existing second.* files, but should give an error. That error should be different depending whether second.cpt exists
gmx mdrun -deffnm first -nsteps 100
gmx convert-tpr -s first -extend 1 -o second
gmx mdrun -s second -deffnm second -cpi first -nsteps 100
gmx mdrun -s second -deffnm second -cpi first -append
starts from step 100 and replaces the existing second.* files, but should give an error
gmx mdrun -deffnm first -nsteps 100
gmx convert-tpr -s first -extend 1 -o second
gmx mdrun -s second -deffnm second -cpi first -nsteps 100
gmx mdrun -s second -deffnm second -cpi second -nsteps 100
gmx mdrun -s second -deffnm second -cpi first -append
starts from step 100 and replaces the existing second.* files, but should give an error
https://gerrit.gromacs.org/#/c/4439/ is related, but IIRC doesn’t fix any of this
(from redmine: issue id 1777, created on 2015-07-14 by mark.j.abraham, closed on 2016-07-11)
- Relations:
- relates #1889 (closed)
- relates #1781 (closed)
- relates #2169 (closed)
- Changesets:
- Revision 07d12095 by Erik Lindahl on 2016-07-09T15:40:51Z:
Prevent fragile use cases of checkpoint appending
There are way too many ways we allow runs to be continued
and extended. We still allow the checkpoint file to be
missing (so -cpi can be used for all command lines), but
we warn if it is not found. To avoid mistakes with file
appending when restarting from checkpoints, we now require
that all previous output files must be present
(unless -noappend is used), and that the file names must
match the ones used in the previous run.
Fixes #1777.
Change-Id: Id9e89773a4a9214be6dbb76676c526e98e12bd37