]> git.llucax.com Git - software/dgc/dgcbench.git/blob - r.sh
Create time/pause sub-directories in ./build
[software/dgc/dgcbench.git] / r.sh
1 #!/bin/sh
2
3 . ./tests-args.sh
4
5
6 export N=${N:-20}
7
8 TIME=${TIME:-/usr/bin/time}
9
10 FORMATS=${FORMATS:-png svg eps}
11
12 NAMES=${NAMES:-`echo ./micro/*.d | xargs -n1 sh -c 'basename $0 .d'` dil}
13
14 CPUS=${CPUS:-`grep '^processor' /proc/cpuinfo | wc -l`}
15
16 PLOTONLY=${PLOTONLY:-0}
17
18 NORUN=${NORUN:-}
19
20 STRIP=${STRIP:-1}
21
22 ARCH=${ARCH:-}
23
24 stats_file=/tmp/stats.csv
25
26 #for opts in basic \
27 #for opts in \
28 #               conservative=1:fork=0:early_collect=0:eager_alloc=0 \
29 #               conservative=0:fork=0:early_collect=0:eager_alloc=0 \
30 #               conservative=0:fork=1:early_collect=0:eager_alloc=0 \
31 #               conservative=0:fork=1:early_collect=1:eager_alloc=0 \
32 #               conservative=0:fork=1:early_collect=0:eager_alloc=1 \
33 #               conservative=0:fork=1:early_collect=1:eager_alloc=1
34 for min_free in 0 5 10 15 20 25 30 35 40 45 50
35 do
36         gc=cdgc
37         if [ "$opts" = "basic" ]
38         then
39                 gc=basic
40                 opts=""
41         else
42                 export D_GC_OPTS="min_free=$min_free" #:collect_stats_file=$stats_file"
43                 opts="-min_free=$min_free"
44         fi
45         #make -srj4 micro-gc-build dil-gc-build GC=$gc
46         for name in $NAMES
47         do
48                 prog="./build/$gc/bin/$name"
49                 dst="./results/min_free-timemem-$name-$gc${opts}-${CPUS}cpu"
50                 dst="$dst.csv"
51                 eval "args=\"\$args_$name\""
52                 pa="$args"
53                 test ${#args} -gt 40 &&
54                         pa="`echo $args | cut -b1-40`..."
55                 test $STRIP -eq 1 &&
56                         strip $prog
57                 echo -n "   RUN   $name $pa > $dst: "
58                 echo "Run time (sec),Memory usage (KiB)" > $dst
59                 for i in `seq $N`
60                 do
61                         test $(($i % 5)) -eq 0 &&
62                                 echo -n "$i" ||
63                                 echo -n "."
64                         setarch i386 $ARCH \
65                                 $TIME -f'%e,%M' -a -o $dst \
66                                 $prog $args > /dev/null
67                         #mv $stats_file $dst-$i.csv
68                 done
69                 echo
70         done
71 done
72