From c835e6b7b6995e608e300f0dfa6f0943d2ff96b6 Mon Sep 17 00:00:00 2001 From: Matthias Krack Date: Sat, 11 Jul 2026 16:53:23 +0200 Subject: [PATCH] Disable DLA-Future only with MPICH (#5578) --- make_cp2k.sh | 26 +++++++++++++++++------ tests/QS/regtest-tddfpt-4/TEST_FILES.toml | 2 +- tools/spack/cp2k_deps_p.yaml | 6 +++--- 3 files changed, 23 insertions(+), 11 deletions(-) diff --git a/make_cp2k.sh b/make_cp2k.sh index a0c03a9807..d6bb56006c 100755 --- a/make_cp2k.sh +++ b/make_cp2k.sh @@ -137,7 +137,6 @@ DEPS_BUILD_TYPE="${DEPS_BUILD_TYPE:-Release}" CMAKE_FEATURE_FLAG_ALL="-DCP2K_USE_EVERYTHING=ON" # all features are activated by default CMAKE_FEATURE_FLAGS="-DCP2K_BLAS_VENDOR=OpenBLAS" # LAPACK/BLAS from OpenBLAS by default CMAKE_FEATURE_FLAGS+=" -DCP2K_USE_FFTW3=ON" # FFTW3 is always activated unless explicitly disabled -CMAKE_FEATURE_FLAGS+=" -DCP2K_USE_DLAF=OFF" # DLAF is deactivated by default CMAKE_FEATURE_FLAG_MPI="-DCP2K_USE_MPI=ON" # MPI is switched on by default CMAKE_FEATURE_FLAGS_GPU="-DCP2K_USE_SPLA_GEMM_OFFLOADING=ON" CRAY="no" @@ -281,8 +280,8 @@ while [[ $# -gt 0 ]]; do CMAKE_FEATURE_FLAG_ALL="-DCP2K_USE_EVERYTHING=${ON_OFF}" for package in adios2 cosma deepmdkit dla-future dla-future-fortran elpa \ gauxc greenx hdf5 libfabric libfci libint libvdwxc libsmeagol libvori \ - libxc libxs mimic-mcl openpmd-api pace pexsi plumed py-torch sirius spfft \ - spglib spla tblite trexio; do + libxc libxs libxsmm mimic-mcl openpmd-api pace pexsi plumed py-torch sirius \ + spfft spglib spla tblite trexio; do SED_PATTERN_LIST+=" -e '/\s*-\s+\"${package}@/ ${SUBST}" done # dbcsr must use blas as fallback when libxs/libxsmm is disabled @@ -322,9 +321,9 @@ while [[ $# -gt 0 ]]; do dlaf) SED_PATTERN_LIST+=" -e '/\s*-\s+\"dla-future.*@/ ${SUBST}" if [[ "${ON_OFF}" == "ON" ]]; then - SED_PATTERN_LIST+=" -e 's/\"~dlaf\"/\"+dlaf\"/'" + SED_PATTERN_LIST+=" -e 's/\~dlaf/\+dlaf/'" else - SED_PATTERN_LIST+=" -e 's/\"+dlaf\"/\"~dlaf\"/'" + SED_PATTERN_LIST+=" -e 's/\+dlaf/\~dlaf/'" fi ;; fftw3) @@ -352,7 +351,7 @@ while [[ $# -gt 0 ]]; do fi ;; libxs) - SED_PATTERN_LIST+=" -e '/\s*-\s+\"${2,,}@/ ${SUBST}" + SED_PATTERN_LIST+=" -e '/\s*-\s+\"libxs@/ ${SUBST}" SED_PATTERN_LIST+=" -e '/\s*-\s+\"libxsmm@/ ${SUBST}" if [[ "${ON_OFF}" == "OFF" ]]; then SED_PATTERN_LIST+=" -e '/\s*-\s+\"smm=${2,,}\"/ s/${2,,}/blas/'" @@ -618,6 +617,19 @@ NUM_PROCS=$(awk '{print $1+0}' <<< "${NUM_PROCS}") # Assemble CMake feature flag list CMAKE_FEATURE_FLAGS="${CMAKE_FEATURE_FLAG_ALL} ${CMAKE_FEATURE_FLAG_MPI} ${CMAKE_FEATURE_FLAGS}" +# DLA-Future does not work with MPICH yet +case "${MPI_MODE}" in + mpich | openmpi) + if [[ "${CMAKE_FEATURE_FLAGS}" == *"-DCP2K_USE_EVERYTHING=ON"* ]] || + [[ "${CMAKE_FEATURE_FLAGS}" == *"-DCP2K_USE_DLAF=ON"* ]]; then + echo -e "\nINFO: DLA-Future does not work with ${MPI_MODE^^} yet and is disabled" + CMAKE_FEATURE_FLAGS+=" -DCP2K_USE_DLAF=OFF" + SED_PATTERN_LIST+=" -e '/\s*-\s+\"dla-future.*@/ s/^ /#/'" + SED_PATTERN_LIST+=" -e 's/\+dlaf/\~dlaf/'" + fi + ;; +esac + # Clean CMake feature flag list from repeated entries and keep only the last definition declare -A last=() order=() @@ -757,7 +769,7 @@ echo "" echo "CMAKE_FEATURE_FLAGS = ${CMAKE_FEATURE_FLAGS}" echo "" -((VERBOSE > 0)) && echo "SED_PATTERN_LIST = ${SED_PATTERN_LIST}" +((VERBOSE > 0)) && echo -e "SED_PATTERN_LIST = ${SED_PATTERN_LIST}\n" # Check if a valid number for the packages to be built by spack in parallel is given if ((NUM_PACKAGES < 1)); then diff --git a/tests/QS/regtest-tddfpt-4/TEST_FILES.toml b/tests/QS/regtest-tddfpt-4/TEST_FILES.toml index 3304b59bd9..15a43ace67 100644 --- a/tests/QS/regtest-tddfpt-4/TEST_FILES.toml +++ b/tests/QS/regtest-tddfpt-4/TEST_FILES.toml @@ -21,7 +21,7 @@ "test08.inp" = [{matcher="TDDFPT_Check_Energy", tol=5.0E-06, ref=0.103120E+01}, {matcher="TDDFPT_Check_Osc_Strength", tol=1.0E-06, ref=0.53475506E+00}] "test09.inp" = [{matcher="TDDFPT_Check_Energy", tol=5.0E-06, ref=0.101371E+01}, - {matcher="TDDFPT_Check_Osc_Strength", tol=2.0E-05, ref=0.52917241E+00}] + {matcher="TDDFPT_Check_Osc_Strength", tol=4.0E-05, ref=0.52917241E+00}] "test10.inp" = [{matcher="TDDFPT_Check_Energy", tol=5.0E-06, ref=0.997064E+00}, {matcher="TDDFPT_Check_Osc_Strength", tol=1.0E-05, ref=0.550257E+00}] "test11.inp" = [{matcher="TDDFPT_Check_Energy", tol=5.0E-06, ref=0.105541E+01}, diff --git a/tools/spack/cp2k_deps_p.yaml b/tools/spack/cp2k_deps_p.yaml index cabc824658..81c2bb12fa 100644 --- a/tools/spack/cp2k_deps_p.yaml +++ b/tools/spack/cp2k_deps_p.yaml @@ -167,7 +167,7 @@ spack: require: - "~apps" - "+dftd3" - - "~dlaf" + - "+dlaf" - "+elpa" - "+fortran" - "+pugixml" @@ -201,8 +201,8 @@ spack: - "dbcsr@2.10.0" - "deepmdkit@3.1.3" # - "dftd4@4.0.2" -# - "dla-future@0.10.0" -# - "dla-future-fortran@0.5.0" + - "dla-future@0.10.0" + - "dla-future-fortran@0.5.0" - "elpa@2026.02.002" - "fftw@3.3.11" - "gauxc@dev20260608"