-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun_all.sh
More file actions
60 lines (48 loc) · 1.62 KB
/
run_all.sh
File metadata and controls
60 lines (48 loc) · 1.62 KB
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
#!/bin/bash
run_type="${1:-integrated}"
latency_output="$PWD/output/$run_type.out"
mkdir -p "$PWD/output"
run_benchmark() {
local benchmark="$1"
local script="$2"
cd "$benchmark" || exit
benchmark_output_dir="$PWD/output/$benchmark"
mkdir -p "$benchmark_output_dir"
# Tailbench benchmarks can only use core 0
taskset -c 0 bash ./"$script"
echo "------------------------------------" >> "$latency_output"
echo "$benchmark:" >> "$latency_output"
python3 ../utilities/parselats.py lats.bin >> "$latency_output"
cp lats.bin "$benchmark_output_dir"
cp lats.txt "$benchmark_output_dir"
cd ..
}
run_all_benchmarks() {
local run_type="$1"
local benchmarks=("${@:2}")
rm -f "$latency_output" # Remove old output file
if [ "${#benchmarks[@]}" -eq 0 ]; then
benchmarks=("masstree" "moses" "shore" "img-dnn" "silo" "sphinx" "xapian")
fi
for benchmark in "${benchmarks[@]}"; do
if [ "$run_type" == "integrated" ]; then
script_name="run.sh"
elif [ "$run_type" == "networked" ]; then
script_name="run_networked.sh"
else
echo "Invalid run type: $run_type"
exit 1
fi
if [ -f "$benchmark/$script_name" ]; then
run_benchmark "$benchmark" "$script_name"
else
echo "No script found for $benchmark with type $run_type"
fi
done
}
if [ "$run_type" == "integrated" ] || [ "$run_type" == "networked" ]; then
run_all_benchmarks "$run_type" "${@:2}"
else
echo "Invalid argument. First argument must be 'integrated' or 'networked'."
exit 1
fi