-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmake-all-analyses.sh
executable file
·86 lines (69 loc) · 1.92 KB
/
make-all-analyses.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
78
79
80
81
82
83
84
85
86
#!/bin/zsh
out=plotstables
in=preprocessed-data
if which prll >&/dev/null; then
PRLL=true
rm -rf tmp/make-all-analyses
mkdir tmp/make-all-analyses
else
PRLL=false
fi
startTime=$(date +%s.%N)
n=0
rm -rf $out
mkdir $out
echo -n CT; analysis/cactus-time.sh $out/cactus-time.svg $in/times.csv 40 75; echo -n ' '; ((++n))
echo -n CTd; analysis/cactus-time.sh $out/cactus-time-detailed.svg $in/times.csv 60 75 1800; echo -n ' '; ((++n))
echo -n CM; analysis/cactus-mem.sh $out/cactus-mem.svg $in/mems.csv 40 75; echo -n ' '; ((++n))
echo -n TS; analysis/table-summary.sh $in/{time,mem}s.csv > $out/table-summary.html; echo; ((++n))
for bm in $in/*; do
if [[ ! -d $bm ]]; then continue; fi
echo -n "$(basename $bm)... "
od=$out/$(basename $bm)
mkdir -p $od
echo -n LT; analysis/line-time-vs-size.sh $od/line-time.svg $bm 12000; echo -n ' '; ((++n))
echo -n LM; analysis/line-mem-vs-size.sh $od/line-mem.svg $bm; echo -n ' '; ((++n))
echo -n TB; analysis/table-benchmark.sh $bm > $od/table-summary.html; echo; ((++n))
doParam() {
if [[ ! -d $1 ]]; then return; fi
p=$1
s=
if $PRLL; then
myecho() { s="$s$1"; }
tmpd=$(mktemp -dp tmp/make-all-analyses/)
else
myecho() { echo -n "$1"; }
tmpd=
fi
myecho "\t$(basename $p)... "
od=$od/$(basename $p)
mkdir -p $od
myecho LMT; analysis/line-mem-vs-time.sh $od/line-memtime.svg $(basename $bm)-$(basename $p) $tmpd/ >/dev/null; myecho ' '
myecho TP; analysis/table-specific.sh $p $tmpd/ > $od/table.html; myecho ' '
echo $s
rm -rf $tmpd
}
if $PRLL; then
prll doParam $bm/* |& grep -v '^PRLL'
((n+=2))
else
for p in $bm/*; do
doParam $p
done
fi
done
echo -n "Created $n files in "
endTime=$(date +%s.%N)
diff=$((endTime - startTime))
part() {
if [[ $diff -ge $1 ]]; then
n=$(echo $((diff / $1)) | cut -d. -f1)
echo -n "$n $2 "
while [[ $diff -ge $1 ]]; do
diff=$((diff - $1))
done
fi
}
part 3600 hours
part 60 minutes
echo "$diff seconds."