Extend NPT equilibration

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?

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.

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?

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.

1 Like

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.

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!

1 Like

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)

1 Like

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 flags. I would just keep the names consistent, though.

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 ?

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, and the energy files, which you can concatenate with gmx eneconv.

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?

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.