# 5. Equilibrium molecular dynamics¶

## 5.1. Set up the production run¶

As usual, we must tell Gromacs what it will be doing using grompp before we can perform our production simulation. Since we want to start our run where we left off (after doing equilibration), we prepare the TPR input file based on the last frame of the position-restraints with grompp:

cd ../MD
cp ../templates/md.mdp .
gmx grompp -f md.mdp -p ../top/4ake.top -c ../posres/posres.pdb -o md.tpr -maxwarn 3


The md.mdp file uses different algorithms from the position-restraints for the temperature and pressure coupling, which are known to reproduce the exact NPT ensemble distribution.

## 5.2. Run the simulation¶

CPU run

If your workstation has a decent number of cores or if you simply don’t mind waiting a bit longer you can also run the simulation as usual with

gmx mdrun -v -stepout 10 -s md.tpr -deffnm md -cpi


This will automatically utilize all available cores. The -cpi flag indicates that you want Gromacs to continue from a previous run. You can kill the job with CONTROL-C, look at the output, then continue with exactly the same command line

gmx mdrun -v -stepout 10 -s md.tpr -deffnm md -cpi


(Try it out!). The -cpi flag can be used on the first run without harm. For a continuation to occur, Gromacs needs to find the checkpoint file md.cpt and all output files (md.xtc, md.edr, md.log) in the current directory.

GPU run

We can also try utilizing the GPU(s) available on the workstation. We use a modified MDP file that contains settings compatible with GPU-based Gromacs simulations to generate a new TPR file, which is used to perform the simulation:

gmx grompp -f mdgpu.mdp -p ../top/4ake.top -c ../posres/posres.pdb -o mdgpu.tpr -maxwarn 3
gmx mdrun -v -stepout 10 -s mdgpu.tpr -deffnm mdgpu -cpi


On machines equipped with a well-matched CPU and GPU, a GPU-accelerated Gromacs run can be around 3 to 5 times faster than a CPU-only run on the same machine. Take a look at the Gromacs page on GPU acceleration for more information.