-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathplot-benchmark-cdeque.sh
87 lines (84 loc) · 2.33 KB
/
plot-benchmark-cdeque.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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
b=3
d=15
n=2
type=png
while getopts b:d:n:T: opt; do
case $opt in
b)
b=$OPTARG
;;
d)
d=$OPTARG
;;
n)
n=$OPTARG
;;
T)
type=$OPTARG
esac
done
shift $((OPTIND - 1))
plot()
{
gnuplot - <<EOF
set terminal $type
set xlabel '$4'
set ylabel '$5'
set output '$1.$n.$b.$d.$type'
set title '$3 (n=$n; b=$b; d=$d)'
plot '$1.$n.$b.$d.data' title 'native' w $2, \\
'$1-nofences.$n.$b.$d.data' title 'nofences' w $2, \\
'$1-c11.$n.$b.$d.data' title 'c11' w $2, \\
'$1-dumbc11.$n.$b.$d.data' title 'seqcst' w $2
set output '$1.$n.$b.$d.log.$type'
set title '$3 (n=$n; b=$b; d=$d; log)'
set log x
plot '$1.$n.$b.$d.data' title 'native' w $2, \\
'$1-nofences.$n.$b.$d.data' title 'nofences' w $2, \\
'$1-c11.$n.$b.$d.data' title 'c11' w $2, \\
'$1-dumbc11.$n.$b.$d.data' title 'seqcst' w $2
EOF
}
tests='test-cdeque test-cdeque-nofences test-cdeque-c11 test-cdeque-dumbc11'
if [ -n "$(find . -maxdepth 1 -name "test-*.$n.$b.$d.log")" ]; then
for t in $tests; do
awk '{print $NF, $1}' $t.$n.$b.$d.log |
sort -n >time.$t.$n.$b.$d.data
done
plot time.test-cdeque points \
'Execution time' \
'effective steals' 'execution time (s)'
for t in $tests; do
awk '{print $(NF-2), $1}' $t.$n.$b.$d.log |
sort -n >time_exp_tput.$t.$n.$b.$d.data
done
plot time_exp_tput.test-cdeque points \
'Execution time' \
'expected steal throughput (s⁻¹)' 'execution time (s)'
for t in $tests; do
awk '{print $NF/$1, $1}' $t.$n.$b.$d.log |
sort -n >time_eff_tput.$t.$n.$b.$d.data
done
plot time_eff_tput.test-cdeque points \
'Execution time' \
'effective steal throughput (s⁻¹)' 'execution time (s)'
for t in $tests; do
awk '{print $NF/$1, 2*$(NF-3)/$1}' $t.$n.$b.$d.log |
sort -n >tput_eff_tput.$t.$n.$b.$d.data
done
plot tput_eff_tput.test-cdeque points \
'Critical path throughput' \
'effective steal throughput (s⁻¹)' \
'push/take throughput (s⁻¹)'
norm=$(awk '{x+=2*$(NF-3)/$1;++n} END{print x/n}' \
test-cdeque-nosync.$n.$b.$d.log)
for t in $tests; do
awk -v norm=$norm '{print $NF/$1, 2*$(NF-3)/$1/norm}' \
$t.$n.$b.$d.log |
sort -n >norm_tput_eff_tput.$t.$n.$b.$d.data
done
plot norm_tput_eff_tput.test-cdeque points \
'Critical path throughput' \
'effective steal throughput (s⁻¹)' \
'normalized push/take throughput'
fi