Skip to content

Commit 4d01d40

Browse files
committed
support new intelmpi compiler
1 parent 52b03c2 commit 4d01d40

File tree

2 files changed

+38
-10
lines changed

2 files changed

+38
-10
lines changed

toolchain/install_abacus_toolchain.sh

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -152,8 +152,11 @@ The --with-PKG options follow the rules:
152152
Default = system
153153
--with-intel Use the Intel compiler to compile ABACUS.
154154
Default = system
155-
--with-intel-classic Use the classic Intel compiler (icc and icpc) to compile ABACUS.
156-
--with-ifx Use the new Intel Fortran compiler ifx instead of ifort to compile dependence of ABACUS
155+
--with-intel-classic Use the classic Intel compiler (icc, icpc, ifort) to compile ABACUS.
156+
Default = no
157+
--with-intelmpi-classic Use the classic Intelmpi compiler (mpiicc, mpiicpc and mpiifort)
158+
Default = no
159+
--with-ifx Use the new Intel Fortran compiler ifx instead of ifort to compile dependence of ABACUS, along with mpiifx (if --with-intel-classic=no)
157160
Default = yes
158161
--with-cmake Cmake utilities
159162
Default = install
@@ -305,13 +308,15 @@ enable_opencl="__FALSE__"
305308
enable_cuda="__FALSE__"
306309
enable_hip="__FALSE__"
307310
export intel_classic="no"
308-
# no, then icc->icx, icpc->icpx,
311+
# no, then icc->icx, icpc->icpx
309312
# which cannot compile elpa in AMD server
310313
# due to some so-called cross-compile problem
311314
# and will lead to problem in force calculation
312315
# but icx is recommended by intel compiler
313316
# option: --with-intel-classic can change it to yes/no
314-
# zhaoqing by 2023.08.31
317+
# zhaoqing by 2023.08
318+
export intelmpi_classic="no"
319+
export with_ifx="yes"
315320
export GPUVER="no"
316321
export MPICH_DEVICE="ch4"
317322
export TARGET_CPU="native"
@@ -506,6 +511,9 @@ while [ $# -ge 1 ]; do
506511
--with-intel-classic*)
507512
intel_classic=$(read_with "${1}" "no") # default new intel compiler
508513
;;
514+
--with-intelmpi-classic*)
515+
intelmpi_classic=$(read_with "${1}" "no") # default new intel mpi compiler
516+
;;
509517
--with-intel*)
510518
with_intel=$(read_with "${1}" "__SYSTEM__")
511519
;;

toolchain/scripts/stage1/install_intelmpi.sh

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,19 @@ case "${with_intelmpi}" in
3333
echo "==================== Finding Intel MPI from system paths ===================="
3434
check_command mpiexec "intelmpi" && MPIRUN="$(realpath $(command -v mpiexec))"
3535
if [ "${with_intel}" != "__DONTUSE__" ]; then
36-
check_command mpiicc "intelmpi" && MPICC="$(realpath $(command -v mpiicc))" || exit 1
37-
check_command mpiicpc "intelmpi" && MPICXX="$(realpath $(command -v mpiicpc))" || exit 1
38-
check_command mpiifort "intelmpi" && MPIFC="$(realpath $(command -v mpiifort))" || exit 1
36+
if [ "${intelmpi_classic}" = "yes" ]; then
37+
check_command mpiicc "intelmpi" && MPICC="$(realpath $(command -v mpiicc))" || exit 1
38+
check_command mpiicpc "intelmpi" && MPICXX="$(realpath $(command -v mpiicpc))" || exit 1
39+
check_command mpiifort "intelmpi" && MPIFC="$(realpath $(command -v mpiifort))" || exit 1
40+
else
41+
check_command mpiicx "intelmpi" && MPICC="$(realpath $(command -v mpiicc))" || exit 1
42+
check_command mpiicpx "intelmpi" && MPICXX="$(realpath $(command -v mpiicpc))" || exit 1
43+
if [ "${with_ifx}" = "yes" ]; then
44+
check_command mpiifx "intelmpi" && MPIFC="$(realpath $(command -v mpiifx))" || exit 1
45+
else
46+
check_command mpiifort "intelmpi" && MPIFC="$(realpath $(command -v mpiifort))" || exit 1
47+
fi
48+
fi
3949
else
4050
echo "The use of Intel MPI is only supported with the Intel compiler"
4151
exit 1
@@ -59,9 +69,19 @@ case "${with_intelmpi}" in
5969
check_dir "${pkg_install_dir}/include"
6070
check_command ${pkg_install_dir}/bin/mpiexec "intel" && MPIRUN="${pkg_install_dir}/bin/mpiexec" || exit 1
6171
if [ "${with_intel}" != "__DONTUSE__" ]; then
62-
check_command ${pkg_install_dir}/bin/mpiicc "intel" && MPICC="${pkg_install_dir}/bin/mpiicc" || exit 1
63-
check_command ${pkg_install_dir}/bin/mpiicpc "intel" && MPICXX="${pkg_install_dir}/bin/mpiicpc" || exit 1
64-
check_command ${pkg_install_dir}/bin/mpiifort "intel" && MPIFC="${pkg_install_dir}/bin/mpiifort" || exit 1
72+
if [ "${intelmpi_classic}" = "yes" ]; then
73+
check_command ${pkg_install_dir}/bin/mpiicc "intel" && MPICC="${pkg_install_dir}/bin/mpiicc" || exit 1
74+
check_command ${pkg_install_dir}/bin/mpiicpc "intel" && MPICXX="${pkg_install_dir}/bin/mpiicpc" || exit 1
75+
check_command ${pkg_install_dir}/bin/mpiifort "intel" && MPIFC="${pkg_install_dir}/bin/mpiifort" || exit 1
76+
else
77+
check_command ${pkg_install_dir}/bin/mpiicx "intel" && MPICC="${pkg_install_dir}/bin/mpiicx" || exit 1
78+
check_command ${pkg_install_dir}/bin/mpiicpx "intel" && MPICXX="${pkg_install_dir}/bin/mpiicpx" || exit 1
79+
if [ "${with_ifx}" = "yes" ]; then
80+
check_command ${pkg_install_dir}/bin/mpiifx "intel" && MPIFC="${pkg_install_dir}/bin/mpiifx" || exit 1
81+
else
82+
check_command ${pkg_install_dir}/bin/mpiifort "intel" && MPIFC="${pkg_install_dir}/bin/mpiifort" || exit 1
83+
fi
84+
fi
6585
else
6686
echo "The use of Intel MPI is only supported with the Intel compiler"
6787
exit 1

0 commit comments

Comments
 (0)