1
Fork 0
mirror of https://github.com/Steffo99/unimore-hpc-assignments.git synced 2024-11-25 01:24:22 +00:00
hpc-2022-g3/OpenMP/linear-algebra/kernels/atax/.bench.sh

50 lines
1.1 KiB
Bash
Raw Normal View History

#!/bin/bash
run_benchmarks() {
runs=25
totalt=0.0
for i in $(seq $runs)
do
exet=$(./atax_acc)
totalt=$(awk "BEGIN{print $totalt+$exet}")
echo -n "."
# echo "Run #$i: " $(awk "BEGIN{printf(\"%.3g\", $exet)}") "seconds"
done
avgt=$(awk "BEGIN{print $totalt/$runs}")
echo " Average of $runs runs: " $(awk "BEGIN{printf(\"%.3g\", $avgt)}") "seconds"
}
2022-11-17 13:58:32 +00:00
for dataset in MINI_DATASET SMALL_DATASET STANDARD_DATASET LARGE_DATASET EXTRALARGE_DATASET
do
2022-11-17 13:58:32 +00:00
for c in $(seq 0 15)
do
cflags="-D$dataset"
2022-11-17 13:58:32 +00:00
if (( $c & 1 ))
then
cflags="$cflags -DTOGGLE_INIT_ARRAY_1"
fi
2022-11-17 13:58:32 +00:00
if (( $c & 2 ))
then
cflags="$cflags -DTOGGLE_INIT_ARRAY_2"
fi
2022-11-17 13:58:32 +00:00
if (( $c & 4 ))
then
cflags="$cflags -DTOGGLE_KERNEL_ATAX_1"
fi
2022-11-17 13:58:32 +00:00
if (( $c & 8 ))
then
cflags="$cflags -DTOGGLE_KERNEL_ATAX_2"
fi
2022-11-17 13:58:32 +00:00
echo "Flags: $cflags"
make "EXTRA_CFLAGS=$cflags" clean all
2022-11-17 13:58:32 +00:00
run_benchmarks
done
done