gnuplot_sched.sh 2.3 KB

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