Disable DLA-Future only with MPICH (#5578)

This commit is contained in:
Matthias Krack 2026-07-11 16:53:23 +02:00 committed by GitHub
parent 440cf4f012
commit c835e6b7b6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 23 additions and 11 deletions

View file

@ -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

View file

@ -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},

View file

@ -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"