#! /bin/bash set -u #comList = `ls | perl -pi -e 's/.*-(\w+)_com/$1/' | sort | uniq` comList=`ls *.log | perl -ni -e '/-([^-]+)_comm/; $a{$1}=""; END { foreach ( sort keys %a ) {print "$_ "}}'` cacheList=`ls *log | perl -ni -e '/cache_([^-]+)-/; $a{$1}=""; END { foreach ( sort keys %a ) {print "$_ "}}'` prodList=`ls *.log | perl -ni -e '/typeProd_([^-]+)-/; $a{$1}=""; END { foreach ( sort keys %a ) {print "$_ "}}'` barriereList="jikes_barrier asm_cache c_cache fake" communicationList="asm_cache c_cache shared_mem shared_mem_opt pipe" metriqueList="cache_hits cache_miss cycles total_time" echo "set style data histogram" > multicores.gnuplot echo "set style histogram cluster gap 1" >> multicores.gnuplot echo "set style fill solid border -1" >> multicores.gnuplot echo "set boxwidth 0.9" >> multicores.gnuplot echo "set xtic rotate by -45" >> multicores.gnuplot echo "set bmargin 5" >> multicores.gnuplot echo "set terminal postscript landscape color" >> multicores.gnuplot for prod in $prodList ; do for bench in "communication" "barriere" ; do for metrique in $metriqueList ; do > bench_$bench-prod_$prod-$metrique.dat for file in cache_$cache-*-typeProd_$prod-*-${com}_comm.log ; do argTypeProd=`echo "$file" | sed -r "s/.*argTypeProd_([[:digit:]]+).*/\1/"` echo -ne "\t\t$argTypeProd" >> bench_$bench-prod_$prod-$metrique.dat done done for com in `eval echo \\\$\${bench}List` ; do for metrique in $metriqueList ; do echo -ne "\n$com\t\t" >> bench_$bench-prod_$prod-$metrique.dat done for cache in $cacheList ; do for value in `perl -n -e 'print "$1 $2 $3 " if /cache hits.* (\d+) \/ (\S+) \/ (\S+)/' cache_$cache-*-typeProd_$prod-*-${com}_comm.log` ; do echo -ne "\t$value " >> bench_$bench-prod_$prod-cache_hits.dat done for value in `perl -n -e 'print "$1 $2 $3 " if /cache miss.* (\d+) \/ (\S+) \/ (\S+)/' cache_$cache-*-typeProd_$prod-*-${com}_comm.log` ; do echo -ne "\t$value" >> bench_$bench-prod_$prod-cache_miss.dat done for value in `perl -n -e 'print "$1 $2 $3 " if /cycles.* (\d+) \/ (\S+) \/ (\S+)/' cache_$cache-*-typeProd_$prod-*-${com}_comm.log` ; do echo -ne "\t$value" >> bench_$bench-prod_$prod-cycles.dat done for value in `perl -n -e 'print "$1 $2 $3 " if /total_time.* (\S+) \/ (\S+) \/ (\S+)/' cache_$cache-*-typeProd_$prod-*-${com}_comm.log` ; do echo -ne "\t$value" >> bench_$bench-prod_$prod-total_time.dat done done done if [ "${bench}" = "barriere" ] ; then echo "set style data lines" >> multicores.gnuplot else echo "set style data histogram" >> multicores.gnuplot fi for metrique in $metriqueList ; do case "$metrique" in cache_hits) ylabel="Nb cache hit" ;; cache_miss) ylabel="Nb cache miss" ;; cycles) ylabel="Nb cycles" ;; total_time) ylabel="Secondes" ;; *) echo "Pas de label pour cette métrique : $metrique" ; exit 1 ;; esac for yscale in "nologscale" "logscale" ; do echo "set $yscale y" >> multicores.gnuplot [ "$yscale" = "nologscale" ] && echo "set yrange [0:*]" >> multicores.gnuplot \ || echo "set yrange [*:*]" >> multicores.gnuplot echo "set title \"Producteur : $prod\"" >> multicores.gnuplot echo "set ylabel \"$ylabel\"" >> multicores.gnuplot echo "set output 'bench_$bench-prod_$prod-$metrique-total-$yscale.ps'" >> multicores.gnuplot echo "plot 'bench_$bench-prod_$prod-$metrique.dat' using 2:xtic(1) ti 'L2', '' u 5 ti 'MEM'" >> multicores.gnuplot echo "set ylabel \"$ylabel par boucle\"" >> multicores.gnuplot echo "set output 'bench_$bench-prod_$prod-$metrique-byLoop-$yscale.ps'" >> multicores.gnuplot echo "plot 'bench_$bench-prod_$prod-$metrique.dat' using 3:xtic(1) ti 'L2', '' u 6 ti 'MEM'" >> multicores.gnuplot echo "set ylabel \"$ylabel par ecriture\"" >> multicores.gnuplot echo "set output 'bench_$bench-prod_$prod-$metrique-byWrite-$yscale.ps'" >> multicores.gnuplot echo "plot 'bench_$bench-prod_$prod-$metrique.dat' using 4:xtic(1) ti 'L2', '' u 7 ti 'MEM'" >> multicores.gnuplot done done done done gnuplot multicores.gnuplot for f in *.ps ; do ps2pdf $f done acroread *.pdf