-
Notifications
You must be signed in to change notification settings - Fork 2
/
run_all.sh
77 lines (61 loc) · 1.52 KB
/
run_all.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
#!/usr/bin/env bash
OUTNAME="stdout"
bash ./compile.sh
function get_pmem0_id () {
if ! sudo ipmctl show -performance | grep "DimmID=" | sed -n "1p" | sed 's/---//g' | sed 's/DimmID=//g'; then
echo "Error: Cannot get pmem0 id. Did you active pmem0?"
exit 1
fi
}
# set default pmem id
PMEM_ID=$(get_pmem0_id)
function set_pmem_id() {
FILE=$1
PMEM_ID=$2
sed_cmd=s/PMEM_ID/"$PMEM_ID"/g
sed -i "$sed_cmd" "$FILE"
}
loop=1
if [ "$1" ]; then
loop=$1
fi
for filename in `ls`
do
if test -d "$filename" ; then
if ( echo "$filename" | grep -q "Deprecated" ); then
continue
fi
if ( echo "$filename" | grep -q "Finished" ); then
continue
fi
if ( echo "$filename" | grep -q "TODO" ); then
continue
fi
cd "$filename" || exit
# Set pmem0 id
if [[ "${filename}" == "FIG10_Percore_Allocator" ]]; then
bash test.sh "$PMEM_ID" "$loop" > $OUTNAME
elif [[ "${filename}" == "TABLE3_Amplification" ]]; then
bash test.sh "$PMEM_ID" "$loop" > $OUTNAME
elif [[ "${filename}" == "TABLE5_AgingSystem" ]]; then
bash test.sh "$PMEM_ID" "$loop" > $OUTNAME
else
bash test.sh "$loop" > $OUTNAME
fi
# Aggregate Results
if [ -f "agg.sh" ]; then
bash agg.sh "$loop"
fi
# Run Process Script
if [ -f "process.py" ]; then
python3 process.py
fi
cd - || exit
fi
done
# Draw Figures
bash batch_draw.sh
# Fetch all figures in fig-fetched
bash fetch_all_figures.sh
# Craft latex table
bash batch_craft_table.sh