Skip to content

Commit

Permalink
Add sysdep files for LLVM based intel compiler
Browse files Browse the repository at this point in the history
  • Loading branch information
ywkawai committed Jan 5, 2025
1 parent 75dc2b5 commit 64eb360
Show file tree
Hide file tree
Showing 3 changed files with 224 additions and 1 deletion.
2 changes: 1 addition & 1 deletion sysdep/Makedef.Linux64-intel-impi
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
################################################################################
#
# ------ For Linux64 & intel fortran&C & intel mpi -----
# ------ For Linux64 & intel fortran (classic) & C & intel mpi -----
#
################################################################################

Expand Down
93 changes: 93 additions & 0 deletions sysdep/Makedef.Linux64-llvm-intel-impi
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
################################################################################
#
# ------ For Linux64 & LLVM based intel fortran&C & intel mpi -----
#
################################################################################

##### Fortran setting
#FFLAGS is set in Mkinclude. FFLAGS_DEBUG is used if SCALE_DEBUG=T

FC = mpiifx
SFC = ifx
MODDIROPT = -module

#FFLAGS_FAST = -fpp
FFLAGS_FAST = -fpp -m64 -O3 -xAVX \
-assume byterecl -convert big_endian \
-fp-model source \
-ftz -fno-alias -align all

FFLAGS_AGGRESSIVE = -ipo -no-prec-div

FFLAGS_QUICKDEBUG = -traceback -fpe0 -CB -CU

FFLAGS_DYN = $(FFLAGS)

FFLAGS_DEBUG = -fpp -m64 -O0 \
-assume byterecl -convert big_endian \
-fpe0 -fp-model source \
-check all -warn all -g -traceback \
-mcmodel=medium -heap-arrays \
-assume nobuffered_io



##### C setting
#CFLAGS is set in Mkinclude. CFLAGS_DEBUG is used if SCALE_DEBUG=T

CC = mpiicx

CFLAGS_FAST = -O3 -xHost -ip -ftz -mcmodel=medium -shared-intel
CFLAGS_AGGRESSIVE = -ipo -no-prec-div
CFLAGS_DEBUG = -O0



##### Special setting

IFORT_VERSION=$(shell $(SFC) -v 2>&1 | cut -f3 -d' ' | cut -f1 -d.)
ifeq ($(shell if [ $(IFORT_VERSION) -ge 15 ]; then echo yes; fi),yes)
FFLAGS_OPENMP = -qopenmp -no-heap-arrays
# FFLAGS_OPENMP = -qopenmp -heap-arrays
else
FFLAGS_OPENMP = -openmp -no-heap-arrays
endif

ifeq ($(SCALE_DISABLE_INTELVEC),T)
NOVEC = -no-vec
endif

FFLAGS_SYSDEPEND = $(NOVEC)
CFLAGS_SYSDEPEND =

FFLAGS_TENTATIVE = -no-ip -no-ipo

##### Linker setting

LD = $(FC)
LDFLAGS = $(FFLAGS)

##### Execute command

MPIEXEC = "mpiexec.hydra -np"

################################################################################

###### NetCDF library
# Settings are inquired by using nf-config & nc-config command (see scale/Mkinclude)
# Or, please set environment variable
# example:
# export SCALE_NETCDF_INCLUDE="-I/ap/netcdf4-fortran/4.4.2-intel/include -I/ap/HDF5/1.8.16-intel/include -I/ap/netcdf4/4.3.3.1-intel/include"
# export SCALE_NETCDF_LIBS="-L/ap/netcdf4-fortran/4.4.2-intel/lib -L/ap/HDF5/1.8.16-intel/lib -L/ap/netcdf4/4.3.3.1-intel/lib -lnetcdff -lnetcdf"

###### Math library
# Please set environment variable
# example:
export SCALE_MATHLIB_LIBS="-qmkl=sequential"

##### for frontend
INSTALL = install
AR = ar
ARFLAGS = r
RANLIB = ranlib
JOBSUB = sh
130 changes: 130 additions & 0 deletions sysdep/Mkjobshell.Linux64-llvm-intel-impi.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
#! /bin/bash -x

# Arguments
MPIEXEC=${1}
BINDIR=${2}
PPNAME=${3}
INITNAME=${4}
BINNAME=${5}
PPCONF=${6}
INITCONF=${7}
RUNCONF=${8}
PROCS=${9}
eval DATPARAM=(`echo ${10} | tr -s '[' '"' | tr -s ']' '"'`)
eval DATDISTS=(`echo ${11} | tr -s '[' '"' | tr -s ']' '"'`)

PROCLIST=(`echo ${PROCS} | tr -s ',' ' '`)
TPROC=${PROCLIST[0]}
for n in ${PROCLIST[@]}
do
(( n > TPROC )) && TPROC=${n}
done

if [ ! ${PPCONF} = "NONE" ]; then
CONFLIST=(`echo ${PPCONF} | tr -s ',' ' '`)
ndata=${#CONFLIST[@]}
for n in `seq 1 ${ndata}`
do
let i="n - 1"
RUN_PP=`echo -e "${RUN_PP}\n"${MPIEXEC} ${PROCLIST[i]} ${BINDIR}/${PPNAME} ${CONFLIST[i]} "|| exit 1"`
done
fi

if [ ! ${INITCONF} = "NONE" ]; then
CONFLIST=(`echo ${INITCONF} | tr -s ',' ' '`)
ndata=${#CONFLIST[@]}
for n in `seq 1 ${ndata}`
do
let i="n - 1"
RUN_INIT=`echo -e "${RUN_INIT}\n"${MPIEXEC} ${PROCLIST[i]} ${BINDIR}/${INITNAME} ${CONFLIST[i]} "|| exit 1"`
done
fi

if [ ! ${RUNCONF} = "NONE" ]; then
CONFLIST=(`echo ${RUNCONF} | tr -s ',' ' '`)
ndata=${#CONFLIST[@]}
for n in `seq 1 ${ndata}`
do
let i="n - 1"
RUN_MAIN=`echo -e "${RUN_MAIN}\n"${MPIEXEC} ${PROCLIST[i]} ${BINDIR}/${BINNAME} ${CONFLIST[i]} "|| exit 1"`
done
fi


cat << EOF1 > ./run.sh
#! /bin/bash -x
################################################################################
#
# ------ For Linux64 & intel fortran&C & intel mpi -----
#
################################################################################
export FORT_FMT_RECL=400
export OMP_NUM_THREADS=${OMP_NUM_THREADS}
EOF1

# link to file or directory
ndata=${#DATPARAM[@]}

if [ ${ndata} -gt 0 ]; then
for n in `seq 1 ${ndata}`
do
let i="n - 1"

pair=(${DATPARAM[$i]})

src=${pair[0]}
dst=${pair[1]}
if [ "${dst}" = "" ]; then
dst=${pair[0]}
fi

if [ -f ${src} ]; then
echo "ln -svf ${src} ./${dst}" >> ./run.sh
elif [ -d ${src} ]; then
echo "rm -f ./${dst}" >> ./run.sh
echo "ln -svf ${src} ./${dst}" >> ./run.sh
else
echo "datafile does not found! : ${src}"
exit 1
fi
done
fi

# link to distributed file
ndata=${#DATDISTS[@]}

if [ ${ndata} -gt 0 ]; then
for n in `seq 1 ${ndata}`
do
let i="n - 1"

triple=(${DATDISTS[$i]})

for np in `seq 1 ${triple[0]}`
do
let "ip = ${np} - 1"
PE=`printf %06d ${ip}`

src=${triple[1]}.pe${PE}${nc}
dst=${triple[2]}.pe${PE}${nc}

if [ -f ${src} ]; then
echo "ln -svf ${src} ./${dst}" >> ./run.sh
else
echo "datafile does not found! : ${src}"
exit 1
fi
done
done
fi

cat << EOF2 >> ./run.sh
# run
${RUN_PP}
${RUN_INIT}
${RUN_MAIN}
################################################################################
EOF2

0 comments on commit 64eb360

Please sign in to comment.