Skip to content

GROMACS

GROMACS is a molecular dynamics package primarily designed for biomolecular simulations (proteins, lipids, nucleic acids) but widely used for any system where non-bonded interactions dominate.

Loading the module

module load GROMACS/2024.4-foss-2023b

To see all installed versions across clusters, check the software catalog or run module spider GROMACS.

Expand to see all available modules on each cluster
GROMACS/2019.4-foss-2021a GROMACS/2020.7-foss-2021b-CUDA-11.4.1-PLUMED-2.8.0 GROMACS/2021.5-foss-2021b-CUDA-11.4.1-PLUMED-2.8.0
GROMACS/2023.1-foss-2022a GROMACS/2023.1-foss-2022a-CUDA-11.7.0 GROMACS/2023-foss-2022a-CUDA-11.7.0
GROMACS/2023-foss-2022a-CUDA-11.7.0-PLUMED-2.9.0 GROMACS/2024.2-foss-2023a-CUDA-12.1.1-PLUMED-2.9.0 GROMACS/2024.4-foss-2022a-CUDA-11.7.0
GROMACS/2024.4-foss-2023b-CUDA-12.8.0-PLUMED-2.9.2 GROMACS/2024.4-foss-2023b-PLUMED-2.9.2 GROMACS/2024-foss-2023a
GROMACS/2025.3-foss-2025a GROMACS/2025.3-foss-2025a-CUDA-12.8.0 GROMACS/2026.2-foss-2025a
GROMACS/constantph-foss-2021a-CUDA-11.7.0-PLUMED-2.9.0 GROMACS/constantph-foss-2021a-PLUMED-2.7.2
GROMACS/2016.4-foss-2019b-PLUMED-2.4.0 GROMACS/2016.4-fosscuda-2019b-PLUMED-2.4.0 GROMACS/2019.4-foss-2019b
GROMACS/2020.1-foss-2020a-Python-3.8.2 GROMACS/2020.3-fosscuda-2019b GROMACS/2020.4-foss-2020a-Python-3.8.2
GROMACS/2020-foss-2019b GROMACS/2020-fosscuda-2019b GROMACS/2021.2-fosscuda-2020b
GROMACS/2021.3-fosscuda-2020b-PLUMED-2.7.2 GROMACS/2022.4-foss-2020b GROMACS/2022.4-fosscuda-2020b
GROMACS/2022.4-intel-2021a GROMACS/2022.5-foss-2021b-PLUMED-2.8.1 GROMACS/2022.5-foss-2022a-PLUMED-2.8.1
GROMACS/2023.1-foss-2022a-CUDA-11.7.0 GROMACS/2023.5-foss-2023a-CUDA-12.1.1-PLUMED-2.9.0 GROMACS/2024.4-foss-2023a-CUDA-12.1.1
GROMACS/4.6.5-foss-2021b GROMACS/4.6.5-intel-2021b GROMACS/constantph-foss-2020b-CUDA-11.1.1
GROMACS/constantph-intel-2021a-PLUMED-2.8.1
GROMACS/2016.4-intel-2017a GROMACS/2018-foss-2018a GROMACS/2019.2-intel-2019a
GROMACS/2019.4-foss-2019b GROMACS/2019-foss-2018b GROMACS/2019-foss-2018b-Gold
GROMACS/2021.3-foss-2021a GROMACS/2022.4-foss-2021a GROMACS/2022.4-intel-2021a
GROMACS/4.0.5-mod GROMACS/4.0.5-mod2 GROMACS/4.0.5-mod2-foss-2018b
GROMACS/4.0.5-mod2-foss-2018b-minimalopt GROMACS/4.0.5-mod2-foss-2018b-noopt GROMACS/4.0.5-mod2-intel-2016b
GROMACS/4.0.5-mod2-intel-2016b-noopt GROMACS/4.0.5-mod2-intel-2018b-minimalopt GROMACS/5.0.7-intel-2017b-hybrid
GROMACS/5.1.2-intel-2017a-hybrid

PLUMED variants

Modules with -PLUMED in the name include the PLUMED plugin for enhanced sampling and free energy methods.

Batch job examples

gromacs.slurm
#!/bin/bash
#SBATCH --qos=regular
#SBATCH --job-name=gmx
#SBATCH --nodes=2
#SBATCH --ntasks-per-node=8
#SBATCH --cpus-per-task=6
#SBATCH --mem=200G
#SBATCH --time=24:00:00
#SBATCH --output=%x.%j.out
#SBATCH --error=%x.%j.err

module load GROMACS/2024.4-foss-2023b

srun gmx_mpi mdrun -ntomp ${SLURM_CPUS_PER_TASK} -s input.tpr
gromacs_gpu.slurm
#!/bin/bash
#SBATCH --qos=regular
#SBATCH --job-name=gmx_gpu
#SBATCH --nodes=1
#SBATCH --ntasks-per-node=2
#SBATCH --cpus-per-task=12
#SBATCH --mem=64G
#SBATCH --gpus=2
#SBATCH --time=24:00:00
#SBATCH --output=%x.%j.out
#SBATCH --error=%x.%j.err

module load GROMACS/2024.4-foss-2023b-CUDA-12.4.0

srun gmx_mpi mdrun -ntomp ${SLURM_CPUS_PER_TASK} \
     -nb gpu -bonded gpu -pme gpu -s input.tpr

Tip

Use one MPI rank per GPU. GROMACS distributes non-bonded, bonded, and PME work across GPUs automatically when you pass -nb gpu -bonded gpu -pme gpu.

gromacs.slurm
#!/bin/bash
#SBATCH --qos=regular
#SBATCH --job-name=gmx
#SBATCH --nodes=2
#SBATCH --ntasks-per-node=8
#SBATCH --cpus-per-task=6
#SBATCH --mem=200G
#SBATCH --time=24:00:00
#SBATCH --output=%x.%j.out
#SBATCH --error=%x.%j.err

module load GROMACS/2024.4-foss-2023a

srun gmx_mpi mdrun -ntomp ${SLURM_CPUS_PER_TASK} -s input.tpr
gromacs.slurm
#!/bin/bash
#SBATCH --qos=regular
#SBATCH --job-name=gmx
#SBATCH --nodes=2
#SBATCH --ntasks-per-node=8
#SBATCH --cpus-per-task=6
#SBATCH --mem=200G
#SBATCH --time=24:00:00
#SBATCH --output=%x.%j.out
#SBATCH --error=%x.%j.err

module load GROMACS/2022.4-foss-2021a

srun gmx_mpi mdrun -ntomp ${SLURM_CPUS_PER_TASK} -s input.tpr

Performance tips

The balance between MPI ranks (--ntasks-per-node) and OpenMP threads (--cpus-per-task) depends on your system size. As a starting point, use 6-12 threads per rank. Small systems (< 100k atoms) often run better with fewer ranks and more threads.

For detailed tuning, see the official guide: Getting good performance from mdrun.

See also