-
Notifications
You must be signed in to change notification settings - Fork 0
/
run-extended-benchmark
executable file
·64 lines (58 loc) · 3 KB
/
run-extended-benchmark
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
#!/bin/sh
logfilename="$CATBENCH_JAGFILE"
if [ -z "$logfilename" ]
then
cat >&2 <<-tac
$0: should be invoked via driver
tac
exit 1
fi
traverse=0
traverse_pause=0
iters=1
if [ $# -eq 3 ]
then
echo "I hear you like choppier lockservers, bro. Here comes one!"
traverse="$1"
# TODO: Must be big enough that signals don't cancel out!
traverse_pause="$2"
iters="$3"
fi
jaguar/jaguar set "$logfilename" legend.samples.trash_alloc.description string "Allocation size of non-lockserver processes"
jaguar/jaguar set "$logfilename" legend.samples.trash_alloc.unit string "KB"
jaguar/jaguar set "$logfilename" legend.samples.access_time.description string "Time per memory access"
jaguar/jaguar set "$logfilename" legend.samples.access_time.unit string "s"
lockserver_mask="0x003"
trash_mask="0xffc"
cache_num_sets="$(cat /sys/devices/system/cpu/cpu0/cache/index3/number_of_sets)"
cache_line_size="$(cat /sys/devices/system/cpu/cpu0/cache/index3/coherency_line_size)"
cache_way_size="$((cache_num_sets * cache_line_size / 1024))"
for lockserver_percent in 50 100
do
lock_kb=$((cache_way_size * lockserver_percent / 100))
jaguar/jaguar set "$logfilename" "data.l${lock_kb}k_baseline.description" string "Lockserver ${lock_kb}k, baseline"
jaguar/jaguar set "$logfilename" "data.l${lock_kb}k_nocat.description" string "Lockserver ${lock_kb}k, no CAT"
jaguar/jaguar set "$logfilename" "data.l${lock_kb}k_withcat.description" string "Lockserver ${lock_kb}k, CAT $lockserver_mask"
header="integer,fraction\ntrash_alloc,access_time"
baseline="$header"
ctrlline="$header"
exptline="$header"
traverse_accs=$((traverse * cache_num_sets * lockserver_percent / 100))
sleep 10
base="`sudo CATBENCH_JAGFILE="$CATBENCH_JAGFILE" ./lockserver-driver -n 0 -o base-line.dat -l "$lockserver_percent" -d "l${lock_kb}k_baseline" -s "$traverse_accs" -i "$iters" -w "$traverse_pause"`"
for trash_percent in 50 100 200 400 800 1600 3200 6400
do
echo "Lockserver%: $lockserver_percent, Trash%: $trash_percent, Trash: $num_trash"
trash_kb=$((cache_way_size * trash_percent / 100))
sleep 10
control="`sudo CATBENCH_JAGFILE="$CATBENCH_JAGFILE" ./lockserver-driver -o no-cat.dat -l "$lockserver_percent" -d "l${lock_kb}k_nocat" -t "$trash_percent" -s "$traverse_accs" -i "$iters" -w "$traverse_pause"`"
sleep 10
experimental="`sudo CATBENCH_JAGFILE="$CATBENCH_JAGFILE" ./lockserver-driver -c -m "$lockserver_mask" -p "$trash_mask" -o with-cat.dat -l "$lockserver_percent" -d "l${lock_kb}k_withcat" -t "$trash_percent" -s "$traverse_accs" -i "$iters" -w "$traverse_pause"`"
baseline="$baseline\n`printf "%d,%s\n" "$trash_kb" "$base"`"
ctrlline="$ctrlline\n`printf "%d,%s\n" "$trash_kb" "$control"`"
exptline="$exptline\n`printf "%d,%s\n" "$trash_kb" "$experimental"`"
done
echo "$baseline" | jaguar/jaguar set "$logfilename" "data.l${lock_kb}k_baseline.samples" array -
echo "$ctrlline" | jaguar/jaguar set "$logfilename" "data.l${lock_kb}k_nocat.samples" array -
echo "$exptline" | jaguar/jaguar set "$logfilename" "data.l${lock_kb}k_withcat.samples" array -
done