forked from pabuhr/concurrent-locking
-
Notifications
You must be signed in to change notification settings - Fork 0
/
run1
executable file
·53 lines (46 loc) · 1.37 KB
/
run1
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
#!/bin/sh -
# sudo echo $PID > /cpuset/exp/tasks
# IRQs
# /proc/irq and /proc/interrupts
# /etc/default/irqbalance
# ENABLED="0"
# reboot
# disable address-space randomization (ASR) via the following
# sudo
# cat /proc/sys/kernel/randomize_va_space
# 0 => disable, 2 => randomize stack positions
# echo 0 > /proc/sys/kernel/randomize_va_space
# echo 2 > /proc/sys/kernel/randomize_va_space
# set CPUs to maximum frequency
# sudo
# cpufreq-info (lists information about all cores)
# cpufreq-set --cpu 0 --min 2600000
# ... for each even CPU (may work in pairs)
# cpufreq-set --cpu 0 --min 1000000
T=1
N=32 # T to N threads tested
Time=10 # R x Time = length of experiment
D="" # tree degree (d-ary) for Zhang (optional)
Exec=a.out # name of executable file
while [ ${#} -gt 0 ] ; do # process command-line arguments
case "${1}" in
"Time="* | "N="* | "T="* | "D="* | "Exec="* )
eval ${1}
;;
* )
echo "Usage: invalid command-line option ${1}"
exit 1
;;
esac
shift # remove argument
done
rm -rf core
while [ ${T} -le ${N} ] ; do
# perf stat -B -e L1-dcache-load-misses -e L1-dcache-prefetch-misses -e branch-load-misses ./a.out ${T} ${Time} ${Zhang} # Zhang d-ary
./${Exec} ${T} ${Time} ${D} # Zhang d-ary
if [ -f core ] ; then
echo core generated for ${T} ${Time}
break
fi
T=`expr ${T} + 1`
done