bandwidth_scheds.sh 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. #!/bin/sh
  2. # StarPU --- Runtime system for heterogeneous multicore architectures.
  3. #
  4. # Copyright (C) 2016-2020 Université de Bordeaux, CNRS (LaBRI UMR 5800), Inria
  5. #
  6. # StarPU 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. # StarPU 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. set -e
  18. if [ -n "$STARPU_SCHED" ]
  19. then
  20. SCHEDS=$STARPU_SCHED
  21. DEFAULT=$STARPU_SCHED
  22. else
  23. SCHEDS=`$(dirname $0)/../../tools/starpu_sched_display`
  24. DEFAULT=eager
  25. fi
  26. if [ -n "$STARPU_BENCH_DIR" ]; then
  27. cat > bandwidth.gp << EOF
  28. set term png font ",16"
  29. set output "bandwidth.png"
  30. EOF
  31. else
  32. cat > bandwidth.gp << EOF
  33. set term postscript eps enhanced color font ",18"
  34. set output "bandwidth.eps"
  35. EOF
  36. fi
  37. cat >> bandwidth.gp << EOF
  38. set key outside
  39. set size 2,1
  40. set ylabel "GB/s"
  41. set xlabel "ncores"
  42. plot \\
  43. "bandwidth-$DEFAULT.dat" using 1:2 with lines title "alone", \\
  44. "bandwidth-$DEFAULT.dat" using 1:6 with lines title "nop", \\
  45. "bandwidth-$DEFAULT.dat" using 1:7 with lines title "sync", \\
  46. "bandwidth-$DEFAULT.dat" using 1:5 with lines title "alone interleave", \\
  47. EOF
  48. type=1
  49. for sched in $SCHEDS
  50. do
  51. if [ "$sched" != eager -a "$sched" != "$SCHEDS" ]; then
  52. extra=-a
  53. else
  54. extra=
  55. fi
  56. STARPU_BACKOFF_MIN=0 STARPU_BACKOFF_MAX=0 STARPU_SCHED=$sched $STARPU_LAUNCH $(dirname $0)/bandwidth $extra | tee bandwidth-$sched.dat
  57. echo "\"bandwidth-$sched.dat\" using 1:3 with linespoints lt $type pt $type title \"$sched\", \\" >> bandwidth.gp
  58. echo "\"bandwidth-$sched.dat\" using 1:8 with linespoints lt $type pt $type notitle, \\" >> bandwidth.gp
  59. type=$((type+1))
  60. done
  61. if gnuplot bandwidth.gp ; then
  62. if [ -n "$STARPU_BENCH_DIR" ]; then
  63. cp bandwidth.png $STARPU_BENCH_DIR/
  64. fi
  65. fi