parsing.sh Remove a few assumptions

Remove assumptions around barriere bench:
* Not always 2 memory hierarchy are tested -> numCacheConfigs
* barriereList -> ${bench}List
* Size of the calc argument -> *
This commit is contained in:
Thomas Preud'homme 2012-03-26 16:04:31 +02:00
parent 40dfd58c86
commit 74f5176116
1 changed files with 10 additions and 9 deletions

View File

@ -48,7 +48,7 @@ init_log_vars ()
fi
metriqueList="cache_hits cache_miss cycles total_time"
nbIter=`ls -1 *.log | head -1 | sed -r "s/^.*nbIter_([[:digit:]]+).*$/\1/"`
valuePerCacheLine=$(grep "^buf size: " *.log | head -1 | sed -r "s/^.*:buf size: ([[:digit:]]+)$/\1/")
valuePerCacheLine=$(grep "^buf size: " *.log | head -1 | sed -r "s/^.*:buf size: ([[:digit:]]+)[^[:digit:]+]$/\1/")
}
parse_args ()
@ -96,6 +96,7 @@ contains_zero()
bench="$2"
datFile="$3"
lineNum="$4"
numCacheConfigs="$5"
if use_histo "$prod" "$bench"
then
@ -112,10 +113,10 @@ contains_zero()
fi
done
else
iMin=$((lineNum + 9))
iMin=$((lineNum + numCacheConfigs * 4 + 1))
# Count the number of spaces in the list + the line feed
nbArg=$(echo $argTypeProdList | sed -r "s/[^ ]//g" | wc -c)
iMax=$((iMin + nbArg * 8 - 4))
iMax=$((iMin + nbArg * numCacheConfigs * 4 - 4))
for i in $(seq $iMin 4 $iMax)
do
if head -$i $datFile | tail -1 | grep -E "\.0+([^[:digit:]])?$" > /dev/null
@ -164,7 +165,7 @@ create_dat_header ()
for j in 1 2 3 # 1: total, 2: by loop, 3: by write
do
echo -n "argTypeProd\t\t" >> bench_$bench-prod_$prod-metrique_$metrique.dat
for com in $barriereList
for com in `eval echo \\\$\${bench}List`
do
echo -n "\t$com" >> bench_$bench-prod_$prod-metrique_$metrique.dat
done
@ -340,10 +341,10 @@ create_complex_gnuplot_body ()
else
echo -n "plot '$datFile' " >> $patternPlotFile.gnuplot
fi
echo -n "every :2:$lineNum:0:$lineNum using 1:$columnNo:xtic(1) title '$baseTitle (L2)'" >> $patternPlotFile.gnuplot
echo -n "every :$numCacheConfigs:$lineNum:$((numCacheConfigs)):$lineNum using 1:$columnNo:xtic(1) title '$baseTitle (L2)'" >> $patternPlotFile.gnuplot
if [ $numCacheConfigs -gt 2 ]
then
echo -n ", '' every :2:$lineNum:1:$lineNum using 1:$columnNo:xtic(1) title '$baseTitle (mem)'" >> $patternPlotFile.gnuplot
echo -n ", '' every :$numCacheConfigs:$lineNum:$((numCacheConfigs * 2)):$lineNum using 1:$columnNo:xtic(1) title '$baseTitle (mem)'" >> $patternPlotFile.gnuplot
fi
columnNo=$((columnNo + 1))
done
@ -404,7 +405,7 @@ create_gnuplot_file ()
esac
datFile=bench_$bench-prod_$prod-metrique_$metrique.dat
patternPlotFile="bench_$bench-prod_$prod-$metrique-$avg-$yscale" # Name without extension of plot and ps files
if [ $yscale != "logscale" ] || ! contains_zero "$prod" "$bench" "$datFile" "$lineNum"
if [ $yscale != "logscale" ] || ! contains_zero "$prod" "$bench" "$datFile" "$lineNum" "$numCacheConfigs"
then
create_gnuplot_header "$prod" "$bench" "$patternPlotFile.gnuplot"
create_gnuplot_body "$prod" "$bench" "$yscale" "$ylabel" "$lineNum" "$datFile" "$patternPlotFile" "$numCacheConfigs"
@ -424,8 +425,8 @@ main()
for prod in $prodList ; do
case "$prod" in
matrice) argTypeProd=16 ;;
*) argTypeProd=1 ;;
matrice) argTypeProd=\* ;;
*) argTypeProd=\* ;;
esac
for bench in "communication" "barriere" ; do
eval benchName="\${${bench}List:-}"