-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplot.sh
executable file
·62 lines (57 loc) · 1.72 KB
/
plot.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
#!/usr/bin/env bash
BENCH_RUN_FOLDER=""
WORKLOAD_NAMES=""
OUTPUT_FILE="output.png"
NUMBER_FORMAT_PARAM=""
POSITIONAL=()
while [[ $# -gt 0 ]]; do
case "$1" in
--number_format)
case "$2" in
EN)
NUMBER_FORMAT_PARAM=""
;;
DE)
NUMBER_FORMAT_PARAM="-gf"
;;
*)
echo "invalid number format - possible values: EN, DE"
exit 1
;;
esac
shift # past argument
shift # past value
;;
--help)
echo "./plot.sh <bench_run_folder> [workload_names...] [--number_format EN/DE]"
echo "Default number format is EN"
exit 0
;;
*) # unknown option
POSITIONAL+=("$1") # save it in an array for later
shift # past argument
;;
esac
done
set -- "${POSITIONAL[@]}" # restore positional parameters
if [ "$#" -le "0" ]; then
echo "./plot.sh <bench_run_folder> [workload_names...] [--number_format EN/DE]"
echo "Default number format is EN"
exit 1
fi
BENCH_RUN_FOLDER="$1"
if [ "$#" -gt 1 ]; then
WORKLOAD_NAMES="${@:2:$#}"
else
for POSSIBLE_WORKLOAD in `ls $BENCH_RUN_FOLDER`; do
if [ -f "$BENCH_RUN_FOLDER/$POSSIBLE_WORKLOAD/$POSSIBLE_WORKLOAD-memutil.txt" ] \
&& [ -f "$BENCH_RUN_FOLDER/$POSSIBLE_WORKLOAD/$POSSIBLE_WORKLOAD-schedutil.txt" ]; then
WORKLOAD_NAMES="$WORKLOAD_NAMES $POSSIBLE_WORKLOAD"
fi
done
fi
for WORKLOAD_NAME in $WORKLOAD_NAMES; do
TEST_RUN_FOLDER="$BENCH_RUN_FOLDER/$WORKLOAD_NAME"
echo "Plotting $TEST_RUN_FOLDER"
python plot-evaluation.py -sd -sp time $NUMBER_FORMAT_PARAM "$WORKLOAD_NAME" "$TEST_RUN_FOLDER" "$TEST_RUN_FOLDER/$OUTPUT_FILE"
done