Skip to content

Commit

Permalink
Revised Intel based build (ELPA).
Browse files Browse the repository at this point in the history
  • Loading branch information
hfp committed Oct 25, 2024
1 parent 7fae28c commit ae8be2b
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 74 deletions.
42 changes: 16 additions & 26 deletions config/elpa/configure-elpa-hsw.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,42 +51,34 @@ MKL_OMPRTL="intel_thread"
MKL_FCRTL="intel"
MKL_BITS="lp64"

TARGET="-xCORE-AVX2"
TARGET_GNU="-march=core-avx2"
FLAGS="-O3 -I${MKLROOT}/include"

CFLAGS="${FLAGS} -qopenmp -fno-alias -ansi-alias -fp-model fast ${TARGET}"
FLAGS="-O3 -xCORE-AVX2 -I${MKLROOT}/include"
CFLAGS="${FLAGS} -qopenmp -fno-alias -ansi-alias -fp-model fast"
CXXFLAGS="${CFLAGS}"
FCFLAGS="${FLAGS} -I${MKLROOT}/include/intel64/${MKL_BITS}"
FCFLAGS="${FLAGS} -I${MKLROOT}/include/intel64/${MKL_BITS} -align array64byte -threads -qopenmp"
SCALAPACK_LDFLAGS="-lmkl_scalapack_${MKL_BITS} -lmkl_blacs_intelmpi_${MKL_BITS}"
LIBS="-lmkl_${MKL_FCRTL}_${MKL_BITS} -lmkl_core -lmkl_${MKL_OMPRTL} -Wl,--as-needed -liomp5 -Wl,--no-as-needed"
LDFLAGS="-L${MKLROOT}/lib/intel64"

AR=$(command -v xiar || echo "ar")
if [ "1" != "${INTEL}" ]; then
CXX=icpx; CC=icx
CXX=$(command -v mpiicpx || echo "mpiicpc -cxx=icpx")
CC=$(command -v mpiicx || echo "mpiicc -cc=icx")
else
CXX=$(command -v icpc || echo icpx)
CC=$(command -v icc || echo icx)
CXX="mpiicpc -cxx=$(command -v icpc || echo icpx)"
CC="mpiicc -cc=$(command -v icc || echo icx)"
fi

if [ "0" != "${GPU}" ]; then # incl. undefined
CONFOPTS+=" --enable-intel-gpu-backend=sycl --enable-intel-gpu-sycl-kernels"
CXXFLAGS+=" -I$(dirname "$(command -v ${CXX})")/../linux/include/sycl -fsycl -fsycl-targets=spir64"
LIBS+=" -lmkl_sycl -lsycl -lsvml"
LDFLAGS+=" -Wc,-fsycl"
fi
if [ "1" != "${INTEL}" ]; then
if [ "0" != "${INTEL}" ]; then
FC=$(command -v mpiifx || echo "mpiifort -fc=ifx")
FCFLAGS+=" ${TARGET} -align array64byte -threads -qopenmp"
CONFOPTS+=" --enable-ifx-compiler"
else
FCFLAGS+=" ${TARGET_GNU}"
FC=mpif90
FC=$(command -v mpiifx || echo "mpiifort -fc=ifx")
CONFOPTS+=" --enable-ifx-compiler"
if [ "0" != "${GPU}" ]; then # incl. undefined
CONFOPTS+=" --enable-intel-gpu-backend=sycl --enable-intel-gpu-sycl-kernels"
CXXISYCL=$(dirname "$(command -v ${CXX})")/../linux/include/sycl
CXXFLAGS+=" -I${CXXISYCL} -fsycl -fsycl-targets=spir64"
LIBS+=" -lmkl_sycl -lsycl -lsvml"
LDFLAGS+=" -Wc,-fsycl"
fi
else
FCFLAGS+=" ${TARGET} -align array64byte -threads -qopenmp"
FC="mpiifort"
fi

Expand Down Expand Up @@ -139,9 +131,7 @@ fi
--prefix="${DEST}" ${CONFOPTS} "$@"

if [ -e "${HERE}/Makefile" ]; then
sed -i \
-e "s/all-am:\(.*\) \$(PROGRAMS)/all-am:\1/" \
Makefile
sed -i "s/all-am:\(.*\) \$(PROGRAMS)/all-am:\1/" Makefile
fi

if [ -e "${HERE}/config.h" ]; then
Expand Down
42 changes: 16 additions & 26 deletions config/elpa/configure-elpa-skx.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,42 +51,34 @@ MKL_OMPRTL="intel_thread"
MKL_FCRTL="intel"
MKL_BITS="lp64"

TARGET="-xCORE-AVX512"
TARGET_GNU="-mavx512f -mavx512cd -mavx512dq -mavx512bw -mavx512vl -mfma"
FLAGS="-O3 -I${MKLROOT}/include"

CFLAGS="${FLAGS} -qopenmp -fno-alias -ansi-alias -fp-model fast ${TARGET}"
FLAGS="-O3 -xCORE-AVX512 -I${MKLROOT}/include"
CFLAGS="${FLAGS} -qopenmp -fno-alias -ansi-alias -fp-model fast"
CXXFLAGS="${CFLAGS}"
FCFLAGS="${FLAGS} -I${MKLROOT}/include/intel64/${MKL_BITS}"
FCFLAGS="${FLAGS} -I${MKLROOT}/include/intel64/${MKL_BITS} -align array64byte -threads -qopenmp"
SCALAPACK_LDFLAGS="-lmkl_scalapack_${MKL_BITS} -lmkl_blacs_intelmpi_${MKL_BITS}"
LIBS="-lmkl_${MKL_FCRTL}_${MKL_BITS} -lmkl_core -lmkl_${MKL_OMPRTL} -Wl,--as-needed -liomp5 -Wl,--no-as-needed"
LDFLAGS="-L${MKLROOT}/lib/intel64"

AR=$(command -v xiar || echo "ar")
if [ "1" != "${INTEL}" ]; then
CXX=icpx; CC=icx
CXX=$(command -v mpiicpx || echo "mpiicpc -cxx=icpx")
CC=$(command -v mpiicx || echo "mpiicc -cc=icx")
else
CXX=$(command -v icpc || echo icpx)
CC=$(command -v icc || echo icx)
CXX="mpiicpc -cxx=$(command -v icpc || echo icpx)"
CC="mpiicc -cc=$(command -v icc || echo icx)"
fi

if [ "0" != "${GPU}" ]; then # incl. undefined
CONFOPTS+=" --enable-intel-gpu-backend=sycl --enable-intel-gpu-sycl-kernels"
CXXFLAGS+=" -I$(dirname "$(command -v ${CXX})")/../linux/include/sycl -fsycl -fsycl-targets=spir64"
LIBS+=" -lmkl_sycl -lsycl -lsvml"
LDFLAGS+=" -Wc,-fsycl"
fi
if [ "1" != "${INTEL}" ]; then
if [ "0" != "${INTEL}" ]; then
FC=$(command -v mpiifx || echo "mpiifort -fc=ifx")
FCFLAGS+=" ${TARGET} -align array64byte -threads -qopenmp"
CONFOPTS+=" --enable-ifx-compiler"
else
FCFLAGS+=" ${TARGET_GNU}"
FC=mpif90
FC=$(command -v mpiifx || echo "mpiifort -fc=ifx")
CONFOPTS+=" --enable-ifx-compiler"
if [ "0" != "${GPU}" ]; then # incl. undefined
CONFOPTS+=" --enable-intel-gpu-backend=sycl --enable-intel-gpu-sycl-kernels"
CXXISYCL=$(dirname "$(command -v ${CXX})")/../linux/include/sycl
CXXFLAGS+=" -I${CXXISYCL} -fsycl -fsycl-targets=spir64"
LIBS+=" -lmkl_sycl -lsycl -lsvml"
LDFLAGS+=" -Wc,-fsycl"
fi
else
FCFLAGS+=" ${TARGET} -align array64byte -threads -qopenmp"
FC="mpiifort"
fi

Expand Down Expand Up @@ -139,9 +131,7 @@ fi
--prefix="${DEST}" ${CONFOPTS} "$@"

if [ -e "${HERE}/Makefile" ]; then
sed -i \
-e "s/all-am:\(.*\) \$(PROGRAMS)/all-am:\1/" \
Makefile
sed -i "s/all-am:\(.*\) \$(PROGRAMS)/all-am:\1/" Makefile
fi

if [ -e "${HERE}/config.h" ]; then
Expand Down
27 changes: 5 additions & 22 deletions config/elpa/configure-elpa.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,10 @@ MKL_OMPRTL="intel_thread"
MKL_FCRTL="intel"
MKL_BITS="lp64"

TARGET="-xHost"
TARGET_GNU="-march=native -mtune=native"
FLAGS="-O3 -I${MKLROOT}/include"

CFLAGS="${FLAGS} -qopenmp -fno-alias -ansi-alias -fp-model fast ${TARGET}"
FLAGS="-O3 -xHost -I${MKLROOT}/include"
CFLAGS="${FLAGS} -qopenmp -fno-alias -ansi-alias -fp-model fast"
CXXFLAGS="${CFLAGS}"
FCFLAGS="${FLAGS} -I${MKLROOT}/include/intel64/${MKL_BITS}"
FCFLAGS="${FLAGS} -I${MKLROOT}/include/intel64/${MKL_BITS} -align array64byte -threads -qopenmp"
SCALAPACK_LDFLAGS="-lmkl_scalapack_${MKL_BITS} -lmkl_blacs_intelmpi_${MKL_BITS}"
LIBS="-lmkl_${MKL_FCRTL}_${MKL_BITS} -lmkl_core -lmkl_${MKL_OMPRTL} -Wl,--as-needed -liomp5 -Wl,--no-as-needed"
LDFLAGS="-L${MKLROOT}/lib/intel64"
Expand All @@ -80,28 +77,16 @@ else
fi

if [ "1" != "${INTEL}" ]; then
IFX=$(command -v mpiifx || echo "mpiifort -fc=ifx")
FC=$(command -v mpiifx || echo "mpiifort -fc=ifx")
CONFOPTS+=" --enable-ifx-compiler"
if [ "0" != "${GPU}" ]; then # incl. undefined
CONFOPTS+=" --enable-intel-gpu-backend=sycl --enable-intel-gpu-sycl-kernels"
CXXISYCL=$(dirname "$(command -v ${CXX})")/../linux/include/sycl
CXXFLAGS+=" -I${CXXISYCL} -fsycl -fsycl-targets=spir64"
LIBS+=" -lmkl_sycl -lsycl -lsvml"
fi
if [ "0" != "${INTEL}" ]; then
FCFLAGS+=" ${TARGET} -align array64byte -threads -qopenmp"
CONFOPTS+=" --enable-ifx-compiler"
LDFLAGS+=" -Wc,-fsycl"
FC=${IFX}
else
FCFLAGS+=" ${TARGET_GNU}"
FCLD="${IFX} -Wc,-fsycl -nofor-main"
CXXLD="${CXX} -Wc,-fsycl"
CCLD="${CC} -Wc,-fsycl"
LIBS+=" -lgfortran"
FC=mpif90
fi
else
FCFLAGS+=" ${TARGET} -align array64byte -threads -qopenmp"
FC="mpiifort"
fi

Expand Down Expand Up @@ -155,8 +140,6 @@ fi

if [ -e "${HERE}/Makefile" ]; then
sed -i "s/all-am:\(.*\) \$(PROGRAMS)/all-am:\1/" Makefile
if [ "${CXXLD}" ]; then echo "CXXLD = \"${CXXLD}\"" >>Makefile; fi
if [ "${FCLD}" ]; then echo "FCLD = \"${FCLD}\"" >>Makefile; fi
fi

if [ -e "${HERE}/config.h" ]; then
Expand Down

0 comments on commit ae8be2b

Please sign in to comment.