forked from uishi/FastHETrace
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun_bench.sh
104 lines (90 loc) · 1.89 KB
/
run_bench.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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
#!/bin/bash
set -u
##############
# NUMA config
#############
cpunode="0"
memnode="0"
##############
# parameter for the bench
##############
logN=15
MM=(2 7 15)
#MM=(15)
hh=(1 2 3 4 5 6 7 8 9 10 11 12 13 14 15)
#hh=(1)
L=9
ll=(1 4 9)
kk=(1 5 10)
delta=40 # scaling factor
#d= # maximal number of digits for key-switching (an integer that divides L+1)
dd=(1 2 10)
T=100
GITREV=$(git rev-parse --short HEAD)
function usage() {
echo "Usage: $0 [--thread] <normal|hexl>"
}
function eval_cmd() {
eval numactl --cpunodebind 1 --membind 1 $@
}
function run_test() {
mode=$1
shift 1
for M in "${MM[@]}"; do
for h in `seq 1 $M`; do
for l in "${ll[@]}"; do
for d in "${dd[@]}"; do
echo "[+] $logN $M $h $L $l $delta $d $T"
if [ $M = 15 ] && [ $h = 1 ]; then
echo "[+] Skip M=15, h=1 case due to OOM"
continue
fi
eval_cmd "build-$mode/src/bench_unroll $logN $M $h $L $l $delta $d $T $*"
done
done
done
done
}
# main <mode> <time> <any flags that passed to run_test command>
function main() {
mode=$1
if [ $# -lt 2 ]; then
time=$(date "+%Y%m%d_%H%M%S")
else
time=$2
fi
shift 2
case $mode in
normal)
rm -rf /tmp/result/Trace{Runtime,Memory}
mkdir -p /tmp/result/Trace{Runtime,Memory}
run_test normal $*
mv /tmp/result/TraceRuntime /tmp/result/TraceRuntime_${GITREV}_normal_$time
mv /tmp/result/TraceMemory /tmp/result/TraceMemory_${GITREV}_normal_$time
;;
hexl)
rm -rf /tmp/result/Trace{Runtime,Memory}
mkdir -p /tmp/result/Trace{Runtime,Memory}
run_test hexl $*
mv /tmp/result/TraceRuntime /tmp/result/TraceRuntime_${GITREV}_hexl_$time
mv /tmp/result/TraceMemory /tmp/result/TraceMemory_${GITREV}_hexl_$time
;;
*)
;;
esac
}
if [ $# -lt 1 ]; then
usage
exit -1
fi
time=$(date "+%Y%m%d_%H%M%S")
flag=""
if [ $1 = "--thread" ]; then
flag="--thread"
fi
while [ $# -gt 0 ]
do
echo "Run $1"
main $1 $time $flag
shift
done