histo.sh 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. #!/bin/bash
  2. # StarPU --- Runtime system for heterogeneous multicore architectures.
  3. #
  4. # Copyright (C) 2008, 2009, 2010 Université de Bordeaux 1
  5. # Copyright (C) 2010 Centre National de la Recherche Scientifique
  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. # generate the input data
  18. ./starpu_fxt_tool $1
  19. # generate the gnuplot script
  20. echo "#!/usr/bin/gnuplot -persist" > histo.gp
  21. echo "set term postscript eps enhanced color" >> histo.gp
  22. echo "set output \"histo.eps\"" >> histo.gp
  23. echo "set boxwidth 0.75 absolute" >> histo.gp
  24. echo "set boxwidth 0.75 absolute" >> histo.gp
  25. echo "set nokey" >> histo.gp
  26. echo "set style fill solid 1.00 border -1" >> histo.gp
  27. #echo "set key invert samplen 4 spacing 1 width 0 height 0" >> histo.gp
  28. #echo "set style histogram rowstacked title offset character 0, 0, 0" >> histo.gp
  29. echo "set style histogram rowstacked" >> histo.gp
  30. echo "set style data histograms" >> histo.gp
  31. echo "set xtics border in scale 1,0.5 nomirror rotate by -45 offset character 0, 0, 0" >> histo.gp
  32. #and the actual plotting part :
  33. ncols=`head -1 data |wc -w`
  34. color="red"
  35. echo "plot \\" >> histo.gp
  36. for i in `seq 1 $(($ncols - 2))`
  37. do
  38. if [ $color == "red" ];
  39. then
  40. color="green"
  41. else
  42. color="red"
  43. fi
  44. echo "\"data\" using $i lt rgb \"$color\",\\" >> histo.gp
  45. done
  46. if [ $color == "red" ];
  47. then
  48. color="green"
  49. else
  50. color="red"
  51. fi
  52. echo "\"data\" using $(($ncols - 1)) lt rgb \"$color\"" >> histo.gp
  53. # now call the script
  54. gnuplot histo.gp