diff --git a/communication_techniques/parsing.sh b/communication_techniques/parsing.sh index dc589aa..5ee954c 100755 --- a/communication_techniques/parsing.sh +++ b/communication_techniques/parsing.sh @@ -23,6 +23,44 @@ use_histo () return $? } +contains_zero() +{ + local prod bench datFile lineNum commTechs nbCommTechs nbArg iMin iMax + prod="$1" + bench="$2" + datFile="$3" + lineNum="$4" + + if use_histo "$prod" "$bench" + then + eval commTechs=\$${bench}List + # Count the number of spaces in the list + the line feed + nbCommTechs=$(echo $commTechs | sed -r "s/[^ ]//g" | wc -c) + iMin=$((lineNum + 4)) + iMax=$((lineNum + 1 + nbCommTechs * 3)) + for i in $(seq $iMin 3 $iMax) + do + if head -$i $datFile | tail -1 | grep "0\.00" > /dev/null + then + return 0 + fi + done + else + iMin=$((lineNum + 9)) + # 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)) + for i in $(seq $iMin 4 $iMax) + do + if head -$i $datFile | tail -1 | grep "0\.00" > /dev/null + then + return 0 + fi + done + fi + return 1 +} + create_dat_header () { local prod bench metrique @@ -270,7 +308,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 [ $metrique != "total_time" -o $yscale != "logscale" ] + if [ $yscale != "logscale" ] || ! contains_zero "$prod" "$bench" "$datFile" "$lineNum" then create_gnuplot_header "$prod" "$bench" "$patternPlotFile.gnuplot" create_gnuplot_body "$prod" "$bench" "$yscale" "$ylabel" "$lineNum" "$datFile" "$patternPlotFile"