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): 1) 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 2) 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. 3) 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 4) 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. 5) 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 6) 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.\*. 7) 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 8) 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 9) 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 10) 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 * relates #1781 * relates #2169 * Changesets: * Revision 07d120957728dd271752128113b58b45f6b8e194 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 ```
issue