CP2K 9.1
ウェブページ
バージョン
9.1 (9.1.0)
ビルド環境
- GCC 11.2.1 (gcc-toolset-11)
- HPC-X 2.13.1 (Open MPI 4.1.5)
ビルドに必要なファイル
- cp2k-9.1.0.tar.gz
- tc-install-libint.sh.diff
--- scripts/stage3/install_libint.sh.org 2022-01-26 09:34:28.922143775 +0900
+++ scripts/stage3/install_libint.sh 2022-01-26 09:41:44.440708192 +0900
@@ -90,6 +90,7 @@
# Fix bug in makefile for Fortran module
sed -i "s/\$(CXX) \$(CXXFLAGS)/\$(FC) \$(FCFLAGS)/g" fortran/Makefile
fi
+ sed -i 's/FCLIBS)/FCLIBS) -lstdc++/' fortran/Makefile
make -j $(get_nprocs) > make.log 2>&1
make install > install.log 2>&1
- patch-openblas-makefile
--- scripts/stage2/install_openblas.sh.org 2023-01-17 10:19:31.000000000 +0900
+++ scripts/stage2/install_openblas.sh 2023-01-17 10:20:21.000000000 +0900
@@ -47,6 +47,7 @@
[ -d OpenBLAS-${openblas_ver} ] && rm -rf OpenBLAS-${openblas_ver}
tar -zxf ${openblas_pkg}
cd OpenBLAS-${openblas_ver}
+ sed -i -e "/NOTPARALLEL/s/$/ shared/" Makefile
# First attempt to make openblas using auto detected
# TARGET, if this fails, then make with forced
ビルド手順
#!/bin/sh
INSTDIR=/apl/cp2k/9.1
GITHUB_VERSION=9.1.0
VERSION=9.1.0
DBCSR_VERSION=v2.2.0
SOURCE_ROOT=/home/users/${USER}/Software/CP2K/${GITHUB_VERSION}
TARBALL=${SOURCE_ROOT}/cp2k-${VERSION}.tar.gz
TC_PATCH_3_1=${SOURCE_ROOT}/tc-install-libint.sh.diff
TC_PATCH_2_OB=${SOURCE_ROOT}/patch-openblas-makefile
PARALLEL=12
#---------------------------------------------------------------------------
umask 0022
export LANG=C
export LC_ALL=C
ulimit -s unlimited
module purge
module load gcc-toolset/11
module load openmpi/4.1.5-hpcx/gcc11
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 -rf cp2k-${VERSION}/{.dockerignore,.github}
rmdir cp2k-${VERSION}
cd ${INSTDIR}/tools/toolchain
# apply patches
patch -p0 < ${TC_PATCH_3_1}
patch -p0 < ${TC_PATCH_2_OB}
# ad hoc...
sed -i -e "s/https:.*/https:\/\/github.com\/spglib\/spglib\/archive\/refs\/tags\/v1.16.2.tar.gz \\\/" scripts/stage7/install_spglib.sh
export CC=gcc
export CXX=g++
export FC=gfortran
export MPICC=mpicc
export MPICXX=mpicxx
export MPIFC=mpif90
./install_cp2k_toolchain.sh --mpi-mode=openmpi \
--math-mode=openblas \
--with-gcc=system \
--with-cmake=system \
--with-openmpi=system \
--with-mpich=no \
--with-intelmpi=no \
--with-libxc=install \
--with-libint=install \
--with-fftw=install \
--with-acml=no \
--with-mkl=no \
--with-openblas=install \
--with-scalapack=install \
--with-libsmm=no \
--with-libxsmm=install \
--with-elpa=no \
--with-ptscotch=no \
--with-superlu=no \
--with-pexsi=no \
--with-quip=install \
--with-plumed=install \
--with-sirius=install \
--with-gsl=install \
--with-libvdwxc=install \
--with-spglib=install \
--with-hdf5=install \
--with-spfft=install \
--with-spla=install \
--with-cosma=no \
--with-libvori=install \
-j ${PARALLEL}
cp install/arch/local.psmp ../../arch/rccs.psmp
cd ${INSTDIR}
cd ${INSTDIR}/exts
rmdir dbcsr
git clone https://github.com/cp2k/dbcsr.git
cd dbcsr
git checkout refs/tags/${DBCSR_VERSION}
git submodule update --init --recursive
cd ${INSTDIR}
make -j ${PARALLEL} ARCH=rccs VERSION=psmp
make -j ${PARALLEL} ARCH=rccs VERSION=psmp libcp2k
テスト
以下のスクリプトで実行。
#!/bin/sh
#PBS -l select=1:ncpus=16:mpiprocs=16:ompthreads=1
#PBS -l walltime=12:00:00
export LC_ALL=C
export LANG=""
export OMP_STACKSIZE=64M
module purge
module load gcc-toolset/11
module load openmpi/4.1.5-hpcx/gcc11
CP2K=/apl/cp2k/9.1
CP2K_ARCH=rccs
CP2K_VER=psmp
TIMEOUT=600
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 \
-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 \
-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 \
-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 \
-arch ${CP2K_ARCH} \
-version ${CP2K_VER} \
-mpiranks 2 \
-ompthreads 2 \
-jobmaxtime ${TIMEOUT} \
-cp2kdir ../../../ \
-maxtasks ${PARALLEL} >& regtest_mpi2_omp2.log
# yet another mpi test
../../../tools/regtesting/do_regtest \
-nobuild \
-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 \
-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}
結果
$ grep GREPME regtest_mpi*
regtest_mpi1_omp1.log:GREPME 0 0 3586 0 3586 X
regtest_mpi1_omp2.log:GREPME 0 0 3586 0 3586 X
regtest_mpi2_omp1.log:GREPME 0 0 3642 0 3642 X
regtest_mpi2_omp2.log:GREPME 0 0 3642 0 3642 X
regtest_mpi8_omp1.log:GREPME 11 16 3629 0 3656 X
regtest_mpi8_omp2.log:GREPME 11 17 3628 0 3656 X
テスト結果は /apl/cp2k/9.1/regtesting/rccs/psmp 以下にあります。
メモ
- elpa はうまくいかなかったため、今回は回避。
- openmpi では superlu がどうにもならず。pexsi と ptscotch もつられて回避。
- (intel mpi はシステム側の問題(2/3 解消)に遭遇し、その時点では回避できなかったために詳細な検証はできていない。)
- (2024/7/26) HPC-X 2.11, 2.13.1 の実行時ライブラリを使った場合 H20-256 系の 128 並列計算で速度が大幅に落ちる現象を確認。Open MPI 4.1.5, 4.1.6, HPC-X 2.16 を使えば問題は発生しない。