瀏覽代碼

tests/microbenchs: only generate plots for available results

Nathalie Furmento 8 年之前
父節點
當前提交
914f77e938
共有 2 個文件被更改,包括 29 次插入33 次删除
  1. 16 24
      tests/microbenchs/tasks_size_overhead.gp
  2. 13 9
      tests/microbenchs/tasks_size_overhead_sched.sh

+ 16 - 24
tests/microbenchs/tasks_size_overhead.gp

@@ -3,7 +3,7 @@
 # StarPU --- Runtime system for heterogeneous multicore architectures.
 #
 # Copyright (C) 2009, 2010, 2016  Université de Bordeaux
-# Copyright (C) 2010, 2011  CNRS
+# Copyright (C) 2010, 2011, 2017  CNRS
 #
 # StarPU is free software; you can redistribute it and/or modify
 # it under the terms of the GNU Lesser General Public License as published by
@@ -19,17 +19,19 @@
 
 OUTPUT=tasks_size_overhead.output
 VALS=$(sed -n -e '3p' < $OUTPUT)
-VAL1=$(echo "$VALS" | cut -d '	' -f 3)
-VAL2=$(echo "$VALS" | cut -d '	' -f 5)
-VAL3=$(echo "$VALS" | cut -d '	' -f 7)
-VAL4=$(echo "$VALS" | cut -d '	' -f 9)
-VAL5=$(echo "$VALS" | cut -d '	' -f 11)
-VAL6=$(echo "$VALS" | cut -d '	' -f 13)
-VAL7=$(echo "$VALS" | cut -d '	' -f 15)
-VAL8=$(echo "$VALS" | cut -d '	' -f 17)
-VAL9=$(echo "$VALS" | cut -d '	' -f 19)
-VAL10=$(echo "$VALS" | cut -d '	' -f 21)
-VAL11=$(echo "$VALS" | cut -d '	' -f 23)
+
+PLOTS=""
+for x in $(seq 1 11)
+do
+    pos=$((2 * $x + 1))
+    double=$((2 * $x))
+    value=$(echo "$VALS" | cut -d '	' -f $pos)
+    if test -n "$value"
+    then
+	PLOTS=",\"$OUTPUT\" using 1:($value)/(\$$pos) with linespoints title columnheader($double) $PLOTS"
+    fi
+done
+
 [ -n "$TERMINAL" ] || TERMINAL=eps
 [ -n "$OUTFILE" ] || OUTFILE=tasks_size_overhead.eps
 gnuplot << EOF
@@ -39,16 +41,6 @@ set key top left
 set xlabel "number of cores"
 set ylabel "speedup"
 plot \
-	x title "linear", \
-	"$OUTPUT" using 1:($VAL11)/(\$23) with linespoints title columnheader(22), \
-	"$OUTPUT" using 1:($VAL10)/(\$21) with linespoints title columnheader(20), \
-	"$OUTPUT" using 1:($VAL9)/(\$19) with linespoints title columnheader(18), \
-	"$OUTPUT" using 1:($VAL8)/(\$17) with linespoints title columnheader(16), \
-	"$OUTPUT" using 1:($VAL7)/(\$15) with linespoints title columnheader(14), \
-	"$OUTPUT" using 1:($VAL6)/(\$13) with linespoints title columnheader(12), \
-	"$OUTPUT" using 1:($VAL5)/(\$11) with linespoints title columnheader(10), \
-	"$OUTPUT" using 1:($VAL4)/(\$9) with linespoints title columnheader(8), \
-	"$OUTPUT" using 1:($VAL3)/(\$7) with linespoints title columnheader(6), \
-	"$OUTPUT" using 1:($VAL2)/(\$5) with linespoints title columnheader(4), \
-	"$OUTPUT" using 1:($VAL1)/(\$3) with linespoints title columnheader(2)
+	x title "linear" $PLOTS
 EOF
+

+ 13 - 9
tests/microbenchs/tasks_size_overhead_sched.sh

@@ -21,16 +21,20 @@ ROOT=${ROOT%_sched}
 unset STARPU_SSILENT
 $ROOT "$@" > tasks_size_overhead.output
 ret=$?
-DIR=
-[ -z "$STARPU_BENCH_DIR" ] || DIR="$STARPU_BENCH_DIR/"
-export TERMINAL=png
-export OUTFILE=${DIR}tasks_size_overhead_${STARPU_SCHED}.png
-gnuplot_av=$(which gnuplot)
-if test -n "$gnuplot_av" -a $ret -eq 0
+if test "$ret" == "0"
 then
-    # If gnuplot is available and the program was successfull, plot the result
-    $ROOT.gp
-    ret=$?
+    # if the program was successfull try to run gnuplot
+    DIR=
+    [ -z "$STARPU_BENCH_DIR" ] || DIR="$STARPU_BENCH_DIR/"
+    export TERMINAL=png
+    export OUTFILE=${DIR}tasks_size_overhead_${STARPU_SCHED}.png
+    gnuplot_av=$(which gnuplot)
+    if test -n "$gnuplot_av"
+    then
+	# If gnuplot is available, plot the result
+	$ROOT.gp
+	ret=$?
+    fi
 fi
 
 exit $ret