# Problems in restarting simulation

**URL:** <https://gromacs.bioexcel.eu/t/problems-in-restarting-simulation/447>\
**Category:** User discussions\
**Created:** [July 8, 2020, 8:23pm UTC](https://gromacs.bioexcel.eu/t/problems-in-restarting-simulation/447 "2020-07-08T20:23:44Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![qweqwe](https://avatars.discourse-cdn.com/v4/letter/q/8e7dd6/32.png) [@qweqwe](https://gromacs.bioexcel.eu/u/qweqwe)\
**Post date:** [July 8, 2020, 8:23pm UTC](https://gromacs.bioexcel.eu/t/problems-in-restarting-simulation/447/1 "2020-07-08T20:23:44Z")

</div>

GROMACS version: 2016.3  
GROMACS modification: Yes/No  
Here post your question

Hi everyone,

I am restarting my simulation from the last point in my trajectory. As I want to sample steps with more frequency for the simulation after restart I have to supply a new mdp file and use these commands as mentioned in the manual::

gmx\_mpi grompp -f tmp.mdp -p water.top -t c.cpt -c confout.gro -o new.tpr  
gmx\_mpi mdrun -s new.tpr -cpi c.cpt -ntomp 1 -v -deffnm cnt -reprod -noappend

The simulation runs to infinity after mdrun and the output on the screen is –

WARNING: This run will generate roughly 641868500016085376 Mb of data  
300 steps, infinite ps (continuing from step 1000000, 1000.0 ps).

However supplying mdrun with only tpr file and without cpt file helps prevent this and runs only for the desired steps.

Output is -:  
300 steps, 0.3 ps.

I am storing data at 1 fs interval, earlier I was storing it every 100 fs and I am using Gromacs/2016.3 .

Running gmx check on the c.cpt file I obtain

Last frame -1 time 1000.000

Item #frames Timestep (ps)  
Step 1  
Time 1  
Lambda 1  
Coords 1  
Velocities 1  
Forces 0  
Box 1

What sequence of steps should I use in order to sample my restart simulation at a different frequency ?

Thnx everyone

---

<div class="post-metadata">

**Author:** ![Dr\_DBW](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/dr_dbw/32/42_2.png) [@Dr\_DBW](https://gromacs.bioexcel.eu/u/Dr_DBW)\
**Post date:** [July 8, 2020, 10:04pm UTC](https://gromacs.bioexcel.eu/t/problems-in-restarting-simulation/447/2 "2020-07-08T22:04:29Z")

</div>

[http://manual.gromacs.org/documentation/current/user-guide/managing-simulations.html#changing-mdp-options-for-a-restart](http://manual.gromacs.org/documentation/current/user-guide/managing-simulations.html#changing-mdp-options-for-a-restart)

---

<div class="post-metadata">

**Author:** ![qweqwe](https://avatars.discourse-cdn.com/v4/letter/q/8e7dd6/32.png) [@qweqwe](https://gromacs.bioexcel.eu/u/qweqwe)\
**Post date:** [July 9, 2020, 11:03am UTC](https://gromacs.bioexcel.eu/t/problems-in-restarting-simulation/447/3 "2020-07-09T11:03:47Z")

</div>

I had gone through this and used the commands mentioned in “Changing mdp options for a restart” as mentioned above but still could not figure out why i am running into an infinite simulation . How should i use the checkpoint file with mdrun ?

---

<div class="post-metadata">

**Author:** ![jalemkul](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/jalemkul/32/18_2.png) [@jalemkul](https://gromacs.bioexcel.eu/u/jalemkul)\
**Post date:** [July 9, 2020, 12:09pm UTC](https://gromacs.bioexcel.eu/t/problems-in-restarting-simulation/447/4 "2020-07-09T12:09:41Z")

</div>

The infinite time probably comes from failing to set `tinit` as the information in the link notes. Without your `.mdp` file, we can’t be sure.

The syntax for `grompp` and `mdrun` is exactly as shown in that link. That’s how you make use of the checkpoint file.

---

<div class="post-metadata">

**Author:** ![qweqwe](https://avatars.discourse-cdn.com/v4/letter/q/8e7dd6/32.png) [@qweqwe](https://gromacs.bioexcel.eu/u/qweqwe)\
**Post date:** [July 11, 2020, 7:37am UTC](https://gromacs.bioexcel.eu/t/problems-in-restarting-simulation/447/5 "2020-07-11T07:37:35Z")

</div>

Thnx @jalemkul , @Dr_DBW .  
According to the above replies ,  
I tried all possible combinations to restart my simulation from 1000 ps to 1000.3 ps (  
1000000 to 1000300 steps).

1.nsteps = 300 tinit = 0 ps init-step = 0

OUTPUT --\> 300 steps, infinite ps (continuing from step 1000000, 1000.0 ps).

0th step on log file --\>

Step Time  
1000000 1000.00000

1. nsteps = 300 tinit = 1000 ps init-step = 0

OUTPUT --\> 300 steps, infinite ps (continuing from step 1000000, 1000.0 ps).

0th step on log file --\>

Step Time  
1000000 2000.00000

1. nsteps = 300 tinit = 0 ps init-step = 1000000

OUTPUT --\> 1000300 steps, 1000.3 ps (continuing from step 1000000, 1000.0 ps).

0th step on log file --\>

Step Time  
1000000 1000.00000

1. nsteps = 300 tinit = 1000 ps init-step = 1000000

OUTPUT --\> 1000300 steps, 1000.3 ps (continuing from step 1000000, 1000.0 ps).

0th step on log file --\>

Step Time  
1000000 2000.00000

The 3rd simulation began and ended at the desired time and correct number of steps.

Is this the correct way to restart the simulation mentioning both the beginning time and the number of steps ?

The mdp file is pasted below --\>

; Define can be used to control processes  
define = -DPOSRES

; Parameters describing what to do, when to stop and what to save  
integrator = md-vv ; Algorithm  
nsteps = 300 ; Maximum number of (minimization) steps to perform(10 ns)  
init-step = 1000000 ;  
dt = 0.001 ; time step(1 fs or .001 ps)  
nstfout = 1 ;  
nstxout = 1 ;  
nstvout = 1 ;  
nstlog = 1 ;  
nstenergy = 1 ; Write energies to disk every nstenergy steps  
nstcalcenergy = 10 ;  
nstxout-compressed = 1 ;  
energygrps = SOL ; Which energy group(s) to write to disk

;NVE  
nstcomm = 10 ; frequency for center of mass motion removal  
comm-mode = Linear ; remove com translation and rotation around com  
comm-grps = SOL ; group(s) for center of mass motion removal

;SEARCHLIST  
cutoff-scheme = Verlet ;  
nstlist = 10 ; Frequency to update the neighbor list(default)  
ns\_type = grid ; Method to determine neighbor list (simple, grid)  
pbc = xyz ;  
verlet-buffer-tolerance = 0.005 ; maximum error for pair interactions per particle(default)

;USING LJ-PME  
coulombtype = PME  
vdwtype = PME

rlist = 1.4  
rvdw = 1.4  
rcoulomb = 1.4  
fourierspacing = 0.12  
pme-order = 4  
ewald-rtol-lj = 0.001  
lj-pme-comb-rule = geometric  
DispCorr = Ener

;BOND CONSTRAINTS  
continuation = yes ; Continue NVT after the box has been resized  
constraints = h-bonds ; Bond types to replace by constraints  
constraint\_algorithm = shake ;

;Velocity generation  
gen-vel = no ;  
gen-temp = 298 ;

Thnx everyone

---

<div class="post-metadata">

**Author:** ![Dr\_DBW](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/dr_dbw/32/42_2.png) [@Dr\_DBW](https://gromacs.bioexcel.eu/u/Dr_DBW)\
**Post date:** [July 13, 2020, 11:11am UTC](https://gromacs.bioexcel.eu/t/problems-in-restarting-simulation/447/6 "2020-07-13T11:11:20Z")

</div>

As noted at [http://manual.gromacs.org/documentation/current/user-guide/mdp-options.html#mdp-init-step](http://manual.gromacs.org/documentation/current/user-guide/mdp-options.html#mdp-init-step) `t = tinit + dt * (init-step + i)` to get the correct starting time of `t=1000` for your extension you have to set `tinit=0`, `init-step=1000000`, `dt=0.001`.
