From: Leandro Lucarella Date: Sun, 14 Nov 2010 22:54:59 +0000 (-0300) Subject: Add scripts to generate graphs for the document X-Git-Url: https://git.llucax.com/software/dgc/dgcbench.git/commitdiff_plain/7c1d9b998628522b961c497cc16a825f8f352cdf?hp=3d0f6ad78baaf76908087a0564394617d4003a86 Add scripts to generate graphs for the document This scripts were used to generate the results presented in the document. --- diff --git a/p.gpi b/p.gpi new file mode 100644 index 0000000..ef27823 --- /dev/null +++ b/p.gpi @@ -0,0 +1,43 @@ +#!/usr/bin/gnuplot + +# Terminal +set term postscript eps monochrome solid size 4.90cm,7cm 17 +set output "/tmp/output.eps" + +# Style +set style histogram rows title offset character 2, 0.25, 0 +set style fill solid 1.00 border -1 +set style data histograms +set xtics border in scale 1,0.5 nomirror rotate by -45 +set boxwidth 0.6 +set lmargin at screen 0.19 +#set lmargin at screen 0.17 +#set lmargin at screen 0.15 +#set lmargin at screen 0.12 +set rmargin at screen 0.975 +unset key +#set xtics font "/usr/share/fonts/truetype/msttcorefonts/arial.ttf,9" + +# Title +#set title "TituloN=${n}$ ${cpus}$ CPU${'s' if cpus > 1 else ''}$" + +# Data format +set datafile separator ',' + +# Labels +#set ylabel "Tiempo (seg)" +#set xlabel font "/usr/share/fonts/truetype/msttcorefonts/arial.ttf,9" + +# Plot +plot '/tmp/input.csv' \ + using 2:xtic(1) title "min" \ + lc rgb 'black', \ + '' using (abs($3-$2-$5)) notitle \ + lc rgb 'white', \ + '' using ($5) title "med+/-desv" \ + lc rgb 'gray60', \ + '' using ($5) notitle \ + lc rgb 'gray60', \ + '' using (abs($4-$3-$5)) title "max" \ + lc rgb 'white' + diff --git a/p.sh b/p.sh new file mode 100755 index 0000000..9630ee1 --- /dev/null +++ b/p.sh @@ -0,0 +1,15 @@ +#!/bin/sh + +for CPUS in 1 2 4; do + for name in `echo ./micro/*.d | xargs -n1 sh -c 'basename $0 .d'` dil + do + dst=../informe/source/plots/mem-$name-${CPUS}cpu.pdf + src=./results/to-plot/collect-mem-$name-${CPUS}cpu.csv + echo " PLOT $dst" + cp "$src" /tmp/input.csv && + gnuplot p.gpi && + epstopdf /tmp/output.eps && + mv /tmp/output.pdf "$dst" + done +done + diff --git a/r.sh b/r.sh new file mode 100755 index 0000000..10e5ac6 --- /dev/null +++ b/r.sh @@ -0,0 +1,72 @@ +#!/bin/sh + +. ./tests-args.sh + + +export N=${N:-20} + +TIME=${TIME:-/usr/bin/time} + +FORMATS=${FORMATS:-png svg eps} + +NAMES=${NAMES:-`echo ./micro/*.d | xargs -n1 sh -c 'basename $0 .d'` dil} + +CPUS=${CPUS:-`grep '^processor' /proc/cpuinfo | wc -l`} + +PLOTONLY=${PLOTONLY:-0} + +NORUN=${NORUN:-} + +STRIP=${STRIP:-1} + +ARCH=${ARCH:-} + +stats_file=/tmp/stats.csv + +#for opts in basic \ +#for opts in \ +# conservative=1:fork=0:early_collect=0:eager_alloc=0 \ +# conservative=0:fork=0:early_collect=0:eager_alloc=0 \ +# conservative=0:fork=1:early_collect=0:eager_alloc=0 \ +# conservative=0:fork=1:early_collect=1:eager_alloc=0 \ +# conservative=0:fork=1:early_collect=0:eager_alloc=1 \ +# conservative=0:fork=1:early_collect=1:eager_alloc=1 +for min_free in 0 5 10 15 20 25 30 35 40 45 50 +do + gc=cdgc + if [ "$opts" = "basic" ] + then + gc=basic + opts="" + else + export D_GC_OPTS="min_free=$min_free" #:collect_stats_file=$stats_file" + opts="-min_free=$min_free" + fi + #make -srj4 micro-gc-build dil-gc-build GC=$gc + for name in $NAMES + do + prog="./build/$gc/bin/$name" + dst="./results/min_free-timemem-$name-$gc${opts}-${CPUS}cpu" + dst="$dst.csv" + eval "args=\"\$args_$name\"" + pa="$args" + test ${#args} -gt 40 && + pa="`echo $args | cut -b1-40`..." + test $STRIP -eq 1 && + strip $prog + echo -n " RUN $name $pa > $dst: " + echo "Run time (sec),Memory usage (KiB)" > $dst + for i in `seq $N` + do + test $(($i % 5)) -eq 0 && + echo -n "$i" || + echo -n "." + setarch i386 $ARCH \ + $TIME -f'%e,%M' -a -o $dst \ + $prog $args > /dev/null + #mv $stats_file $dst-$i.csv + done + echo + done +done + diff --git a/s.sh b/s.sh new file mode 100755 index 0000000..dc24a69 --- /dev/null +++ b/s.sh @@ -0,0 +1,70 @@ +#!/bin/sh + +. ./tests-args.sh + + +TIME=${TIME:-/usr/bin/time} + +FORMATS=${FORMATS:-png svg eps} + +NAMES=${NAMES:-`echo ./micro/*.d | xargs -n1 sh -c 'basename $0 .d'` dil} + +GCS=${GCS:-basic cdgc-conservative=1:fork=0:early_collect=0:eager_alloc=0} + +CPUS=${CPUS:-`grep '^processor' /proc/cpuinfo | wc -l`} + +PLOTONLY=${PLOTONLY:-0} + +NORUN=${NORUN:-} + +STRIP=${STRIP:-1} + +ARCH=${ARCH:-} + + +for CPUS in 1 2 4; do +for name in $NAMES +do + dst=./results/to-plot/collect-stw-$name-${CPUS}cpu.csv + #if test -f $dst + #then + # echo "$NORUN" | grep -q "$name" && + # continue + # test $PLOTONLY -eq 1 && + # continue + # mv $dst ./build/time-$name-${CPUS}cpu-old.csv + #fi + echo -n > $dst + #for gc in basic \ + for gc in \ + cdgc-conservative=1:fork=0:early_collect=0:eager_alloc=0 \ + cdgc-conservative=0:fork=0:early_collect=0:eager_alloc=0 \ + cdgc-conservative=0:fork=1:early_collect=0:eager_alloc=0 \ + cdgc-conservative=0:fork=1:early_collect=1:eager_alloc=0 \ + cdgc-conservative=0:fork=1:early_collect=0:eager_alloc=1 \ + cdgc-conservative=0:fork=1:early_collect=1:eager_alloc=1 + do + eval "factor=\"\$factor_$name\"" + test -z "$factor" && + factor=1 + [ "$gc" = "basic" ] && pgc="tbgc" + [ "$gc" = "cdgc-conservative=1:fork=0:early_collect=0:eager_alloc=0" ] && pgc="cons" + [ "$gc" = "cdgc-conservative=0:fork=0:early_collect=0:eager_alloc=0" ] && pgc="prec" + [ "$gc" = "cdgc-conservative=0:fork=1:early_collect=0:eager_alloc=0" ] && pgc="fork" + [ "$gc" = "cdgc-conservative=0:fork=1:early_collect=1:eager_alloc=0" ] && pgc="ecol" + [ "$gc" = "cdgc-conservative=0:fork=1:early_collect=0:eager_alloc=1" ] && pgc="eall" + [ "$gc" = "cdgc-conservative=0:fork=1:early_collect=1:eager_alloc=1" ] && pgc="todo" + echo -n " STATS $name-$gc" + echo -n "$pgc," >> $dst + ( + for f in results/raw-collect/collect-$name-$gc-${CPUS}cpu-*.csv; + do + grep -v -- -1 "$f" | ./stats.py '$4' '%(max)f'; + #echo $((`grep -v -- -1 "$f" | wc -l`-1)) + done + ) | ./stats.py >> $dst + echo " (`tail -n1 $dst | tr , ' '`) >> $dst" + done +done +done +