-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathbenchmark.sh
More file actions
executable file
·61 lines (53 loc) · 1.25 KB
/
benchmark.sh
File metadata and controls
executable file
·61 lines (53 loc) · 1.25 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
61
#!/bin/bash
SCRIPT_DIR="$(dirname $(readlink -f $0))"
source "${SCRIPT_DIR}/.venv/bin/activate"
# Initialize the flags
NORETRY=false
# Parse command-line options
while [[ $# -gt 0 ]]; do
case $1 in
--clear)
CLEAR="--clear"
shift # Move to the next argument
;;
--launch)
LAUNCH="--launch"
shift # Move to the next argument
;;
--noretry)
NORETRY=true
shift # Move to the next argument
;;
--verbose | -v)
VERBOSE="-v"
shift # Move to the next argument
;;
--veryverbose | -vv)
VERBOSE="-vv"
shift # Move to the next argument
;;
*)
break # Stop parsing when we reach the JSON argument
;;
esac
done
JSON=$1
shift
BENCHMARK=${*:-default}
while true; do
# Call the benchmark script
"${SCRIPT_DIR}/benchmark.py" ${VERBOSE} ${CLEAR} ${LAUNCH} -j $JSON $BENCHMARK
EXIT_CODE=$?
# Do not clear the previous benchmark results
CLEAR=""
if [[ $EXIT_CODE -eq 0 ]]; then
echo "Benchmark succeeded."
break
else
echo "Benchmark failed with exit code $EXIT_CODE. Retrying..."
fi
if $NORETRY; then
echo "Exiting without retrying."
break
fi
done