| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122 | #!/bin/bash## StarPU# Copyright (C) INRIA 2008-2009 (see AUTHORS file)## This program is free software; you can redistribute it and/or modify# it under the terms of the GNU Lesser General Public License as published by# the Free Software Foundation; either version 2.1 of the License, or (at# your option) any later version.## This program is distributed in the hope that it will be useful, but# WITHOUT ANY WARRANTY; without even the implied warranty of# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.## See the GNU Lesser General Public License in COPYING.LGPL for more details.#prefix=schedoutputfile=$prefix.datafind timings_sched/* -name "$prefix.*" > filelistgrainlist=`sed -e "s/.*$prefix\.\(.*\)\.\(.*\)$/\1/" filelist |sort -n|uniq|xargs`sizelist=`sed -e "s/.*$prefix\.\(.*\)\.\(.*\)$/\2/" filelist |sort -n|uniq`schedlist="0.greedy 0.dm 1.dm 1.dmda"# Make some header line="#SIZE	"for sched in $schedlistdo	line="$line	$sched"doneecho "$line" > $outputfilefor size in $sizelistdo	line="$size	"	for sched in $schedlist	do		# Compute Average value ...		if test -f timings_sched/$prefix.$sched.$size; then			# file does exists 			filename=timings_sched/$prefix.$sched.$size			# how many samples do we have ?			nsample=`cat $filename | wc -w`			if test $nsample -ge 1; then				sum=0				for i in `cat $filename | xargs`				do					sum=$(echo "$sum + $i"|bc -l)				done								# average execution time is ...				mean=$(echo "$sum / $nsample"|bc -l)				# in Flop/s this is 2*size^3/3				gflops=$(echo "2.0 * $size * $size * $size / (3000000 * $mean)"|bc -l)				# just make this a bit prettier ..				gflops=`echo $gflops | sed -e "s/\(.*\.[0-9][0-9]\).*$/\1/"` 				line="$line     $gflops"			else				# we have no valid sample even if the file exists				line="$line     x"			fi 		else			# file does not exist			line="$line     x"		fi				line="$line	"	done	echo "$line" >> $outputfiledonegnuplotline="plot "cnt=2echo "grainlist ... $grainlist"for sched in $schedlistdo	if test $cnt -ne 2; then		# i hate gnuplot :)		gnuplotline="$gnuplotline , "	fi	gnuplotline="$gnuplotline \"$outputfile\" usi 1:$cnt with linespoint title \"\($grain x $grain\)\" lt rgb \"black\" "	cnt=$(($cnt+1))donegnuplot > /dev/null << EOFset term postscript eps enhanced colorset output "$prefix.eps"set datafile missing 'x'set pointsize 0.75#set title "Impact of granularity"set grid yset grid xset xrange [0:49152]#set logscale xset xtics 8192,8192,65536set key invert box right bottom title "Scheduling policy"set size 0.65set xlabel "Matrix size"set ylabel "GFlop/s"plot "$outputfile" usi 1:2 with linespoint title "greedy" lt rgb "black" lw 2,\	"$outputfile" usi 1:3 with linespoint title "heft-tm" lt rgb "black" lw 2,\	"$outputfile" usi 1:4 with linespoint title "heft-tm-pr" lt rgb "black" lw 2,\	"$outputfile" usi 1:5 with linespoint title "heft-tmdp-pr" lt rgb "black" lw 2EOF
 |