forked from Poulpy/asm_benchmarks
-
Notifications
You must be signed in to change notification settings - Fork 0
/
script.sh
executable file
·72 lines (61 loc) · 1.68 KB
/
script.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#!/bin/bash
CORE_ID='3'
# Removed pc and memcpy, dotprod & triad
BENCHMARKS=(copy load ntstore reduc store)
CACHES=(L1 L2)
CACHES_SIZES=(24576 1048576)
CACHES_REPETITIONS=(1000 300)
# Can't set frequency, because there's only performance & powersave governor
# modes
FREQUENCY='2.0GHz'
GNUPLOT_SCRIPT='create_plots_bw.gp'
GNUPLOT_PLOTNAME='plots_bw.png'
sudo cpupower -c $CORE_ID frequency-set --governor performance
# sudo cpupower -c $CORE_ID frequency-set --min $FREQUENCY
echo ""
echo "* Compiling benchmarks *"
echo ""
for benchmark in "${BENCHMARKS[@]}"
do
echo "[$benchmark] make"
cd ${benchmark}
make
cd -
done
echo ""
echo "* Running the benchmarks *"
echo ""
# set loop for the number of caches
# Only one iteration here (L1) because L2 takes too much time :/
for cache in {0..1}
do
for benchmark in "${BENCHMARKS[@]}"
do
echo "[$benchmark] cache: ${CACHES_SIZES[$cache]}"
cd ${benchmark}/
taskset -c $CORE_ID ./${benchmark}_SSE_AVX ${CACHES_SIZES[$cache]} ${CACHES_REPETITIONS[$cache]} | cut -d';' -f1,9 > ${benchmark}_${CACHES[$cache]}.dat
cd -
done
done
# removed pc because AVX
OTHER_BENCHMARKS=(memcpy)
for cache in {0..1}
do
for benchmark in "${OTHER_BENCHMARKS[@]}"
do
echo "[$benchmark] cache: ${CACHES_SIZES[$cache]}"
cd ${benchmark}/
taskset -c $CORE_ID ./${benchmark} ${CACHES_SIZES[$cache]} ${CACHES_REPETITIONS[$cache]} | head -n34 | tail -n33 | cut -d',' -f1,4 > ${benchmark}_${CACHES[$cache]}.dat
cd -
done
done
echo ""
echo "* Benchmarks done *"
echo ""
echo ""
echo "* Creating the plots *"
echo ""
gnuplot -c "$GNUPLOT_SCRIPT" > $GNUPLOT_PLOTNAME
echo ""
echo "* Done * "
echo ""