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.

It is primarily designed for biochemical molecules like proteins, lipids, and nucleic acids that have a lot of complicated bonded interactions, but since GROMACS is extremely fast at calculating the nonbonded interactions (that usually dominate simulations) many groups are also using it for research on non-biological systems, e.g. polymers.

Availability

Software Version Dependent Toolchain Module Load Command
GROMACS 2021.5 foss/2021b module load foss/2021b GROMACS/2021.5
GROMACS 2021.5-CUDA-11.4.1 foss/2021b module load foss/2021b GROMACS/2021.5-CUDA-11.4.1
GROMACS 2024.1 foss/2023b module load foss/2023b GROMACS/2024.1
GROMACS 2023.1-CUDA-12.0.0 foss/2022b module load foss/2022b GROMACS/2023.1-CUDA-12.0.0

Application Information, Documentation

The documentation of GROMACS is available at GROMACS Manual, where you can find the tutorials in topologies, input file format, setting parameters, etc.

Using GROMACS

GROMACS can be used on CPU or GPU. When using GROMACS with GPUs (Graphics Processing Units), the calculations can be significantly accelerated, allowing for faster simulations. You can use GROMACS with GPU acceleration, but you need to use GPU nodes on our cluster.

Sample Batch Script to Run GROMACS on GPU gmx_gpu.submit.sh
#!/bin/bash -l
# NOTE the -l (login) flag!
#SBATCH -J gmx2023
#SBATCH -o test.%x.%j.out
#SBATCH -e test.%x.%j.err
#SBATCH --mail-type=ALL
#SBATCH --partition=gpu
#SBATCH --qos=standard
#SBATCH --time 72:00:00   # Max 3 days
#SBATCH --nodes=2
#SBATCH --ntasks-per-node=2
#SBATCH --cpus-per-task=2
#SBATCH --gpus-per-node=4  
#SBATCH --account=PI_ucid  # Replace PI_ucid with the UCID of PI, if you don't know PI's UCID use "sacctmgr show user username" on the login screen, replace "username" with your UCID

module purge
module load wulver
module load foss/2022b GROMACS/2023.1-CUDA-12.0.0

INPUT_DIR=${PWD}/INPUT
OUTPUT_DIR=${PWD}/OUTPUT

cp -r $INPUT_DIR/* $OUTPUT_DIR/
cd $OUTPUT_DIR

srun gmx_mpi mdrun -deffnm run -cpi -v -ntomp 2 -pin on -tunepme -dlb yes -nb gpu -noappend
Sample Batch Script to Run GROMACS on CPU gmx_cpu.submit.sh
#!/bin/bash -l
# NOTE the -l (login) flag!
#SBATCH -J gmx2021
#SBATCH -o test.%x.%j.out
#SBATCH -e test.%x.%j.err
#SBATCH --mail-type=ALL
#SBATCH --partition=general
#SBATCH --qos=standard
#SBATCH --time 72:00:00   # Max 3 days
#SBATCH --nodes=1
#SBATCH --ntasks-per-node=8
#SBATCH --account=PI_ucid  # Replace PI_ucid with the UCID of PI, if you don't know PI's UCID use "sacctmgr show user username" on the login screen, replace "username" with your UCID

module purge
module load wulver
module load foss/2021b GROMACS/2021.5

INPUT_DIR=${PWD}/INPUT
OUTPUT_DIR=${PWD}/OUTPUT

cp -r $INPUT_DIR/* $OUTPUT_DIR/
cd $OUTPUT_DIR

srun gmx_mpi mdrun -v -deffnm em -cpi -v -ntomp 1 -pin on -tunepme -dlb yes -noappend

The tutorial in the above-mentioned job script can be found in

/apps/testjobs/gromacs

User Contributed Information

Please help us improve this page

Users are invited to contribute helpful information and corrections through our Github repository.