gnuplot_sched.sh 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. #!/bin/bash
  2. # StarPU --- Runtime system for heterogeneous multicore architectures.
  3. #
  4. # Copyright (C) 2009-2011,2014 Université de Bordeaux
  5. # Copyright (C) 2010,2015,2017 CNRS
  6. #
  7. # StarPU is free software; you can redistribute it and/or modify
  8. # it under the terms of the GNU Lesser General Public License as published by
  9. # the Free Software Foundation; either version 2.1 of the License, or (at
  10. # your option) any later version.
  11. #
  12. # StarPU is distributed in the hope that it will be useful, but
  13. # WITHOUT ANY WARRANTY; without even the implied warranty of
  14. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  15. #
  16. # See the GNU Lesser General Public License in COPYING.LGPL for more details.
  17. #
  18. #suffix="-5800"
  19. suffix=""
  20. TIMINGDIR=$PWD/timing$suffix/
  21. sizelist=""
  22. schedlist=""
  23. outputfiles=""
  24. for file in `find $TIMINGDIR -type f`
  25. do
  26. name=`basename $file`
  27. size=`echo $name|sed -e "s/.*\.\(.*\)\..*/\1/"`
  28. sched=`echo $name|sed -e "s/\(.*\)\..*\(\..*\)/\1/"`
  29. sizelist="$sizelist $size"
  30. schedlist="$schedlist $sched"
  31. done
  32. sizelist=`echo $sizelist|tr " " "\n" |sort -n|uniq`
  33. schedlist=`echo $schedlist|tr " " "\n" |sort|uniq`
  34. for prio in `seq 0 1`
  35. do
  36. for sched in $schedlist
  37. do
  38. outputfile=output$suffix.$sched.$prio
  39. outputfiles="$outputfiles $outputfile"
  40. rm -f $outputfile
  41. for size in $sizelist
  42. do
  43. filename=$TIMINGDIR/$sched.$size.$prio
  44. if test -f $filename; then
  45. # file exists
  46. sum=0
  47. nsample=0
  48. for val in `cat $filename`
  49. do
  50. nsample=$(($nsample + 1))
  51. sum=$(echo "$sum + $val"|bc -l)
  52. done
  53. avg=$(echo "$sum / $nsample"|bc -l)
  54. gflops=$(echo "$size * $size * $size / ( $avg * 3000000)"|bc -l)
  55. echo "$size $gflops" >> $outputfile
  56. else
  57. # file does not exist
  58. echo "$size x" >> $outputfile
  59. fi
  60. done
  61. done
  62. done
  63. gnuplotline=""
  64. for outputfile in $outputfiles
  65. do
  66. line=" \"$outputfile\" with linespoint"
  67. gnuplotline="$gnuplotline $line @"
  68. done
  69. gnuplotarg=`echo $gnuplotline|tr '@' ','|sed -e "s/\(.*\),/\1/"`
  70. prefix=cholesky
  71. gnuplot > /dev/null << EOF
  72. set term postscript eps enhanced color
  73. set output "$prefix$suffix.eps"
  74. set datafile missing 'x'
  75. set pointsize 0.75
  76. #set title "Impact of granularity"
  77. set grid y
  78. set grid x
  79. set xrange [0:49152]
  80. #set logscale x
  81. #set xtics 8192,8192,65536
  82. #set key invert box right bottom title "Scheduling policy"
  83. #set size 0.65
  84. set xlabel "Matrix size"
  85. set ylabel "GFlop/s"
  86. plot $gnuplotarg
  87. EOF