sched.sh 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. #!/bin/bash
  2. # StarPU --- Runtime system for heterogeneous multicore architectures.
  3. #
  4. # Copyright (C) 2008-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. maxiter=5
  18. # Testing another specific scheduler, no need to run this
  19. [ -z "$STARPU_SCHED" -o "$STARPU_SCHED" = greedy -o "$STARPU_SCHED" = dm -o "$STARPU_SCHED" = dmda ] || exit 77
  20. calibrate_point()
  21. {
  22. strat=$1
  23. nblocks=$2
  24. prefetch=$3
  25. size=$(($nblocks * 1024))
  26. echo "STARPU_CALIBRATE size : $size / blocks : $nblocks strat -> $strat prefetch -> $prefetch"
  27. rm -f $SAMPLINGDIR/*
  28. for iter in `seq 1 $maxiter`
  29. do
  30. echo "$iter / $maxiter"
  31. export STARPU_SCHED=$strat
  32. export STARPU_CALIBRATE=1
  33. export STARPU_PREFETCH=$prefetch
  34. val=`$STARPU_LAUNCH $ROOTDIR/examples/heat/heat -pin -nblocks $nblocks -size $size -v3 2> /dev/null`
  35. echo "$val"
  36. done
  37. }
  38. trace_point()
  39. {
  40. strat=$1
  41. nblocks=$2
  42. docalibrate=$3
  43. prefetch=$4
  44. size=$(($nblocks * 1024))
  45. echo "size : $size ... docalibrate $docalibrate"
  46. filename=$TIMINGDIR/sched.$prefetch.$strat.$size
  47. if [ $docalibrate == 1 ];
  48. then
  49. calibrate_point $strat $nblocks $prefetch
  50. fi
  51. for iter in `seq 1 $maxiter`
  52. do
  53. echo "$iter / $maxiter"
  54. export STARPU_SCHED=$strat
  55. export STARPU_CALIBRATE=$docalibrate
  56. export STARPU_PREFETCH=$prefetch
  57. val=`$STARPU_LAUNCH $ROOTDIR/examples/heat/heat -pin -nblocks $nblocks -size $size -v3 2> /dev/null`
  58. echo "$val"
  59. echo "$val" >> $filename
  60. done
  61. }
  62. trace_sched()
  63. {
  64. strat=$1
  65. prefetch=$2
  66. docalibrate=$3
  67. for nblocks in `seq 2 2 30`
  68. do
  69. trace_point $strat $nblocks $docalibrate $prefetch
  70. done
  71. }
  72. DIR=$PWD
  73. ROOTDIR=$DIR/../..
  74. TIMINGDIR=$DIR/timings_sched/
  75. SAMPLINGDIR=$DIR/sampling/
  76. export STARPU_PERF_MODEL_DIR=$SAMPLINGDIR
  77. mkdir -p $TIMINGDIR
  78. mkdir -p $SAMPLINGDIR
  79. #schedlist="ws lws no-prio greedy prio dm random"
  80. #schedlist="random random random random"
  81. export STARPU_NCUDA=3
  82. export STARPU_NCPUS=8
  83. trace_sched "greedy" 0 0;
  84. trace_sched "dm" 0 1;
  85. trace_sched "dm" 1 1;
  86. trace_sched "dmda" 1 1;