Navigation

Spack

AMD Toolchain with SPACK

Micro Benchmarks/Synthetic

SPACK HPC Applications

Introduction

GROMACS is a versatile package for performing molecular dynamics for systems with hundreds to millions of particles.  GROMACS is primarily designed for biochemical molecules like proteins, lipids, and nucleic acids that have a multitude of complicated bonded interactions.  Since GROMACS is extremely fast at calculating the non-bonded interactions typically dominating simulations, many researchers use it for research on non-biological systems, such as polymers.  GROMACS supports all the usual algorithms expected from a modern molecular dynamics implementation.

Official Website for GROMACS: https://www.gromacs.org/

Build GROMACS using Spack

Reference to add external packages to Spack: Build Customization (Adding external packages to Spack)

# Format For Building GROMACS with AOCC
$ spack -d install -v gromacs@<Version> +openmp +blas +lapack build_type=Release %aocc@<Version> target=<zen2/zen3> ^amdlibflame@<Version> ^amdblis@<Version> ^amdfftw@<Version> ^openmpi@<Version>
# Example: For building GROMACS 2021.2 with AOCC 3.2.0 and AOCL 3.1
$ spack -d install -v -j 16 gromacs@2021.2 +openmp +blas +lapack build_type=Release %aocc@3.2.0 target=zen3 ^amdblis@3.1 threads=openmp ^amdlibflame@3.1 ^amdfftw@3.1 ^openmpi@4.1.1 fabrics=auto
# Example: For building GROMACS 2021.2 with AOCC 3.1.0 and AOCL 3.0
$ spack -d install -v -j 16 gromacs@2021.2 +openmp +blas +lapack build_type=Release %aocc@3.1.0 target=zen3 ^amdblis@3.0 threads=openmp ^amdlibflame@3.0 ^amdfftw@3.0 ^openmpi@4.0.5 fabrics=auto
# Example: For building GROMACS 2020.4 with AOCC 3.0.0 and AOCL 3.0
$ spack -d install -v -j 16 gromacs@2020.4 +openmp +blas +lapack build_type=Release %aocc@3.0.0 target=zen2 ^amdlibflame@3.0 ^amdblis@3.0 ^amdfftw@3.0 ^openmpi@4.0.3 fabrics=auto
# Example: For building GROMACS 2020.4 with AOCC 2.3.0 and AOCL 2.2
$ spack -d install -v -j 16 gromacs@2020.4 +openmp +blas +lapack build_type=Release %aocc@3.0.0 target=zen2 ^amdlibflame@2.2 ^amdblis@2.2 ^amdfftw@2.2 ^openmpi@4.0.3 fabrics=auto
# Example: For building GROMACS 2020.4 with AOCC 2.2.0 and AOCL 2.2
$ spack -d install -v -j 16 gromacs@2020.4 +openmp +blas build_type=Release %aocc@3.0.0 target=zen2 ^amdblis@2.2 ^amdfftw@2.2 ^openmpi@4.0.3 fabrics=auto

Use any combination of following components/applications and their versions:

Component/Application Versions Applicable
GROMACS 2021.2, 2020.4, 2020.3, 2020.2
AOCC 3.2.0, 3.1.0, 3.0.0, 2.3.0, 2.2.0
AOCL 3.1, 3.0, 2.2

Specifications and Dependencies

Symbol Meaning
-d To enable debug
-v To enable verbose
@ To specify version number
% To specify compiler
target=zen2 / target=zen3 To enable target zen2 or zen3 architecture
+openmp Use OpenMP variant
+blas Blas variant specifier
+lapack Lapack variant specifier
^amdlibflame Build with amdlibflame dependency
^amdblis Build with amdblis dependency
^amdfftw Build with amdfftw dependency
^openmpi Build with Open MPI

Running GROMACS

GROMACS has vast variety of input data sets.  The following example steps we will run GROMACS with the commonly used “water_GMX50_bare” benchmark data set.

Running GROMACS is a two-step process:

  1. Generating the input file (.tpr)
  2. Running the generated .tpr file

Examples for running GROMACS on AMD 2nd and 3rd Gen EPYCTM processors are as follows:

Setting Environment
# Format for loading GROMACS build with AOCC
$ spack load gromacs@<Version> %aocc@<Version>
# Example: Load Gromacs build with AOCC 3.2.0 module into environment
$ spack load gromacs@2021.2 %aocc@3.2.0

 

Obtaining Benchmarks
# Obtaining bench-mark "water_GMX50_bare" i.e. water 3072 and 1536
# This is the standard benchmark sets that can be downloaded
$ wget http://ftp.gromacs.org/pub/benchmarks/water_GMX50_bare.tar.gz
tar -xvf water_GMX50_bare.tar.gz
cd water-cut1.0_GMX50_bare/3072
# Follow below steps to generate the .tpr input file from gmx_pmi
# gmx_pmi can be found using command: "spack cd -i gromacs@2021.2 %aocc@3.2.0"

export GMX=/<gromacs_installed_path>/bin/gmx_mpi
$ $GMX grompp -f pme.mdp -c conf.gro -p topol.top -o water_pme.tpr

Run Command
# Run Command for Water3072
$ mpirun --bind-to core --map-by hwthread -use-hwthread-cpus -np 256 -mca btl vader,self $GMX mdrun -notunepme -dlb yes -v -resethway -noconfout -nsteps 4000 -s water_pme.tpr