starpu_codelet_profile 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. #!/bin/bash
  2. # StarPU --- Runtime system for heterogeneous multicore architectures.
  3. #
  4. # Copyright (C) 2008, 2009, 2010, 2013 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. if [ "$#" -lt 2 -o "$1" = --help -o "$1" = -h ]
  18. then
  19. echo "Offline tool to display codelet profile over a traced execution"
  20. echo ""
  21. echo "Usage: $0 distrib.data codelet_name"
  22. exit 1
  23. fi
  24. inputfile=$1
  25. codelet_name=$2
  26. archlist=`< $inputfile grep "^$codelet_name " | cut -f 2 | sort | uniq | xargs`
  27. # extract subfiles from the history file
  28. for arch in $archlist
  29. do
  30. echo "Arch $arch"
  31. grep "^$codelet_name $arch" $inputfile > $inputfile.$arch
  32. done
  33. # create the gnuplot file
  34. gpfile=$inputfile.gp
  35. echo "#!/usr/bin/gnuplot -persist" > $gpfile
  36. echo "set term postscript eps enhanced color" >> $gpfile
  37. echo "set logscale x" >> $gpfile
  38. echo "set logscale y" >> $gpfile
  39. echo "set output \"$inputfile.eps\"" >> $gpfile
  40. echo "set key top left" >> $gpfile
  41. echo "set xlabel \"Total data size\"" >> $gpfile
  42. echo "set ylabel \"Execution time (ms)\"" >> $gpfile
  43. echo -n "plot " >> $gpfile
  44. first=1
  45. for arch in $archlist
  46. do
  47. if [ $first = 0 ]
  48. then
  49. echo -n " , " >> $gpfile
  50. else
  51. first=0
  52. fi
  53. echo -n " \"$inputfile.$arch\" using 3:5 title \"${codelet_name//_/\\\\_} arch $arch\"" >> $gpfile
  54. done