bandwidth_scheds.sh 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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 svg font ",12" size 1500,500 linewidth 0.5
  29. set output "bandwidth.svg"
  30. set pointsize 0.3
  31. EOF
  32. else
  33. cat > bandwidth.gp << EOF
  34. set term postscript eps enhanced color font ",18"
  35. set output "bandwidth.eps"
  36. set size 2,1
  37. EOF
  38. fi
  39. cat >> bandwidth.gp << EOF
  40. set key outside
  41. set ylabel "GB/s"
  42. set xlabel "ncores"
  43. plot \\
  44. "bandwidth-$DEFAULT.dat" using 1:5 with lines title "alone interleave", \\
  45. "bandwidth-$DEFAULT.dat" using 1:6 with lines title "nop", \\
  46. "bandwidth-$DEFAULT.dat" using 1:7 with lines title "sync", \\
  47. "bandwidth-$DEFAULT.dat" using 1:2 with lines title "alone contiguous", \\
  48. EOF
  49. type=1
  50. for sched in $SCHEDS
  51. do
  52. if [ "$sched" != eager -a "$sched" != "$SCHEDS" ]; then
  53. extra=-a
  54. else
  55. extra=
  56. fi
  57. STARPU_BACKOFF_MIN=0 STARPU_BACKOFF_MAX=0 STARPU_SCHED=$sched $STARPU_LAUNCH $(dirname $0)/bandwidth $extra | tee bandwidth-$sched.dat
  58. echo "\"bandwidth-$sched.dat\" using 1:3 with linespoints lt $type pt $type title \"$sched\", \\" >> bandwidth.gp
  59. echo "\"bandwidth-$sched.dat\" using 1:8 with linespoints lt $type pt $type notitle, \\" >> bandwidth.gp
  60. type=$((type+1))
  61. done
  62. if gnuplot bandwidth.gp ; then
  63. if [ -n "$STARPU_BENCH_DIR" ]; then
  64. cp bandwidth.png $STARPU_BENCH_DIR/
  65. fi
  66. fi