perfmodel-display-gnuplot.sh 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. #!/bin/bash
  2. #
  3. # StarPU
  4. # Copyright (C) INRIA 2008-2009 (see AUTHORS file)
  5. #
  6. # This program 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. # This program 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. function gnuplot_symbol()
  18. {
  19. symbol=$1
  20. echo "Display symbol $symbol"
  21. # TODO check return value $? of perfmodel-display to ensure we have valid data
  22. cuda_a=`./perfmodel-display -s $symbol -a cuda -p a`
  23. cuda_b=`./perfmodel-display -s $symbol -a cuda -p b`
  24. cuda_c=`./perfmodel-display -s $symbol -a cuda -p c`
  25. cuda_alpha=`./perfmodel-display -s $symbol -a cuda -p alpha`
  26. cuda_beta=`./perfmodel-display -s $symbol -a cuda -p beta`
  27. cuda_debug=`./perfmodel-display -s $symbol -p path-file-debug -a cuda`
  28. echo "CUDA : y = $cuda_a * size ^ $cuda_b + $cuda_c"
  29. echo "CUDA : y = $cuda_alpha * size ^ $cuda_beta"
  30. echo "CUDA : debug file $cuda_debug"
  31. core_a=`./perfmodel-display -s $symbol -a core -p a`
  32. core_b=`./perfmodel-display -s $symbol -a core -p b`
  33. core_c=`./perfmodel-display -s $symbol -a core -p c`
  34. core_alpha=`./perfmodel-display -s $symbol -a core -p alpha`
  35. core_beta=`./perfmodel-display -s $symbol -a core -p beta`
  36. core_debug=`./perfmodel-display -s $symbol -p path-file-debug -a core`
  37. echo "CORE : y = $core_a * size ^ $core_b + $core_c"
  38. echo "CORE : y = $core_alpha * size ^ $core_beta"
  39. echo "CORE : debug file $core_debug"
  40. gnuplot > /dev/null << EOF
  41. set term postscript eps enhanced color
  42. set output "model_$symbol.eps"
  43. set logscale x
  44. set logscale y
  45. plot $core_a * ( x ** $core_b ) + $core_c title "core (non linear)" ,\
  46. $cuda_a * ( x ** $cuda_b ) + $cuda_c title "cuda (non linear)" ,\
  47. "$core_debug" usi 2:3 title "core measured" ,\
  48. "$cuda_debug" usi 2:3 title "cuda measured"
  49. EOF
  50. }
  51. for symbol in $@
  52. do
  53. gnuplot_symbol $symbol
  54. done