# Best way for extending molecular dynamics simulation

**URL:** <https://gromacs.bioexcel.eu/t/best-way-for-extending-molecular-dynamics-simulation/5242>\
**Category:** User discussions\
**Created:** [November 14, 2022, 11:07am UTC](https://gromacs.bioexcel.eu/t/best-way-for-extending-molecular-dynamics-simulation/5242 "2022-11-14T11:07:57Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![aysebercinb](https://avatars.discourse-cdn.com/v4/letter/a/5daacb/32.png) [@aysebercinb](https://gromacs.bioexcel.eu/u/aysebercinb)\
**Post date:** [November 14, 2022, 11:07am UTC](https://gromacs.bioexcel.eu/t/best-way-for-extending-molecular-dynamics-simulation/5242/1 "2022-11-14T11:07:57Z")

</div>

GROMACS version:2020.4  
Hello everyone,

I want to ask to extend my molecular dynamics simulation. I’ve searched the forum before but I’ve seen different answers about this and I want to be sure before doing extended simulation.

I have a 1 µs long completed MD trajectory, I want to extend this simulation to 2 µs. I want to start the new simulation from the end of the first simulation, as a continuation. I also want to append the extended simulation to my previous simulation.

I’ve seen these two sets of commands for this:

1st:  
(By editing tpr file)  
gmx convert-tpr -s complex.tpr -extension 1000000 -o complex\_new.tpr  
gmx mdrun -deffnm complex\_new -cpi complex.cpt -append

2nd:  
(by editing the md.mdp file for 2µs simulation)  
gmx grompp -f md.mdp -c complex.gro -p complex.top -o complex\_new.tpr  
gmx mdrun -deffnm complex\_new -append -cpi complex.cpt

Which is the most reliable way? My simulations are too long and I hesitate to do anything wrong.

I’m waiting for your help.

Bests,

---

<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:** [November 14, 2022, 11:27am UTC](https://gromacs.bioexcel.eu/t/best-way-for-extending-molecular-dynamics-simulation/5242/2 "2022-11-14T11:27:31Z")

</div>

Use `convert-tpr`. You only ever need to invoke `grompp` when you are changing something about the `.mdp` options. Note that the `convert-tpr` option is `-extend`, not `extension`.

---

<div class="post-metadata">

**Author:** ![aysebercinb](https://avatars.discourse-cdn.com/v4/letter/a/5daacb/32.png) [@aysebercinb](https://gromacs.bioexcel.eu/u/aysebercinb)\
**Post date:** [November 15, 2022, 1:37pm UTC](https://gromacs.bioexcel.eu/t/best-way-for-extending-molecular-dynamics-simulation/5242/3 "2022-11-15T13:37:56Z")

</div>

Thank you very much. Indeed, in the second command set includes changing mdp file and running the simulation from checkpoint.

_gmx convert-tpr -s complex.tpr -extend 1000000 -o complex\_new.tpr_  
_gmx mdrun -deffnm complex\_new -cpi complex.cpt -append_

You recommend this one, thanks again.

---

<div class="post-metadata">

**Author:** ![aysebercinb](https://avatars.discourse-cdn.com/v4/letter/a/5daacb/32.png) [@aysebercinb](https://gromacs.bioexcel.eu/u/aysebercinb)\
**Post date:** [November 17, 2022, 7:55pm UTC](https://gromacs.bioexcel.eu/t/best-way-for-extending-molecular-dynamics-simulation/5242/4 "2022-11-17T19:55:47Z")

</div>

Hi again,

I am not sure about appending the second simulation to the first one. In this command, I guess it is not possible because of -deffnm option.

I think appending the simulation as a continuation of the first part would be more useful for the analysis part, what do you suggest?

Thanks in advance

---

<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:** [November 17, 2022, 11:34pm UTC](https://gromacs.bioexcel.eu/t/best-way-for-extending-molecular-dynamics-simulation/5242/5 "2022-11-17T23:34:56Z")

</div>

It doesn’t matter whether you append now or not. You can concatenate trajectory and energy files after the run if you don’t do it directly with `mdrun`.

---

<div class="post-metadata">

**Author:** ![aysebercinb](https://avatars.discourse-cdn.com/v4/letter/a/5daacb/32.png) [@aysebercinb](https://gromacs.bioexcel.eu/u/aysebercinb)\
**Post date:** [December 12, 2022, 10:21am UTC](https://gromacs.bioexcel.eu/t/best-way-for-extending-molecular-dynamics-simulation/5242/6 "2022-12-12T10:21:48Z")

</div>

Thank you very much. After this simulation, for whole part (previous 1µs simulation + extended 1 µs), how can I do image correction? Which tpr file should I use? First one (complex.tpr) or extended tpr (complex\_new.tpr) file?

---

<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:** [December 12, 2022, 6:54pm UTC](https://gromacs.bioexcel.eu/t/best-way-for-extending-molecular-dynamics-simulation/5242/7 "2022-12-12T18:54:41Z")

</div>

It doesn’t matter, the coordinates in both are the same.
