bandwidth_scheds.sh 2.1 KB

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