sampling.sh 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. #!/bin/bash
  2. #
  3. # StarPU
  4. # Copyright (C) Université Bordeaux 1, CNRS 2008-2010 (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. 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