Skip to content
Snippets Groups Projects
Commit f54803c9 authored by Luca Tornatore's avatar Luca Tornatore
Browse files

just some maquillage

parent b30daea9
No related branches found
No related tags found
No related merge requests found
...@@ -2,28 +2,49 @@ ...@@ -2,28 +2,49 @@
print_help() { print_help() {
echo " an argument is needed at least" echo " at least the -c argument is needed"
echo " compile -c name [-p]" echo " compile -c name [-p]"
echo " -c \$compiler_name : specifies the compiler to be used { gcc, icx }" echo " -c \$compiler_name : specifies the compiler to be used { gcc, icx }"
echo " -p : activates PAPI support " echo " -p : activates PAPI support "
exit 0 exit 0
} }
SRC_DIR=../src
X_DIR=. # the relevant folders
INC_DIR=../headers #
PAPI_OPTS=" -DUSE_PAPI "
SRC_DIR=../src # this setup is useful if you want to compile
X_DIR=. # not in src/ but in a sibling folder
INC_DIR=../headers #
# options that you need to compile
#
OPTS=" -std=c2x -DFILL=25 "
# specific options
#
ASSERT_OPT=" -DNDEBUG "
PAPI_OPT=" -DUSE_PAPI "
PAPI_LIB=" -lpapi " PAPI_LIB=" -lpapi "
OPTS=" -std=c2x -DFILL=25 -DNDEBUG "
GCC_OPTS=" -O3 -march=native -mtune=native -ftree-vectorize -funroll-loops " GCC_OPTS=" -O3 -march=native -mtune=native -ftree-vectorize -funroll-loops "
ICX_OPTS=" -O3 -xHost -vec -axCORE-AVX2,CORE-AVX512 " ICX_OPTS=" -O3 -xHost -vec -axCORE-AVX2,CORE-AVX512 "
# variables that control the behaviour
#
compiler=0 compiler=0
gcc=1 gcc=1
icx=2 icx=2
assert_on=0
support_papi=0 support_papi=0
CLOPTIONS="c:ph" #
# ==================================================
#
# parse the arguments
#
CLOPTIONS="c:aph"
if [[ $# -lt 1 ]]; then print_help; fi if [[ $# -lt 1 ]]; then print_help; fi
...@@ -42,6 +63,10 @@ while getopts ${CLOPTIONS} opt; do ...@@ -42,6 +63,10 @@ while getopts ${CLOPTIONS} opt; do
fi fi
;; ;;
a) assert_on=1
echo "compile with asserts on"
;;
p) support_papi=1 p) support_papi=1
echo "compile with PAPI support" echo "compile with PAPI support"
;; ;;
...@@ -57,7 +82,11 @@ while getopts ${CLOPTIONS} opt; do ...@@ -57,7 +82,11 @@ while getopts ${CLOPTIONS} opt; do
done done
#
# ===========================================
#
# set-up things
#
if [ ${compiler} == ${gcc} ]; if [ ${compiler} == ${gcc} ];
then then
...@@ -70,43 +99,30 @@ else ...@@ -70,43 +99,30 @@ else
cc=icx cc=icx
fi fi
if [[ ${assert_on} -eq 1 ]];
then
ASSERT_OPT=""
fi
if [[ ${support_papi} -eq 1 ]]; if [[ ${support_papi} -eq 1 ]];
then then
ADD_PAPI_OPTS=${PAPI_OPTS} ADD_PAPI_OPT=${PAPI_OPT}
ADD_PAPI_LIB=${PAPI_LIB} ADD_PAPI_LIB=${PAPI_LIB}
suffix=${suffix}.papi suffix=${suffix}.papi
else else
ADD_PAPI_OPTS="" ADD_PAPI_OPT=""
ADD_PAPI_LIB="" ADD_PAPI_LIB=""
fi fi
cc ${OPTS} ${ADD_PAPI_OPTS} -I${INC_DIR} ${OPTIMIZATION} -o ${X_DIR}/vect.1${suffix} ${SRC_DIR}/vect.1.c ${ADD_PAPI_LIB} 2> compile.log.out #
cc ${OPTS} ${ADD_PAPI_OPTS} -I${INC_DIR} ${OPTIMIZATION} -o ${X_DIR}/vect.1b${suffix} ${SRC_DIR}/vect.1b.c -lm ${ADD_PAPI_LIB} 2>> compile.log.out # ===========================================
#
cc ${OPTS} ${ADD_PAPI_OPTS} -I${INC_DIR} ${OPTIMIZATION} -o ${X_DIR}/vect.2${suffix} ${SRC_DIR}/vect.2.c ${ADD_PAPI_LIB} 2>> compile.log.out # compile
cc ${OPTS} ${ADD_PAPI_OPTS} -I${INC_DIR} ${OPTIMIZATION} -o ${X_DIR}/vect.2b${suffix} ${SRC_DIR}/vect.2b.c -lm ${ADD_PAPI_LIB} 2>> compile.log.out #
# gcc -std=c2x -DFILL=25 -DNDEBUG -I../headers -O3 -march=native -mtune=native -ftree-vectorize -funroll-loops -o vect.1b.gcc vect.1b.c
# gcc -std=c2x -DFILL=25 -DNDEBUG -DUSE_PAPI -I../headers -O3 -march=native -mtune=native -ftree-vectorize -funroll-loops -o vect.1b.gcc.papi ../src/vect.1b.c -lm -lpapi
# gcc -std=c2x -DFILL=25 -DNDEBUG -I../headers -O3 -march=native -mtune=native -ftree-vectorize -funroll-loops -o vect.2.gcc vect.2.c -lm
# gcc -std=c2x -DFILL=25 -DNDEBUG -I../headers -O3 -march=native -mtune=native -ftree-vectorize -funroll-loops -o vect.2b.gcc vect.2b.c -lm
# gcc -std=c2x -DFILL=25 -DNDEBUG -DUSE_PAPI -I../headers -O3 -march=native -mtune=native -ftree-vectorize -funroll-loops -o vect.2b.gcc.papi ../src/vect.2b.c -lm -lpapi
# gcc -std=c2x -DNDEBUG -I../headers -O3 -march=native -mtune=native -ftree-vectorize -funroll-loops -o compare_outputs compare_outputs.c
# gcc -std=c2x -DNDEBUG -I../headers -O3 -march=native -mtune=native -ftree-vectorize -funroll-loops -o compare_outputs_vforce compare_outputs_vforce.c
# # ------------------- icx
# icx -std=c2x -DFILL=25 -DNDEBUG -I../headers -O3 -xHost -vec -axCORE-AVX2,CORE-AVX512 -o vect.1.icx vect.1.c
# icx -std=c2x -DFILL=25 -DNDEBUG -I../headers -O3 -xHost -vec -axCORE-AVX2,CORE-AVX512 -o vect.1b.icx vect.1b.c cc ${OPTS} ${ADD_PAPI_OPT} -I${INC_DIR} ${OPTIMIZATION} -o ${X_DIR}/vect.1${suffix} ${SRC_DIR}/vect.1.c ${ADD_PAPI_LIB} 2> compile.log.out
# icx -std=c2x -DFILL=25 -DNDEBUG -DUSE_PAPI -I../headers -O3 -xHost -vec -axCORE-AVX2,CORE-AVX512 -o vect.1b.icx.papi ../src/vect.1b.c -lm -lpapi cc ${OPTS} ${ADD_PAPI_OPT} -I${INC_DIR} ${OPTIMIZATION} -o ${X_DIR}/vect.1b${suffix} ${SRC_DIR}/vect.1b.c -lm ${ADD_PAPI_LIB} 2>> compile.log.out
# icx -std=c2x -DFILL=25 -DNDEBUG -I../headers -O3 -xHost -vec -axCORE-AVX2,CORE-AVX512 -o vect.2.icx vect.2.c -lm cc ${OPTS} ${ADD_PAPI_OPT} -I${INC_DIR} ${OPTIMIZATION} -o ${X_DIR}/vect.2${suffix} ${SRC_DIR}/vect.2.c ${ADD_PAPI_LIB} 2>> compile.log.out
# icx -std=c2x -DFILL=25 -DNDEBUG -I../headers -O3 -xHost -vec -axCORE-AVX2,CORE-AVX512 -o vect.2b.icx vect.2b.c -lm cc ${OPTS} ${ADD_PAPI_OPT} -I${INC_DIR} ${OPTIMIZATION} -o ${X_DIR}/vect.2b${suffix} ${SRC_DIR}/vect.2b.c -lm ${ADD_PAPI_LIB} 2>> compile.log.out
# icx -std=c2x -DFILL=25 -DNDEBUG -DUSE_PAPI -I../headers -O3 -xHost -vec -axCORE-AVX2,CORE-AVX512 -o vect.2b.icx.papi ../src/vect.2b.c -lm -lpapi
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment