Skip to content

GROMACS

A versatile package to perform molecular dynamics.


GROMACS requires an environment module

In order to use GROMACS, you must first load the appropriate environment module:

module load gnu

GROMACS is a powerful and versatile molecular dynamics simulation package. It is capable of solving Newtonian Equations of Motion for extremely large systems.

GROMACS Versions on RCC Systems#

RCC currently supports two versions of GROMACS:

  • GROMACS 2021: Available with the default GNU module (module load gnu).
  • GROMACS 2024: Available with GNU 13 and OpenMPI 4.1.6 (module load gnu/13.2.0 openmpi/4.1.6).

GROMACS uses different commands for serial and parallel jobs: - gmx is used for serial execution - gmx_mpi is used for parallel execution

Note that GROMACS 2024 is compiled only in parallel mode and must be run with the gmx_mpi command.

Loading GROMACS Modules#

GROMACS 2021#

module load gnu openmpi
gmx --help

Or, if you want to use the MVAPICH version:

module load gnu mvapich/2.3.5
gmx --help

GROMACS 2024#

module load gnu/13.2.0 openmpi/4.1.6 gromacs
gmx_mpi --help

Running Serial GROMACS Jobs on HPC#

To run GROMACS in serial, load the GNU module and use the gmx command:

module load gnu
gmx mdrun -v -deffnm em

Running Parallel GROMACS Jobs on HPC#

To run parallel GROMACS jobs, load the appropriate modules and use gmx or gmx_mpi depending on the version:

  • GROMACS 2021: Use gmx
  • GROMACS 2024: Use gmx_mpi

For example, the following SLURM script runs a GROMACS 2024 job in parallel using 16 cores:

1
2
3
4
5
6
7
8
9
#!/bin/bash
#SBATCH -J testGROMACS
#SBATCH -n 16
#SBATCH -p backfill
#SBATCH -t 4:00:00

module load gnu/13.2.0 openmpi/4.1.6 gromacs

srun gmx_mpi mdrun -v -deffnm em

To use GROMACS 2021 in parallel:

1
2
3
4
5
6
7
8
9
#!/bin/bash
#SBATCH -J testGROMACS
#SBATCH -n 16
#SBATCH -p backfill
#SBATCH -t 4:00:00

module load gnu openmpi

srun gmx mdrun -v -deffnm em

Save the appropriate script to a .sh file and submit it using sbatch.

Additional Resources#