GMX-MDRUN(1)
๐ GMX-MDRUN(1) โ like, the gmx-mdrun era ๐
bestie welcome to the man page that literally runs your whole simulation ๐งโจ
โจ NAME โจ
gmx-mdrun โ do a simulation, do a normal mode analysis, or do an energy minimization ๐ซถ
๐ธ SYNOPSIS ๐ธ
gmx mdrun [-s [<.tpr>]] [-cpi [<.cpt>]] [-table [<.xvg>]]
[-tablep [<.xvg>]] [-tableb [<.xvg> [...]]]
[-rerun [<.xtc/.trr/...>]] [-ei [<.edi>]]
[-multidir [<dir> [...]]] [-awh [<.xvg>]]
[-plumed [<.dat>]] [-membed [<.dat>]] [-mp [<.top>]]
[-mn [<.ndx>]] [-o [<.trr/.cpt/...>]] [-x [<.xtc/.tng>]]
[-cpo [<.cpt>]] [-c [<.gro/.g96/...>]] [-e [<.edr>]]
[-g [<.log>]] [-dhdl [<.xvg>]] [-field [<.xvg>]]
[-tpi [<.xvg>]] [-tpid [<.xvg>]] [-eo [<.xvg>]]
[-px [<.xvg>]] [-pf [<.xvg>]] [-ro [<.xvg>]] [-ra [<.log>]]
[-rs [<.log>]] [-rt [<.log>]] [-mtx [<.mtx>]]
[-if [<.xvg>]] [-swap [<.xvg>]] [-deffnm <string>]
[-xvg <enum>] [-dd <vector>] [-ddorder <enum>]
[-npme <int>] [-nt <int>] [-ntmpi <int>] [-ntomp <int>]
[-ntomp_pme <int>] [-pin <enum>] [-pinoffset <int>]
[-pinstride <int>] [-gpu_id <string>] [-gputasks <string>]
[-[no]ddcheck] [-rdd <real>] [-rcon <real>] [-dlb <enum>]
[-dds <real>] [-nb <enum>] [-nbfe <enum>] [-nstlist <int>]
[-[no]tunepme] [-pme <enum>] [-pmefft <enum>]
[-bonded <enum>] [-update <enum>] [-[no]v] [-pforce <real>]
[-[no]reprod] [-cpt <real>] [-[no]cpnum] [-[no]append]
[-nsteps <int>] [-maxh <real>] [-replex <int>] [-nex <int>]
[-reseed <int>]
๐ DESCRIPTION ๐
okay so. gmx mdrun is THE main computational chemistry engine inside GROMACS. ๐
Obviously it does Molecular Dynamics simulations โ that's the whole vibe โ but bestie it can also do Stochastic Dynamics, Energy Minimization, test particle insertion, and (re)calculation of energies. Normal mode analysis is another whole option. In that case mdrun builds a Hessian matrix from a single conformation. ๐ฆ For usual Normal Modes-like calculations, make sure the structure you're feeding it is properly energy-minimized, no cap. The generated matrix can be diagonalized by gmx nmeig.
The mdrun program reads the run input file (-s) and distributes the topology over ranks if needed. mdrun produces at least four output files. Here's the lineup:
- A single log file (
-g) gets written. ๐ - The trajectory file (
-o) contains coordinates, velocities and optionally forces. - The structure file (
-c) contains the coordinates and velocities of the last step. - The energy file (
-e) contains energies, the temperature, pressure, etc. โ a lot of these things are also printed in the log file. - Optionally, coordinates can be written to a compressed trajectory file (
-x).
The option -dhdl is only used when free energy calculation is turned on. ๐ฅ
Running mdrun efficiently in parallel is a complex topic, many aspects of which are covered in the online User Guide. You should look there for practical advice on using many of the options available in mdrun. iykyk.
ED (essential dynamics) sampling and/or additional flooding potentials are switched on by using the -ei flag followed by an .edi file. The .edi file can be produced with the make_edi tool or by using options in the essdyn menu of the WHAT IF program. mdrun produces a .xvg output file that contains projections of positions, velocities and forces onto selected eigenvectors. ๐
When user-defined potential functions have been selected in the .mdp file, the -table option is used to pass mdrun a formatted table with potential functions. The file is read from either the current directory or from the GMXLIB directory. A number of pre-formatted tables are presented in the GMXLIB dir, for 6-8, 6-9, 6-10, 6-11, 6-12 Lennard-Jones potentials with normal Coulomb. When pair interactions are present, a separate table for pair interaction functions is read using the -tablep option. ๐
When tabulated bonded functions are present in the topology, interaction functions are read using the -tableb option. For each different tabulated interaction type used, a table file name must be given. For the topology to work, a file name given here must match a character sequence before the file extension. That sequence is: an underscore, then a 'b' for bonds, an 'a' for angles or a 'd' for dihedrals, and finally the matching table number index used in the topology.
โ ๏ธ note that, these options are deprecated, and in future will be available via grompp.
The options -px and -pf are used for writing pull COM coordinates and forces when pulling is selected in the .mdp file. ๐
The option -membed does what used to be g_membed, i.e. embed a protein into a membrane. This module requires a number of settings that are provided in a data file that is the argument of this option. For more details in membrane embedding, see the documentation in the user guide. The options -mn and -mp are used to provide the index and topology files used for the embedding. ๐ซถ
The option -pforce is useful when you suspect a simulation crashes due to too large forces. With this option coordinates and forces of atoms with a force larger than a certain value will be printed to stderr. It will also terminate the run when non-finite forces are present. ๐
Checkpoints containing the complete state of the system are written at regular intervals (option -cpt) to the file -cpo, unless option -cpt is set to -1. The previous checkpoint is backed up to state_prev.cpt to make sure that a recent state of the system is always available, even when the simulation is terminated while writing a checkpoint. With -cpnum all checkpoint files are kept and appended with the step number. A simulation can be continued by reading the full state from file with option -cpi. This option is intelligent in the way that if no checkpoint file is found, GROMACS just assumes a normal run and starts from the first step of the .tpr file. By default the output will be appending to the existing output files. The checkpoint file contains checksums of all output files, such that you will never loose data when some output files are modified, corrupt or removed. There are three scenarios with -cpi:
- no files with matching names are present: new output files are written
- all files are present with names and checksums matching those stored in the checkpoint file: files are appended
- otherwise no files are modified and a fatal error is generated
With -noappend new output files are opened and the simulation part number is added to all output file names. Note that in all cases the checkpoint file itself is not renamed and will be overwritten, unless its name does not match the -cpo option. ๐ธ
With checkpointing the output is appended to previously written output files, unless -noappend is used or none of the previous output files are present (except for the checkpoint file). The integrity of the files to be appended is verified using checksums which are stored in the checkpoint file. This ensures that output can not be mixed up or corrupted due to file appending. When only some of the previous output files are present, a fatal error is generated and no old output files are modified and no new output files are opened. The result with appending will be the same as from a single run. The contents will be binary identical, unless you use a different number of ranks or dynamic load balancing or the FFT library uses optimizations through timing.
With option -maxh a simulation is terminated and a checkpoint file is written at the first neighbor search step where the run time exceeds -maxh*0.99 hours. This option is particularly useful in combination with setting nsteps to -1 either in the mdp or using the similarly named command line option (although the latter is deprecated). This results in an infinite run, terminated only when the time limit set by -maxh is reached (if any) or upon receiving a signal. โจ
Interactive molecular dynamics (IMD) can be activated by using at least one of the three IMD switches:
- The
-imdtermswitch allows one to terminate the simulation from the molecular viewer (e.g. VMD). ๐ฎ - With
-imdwait,mdrunpauses whenever no IMD client is connected. - Pulling from the IMD remote can be turned on by
-imdpull.
The port mdrun listens to can be altered by -imdport. The file pointed to by -if contains atom indices and forces if IMD pulling is used. ๐
โจ OPTIONS โจ
Okay bestie, this is the part where we pick all the knobs and dials. mdrun has SO many options it's giving "I contain multitudes" ๐
. Let's break it down.
๐ Options to specify input files
-s [<.tpr>]โ Portable xdr run input file. default:topol.tpr. This is literally your main character file, the.tprthat holds the whole simulation.-cpi [<.cpt>]โ Checkpoint file. default:state.cpt. (Optional) If you got interrupted, this is your save point, no cap.-table [<.xvg>]โ xvgr/xmgr file. default:table.xvg. (Optional)-tablep [<.xvg>]โ xvgr/xmgr file. default:tablep.xvg. (Optional)-tableb [<.xvg> [...]]โ xvgr/xmgr file. default:table.xvg. (Optional)-rerun [<.xtc/.trr/...>]โ Trajectory: xtc trr cpt gro g96 pdb tng h5md. default:rerun.xtc. (Optional)-ei [<.edi>]โ ED sampling input. default:sam.edi. (Optional)-multidir [<dir> [...]]โ Run directory. default:rundir. (Optional)-awh [<.xvg>]โ xvgr/xmgr file. default:awhinit.xvg. (Optional)-plumed [<.dat>]โ Generic data file. default:plumed.dat. (Optional)-membed [<.dat>]โ Generic data file. default:membed.dat. (Optional)-mp [<.top>]โ Topology file. default:membed.top. (Optional)-mn [<.ndx>]โ Index file. default:membed.ndx. (Optional)
๐ Options to specify output files
-o [<.trr/.cpt/...>]โ Full precision trajectory: trr cpt tng h5md. default:traj.trr.-x [<.xtc/.tng>]โ Compressed trajectory (tng format or portable xdr format). default:traj_comp.xtc. (Optional)-cpo [<.cpt>]โ Checkpoint file. default:state.cpt. (Optional)-c [<.gro/.g96/...>]โ Structure file: gro g96 pdb brk ent esp. default:confout.gro.-e [<.edr>]โ Energy file. default:ener.edr.-g [<.log>]โ Log file. default:md.log.-dhdl [<.xvg>]โ xvgr/xmgr file. default:dhdl.xvg. (Optional)-field [<.xvg>]โ xvgr/xmgr file. default:field.xvg. (Optional)-tpi [<.xvg>]โ xvgr/xmgr file. default:tpi.xvg. (Optional)-tpid [<.xvg>]โ xvgr/xmgr file. default:tpidist.xvg. (Optional)-eo [<.xvg>]โ xvgr/xmgr file. default:edsam.xvg. (Optional)-px [<.xvg>]โ xvgr/xmgr file. default:pullx.xvg. (Optional)-pf [<.xvg>]โ xvgr/xmgr file. default:pullf.xvg. (Optional)-ro [<.xvg>]โ xvgr/xmgr file. default:rotation.xvg. (Optional)-ra [<.log>]โ Log file. default:rotangles.log. (Optional)-rs [<.log>]โ Log file. default:rotslabs.log. (Optional)-rt [<.log>]โ Log file. default:rottorque.log. (Optional)-mtx [<.mtx>]โ Hessian matrix. default:nm.mtx. (Optional)-if [<.xvg>]โ xvgr/xmgr file. default:imdforces.xvg. (Optional)-swap [<.xvg>]โ xvgr/xmgr file. default:swapions.xvg. (Optional)
๐ Other options
This is the main character energy section, so many flags. Let's get into it.
-deffnm <string>โ Set the default filename for all file options. Literally saves you typing, slay.-xvg <enum>โ xvgr plot formatting: xmgrace, xmgr, none. default:xmgrace.-dd <vector>โ Domain decomposition grid, 0 is optimize. default:0 0 0.-ddorder <enum>โ DD rank order: interleave, pp_pme, cartesian. default:interleave.-npme <int>โ Number of separate ranks to be used for PME, -1 is guess. default:-1.-nt <int>โ Total number of threads to start (0 is guess). default:0.-ntmpi <int>โ Number of thread-MPI ranks to start (0 is guess). default:0.-ntomp <int>โ Number of OpenMP threads per MPI rank to start (0 is guess). default:0.-ntomp_pme <int>โ Number of OpenMP threads per MPI rank to start (0 is -ntomp). default:0.-pin <enum>โ Whether mdrun should try to set thread affinities: auto, on, inherit, off. default:auto.-pinoffset <int>โ The lowest logical core number to which mdrun should pin the first thread. default:0.-pinstride <int>โ Pinning distance in logical cores for threads, use 0 to minimize the number of threads per physical core. default:0.-gpu_id <string>โ List of unique GPU device IDs available to use.-gputasks <string>โ List of GPU device IDs, mapping each task on a node to a device. Tasks include PP and PME (if present).-[no]ddcheckโ Check for all bonded interactions with DD. default:yes.-rdd <real>โ The maximum distance for bonded interactions with DD (nm), 0 is determine from initial coordinates. default:0.-rcon <real>โ Maximum distance for P-LINCS (nm), 0 is estimate. default:0.-dlb <enum>โ Dynamic load balancing (with DD): auto, no, yes. default:auto.-dds <real>โ Fraction in (0,1) by whose reciprocal the initial DD cell size will be increased in order to provide a margin in which dynamic load balancing can act while preserving the minimum cell size. default:0.8.-nb <enum>โ Calculate non-bonded interactions on: auto, cpu, gpu. default:auto.-nbfe <enum>โ Perform non-bonded FE calculations on: auto, cpu, gpu. default:auto.-nstlist <int>โ Set nstlist when using a Verlet buffer tolerance (0 is guess). default:0.-[no]tunepmeโ Optimize PME load between PP/PME ranks or GPU/CPU. default:yes.-pme <enum>โ Perform PME calculations on: auto, cpu, gpu. default:auto.-pmefft <enum>โ Perform PME FFT calculations on: auto, cpu, gpu. default:auto.-bonded <enum>โ Perform bonded calculations on: auto, cpu, gpu. default:auto.-update <enum>โ Perform update and constraints on: auto, cpu, gpu. default:auto.-[no]vโ Be loud and noisy. default:no.-pforce <real>โ Print all forces larger than this (kJ/mol nm). default:-1.-[no]reprodโ Avoid optimizations that affect binary reproducibility; this can significantly reduce performance. default:no. โ ๏ธ bestie, this one can tank performance, so use with caution.-cpt <real>โ Checkpoint interval (minutes). default:15.-[no]cpnumโ Keep and number checkpoint files. default:no.-[no]appendโ Append to previous output files when continuing from checkpoint instead of adding the simulation part number to all file names. default:yes.-nsteps <int>โ Run this number of steps (-1 means infinite, -2 means use mdp option, smaller is invalid). default:-2.-maxh <real>โ Terminate after 0.99 times this time (hours). default:-1.-replex <int>โ Attempt replica exchange periodically with this period (steps). default:0.-nex <int>โ Number of random exchanges to carry out each exchange interval (N^3 is one suggestion). -nex zero or not specified gives neighbor replica exchange. default:0.-reseed <int>โ Seed for replica exchange, -1 is generate a seed. default:-1.
๐ SEE ALSO ๐
gmx(1)โ the main gmx man page, go check it out bestie.
More information about GROMACS is available at <http://www.gromacs.org/>.
๐ COPYRIGHT ๐
2026, GROMACS development team. They own this, respect it.
That's a wrap on GMX-MDRUN(1) from GROMACS 2026.4, dated Oct 02, 2026. Periodt. Stay hydrated and may your simulations converge ๐
โจ๐ฆ
๐ฆ where this page comes from
- nixpkgs unstable: gromacs 2026.4
- ubuntu stonking: gromacs-data 2026.4-1ubuntu1
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms