Merge release-2019 into master
[alexxy/gromacs.git] / src / gromacs / mdrun / runner.cpp
index 0c354711d517219d46c83c8484cf60453547ab45..79ebf9fd33fc50042233446d27e68de5c780b7f6 100644 (file)
@@ -919,6 +919,18 @@ int Mdrunner::mdrunner()
 
     if (startingBehavior != StartingBehavior::NewSimulation)
     {
+        /* Check if checkpoint file exists before doing continuation.
+         * This way we can use identical input options for the first and subsequent runs...
+         */
+        if (mdrunOptions.numStepsCommandline > -2)
+        {
+            /* Temporarily set the number of steps to unmlimited to avoid
+             * triggering the nsteps check in load_checkpoint().
+             * This hack will go away soon when the -nsteps option is removed.
+             */
+            inputrec->nsteps = -1;
+        }
+
         load_checkpoint(opt2fn_master("-cpi", filenames.size(), filenames.data(), cr),
                         logFileHandle,
                         cr, domdecOptions.numCells,