1
Fork 0
mirror of https://github.com/Steffo99/unimore-hpc-assignments.git synced 2024-11-24 09:04:23 +00:00
hpc-2022-g3/atax/.bench.sh

43 lines
980 B
Bash
Raw Permalink Normal View History

#!/bin/bash
run_benchmarks() {
2022-12-01 23:15:33 +00:00
runs=3
totalt=0.0
for i in $(seq $runs)
do
2022-12-01 23:15:33 +00:00
exet=$(./atax.elf 2> /dev/null)
totalt=$(awk "BEGIN{print $totalt+$exet}")
2022-12-01 23:50:44 +00:00
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-12-01 23:50:44 +00:00
for dataset in MINI_DATASET SMALL_DATASET STANDARD_DATASET LARGE_DATASET EXTRALARGE_DATASET
do
2022-12-01 23:15:33 +00:00
for c in $(seq 0 3)
2022-11-17 13:58:32 +00:00
do
2022-11-28 13:37:37 +00:00
cxxflags="-D$dataset"
2022-11-17 13:58:32 +00:00
if (( $c & 1 ))
then
cxxflags="$cxxflags -DHPC_INCLUDE_INIT"
2022-11-17 13:58:32 +00:00
fi
2022-11-17 13:58:32 +00:00
if (( $c & 2 ))
then
cxxflags="$cxxflags -DHPC_USE_CUDA"
fi
2022-11-28 13:37:37 +00:00
echo "Flags: $cxxflags"
2022-12-01 23:15:33 +00:00
make --silent "clean"
2022-12-01 23:50:44 +00:00
echo -n "C"
2022-11-28 14:08:26 +00:00
make --silent "EXTRA_CXXFLAGS=$cxxflags" "atax.elf"
2022-12-01 23:50:44 +00:00
echo -n "B"
2022-11-17 13:58:32 +00:00
run_benchmarks
done
done