Gromacs 2021.4 GCC9 with GPU support

Webpage

http://www.gromacs.org/

Version

2021.4

Build Environment

  • Intel MPI 2018.0.4 (2018.4.274)
  • Intel MKL 2020.0.2
  • GCC 9.3.1 (Software Collections devtoolset-9)
  • cuda 11.1
  • cmake 3.16.3

Files Required

  • gromacs-2021.4.tar.gz
  • regressiontests-2021.4.tar.gz

Build Procedure

#!/bin/sh

VERSION=2021.4
INSTALL_PREFIX=/local/apl/lx/gromacs${VERSION}-CUDA

BASEDIR=/home/users/${USER}/Software/Gromacs/${VERSION}/
GROMACS_TARBALL=${BASEDIR}/gromacs-${VERSION}.tar.gz
REGRESSION_TARBALL=${BASEDIR}/regressiontests-${VERSION}.tar.gz
WORKDIR=/work/users/${USER}
REGRESSION_PATH=${WORKDIR}/regressiontests-${VERSION}

PARALLEL=12
export LANG=C

#---------------------------------------------------------------------
umask 0022

module purge
module load scl/devtoolset-9
#module load mpi/intelmpi/2019.8.254
module load mpi/intelmpi/2018.4.274
module load mkl/2020.0.2
module load cuda/11.1
module load cmake/3.16.3

cd ${WORKDIR}
if [ -d gromacs-${VERSION} ]; then
  mv gromacs-${VERSION} gromacs_erase
  rm -rf gromacs_erase &
fi

if [ -d regressiontests-${VERSION} ]; then
  mv regressiontests-${VERSION} regressiontests_erase
  rm -rf regressiontests_erase &
fi

tar xzf ${GROMACS_TARBALL}
tar xzf ${REGRESSION_TARBALL}
cd gromacs-${VERSION}

# single precision, no MPI
mkdir rccs-s
cd rccs-s
cmake .. \
   -DCMAKE_INSTALL_PREFIX=${INSTALL_PREFIX} \
   -DCMAKE_VERBOSE_MAKEFILE=ON \
   -DCMAKE_C_COMPILER=gcc \
   -DCMAKE_CXX_COMPILER=g++ \
   -DGMX_MPI=OFF \
   -DGMX_GPU=CUDA \
   -DGMX_DOUBLE=OFF \
   -DGMX_THREAD_MPI=ON \
   -DGMX_BUILD_OWN_FFTW=ON \
   -DREGRESSIONTEST_DOWNLOAD=OFF \
   -DREGRESSIONTEST_PATH=${REGRESSION_PATH}
make -j${PARALLEL} && make check && make install
cd ..

# single precision, with MPI
mkdir rccs-mpi-s
cd rccs-mpi-s
cmake .. \
   -DCMAKE_INSTALL_PREFIX=${INSTALL_PREFIX} \
   -DCMAKE_VERBOSE_MAKEFILE=ON \
   -DCMAKE_C_COMPILER=mpicc \
   -DCMAKE_CXX_COMPILER=mpicxx \
   -DGMX_MPI=ON \
   -DGMX_GPU=CUDA \
   -DGMX_DOUBLE=OFF \
   -DGMX_THREAD_MPI=OFF \
   -DGMX_BUILD_OWN_FFTW=ON \
   -DREGRESSIONTEST_DOWNLOAD=OFF \
   -DREGRESSIONTEST_PATH=${REGRESSION_PATH}
make -j${PARALLEL} && make check && make install
cd ..

Notes

  • Changes from 2021.2
    • Intel MPI version was changed to 2018; 2020 version got stuck on a test (there may be other ones).
  • NormalIntegrators/MdrunNoAppendContinuationIsExact test failed with a numerical error only once.
    • The reason is unclear.

  Value of: energyValueInTest

    Actual: 49.294784545898438
  Expected: energyValueInReference
  Which is: 49.294990539550781
Difference: 0.000205994 (54 single-prec. ULPs, rel. 4.18e-06)