diff --git a/source/module_base/sph_bessel_recursive.h b/source/module_base/sph_bessel_recursive.h index a74b0987e3..e11af5127d 100644 --- a/source/module_base/sph_bessel_recursive.h +++ b/source/module_base/sph_bessel_recursive.h @@ -7,7 +7,7 @@ #define SPH_BESSEL_RECURSIVE_H #include -#include"stddef.h" +#include namespace ModuleBase { @@ -32,7 +32,7 @@ class Sph_Bessel_Recursive::D1 private: std::vector> jlx; // jlx[l][x] - double dx; + double dx = 0.0; bool finish_set_dx = false; void cal_jlx_0( const int l_size ); @@ -56,7 +56,7 @@ class Sph_Bessel_Recursive::D2 private: std::vector>> jlx; // jlx[l][x1][x2] - double dx; + double dx = 0.0; bool finish_set_dx = false; void cal_jlx_0( const int l_size, const size_t ix1_size, const size_t ix2_size ); diff --git a/toolchain/README.md b/toolchain/README.md index 9f13f6614e..386efc8313 100644 --- a/toolchain/README.md +++ b/toolchain/README.md @@ -1,6 +1,6 @@ # The ABACUS Toolchain -Version 2024.2 +Version 2024.3 ## Author @@ -108,13 +108,13 @@ The needed dependencies version default: - `cmake` 3.30.0 - `gcc` 13.2.0 (which will always NOT be installed, But use system) -- `OpenMPI` 5.0.5 +- `OpenMPI` 4.1.6 (5.0.5 can be used but have some problem in OpenMP parallel computation in ELPA) - `MPICH` 4.2.2 -- `OpenBLAS` 0.3.27 (Intel toolchain need `get_vars.sh` tool from it) -- `ScaLAPACK` 2.2.1 +- `OpenBLAS` 0.3.28 (Intel toolchain need `get_vars.sh` tool from it) +- `ScaLAPACK` 2.2.1 (a developing version) - `FFTW` 3.3.10 - `LibXC` 6.2.2 -- `ELPA` 2024.03.001 +- `ELPA` 2024.05.001 - `CEREAL` 1.3.2 - `RapidJSON` 1.1.0 And Intel-oneAPI need user or server manager to manually install from Intel. diff --git a/toolchain/build_abacus_gnu.sh b/toolchain/build_abacus_gnu.sh index a5b88316fe..c797392585 100755 --- a/toolchain/build_abacus_gnu.sh +++ b/toolchain/build_abacus_gnu.sh @@ -28,6 +28,7 @@ ELPA=$INSTALL_DIR/elpa-2024.03.001/cpu FFTW3=$INSTALL_DIR/fftw-3.3.10 CEREAL=$INSTALL_DIR/cereal-1.3.2/include/cereal LIBXC=$INSTALL_DIR/libxc-6.2.2 +RAPIDJSON=$INSTALL_DIR/rapidjson-1.1.0/ # LIBRI=$INSTALL_DIR/LibRI-0.1.1 # LIBCOMM=$INSTALL_DIR/LibComm-0.1.0 # LIBTORCH=$INSTALL_DIR/libtorch-2.1.2/share/cmake/Torch @@ -47,7 +48,8 @@ cmake -B $BUILD_DIR -DCMAKE_INSTALL_PREFIX=$PREFIX \ -DENABLE_LIBXC=ON \ -DUSE_OPENMP=ON \ -DUSE_ELPA=ON \ - -DENABLE_RAPIDJSON=OFF \ + -DENABLE_RAPIDJSON=ON \ + -DRapdidJSON_DIR=$RAPIDJSON \ # -DENABLE_DEEPKS=1 \ # -DTorch_DIR=$LIBTORCH \ # -Dlibnpy_INCLUDE_DIR=$LIBNPY \ diff --git a/toolchain/build_abacus_intel-mpich.sh b/toolchain/build_abacus_intel-mpich.sh index e199f049cf..dc7fad7d96 100755 --- a/toolchain/build_abacus_intel-mpich.sh +++ b/toolchain/build_abacus_intel-mpich.sh @@ -26,6 +26,7 @@ PREFIX=$ABACUS_DIR ELPA=$INSTALL_DIR/elpa-2024.03.001/cpu CEREAL=$INSTALL_DIR/cereal-1.3.2/include/cereal LIBXC=$INSTALL_DIR/libxc-6.2.2 +RAPIDJSON=$INSTALL_DIR/rapidjson-1.1.0/ # LIBTORCH=$INSTALL_DIR/libtorch-2.1.2/share/cmake/Torch # LIBNPY=$INSTALL_DIR/libnpy-1.0.1/include # LIBRI=$INSTALL_DIR/LibRI-0.1.1 @@ -43,7 +44,8 @@ cmake -B $BUILD_DIR -DCMAKE_INSTALL_PREFIX=$PREFIX \ -DENABLE_LIBXC=ON \ -DUSE_OPENMP=ON \ -DUSE_ELPA=ON \ - -DENABLE_RAPIDJSON=OFF \ + -DENABLE_RAPIDJSON=ON \ + -DRapdidJSON_DIR=$RAPIDJSON \ # -DENABLE_DEEPKS=1 \ # -DTorch_DIR=$LIBTORCH \ # -Dlibnpy_INCLUDE_DIR=$LIBNPY \ diff --git a/toolchain/build_abacus_intel.sh b/toolchain/build_abacus_intel.sh index 777c812655..0b4563c688 100755 --- a/toolchain/build_abacus_intel.sh +++ b/toolchain/build_abacus_intel.sh @@ -26,6 +26,7 @@ PREFIX=$ABACUS_DIR ELPA=$INSTALL_DIR/elpa-2024.03.001/cpu CEREAL=$INSTALL_DIR/cereal-1.3.2/include/cereal LIBXC=$INSTALL_DIR/libxc-6.2.2 +RAPIDJSON=$INSTALL_DIR/rapidjson-1.1.0/ # LIBTORCH=$INSTALL_DIR/libtorch-2.1.2/share/cmake/Torch # LIBNPY=$INSTALL_DIR/libnpy-1.0.1/include # LIBRI=$INSTALL_DIR/LibRI-0.1.1 @@ -44,7 +45,8 @@ cmake -B $BUILD_DIR -DCMAKE_INSTALL_PREFIX=$PREFIX \ -DENABLE_LIBXC=ON \ -DUSE_OPENMP=ON \ -DUSE_ELPA=ON \ - -DENABLE_RAPIDJSON=OFF \ + -DENABLE_RAPIDJSON=ON \ + -DRapdidJSON_DIR=$RAPIDJSON \ # -DENABLE_DEEPKS=1 \ # -DTorch_DIR=$LIBTORCH \ # -Dlibnpy_INCLUDE_DIR=$LIBNPY \ diff --git a/toolchain/scripts/VERSION b/toolchain/scripts/VERSION index a6faad3be8..bce1d6fc01 100644 --- a/toolchain/scripts/VERSION +++ b/toolchain/scripts/VERSION @@ -1,2 +1,2 @@ # version file to force a rebuild of the entire toolchain -VERSION="2024.2" +VERSION="2024.3" diff --git a/toolchain/scripts/get_openblas_arch.sh b/toolchain/scripts/get_openblas_arch.sh index 70b492d576..4104ff821c 100755 --- a/toolchain/scripts/get_openblas_arch.sh +++ b/toolchain/scripts/get_openblas_arch.sh @@ -8,8 +8,8 @@ [ "${BASH_SOURCE[0]}" ] && SCRIPT_NAME="${BASH_SOURCE[0]}" || SCRIPT_NAME=$0 SCRIPT_DIR="$(cd "$(dirname "$SCRIPT_NAME")" && pwd -P)" -openblas_ver="0.3.27" # Keep in sync with install_openblas.sh -openblas_sha256="aa2d68b1564fe2b13bc292672608e9cdeeeb6dc34995512e65c3b10f4599e897" +openblas_ver="0.3.28" # Keep in sync with install_openblas.sh +openblas_sha256="f1003466ad074e9b0c8d421a204121100b0751c96fc6fcf3d1456bd12f8a00a1" openblas_pkg="OpenBLAS-${openblas_ver}.tar.gz" source "${SCRIPT_DIR}"/common_vars.sh diff --git a/toolchain/scripts/stage0/install_cmake.sh b/toolchain/scripts/stage0/install_cmake.sh index a76472901b..b16c9719b2 100755 --- a/toolchain/scripts/stage0/install_cmake.sh +++ b/toolchain/scripts/stage0/install_cmake.sh @@ -36,17 +36,18 @@ case "${with_cmake}" in pkg_install_dir="${INSTALLDIR}/cmake-${cmake_ver}" #pkg_install_dir="${HOME}/apps/cmake/${cmake_ver}" install_lock_file="$pkg_install_dir/install_successful" + cmake_pkg="cmake-${cmake_ver}-${cmake_arch}.sh" if verify_checksums "${install_lock_file}"; then echo "cmake-${cmake_ver} is already installed, skipping it." else - if [ -f cmake-${cmake_ver}-${cmake_arch}.sh ]; then - echo "cmake-${cmake_ver}-${cmake_arch}.sh is found" + if [ -f $cmake_pkg ]; then + echo "$cmake_pkg is found" else - download_pkg_from_ABACUS_org "${cmake_sha256}" "cmake-${cmake_ver}-${cmake_arch}.sh" + download_pkg_from_ABACUS_org "${cmake_sha256}" "$cmake_pkg" fi echo "Installing from scratch into ${pkg_install_dir}" mkdir -p ${pkg_install_dir} - /bin/sh cmake-${cmake_ver}-${cmake_arch}.sh --prefix=${pkg_install_dir} --skip-license > install.log 2>&1 || tail -n ${LOG_LINES} install.log + /bin/sh $cmake_pkg --prefix=${pkg_install_dir} --skip-license > install.log 2>&1 || tail -n ${LOG_LINES} install.log write_checksums "${install_lock_file}" "${SCRIPT_DIR}/stage0/$(basename ${SCRIPT_NAME})" fi ;; diff --git a/toolchain/scripts/stage1/install_openmpi.sh b/toolchain/scripts/stage1/install_openmpi.sh index c5baa47843..99adfc5bd9 100755 --- a/toolchain/scripts/stage1/install_openmpi.sh +++ b/toolchain/scripts/stage1/install_openmpi.sh @@ -8,10 +8,10 @@ [ "${BASH_SOURCE[0]}" ] && SCRIPT_NAME="${BASH_SOURCE[0]}" || SCRIPT_NAME=$0 SCRIPT_DIR="$(cd "$(dirname "$SCRIPT_NAME")/.." && pwd -P)" -openmpi_ver="5.0.5" -openmpi_sha256="6588d57c0a4bd299a24103f4e196051b29e8b55fbda49e11d5b3d32030a32776" -# openmpi_ver="4.1.6" -# openmpi_sha256="f740994485516deb63b5311af122c265179f5328a0d857a567b85db00b11e415" +#openmpi_ver="5.0.5" +#openmpi_sha256="6588d57c0a4bd299a24103f4e196051b29e8b55fbda49e11d5b3d32030a32776" +openmpi_ver="4.1.6" +openmpi_sha256="f740994485516deb63b5311af122c265179f5328a0d857a567b85db00b11e415" openmpi_pkg="openmpi-${openmpi_ver}.tar.bz2" source "${SCRIPT_DIR}"/common_vars.sh @@ -64,6 +64,7 @@ case "${with_openmpi}" in # OpenMPI 5.0 only supports PMIx # PMI support is required for Slurm, but not for other schedulers # default not use + # for OpenMPI 4.1 with pmi slurm, we can open this setting manually # if [ $(command -v srun) ]; then # echo "Slurm installation found. OpenMPI will be configured with --with-pmi." # EXTRA_CONFIGURE_FLAGS="--with-pmi" diff --git a/toolchain/scripts/stage2/install_openblas.sh b/toolchain/scripts/stage2/install_openblas.sh index 18039b2023..6c411edaad 100755 --- a/toolchain/scripts/stage2/install_openblas.sh +++ b/toolchain/scripts/stage2/install_openblas.sh @@ -8,8 +8,8 @@ [ "${BASH_SOURCE[0]}" ] && SCRIPT_NAME="${BASH_SOURCE[0]}" || SCRIPT_NAME=$0 SCRIPT_DIR="$(cd "$(dirname "$SCRIPT_NAME")/.." && pwd -P)" -openblas_ver="0.3.27" # Keep in sync with get_openblas_arch.sh -openblas_sha256="aa2d68b1564fe2b13bc292672608e9cdeeeb6dc34995512e65c3b10f4599e897" +openblas_ver="0.3.28" # Keep in sync with get_openblas_arch.sh +openblas_sha256="f1003466ad074e9b0c8d421a204121100b0751c96fc6fcf3d1456bd12f8a00a1" openblas_pkg="OpenBLAS-${openblas_ver}.tar.gz" source "${SCRIPT_DIR}"/common_vars.sh diff --git a/toolchain/scripts/stage3/install_elpa.sh b/toolchain/scripts/stage3/install_elpa.sh index 24756c43b7..eff2bc7fe8 100755 --- a/toolchain/scripts/stage3/install_elpa.sh +++ b/toolchain/scripts/stage3/install_elpa.sh @@ -9,8 +9,8 @@ SCRIPT_DIR="$(cd "$(dirname "$SCRIPT_NAME")/.." && pwd -P)" # From https://elpa.mpcdf.mpg.de/software/tarball-archive/ELPA_TARBALL_ARCHIVE.html -elpa_ver="2024.03.001" -elpa_sha256="41c6cbf56d2dac26443faaba8a77307d261bf511682a64b96e24def77c813622" +elpa_ver="2024.05.001" +elpa_sha256="9caf41a3e600e2f6f4ce1931bd54185179dade9c171556d0c9b41bbc6940f2f6" source "${SCRIPT_DIR}"/common_vars.sh @@ -59,13 +59,15 @@ case "$with_elpa" in echo "elpa-${elpa_ver} is already installed, skipping it." else require_env MATH_LIBS - if [ -f elpa-${elpa_ver}.tar.gz ]; then - echo "elpa-${elpa_ver}.tar.gz is found" + elpa_pkg="elpa-${elpa_ver}.tar.gz" + url=f"https://elpa.mpcdf.mpg.de/software/tarball-archive/Releases/${elpa_ver}/${elpa_pkg}" + if [ -f ${elpa_pkg} ]; then + echo "${elpa_pkg} is found" else - download_pkg_from_ABACUS_org "${elpa_sha256}" "elpa-${elpa_ver}.tar.gz" + download_pkg_from_url "${elpa_sha256}" "${elpa_pkg}" "${url}" fi [ -d elpa-${elpa_ver} ] && rm -rf elpa-${elpa_ver} - tar -xzf elpa-${elpa_ver}.tar.gz + tar -xzf ${elpa_pkg} # elpa expect FC to be an mpi fortran compiler that is happy # with long lines, and that a bunch of libs can be found diff --git a/toolchain/scripts/stage4/install_rapidjson.sh b/toolchain/scripts/stage4/install_rapidjson.sh index 7883c96943..bce4d84d6f 100755 --- a/toolchain/scripts/stage4/install_rapidjson.sh +++ b/toolchain/scripts/stage4/install_rapidjson.sh @@ -55,6 +55,8 @@ case "$with_rapidjson" in tar -xzf $filename mkdir -p "${pkg_install_dir}" cp -r $dirname/* "${pkg_install_dir}/" + # for CMake to find rapidjson + cp ${pkg_install_dir}/RapidJSONConfig.cmake.in ${pkg_install_dir}/RapidJSONConfig.cmake write_checksums "${install_lock_file}" "${SCRIPT_DIR}/stage4/$(basename ${SCRIPT_NAME})" fi ;;