How to Run GROMACS

Setting GROMACS in your environment

To set up your environment to use GROMACS, use the module command:

module load gromacs

See How to use the module command for further information.

Preparing a GROMACS input file

To run the molecular dynamics part (mdrun) of the GROMACS suite of programs, you are required to have previously generated an input file containing information about the topology, the structure and the parameters of your system. Such input file, which generally has a .tpr, a .tpb or a .tpa extension, is generated via the grompp part of GROMACS.

To run pre- and post-processing parts of GROMACS (such as pdb2gmx, grompp, etc.) you need to set GROMACS into your environment by loading the gromacs module file.

Submit your the pre- and post-processing GROMACS jobs by either obtaining an interactive node with qrsh, or see Running a Batch Job to generate a command file to run your GROMACS pre- or post-processing job to the scheduler.

If you use job.q you will need to first create a script with the gromacs pre- or post-processing commands. For example, for a grompp job:

. /u/local/Modules/default/init/
module load gromacs
cd mydir
grompp -f em

where mydir is the directory where your em.mdp file is. Use this script as the input to job.q.

How to Run GROMACS in Batch

The easiest way to run GROMACS in batch from the login node is to use the queue scripts. See Running a Batch Job for a discussion of the queue scripts and how they are used.

The following queue scripts are available to submit jobs of the mdrun component of GROMACS:


which asks you whether you want to perform a parallel or multithreaded run of mdrun.


which runs mdrun in parallel


which runs mdrun in multithread fashion.


Note: the default version of mdrun set by gromacs.q.mutlithreaded is the single precision version. If needed edit the command file generated by gromacs.q.multithreaded and substitute mdrun with mdrun_d.

To prepare your own submission script see Running a Batch Job for guidelines to follow to create the required UGE command file. Alternatively, you could create an UGE command file with one of the queue scripts listed above. After saving the command file, you could modify it if necessary. See Commonly-Used UGE Commands for a list of the most commonly used UGE commands.

How to Run GROMACS Interactively

To run GROMACS interactively on the cluster please request an interactive node with qrsh (see: How to Get and Interactive Session through UGE for further information), set GROMACS into your environment, and invoke any GROMACS commands at the command line as needed.

Report Typos and Errors