2009-06-23 12:45:15 +02:00
|
|
|
#! /bin/bash
|
|
|
|
|
|
|
|
set -u
|
|
|
|
|
2009-07-28 01:16:11 +02:00
|
|
|
#barriereList="jikes_barrier asm_cache c_cache fake"
|
|
|
|
barriereList="jikes_barrier asm_cache c_cache"
|
|
|
|
communicationList="asm_cache c_cache shared_mem shared_mem_opt pipe"
|
2009-06-23 12:45:15 +02:00
|
|
|
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 "$_ "}}'`
|
2009-07-28 01:16:11 +02:00
|
|
|
barriereCommaList=`echo $barriereList | sed "s/ /,/g"`
|
|
|
|
argTypeProdList=`eval ls *typeProd_useless_loop*{$barriereCommaList}_comm.log | perl -ni -e '/argTypeProd_([\d]+)-/; $a{$1}=""; END { foreach ( sort { $a <=> $b } keys %a ) {print "$_ "}}'`
|
2009-06-23 12:45:15 +02:00
|
|
|
|
2009-06-23 13:10:04 +02:00
|
|
|
metriqueList="cache_hits cache_miss cycles total_time"
|
2009-06-23 12:45:15 +02:00
|
|
|
|
|
|
|
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
|
2009-07-28 01:16:11 +02:00
|
|
|
case "$prod" in
|
|
|
|
matrice) argTypeProd=16 ;;
|
|
|
|
*) argTypeProd=1 ;;
|
|
|
|
esac
|
2009-06-24 20:14:50 +02:00
|
|
|
for bench in "communication" "barriere" ; do
|
2009-06-23 12:45:15 +02:00
|
|
|
for metrique in $metriqueList ; do
|
2009-07-28 01:16:11 +02:00
|
|
|
> bench_$bench-prod_$prod-metrique_$metrique.dat
|
|
|
|
if [ $bench = "communication" -o $prod != "useless_loop" ] ; then
|
|
|
|
echo -ne "Method\t\t" >> bench_$bench-prod_$prod-metrique_$metrique.dat
|
|
|
|
for cache in $cacheList ; do
|
|
|
|
echo -ne "\t$cache" >> bench_$bench-prod_$prod-metrique_$metrique.dat
|
2009-06-24 20:14:50 +02:00
|
|
|
done
|
2009-07-28 01:16:11 +02:00
|
|
|
else
|
|
|
|
echo -ne "argTypeProd\t\t" >> bench_$bench-prod_$prod-metrique_$metrique.dat
|
|
|
|
for com in `eval echo \\\$\${bench}List` ; do
|
|
|
|
echo -ne "\t$com" >> bench_$bench-prod_$prod-metrique_$metrique.dat
|
2009-06-24 20:14:50 +02:00
|
|
|
done
|
2009-07-28 01:16:11 +02:00
|
|
|
echo "" >> bench_$bench-prod_$prod-metrique_$metrique.dat
|
|
|
|
fi
|
|
|
|
# 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
|
|
|
|
if [ $bench = "communication" -o $prod != "useless_loop" ] ; then
|
|
|
|
for com in `eval echo \\\$\${bench}List` ; do
|
|
|
|
for metrique in $metriqueList ; do
|
|
|
|
case "$metrique" in
|
|
|
|
cache_hits) metriquePattern="cache hits" ;;
|
|
|
|
cache_miss) metriquePattern="cache miss" ;;
|
|
|
|
cycles) metriquePattern="cycles" ;;
|
|
|
|
total_time) metriquePattern="total_time" ;;
|
|
|
|
*) echo "Pas de pattern pour cette métrique : $metrique" ; exit 1 ;;
|
|
|
|
esac
|
|
|
|
for i in 1 2 3 ; do # 1: total, 2: by loop, 3: by write
|
|
|
|
echo -ne "\n$com\t\t" >> bench_$bench-prod_$prod-metrique_$metrique.dat
|
|
|
|
for cache in $cacheList ; do
|
|
|
|
if [ $i -eq 1 ]
|
|
|
|
then
|
|
|
|
eval value$cache=\"`perl -n -e "print \"\\$1 \\$2 \\$3 \" if /$metriquePattern.* (\S+) \/ (\S+) \/ (\S+)/" cache_$cache-*-typeProd_$prod-argTypeProd_$argTypeProd-*-${com}_comm.log`\"
|
|
|
|
fi
|
|
|
|
eval echo -ne "\${value$cache}" | cut -d ' ' -f $i | sed -r 's/(.*)/\t\1/' | tr -d '\n' >> bench_$bench-prod_$prod-metrique_$metrique.dat
|
|
|
|
done
|
|
|
|
done
|
2009-06-24 20:14:50 +02:00
|
|
|
done
|
2009-07-28 01:16:11 +02:00
|
|
|
done
|
|
|
|
else
|
|
|
|
for metrique in $metriqueList ; do
|
|
|
|
case "$metrique" in
|
|
|
|
cache_hits) metriquePattern="cache hits" ;;
|
|
|
|
cache_miss) metriquePattern="cache miss" ;;
|
|
|
|
cycles) metriquePattern="cycles" ;;
|
|
|
|
total_time) metriquePattern="total_time" ;;
|
|
|
|
*) echo "Pas de pattern pour cette métrique : $metrique" ; exit 1 ;;
|
|
|
|
esac
|
|
|
|
for argTypeProd in $argTypeProdList ; do
|
|
|
|
for cache in $cacheList ; do
|
|
|
|
echo "" >> bench_$bench-prod_$prod-metrique_$metrique.dat
|
|
|
|
for i in 1 2 3 ; do # 1: total, 2: by loop, 3: by write
|
|
|
|
echo -ne "\n$argTypeProd\t\t" >> bench_$bench-prod_$prod-metrique_$metrique.dat
|
|
|
|
for com in `eval echo \\\$\${bench}List` ; do
|
|
|
|
if [ $i -eq 1 ]
|
|
|
|
then
|
|
|
|
eval value$com=\"`perl -n -e "print \"\\$1 \\$2 \\$3 \" if /$metriquePattern.* (\S+) \/ (\S+) \/ (\S+)/" cache_$cache-*-typeProd_$prod-argTypeProd_$argTypeProd-*-${com}_comm.log`\"
|
|
|
|
fi
|
|
|
|
eval echo -ne "\${value$com}" | cut -d ' ' -f $i | sed -r 's/(.*)/\t\1/' | tr -d '\n' >> bench_$bench-prod_$prod-metrique_$metrique.dat
|
|
|
|
done
|
|
|
|
done
|
|
|
|
done
|
2009-06-24 20:14:50 +02:00
|
|
|
done
|
|
|
|
done
|
2009-07-28 01:16:11 +02:00
|
|
|
fi
|
|
|
|
if [ "${bench}" != "barriere" ] ;
|
2009-07-08 18:58:18 +02:00
|
|
|
then
|
2009-07-28 01:16:11 +02:00
|
|
|
# echo "set style data lines" >> multicores.gnuplot
|
|
|
|
#else
|
2009-07-08 18:58:18 +02:00
|
|
|
echo "set style data histogram" >> multicores.gnuplot
|
2009-07-28 01:16:11 +02:00
|
|
|
#fi
|
2009-06-24 20:14:50 +02:00
|
|
|
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
|
2009-07-08 18:42:51 +02:00
|
|
|
echo "set output 'bench_$bench-prod_$prod-$metrique-total-$yscale.ps'" >> multicores.gnuplot
|
2009-07-28 01:16:11 +02:00
|
|
|
echo "plot 'bench_$bench-prod_$prod-metrique_$metrique.dat' every 3:1 using 2:xtic(1) title 2 , '' every 3:1 u 3 ti 3" >> multicores.gnuplot
|
2009-06-24 20:14:50 +02:00
|
|
|
echo "set ylabel \"$ylabel par boucle\"" >> multicores.gnuplot
|
2009-07-08 18:42:51 +02:00
|
|
|
echo "set output 'bench_$bench-prod_$prod-$metrique-byLoop-$yscale.ps'" >> multicores.gnuplot
|
2009-07-28 01:16:11 +02:00
|
|
|
echo "plot 'bench_$bench-prod_$prod-metrique_$metrique.dat' every 3:2 using 2:xtic(1) title 2 , '' every 3:2 u 3 ti 3" >> multicores.gnuplot
|
2009-06-24 20:14:50 +02:00
|
|
|
echo "set ylabel \"$ylabel par ecriture\"" >> multicores.gnuplot
|
2009-07-08 18:42:51 +02:00
|
|
|
echo "set output 'bench_$bench-prod_$prod-$metrique-byWrite-$yscale.ps'" >> multicores.gnuplot
|
2009-07-28 01:16:11 +02:00
|
|
|
echo "plot 'bench_$bench-prod_$prod-metrique_$metrique.dat' every 3:3 using 2:xtic(1) title 2 , '' every 3:3 u 3 ti 3" >> multicores.gnuplot
|
2009-06-24 20:14:50 +02:00
|
|
|
done
|
2009-06-24 00:53:13 +02:00
|
|
|
done
|
2009-07-28 01:16:11 +02:00
|
|
|
fi
|
2009-06-23 12:45:15 +02:00
|
|
|
done
|
2009-06-24 20:14:50 +02:00
|
|
|
done
|
2009-06-23 12:45:15 +02:00
|
|
|
|
|
|
|
gnuplot multicores.gnuplot
|
|
|
|
|
|
|
|
for f in *.ps ; do
|
|
|
|
ps2pdf $f
|
|
|
|
done
|
|
|
|
|
|
|
|
acroread *.pdf
|