cholesky.sh 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. #!/bin/bash
  2. # StarPU --- Runtime system for heterogeneous multicore architectures.
  3. #
  4. # Copyright (C) 2018-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. ROOT=${0%.sh}
  18. [ -z "$STARPU_SCHED" ] || STARPU_SCHEDS="$STARPU_SCHED"
  19. #[ -n "$STARPU_SCHEDS" ] || STARPU_SCHEDS=`$(dirname $0)/../../tools/starpu_sched_display`
  20. [ -n "$STARPU_SCHEDS" ] || STARPU_SCHEDS="dmdas modular-heft2 modular-heft modular-heft-prio modular-heteroprio dmdap dmdar dmda dmdasd prio lws"
  21. [ -n "$STARPU_HOSTNAME" ] || export STARPU_HOSTNAME=mirage
  22. unset MALLOC_PERTURB_
  23. (
  24. echo -n "#"
  25. for STARPU_SCHED in $STARPU_SCHEDS ; do
  26. echo -n " $STARPU_SCHED"
  27. done
  28. echo
  29. INCR=2
  30. if [ -n "$STARPU_SIMGRID" ]
  31. then
  32. INCR=8
  33. # These use the thread factory, and are thus much longer
  34. if [ -n "$STARPU_QUICK_CHECK" ]
  35. then
  36. INCR=16
  37. fi
  38. if [ -n "$STARPU_LONG_CHECK" ]
  39. then
  40. INCR=4
  41. fi
  42. fi
  43. for size in `seq 2 $INCR 30` ; do
  44. echo -n "$((size * 960))"
  45. for STARPU_SCHED in $STARPU_SCHEDS
  46. do
  47. export STARPU_SCHED
  48. GFLOPS=`$STARPU_LAUNCH ${ROOT}_implicit -size $((size * 960)) -nblocks $size 2> /dev/null | grep -v GFlops | cut -d ' ' -f 3`
  49. [ -n "$GFLOPS" ] || GFLOPS='""'
  50. echo -n " $GFLOPS"
  51. done
  52. echo
  53. done
  54. ) | tee cholesky.output
  55. [ -n "$TERMINAL" ] || TERMINAL=eps
  56. [ -n "$OUTFILE" ] || OUTFILE=cholesky.eps
  57. cat > cholesky.gp << EOF
  58. set terminal $TERMINAL
  59. set output "$OUTFILE"
  60. set key top left
  61. set xlabel "size"
  62. set ylabel "GFlops"
  63. plot \\
  64. EOF
  65. N=2
  66. COMMA=""
  67. for STARPU_SCHED in $STARPU_SCHEDS
  68. do
  69. echo "$COMMA'cholesky.output' using 1:$N with lines title '$STARPU_SCHED' \\" >> cholesky.gp
  70. N=$(($N + 1))
  71. COMMA=", "
  72. done
  73. gnuplot cholesky.gp
  74. #gv $OUTFILE
  75. true