bandwidth_scheds.sh 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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:5 with lines title "alone interleave", \\
  45. EOF
  46. type=1
  47. for sched in $SCHEDS
  48. do
  49. if [ "$sched" != eager -a "$sched" != "$SCHEDS" ]; then
  50. extra=-a
  51. else
  52. extra=
  53. fi
  54. STARPU_BACKOFF_MIN=0 STARPU_BACKOFF_MAX=0 STARPU_SCHED=$sched $STARPU_LAUNCH $(dirname $0)/bandwidth $extra | tee bandwidth-$sched.dat
  55. echo "\"bandwidth-$sched.dat\" using 1:3 with linespoints lt $type pt $type title \"$sched\", \\" >> bandwidth.gp
  56. echo "\"bandwidth-$sched.dat\" using 1:6 with linespoints lt $type pt $type notitle, \\" >> bandwidth.gp
  57. type=$((type+1))
  58. done
  59. if gnuplot bandwidth.gp ; then
  60. if [ -n "$STARPU_BENCH_DIR" ]; then
  61. cp bandwidth.png $STARPU_BENCH_DIR/
  62. fi
  63. fi