Skip to content

Argonne Leadership
Computing Facility

Gromacs on Theta

What is 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.


ALCF offers assistance with building binaries and compiling instructions for GROMACS. For questions, contact us at

Building Gromacs

  1. Download latest source code:
  2. tar -xzf gromacs-2022.1.tar.gz
  3. cd gromacs-2022.1
  4. mkdir build
  5. module load cmake
  6. module swap PrgEnv-intel PrgEnv-gnu/6.0.10
          -DCMAKE_INSTALL_PREFIX=/path-to/gromacs-2022.1/build \
  8. make –j 16
  9. make install
  10. The installed binary is build/bin/gmx_mpi.

Running Gromacs on Theta

Prebuilt Gromacs binaries can be found in the directory /soft/applications/gromacs/gromacs_theta.

A sample qsub script follows.

#COBALT -n 1
#COBALT -t 30 
#COBALT -q debug-cache-quad 
#COBALT -project catalyst 
#COBALT --attrs mcdram=cache:numa=quad
#COBALT --attrs filesystems=home,theta-fs0

export GMX_MAXBACKUP=-1 

aprun -n64 -N64 --env OMP_NUM_THREADS=2 --cc depth -d 2 -j 2 \
      /soft/applications/gromacs/gromacs_theta/gmx_mpi.2022.1 mdrun \
      -dlb yes -resethway -pin on -v deffnm step5_1 -g test.log

We strongly suggest that users try combinations of different numbers of nodes, MPI ranks per node, and OMP threads per rank to find the optimal throughput for their particular workload.

The following is a representative benchmark for a system with 30,000 atoms generated on a single Theta node with above aprun command.

Core time(sec) Wall time(sec) (%)
Time 9016.068 70.441 12799.4
ns/day hour/ns
Performance 61.330 0.391