# Extend NPT equilibration

**URL:** <https://gromacs.bioexcel.eu/t/extend-npt-equilibration/9389>\
**Category:** User discussions\
**Created:** [June 14, 2024, 9:24am UTC](https://gromacs.bioexcel.eu/t/extend-npt-equilibration/9389 "2024-06-14T09:24:59Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![SP06](https://avatars.discourse-cdn.com/v4/letter/s/ecb155/32.png) [@SP06](https://gromacs.bioexcel.eu/u/SP06)\
**Post date:** [June 14, 2024, 9:24am UTC](https://gromacs.bioexcel.eu/t/extend-npt-equilibration/9389/1 "2024-06-14T09:24:59Z")

</div>

GROMACS version: 2021.4.2  
GROMACS modification: Yes/No  
Here post your question : I equilibrated (NPT) my protein-cyclohexane for 20 ns at 290K, it did not get equilibrated properly, so I want to do NPT equilibration for another 20 ns. Can I extend the previous NPT equilibration or do I need to restart the NPT for 40 ns again. If it can be extended, then kindly tell me how to do so (the commands) and which npt file to use for MD production run?

---

<div class="post-metadata">

**Author:** ![obZehn](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/obzehn/32/2629_2.png) [@obZehn](https://gromacs.bioexcel.eu/u/obZehn)\
**Post date:** [June 14, 2024, 10:52am UTC](https://gromacs.bioexcel.eu/t/extend-npt-equilibration/9389/2 "2024-06-14T10:52:46Z")

</div>

Dear @SP06,

You can (and should) extend the simulation. This can be achieved by extending the time of the simulation with `gmx convert-tpr` and then continuing the run with the flag `-cpi` in mdrun pointing at the last .cpt file of your already concluded simulation. You can find the details [here](https://manual.gromacs.org/current/user-guide/managing-simulations.html#extending-a-tpr-file).

---

<div class="post-metadata">

**Author:** ![SP06](https://avatars.discourse-cdn.com/v4/letter/s/ecb155/32.png) [@SP06](https://gromacs.bioexcel.eu/u/SP06)\
**Post date:** [June 14, 2024, 4:58pm UTC](https://gromacs.bioexcel.eu/t/extend-npt-equilibration/9389/3 "2024-06-14T16:58:58Z")

</div>

Do I need to use this command with -noappend, and then concatenate the files?

gmx convert-tpr -s npt1.tpr -extend timetoextendby -o npt2.tpr  
gmx mdrun -s npt2.tpr -cpi npt1.cpt -noappend

Then if i extend it once again to npt3.tpr, then I should use npt2.tpr and not npt1.tpr ? Then before checking pressure and density, I need to concatenate npt1.xtc, npt2.xtc and npt3.xtc right?

---

<div class="post-metadata">

**Author:** ![MagnusL](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/magnusl/32/2380_2.png) [@MagnusL](https://gromacs.bioexcel.eu/u/MagnusL)\
**Post date:** [June 15, 2024, 9:54am UTC](https://gromacs.bioexcel.eu/t/extend-npt-equilibration/9389/4 "2024-06-15T09:54:48Z")

</div>

Sometimes `-noappend` is a good idea to use (to ensure you don’t mess up what’s already finished). But in most cases I’d recommend not to use it. Then you don’t need to concatenate anything.

---

<div class="post-metadata">

**Author:** ![SP06](https://avatars.discourse-cdn.com/v4/letter/s/ecb155/32.png) [@SP06](https://gromacs.bioexcel.eu/u/SP06)\
**Post date:** [June 15, 2024, 3:26pm UTC](https://gromacs.bioexcel.eu/t/extend-npt-equilibration/9389/5 "2024-06-15T15:26:28Z")

</div>

gmx convert-tpr -s npt.tpr -extend 15000 -o npt\_1.tpr  
gmx mdrun -s npt\_1.tpr -cpi npt.cpt -append

I get the following -  
Inconsistency in user input:  
Some output files listed in the checkpoint file npt.cpt are not present or not  
named as the output files by the current program:)  
Expected output files that are present:

Expected output files that are not present or named differently:  
npt.log  
npt.xtc  
npt.edr

To keep your simulation files safe, this simulation will not restart. Either  
name your output files exactly the same as the previous simulation part (e.g.  
with -deffnm or explicit naming), or make sure all the output files are  
present (e.g. run from the same directory as the previous simulation part), or  
instruct mdrun to write new output files with mdrun -noappend. In the last  
case, you will not be able to use appending in future for this simulation.

Am I using the correct commands for extension? Even without -append and with -deffnm in the command, I get the same error as above although I have all the required .cpt, .log, .xtc and .edr files.

---

<div class="post-metadata">

**Author:** ![obZehn](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/obzehn/32/2629_2.png) [@obZehn](https://gromacs.bioexcel.eu/u/obZehn)\
**Post date:** [June 17, 2024, 6:59am UTC](https://gromacs.bioexcel.eu/t/extend-npt-equilibration/9389/6 "2024-06-17T06:59:13Z")

</div>

As @MagnusL said, appending or not is up to you, usually it is better not to do it if you do not have any specific issue in mind (e.g. data volume management).

The error you are getting is related to the name you are using. You are using the flag `-s` to specify the .tpr file you are using and the the `-cpi` flag to specify the checkpoint, but there is a mismatch between the name of the .tpr and the name of the checkpoint file (npt and npt1). The easiest solution is rename your old `npt.tpr` file to something like `npt_old.tpr` and the rename the new `npt_1.tpr` into `npt.tpr`. Then run the mdrun command with the new .tpr, this will solve the naming issue!

---

<div class="post-metadata">

**Author:** ![SP06](https://avatars.discourse-cdn.com/v4/letter/s/ecb155/32.png) [@SP06](https://gromacs.bioexcel.eu/u/SP06)\
**Post date:** [June 17, 2024, 1:06pm UTC](https://gromacs.bioexcel.eu/t/extend-npt-equilibration/9389/7 "2024-06-17T13:06:49Z")

</div>

gmx convert-tpr -s npt.tpr -extend 15000 -o npt\_1.tpr

gmx mdrun -deffnm npt\_1 -cpi npt.cpt -noappend

For the 1st extension this worked completely fine with -noappend, but again the same error occurred on the 2nd extension-

gmx convert-tpr -s npt\_1.tpr -extend 15000 -o npt\_2.tpr

gmx mdrun -deffnm npt\_2 -cpi npt\_1.cpt -noappend

After convert-tpr, can the mdrun command be used without append/noappend, as given in the documentation for extending a .tpr file (gmx convert-tpr -s previous.tpr -extend timetoextendby -o next.tpr  
gmx mdrun -s next.tpr -cpi state.cpt)

---

<div class="post-metadata">

**Author:** ![obZehn](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/obzehn/32/2629_2.png) [@obZehn](https://gromacs.bioexcel.eu/u/obZehn)\
**Post date:** [June 18, 2024, 8:10am UTC](https://gromacs.bioexcel.eu/t/extend-npt-equilibration/9389/8 "2024-06-18T08:10:31Z")

</div>

Yes, it can, just keep the nomenclature consistent. If you change the name at every new .tpr extension then I guess - if you want to keep using the new name and append the output - you will have to point at each output file from the previous run with the [mdrun](https://manual.gromacs.org/current/onlinehelp/gmx-mdrun.html) flags. I would just keep the names consistent, though.

---

<div class="post-metadata">

**Author:** ![SP06](https://avatars.discourse-cdn.com/v4/letter/s/ecb155/32.png) [@SP06](https://gromacs.bioexcel.eu/u/SP06)\
**Post date:** [June 24, 2024, 9:50pm UTC](https://gromacs.bioexcel.eu/t/extend-npt-equilibration/9389/9 "2024-06-24T21:50:58Z")

</div>

After the first npt equilibration I got the following files : - npt.tpr, npt.edr, npt.cpt, npt.gro, npt.xtc, npt\_prev.cpt.  
I extended the equilibration (with -noappend) and have files : -  
npt\_1.tpr  
npt\_1\_prev.cpt  
npt\_1.part0002.gro  
npt\_1.part0002.edr  
npt\_1.part0002.xtc  
npt\_1.part0002.log

For the production run which npt.gro and npt.cpt files do I need to use. Or if concatenation needed, how to concatenate .gro and .cpt files ?

---

<div class="post-metadata">

**Author:** ![obZehn](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/obzehn/32/2629_2.png) [@obZehn](https://gromacs.bioexcel.eu/u/obZehn)\
**Post date:** [June 25, 2024, 8:20am UTC](https://gromacs.bioexcel.eu/t/extend-npt-equilibration/9389/10 "2024-06-25T08:20:53Z")

</div>

Please do not duplicate topics in the forum, you already have this thread open!

The .cpt files are checkpoint files, that is, they store the complete information of a run at the end of it (or at the moment the file was written) and you need them to properly continue a run. As such, the .cpt file is a snapshot of the full details of the system at a certain time, and there is no need (nor is it possible) to concatenate them. If you want to continue a simulation, just point the pre-processing step (`gmx grompp`) to the latest .cpt file with the `-t` flag.

Similarly for the .gro file. This file stores -most of the times- just the positions of the atoms of the system for a frame of the simulation. The one .gro file you get automatically at the end of a GROMACS run is the frame representing the final state of your system. Again, there is no need to concatenate anything.

What you want to concatenate for analysis are the trajectory files, which you can concatenate with [gmx trjcat](https://manual.gromacs.org/current/onlinehelp/gmx-trjcat.html), and the energy files, which you can concatenate with [gmx eneconv](https://manual.gromacs.org/current/onlinehelp/gmx-eneconv.html).

---

<div class="post-metadata">

**Author:** ![SP06](https://avatars.discourse-cdn.com/v4/letter/s/ecb155/32.png) [@SP06](https://gromacs.bioexcel.eu/u/SP06)\
**Post date:** [June 25, 2024, 8:37am UTC](https://gromacs.bioexcel.eu/t/extend-npt-equilibration/9389/11 "2024-06-25T08:37:12Z")

</div>

I apologise for the inconvenience.

So, you mean to say, for the production run, I should use the npt files of the later/final equilibration run (npt\_1.cpt and npt\_1.gro files) right?

---

<div class="post-metadata">

**Author:** ![obZehn](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/obzehn/32/2629_2.png) [@obZehn](https://gromacs.bioexcel.eu/u/obZehn)\
**Post date:** [June 25, 2024, 8:43am UTC](https://gromacs.bioexcel.eu/t/extend-npt-equilibration/9389/12 "2024-06-25T08:43:36Z")

</div>

I am not completely sure because I never used it but I think with the `-noappend ` flag GROMACS generates the output files by putting a `.partYYYY.` at the end of it. So `npt_1.X` (where X = .gro/.xtc/.edr/etc) is going to be the set of files you get from the first run. Then you continue it and GROMACS generates the `npt_1.part0002.X` files. As such, I would expect that if you want to continue the run/move to another .mdp file like for a production run then the last written files you have to point at are those with the highest YYYY value (in your case I guess `npt_1.part0002.X` if you don’t have any other. Take also a look at the time of writing/modification of the file so you are sure about which one is the last one you got).

Also keep in mind that if you want to extend the simulation then it is up to you if you want to append the energy/trajectory files and build on them or not, while if you are compiling a new .tpr file from a .mdp file then you do not have to concatenate anything but just point the flags to the latest produced files.
