1
Fork 0
mirror of https://github.com/Steffo99/unimore-hpc-assignments.git synced 2024-11-22 16:14:24 +00:00
hpc-2022-g3/atax/.bench.sh
Stefano Pigozzi f919c9f9ce Massive commit with undocumented changes
it's not like anybody but me reads the `git log` anyways

or does someone? in that case, hello, whoever you are! 👋
2022-11-30 23:43:32 +01:00

45 lines
No EOL
997 B
Bash
Executable file

#!/bin/bash
run_benchmarks() {
runs=25
totalt=0.0
for i in $(seq $runs)
do
exet=$(./atax.elf)
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"
}
for dataset in MINI_DATASET SMALL_DATASET STANDARD_DATASET LARGE_DATASET EXTRALARGE_DATASET
do
for c in $(seq 0 7)
do
cxxflags="-D$dataset"
if (( $c & 1 ))
then
cxxflags="$cxxflags -DHPC_INCLUDE_INIT"
fi
if (( $c & 2 ))
then
cxxflags="$cxxflags -DHPC_USE_CUDA"
fi
if (( $c & 2 ))
then
cxxflags="$cxxflags -DHPC_USE_STRIDE"
fi
echo "Flags: $cxxflags"
make --silent "EXTRA_CXXFLAGS=$cxxflags" "atax.elf"
run_benchmarks
done
done