CP2K 7.1.0 (gnu)

Webpage

https://www.cp2k.org/

Version

7.1.0

Build Environment

  • OpenMPI 4.0.2 (GCC 7.3 version)
  • GCC 7.3.1 (devtoolset-7)
  • cmake 3.16.3

Files Required

  • cp2k-7.1.0.tar.gz
  • dbcsr-2.0.1.tar.gz
  • tc_install_cp2k_toolchain.sh.diff

--- install_cp2k_toolchain.sh.org       2020-01-31 17:07:19.000000000 +0900
+++ install_cp2k_toolchain.sh   2020-01-31 17:07:30.000000000 +0900
@@ -942,8 +942,8 @@
     ./scripts/install_superlu.sh
     ./scripts/install_pexsi.sh
     ./scripts/install_quip.sh
-    ./scripts/install_plumed.sh
     ./scripts/install_gsl.sh
+    ./scripts/install_plumed.sh
     ./scripts/install_spglib.sh
     ./scripts/install_hdf5.sh
     ./scripts/install_libvdwxc.sh

  • tc_install_sirius.sh.diff

--- install_sirius.sh.org       2020-02-25 14:50:50.000000000 +0900
+++ install_sirius.sh   2020-02-25 14:48:01.000000000 +0900
@@ -131,8 +131,8 @@
                    -DSpFFT_DIR="${SPFFT_ROOT}/lib/cmake/SpFFT" \
                    -DCMAKE_CXXFLAGS_RELEASE="${SIRIUS_OPT}" \
                    -DCMAKE_CXX_FLAGS_RELWITHDEBINFO="${SIRIUS_DBG}" \
-                   -DCMAKE_CXX_COMPILER=mpic++ \
-                   -DCMAKE_C_COMPILER=mpicc \
+                   -DCMAKE_CXX_COMPILER=${MPICXX} \
+                   -DCMAKE_C_COMPILER=${MPICC} \
                   ${COMPILATION_OPTIONS} .. > compile.log 2>&1
              make -j $NPROCS -C src >> compile.log 2>&1
 
@@ -155,8 +155,8 @@
                       -DCMAKE_CXX_FLAGS_RELWITHDEBINFO="${SIRIUS_DBG}" \
                       -DUSE_CUDA=ON \
                       -DGPU_MODEL=P100 \
-                      -DCMAKE_CXX_COMPILER=mpic++ \
-                      -DCMAKE_C_COMPILER=mpicc ${COMPILATION_OPTIONS} .. >> compile.log 2>&1
+                      -DCMAKE_CXX_COMPILER=${MPICXX} \
+                      -DCMAKE_C_COMPILER=${MPICC} ${COMPILATION_OPTIONS} .. >> compile.log 2>&1
                 make -j $NPROCS -C src >> compile.log 2>&1
                 install -d ${pkg_install_dir}/lib/cuda
                 install -d ${pkg_install_dir}/include/cuda

  • tc_install_plumed_noext.sh.diff

--- install_plumed.sh.org       2020-02-19 13:43:07.000000000 +0900
+++ install_plumed.sh   2020-02-19 13:42:49.000000000 +0900
@@ -40,7 +40,7 @@
 
             echo "Installing from scratch into ${pkg_install_dir}"
             cd plumed-${plumed_ver}
-            ./configure CXX="${MPICXX}" --prefix=${pkg_install_dir} --libdir="${pkg_install_dir}/lib" > configure.log 2>&1
+            ./configure CXX="${MPICXX}" --prefix=${pkg_install_dir} --libdir="${pkg_install_dir}/lib" CXXFLAGS="-I${GSLROOT}/include" LIBS="-L${GSLROOT}/lib" --enable-external-lapack=no --enable-external-blas=no > configure.log 2>&1
             make -j $NPROCS > make.log 2>&1
             make install > install.log 2>&1
             write_checksums "${install_lock_file}" "${SCRIPT_DIR}/$(basename ${SCRIPT_NAME})"
@@ -63,7 +63,7 @@
 esac
 
 if [ "$with_plumed" != "__DONTUSE__" ] ; then
-    PLUMED_LIBS='-lplumed -ldl -lstdc++ -lz -ldl'
+    PLUMED_LIBS='-lplumedKernel -lplumed -ldl -lstdc++ -lz -ldl'
     if [ "$with_plumed" != "__SYSTEM__" ] ; then
         cat <<EOF > "${BUILDDIR}/setup_plumed"
 prepend_path LD_LIBRARY_PATH "$pkg_install_dir/lib"

Build Procedure

#!/bin/sh

INSTDIR=/local/apl/lx/cp2k710-gnu

VERSION=7.1.0
DBCSR_VERSION=2.0.1

SOURCE_ROOT=/home/users/${USER}/Software/CP2K/${VERSION}

TARBALL=${SOURCE_ROOT}/cp2k-${VERSION}.tar.gz
TARBALL_DBCSR=${SOURCE_ROOT}/dbcsr-${DBCSR_VERSION}.tar.gz

TC_PATCH0=${SOURCE_ROOT}/tc_install_cp2k_toolchain.sh.diff
TC_PATCH5=${SOURCE_ROOT}/tc_install_sirius.sh.diff
TC_PATCH9=${SOURCE_ROOT}/tc_install_plumed_noext.sh.diff

PARALLEL=12

#---------------------------------------------------------------------------
umask 0022
export LANG=C
export LC_ALL=C

module purge
module load scl/devtoolset-7
module load mpi/openmpi/4.0.2/gnu7.3
module load cmake/3.16.3

cd $INSTDIR
if [ -d cp2k-${VERSION} ]; then
  mv cp2k-${VERSION} cp2k-erase
  rm -rf cp2k-erase &
fi
tar zxf ${TARBALL}
sleep 5
mv cp2k-${VERSION}/* .
sleep 5
rm -f cp2k-${VERSION}/.dockerignore
rmdir cp2k-${VERSION}

cd ${INSTDIR}/tools/toolchain
patch < ${TC_PATCH0}

cd scripts
patch < ${TC_PATCH5}
patch < ${TC_PATCH9}
cd ../

export MPICC=mpicc
export MPICXX=mpicxx
export MPIFC=mpif90

./install_cp2k_toolchain.sh --math-mode=openblas \
                            --mpi-mode=openmpi \
                            --with-cmake=system \
                            --with-mpich=no \
                            --with-libxc=install \
                            --with-libint=install \
                            --with-fftw=install \
                            --with-openblas=install \
                            --with-scalapack=install \
                            --with-reflapack=no \
                            --with-mkl=no \
                            --with-libxsmm=install \
                            --with-elpa=install \
                            --with-ptscotch=install \
                            --with-pexsi=install \
                            --with-parmetis=install \
                            --with-superlu=install \
                            --with-quip=install \
                            --with-plumed=install \
                            --with-gsl=install \
                            --with-libvdwxc=install \
                            --with-spglib=install \
                            --with-hdf5=install \
                            --with-spfft=install \
                            -j ${PARALLEL}

cp install/arch/local.psmp ../../arch/rccs.psmp

cd ${INSTDIR}/exts
rmdir dbcsr
tar zxf ${TARBALL_DBCSR}
mv dbcsr-${DBCSR_VERSION} dbcsr
cd ../
make -j ${PARALLEL} ARCH=rccs VERSION=psmp

Tests

Test script below was executed on ccfep.

#!/bin/sh

export LC_ALL=C
export LANG=""

# gcc8
module purge
module load scl/devtoolset-7
module load mpi/openmpi/4.0.2/gnu7.3
module load cmake/3.16.3
#CP2K=/home/users/qf7/Software/CP2K/7.1.0/cp2k-7.1.0-gcc7-openmpi4-openblas
CP2K=/local/apl/lx/cp2k710-gnu

CP2K_ARCH=rccs
CP2K_VER=psmp
TIMEOUT=120
PARALLEL=16

ulimit -s unlimited
cd ${CP2K}/regtesting/${CP2K_ARCH}/${CP2K_VER}
rm -rf LAST-${CP2K_ARCH}-${CP2K_VER}

# serial test
../../../tools/regtesting/do_regtest \
        -nobuild \
        -nosvn \
        -arch ${CP2K_ARCH} \
        -version ${CP2K_VER} \
        -mpiranks 1 \
        -ompthreads 1 \
        -jobmaxtime ${TIMEOUT} \
        -cp2kdir ../../../ \
        -maxtasks ${PARALLEL} >& regtest_mpi1_omp1.log
rm -rf LAST-${CP2K_ARCH}-${CP2K_VER}

# omp test
../../../tools/regtesting/do_regtest \
        -nobuild \
        -nosvn \
        -arch ${CP2K_ARCH} \
        -version ${CP2K_VER} \
        -mpiranks 1 \
        -ompthreads 2 \
        -jobmaxtime ${TIMEOUT} \
        -cp2kdir ../../../ \
        -maxtasks ${PARALLEL} >& regtest_mpi1_omp2.log
rm -rf LAST-${CP2K_ARCH}-${CP2K_VER}

# mpi test
../../../tools/regtesting/do_regtest \
        -nobuild \
        -nosvn \
        -arch ${CP2K_ARCH} \
        -version ${CP2K_VER} \
        -mpiranks 2 \
        -ompthreads 1 \
        -jobmaxtime ${TIMEOUT} \
        -cp2kdir ../../../ \
        -maxtasks ${PARALLEL} >& regtest_mpi2_omp1.log
rm -rf LAST-${CP2K_ARCH}-${CP2K_VER}

# mpi/openmp test
../../../tools/regtesting/do_regtest \
        -nobuild \
        -nosvn \
        -arch ${CP2K_ARCH} \
        -version ${CP2K_VER} \
        -mpiranks 2 \
        -ompthreads 2 \
        -jobmaxtime ${TIMEOUT} \
        -cp2kdir ../../../ \
        -maxtasks ${PARALLEL} >& regtest_mpi2_omp2.log
rm -rf LAST-${CP2K_ARCH}-${CP2K_VER}

# yet another mpi test
../../../tools/regtesting/do_regtest \
        -nobuild \
        -nosvn \
        -arch ${CP2K_ARCH} \
        -version ${CP2K_VER} \
        -mpiranks 8 \
        -ompthreads 1 \
        -jobmaxtime ${TIMEOUT} \
        -cp2kdir ../../../ \
        -maxtasks ${PARALLEL} >& regtest_mpi8_omp1.log
rm -rf LAST-${CP2K_ARCH}-${CP2K_VER}

# yet another mpi/openmp test
../../../tools/regtesting/do_regtest \
        -nobuild \
        -nosvn \
        -arch ${CP2K_ARCH} \
        -version ${CP2K_VER} \
        -mpiranks 8 \
        -ompthreads 2 \
        -jobmaxtime ${TIMEOUT} \
        -cp2kdir ../../../ \
        -maxtasks ${PARALLEL} >& regtest_mpi8_omp2.log
rm -rf LAST-${CP2K_ARCH}-${CP2K_VER}

Result: MPI1 - OMP1

--------------------------------- Summary --------------------------------
Number of FAILED  tests 1
Number of WRONG   tests 0
Number of CORRECT tests 3217
Number of NEW     tests 3
Total number of   tests 3221

  • QS/regtest-almo-2/ion-pair.inp: RUNTIME FAIL

Result: MPI1 - OMP2

--------------------------------- Summary --------------------------------
Number of FAILED  tests 1
Number of WRONG   tests 1
Number of CORRECT tests 3216
Number of NEW     tests 3
Total number of   tests 3221

  • QS/regtest-almo-2/ion-pair.inp: RUNTIME FAIL
  • SE/regtest/h2o_gks_e.inp: WRONG

Result: MPI2 - OMP1

--------------------------------- Summary --------------------------------
Number of FAILED  tests 0
Number of WRONG   tests 0
Number of CORRECT tests 3278
Number of NEW     tests 8
Total number of   tests 3286

Result: MPI2 - OMP2

--------------------------------- Summary --------------------------------
Number of FAILED  tests 0
Number of WRONG   tests 0
Number of CORRECT tests 3278
Number of NEW     tests 8
Total number of   tests 3286

Result: MPI8 - OMP1

--------------------------------- Summary --------------------------------
Number of FAILED  tests 0
Number of WRONG   tests 9
Number of CORRECT tests 3228
Number of NEW     tests 6
Total number of   tests 3243

  • QS/regtest-mp2-lr/H2O-mp2-gpw-lr.inp: WRONG
  • xTB/regtest-2/HF-field-gopt.inp: WRONG
  • QS/regtest-mp2-grad/H2O_grad_mme.inp: WRONG
  • QS/regtest-gpw-4/H2O-debug-5.inp: WRONG
  • QS/regtest-gpw-4/H2O-debug-6.inp: WRONG
  • QS/regtest-mp2-4/H2O_NO_HFX.inp: WRONG
  • QS/regtest-rma-3D/H2O-32-dftb-ls-2_mult.inp: WRONG
  • QS/regtest-rma-3D/H2O-32-dftb-ls-2.inp: WRONG
  • QS/regtest-mp2-2/H2O-02.inp: WRONG

Result: MPI8 - OMP2

--------------------------------- Summary --------------------------------
Number of FAILED  tests 0
Number of WRONG   tests 9
Number of CORRECT tests 3228
Number of NEW     tests 6
Total number of   tests 3243

  • QS/regtest-mp2-lr/H2O-mp2-gpw-lr.inp: WRONG
  • xTB/regtest-2/HF-field-gopt.inp: WRONG
  • QS/regtest-mp2-grad/H2O_grad_mme.inp: WRONG
  • QS/regtest-gpw-4/H2O-debug-5.inp: WRONG
  • QS/regtest-gpw-4/H2O-debug-6.inp: WRONG
  • QS/regtest-mp2-4/H2O_NO_HFX.inp: WRONG
  • QS/regtest-rma-3D/H2O-32-dftb-ls-2_mult.inp: WRONG
  • QS/regtest-rma-3D/H2O-32-dftb-ls-2.inp: WRONG
  • QS/regtest-mp2-2/H2O-02.inp: WRONG

Benchmark

H2O-64.inp was employed for benchmark as in 6.1.0. (output of grep "CP2K  " *.log is used)
Ran 21 times, and average of last 20 runs is listed below.

jobtype # of cores
(# of nodes)
MPI OMP GPU elapse(sec)
core 18 (1) 18 1 - 72.685
small 40 (1) 40 1 - 51.424
small 80 (2) 80 1 - 36.697
small 160 (4) 32 5 - 27.455

Notes

  • GPU versions were skipped for this version; they are not so useful in RCCS for now.
    • SIRIUS GPU version might be efficient if correctly built with MAGMA etc. But skipped this time.
  • We couldn't get performance improvement from libgrid (slower than the vanilla one).
    • pyratemp 0.3.2 was used when building libgrid.a. But this version of pyratemp cannot handle *.template files in xyz_to_vab correctly.
    • Applying sed -i -e "s/\\$/\!/g" -e "s/\@</\@\!/g" -e "s/>\@/\!\@/g" to *.template files can solve the issue, although the libgrid.a didn't bring any performance improvement...
      • (Use sed -i -e "s/\\\$/\!/g" -e "s/\@</\@\!/g" -e "s/>\@/\!\@/g" in the script; above one is valid only when manual execution on terminal.)
  • libsmm is simply ignored as in the case of 6.1.0.
  • Released version of dbcsr was used in this build. Using master branch of dbcsr is not a good way to build reliable binary.
  • At least for GCC build, OpenBlas is better than MKL in terms of performance.
  • GCC + Intel MPI failed on building cp2k. MPI module is concerned with this error, but we cannot identify the cause of this error. It might come from the wrong include path setting.
  • Couldn't build correctly with OpenMPI 3.1.0. It turned out to be a known issue.
    • https://github.com/cp2k/dbcsr/issues/141
  • Explicit legacy MPI1 support is required when built with OpenMPI 4.x. (Requested by scalapack (or mkl).)
  • gcc8 build is not good as gcc7 one in terms of performance and reliability.