-
Notifications
You must be signed in to change notification settings - Fork 42
/
Copy pathrun
executable file
·38 lines (29 loc) · 895 Bytes
/
run
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
#!/usr/bin/env bash
set -Eeuo pipefail
shopt -s nullglob
pushd "$(dirname "$0")" >/dev/null
for i in /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor; do
echo performance | sudo dd status=none of="$i"
done
results_dir="$PWD/results"
input_dir="$PWD/inputs"
iterations=${MHB_ITERATIONS:-25}
mkdir -p "$results_dir"
pushd runners >/dev/null
for r in *; do
if [[ ! -d "$r" ]] || [[ "$r" == "node_modules" ]]; then
continue
fi
echo "Running $r..."
pushd "$r" >/dev/null
out="$results_dir/$r.json"
if [[ "$(uname -s)" = "Darwin" ]]; then
MHB_ITERATIONS="$iterations" MHB_INPUT_DIR="$input_dir" RUST_BACKTRACE=1 ./run >"$out"
else
sudo --preserve-env=MHB_HTML_ONLY,PATH MHB_ITERATIONS="$iterations" MHB_INPUT_DIR="$input_dir" RUST_BACKTRACE=1 nice -n -20 taskset -c 1 ./run >"$out"
fi
popd >/dev/null
done
popd >/dev/null
echo "All done!"
popd >/dev/null