Skip to content

GROMACS

GROMACS is a versatile package to perform molecular dynamics, i.e. simulate the Newtonian equations of motion for systems with hundreds to millions of particles and is a community-driven project.

Package availability

Compute node type Available
CPU ✓
NVIDIA A100 GPU ✓
NVIDIA Grace Hopper GPU ✓

Run GROMACS

GROMACS is available in both MPI and non-MPI versions. In single-GPU-node tests, both versions produced comparable results. For multi-node runs, use the MPI version.

To load the non-MPI version:

Bash
module load gcc/13.4.0 gromacs/2026.4

To load the MPI version:

Bash
module load gcc/13.4.0 mpich/5.0.1 gromacs/2026.4

For the examples and benchmarks in this documentation, we use the non-MPI version.

NVIDIA A100 GPU

Bash
#!/bin/bash
#SBATCH --time=01:00:00
#SBATCH --output=gromacs_stdout.txt
#SBATCH --error=gromacs_stderr.txt
#SBATCH --nodes=1
#SBATCH --ntasks-per-node=8
#SBATCH --cpus-per-task=8
#SBATCH --cluster=gmerlin7
#SBATCH --partition=a100-hourly
#SBATCH --gpus=4
#SBATCH --mem=0
#SBATCH --exclusive

module purge
module use Alps_A100
module load gcc/13.4.0 gromacs/2026.4

gmx mdrun \
    -s /path/to/input/topol.tpr \
    -ntmpi $SLURM_NTASKS_PER_NODE \
    -ntomp $SLURM_CPUS_PER_TASK \
    -nb gpu \
    -pme gpu \
    -npme 1 \
    -update gpu \
    -bonded gpu \
    -pin on \
    -v \
    -gpu_id $CUDA_VISIBLE_DEVICES

Grace Hopper GPU

Bash
#!/bin/bash
#SBATCH --time=01:00:00
#SBATCH --output=gromacs_stdout.txt
#SBATCH --error=gromacs_stderr.txt
#SBATCH --nodes=1
#SBATCH --ntasks-per-node=8
#SBATCH --cpus-per-task=36
#SBATCH --cluster=gmerlin7
#SBATCH --partition=gh-hourly
#SBATCH --gpus=4
#SBATCH --mem=0
#SBATCH --exclusive

module purge
module load gcc/13.4.0 gromacs/2026.4

export GMX_DISABLE_DIRECT_GPU_COMM=1

gmx mdrun \
    -s /path/to/input/topol.tpr \
    -ntmpi $SLURM_NTASKS_PER_NODE \
    -ntomp $SLURM_CPUS_PER_TASK \
    -nb gpu \
    -pme gpu \
    -npme 1 \
    -update gpu \
    -bonded gpu \
    -pin on \
    -v \
    -gpu_id $CUDA_VISIBLE_DEVICES

Resource allocation

Request resources according to the requirements of your job. Requesting more resources than necessary may increase queue wait times and reduce cluster efficiency.

Benchmark results

We performed a single-node performance benchmark using the Satellite Tobacco Mosaic Virus (STMV) benchmark, comparing performance on A100 and Grace Hopper nodes.

For most of the tested configurations, 8 tasks per node provided the best performance and appears to be the optimal configuration for single-node runs. For a single GPU, 4 tasks per node has a slight advantage in performance.

Run Version GPUs CPU (Threads) N tasks Memory (Gb) Performance (ns/day)
STMV 2026.3 1 A100 8 per task 2 118 21.9
STMV 2026.3 1 A100 4 per task 4 118 23.0
STMV 2026.3 1 A100 2 per task 8 118 22.8
STMV 2026.3 1 GH 36 per task 2 118 44.1
STMV 2026.3 1 GH 18 per task 4 118 45.9
STMV 2026.3 1 GH 9 per task 8 118 44.7
STMV 2026.3 2 A100 16 per task 2 236 26.0
STMV 2026.3 2 A100 8 per task 4 236 39.3
STMV 2026.3 2 A100 4 per task 8 236 44.8
STMV 2026.3 2 A100 2 per task 16 236 41.3
STMV 2026.3 2 GH 36 per task 4 236 75.4
STMV 2026.3 2 GH 18 per task 8 236 85.2
STMV 2026.3 4 A100 16 per task 4 472 73.8
STMV 2026.3 4 A100 8 per task 8 472 85.7
STMV 2026.3 4 A100 4 per task 16 472 74.6
STMV 2026.3 4 GH 72 per task 4 472 137.1
STMV 2026.3 4 GH 36 per task 8 472 153.4
STMV 2026.3 4 GH 18 per task 16 472 128.2