sampling.sh 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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. inputfile=$1
  18. archlist=`cut -f 1 $inputfile | sort | uniq | xargs`
  19. hashlist=`cut -f 2 $inputfile | sort | uniq | xargs`
  20. # extract subfiles from the history file
  21. for arch in $archlist
  22. do
  23. for h in $hashlist
  24. do
  25. echo "pouet $arch - $h "
  26. grep "^$arch $h" $inputfile > $inputfile.$arch.$h
  27. done
  28. done
  29. # create the gnuplot file
  30. gpfile=$inputfile.gp
  31. echo "#!/usr/bin/gnuplot -persist" > $gpfile
  32. echo "set term postscript eps enhanced color" >> $gpfile
  33. echo "set logscale x" >> $gpfile
  34. echo "set logscale y" >> $gpfile
  35. echo "set output \"$inputfile.eps\"" >> $gpfile
  36. echo -n "plot " >> $gpfile
  37. first=1
  38. for arch in $archlist
  39. do
  40. for h in $hashlist
  41. do
  42. if [ $first = 0 ]
  43. then
  44. echo -n " , " >> $gpfile
  45. else
  46. first=0
  47. fi
  48. echo -n " \"$inputfile.$arch.$h\" using 3:4 title \"arch $arch hash $h\" " >> $gpfile
  49. done
  50. done
  51. gnuplot $gpfile