cholesky.sh 2.1 KB

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