sched.sh 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. #!/bin/bash
  2. # StarPU --- Runtime system for heterogeneous multicore architectures.
  3. #
  4. # Copyright (C) 2008-2011,2014, 2019 Université de Bordeaux
  5. # Copyright (C) 2010,2015,2017 CNRS
  6. #
  7. # StarPU is free software; you can redistribute it and/or modify
  8. # it under the terms of the GNU Lesser General Public License as published by
  9. # the Free Software Foundation; either version 2.1 of the License, or (at
  10. # your option) any later version.
  11. #
  12. # StarPU is distributed in the hope that it will be useful, but
  13. # WITHOUT ANY WARRANTY; without even the implied warranty of
  14. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  15. #
  16. # See the GNU Lesser General Public License in COPYING.LGPL for more details.
  17. #
  18. maxiter=5
  19. # Testing another specific scheduler, no need to run this
  20. [ -z "$STARPU_SCHED" -a "$STARPU_SCHED" != greedy -a "$STARPU_SCHED" != dm -a "$STARPU_SCHED" != dmda ] || exit 77
  21. calibrate_point()
  22. {
  23. strat=$1
  24. nblocks=$2
  25. prefetch=$3
  26. size=$(($nblocks * 1024))
  27. echo "STARPU_CALIBRATE size : $size / blocks : $nblocks strat -> $strat prefetch -> $prefetch"
  28. rm -f $SAMPLINGDIR/*
  29. for iter in `seq 1 $maxiter`
  30. do
  31. echo "$iter / $maxiter"
  32. export STARPU_SCHED=$strat
  33. export STARPU_CALIBRATE=1
  34. export STARPU_PREFETCH=$prefetch
  35. val=`$ROOTDIR/examples/heat/heat -pin -nblocks $nblocks -size $size -v3 2> /dev/null`
  36. echo "$val"
  37. done
  38. }
  39. trace_point()
  40. {
  41. strat=$1
  42. nblocks=$2
  43. docalibrate=$3
  44. prefetch=$4
  45. size=$(($nblocks * 1024))
  46. echo "size : $size ... docalibrate $docalibrate"
  47. filename=$TIMINGDIR/sched.$prefetch.$strat.$size
  48. if [ $docalibrate == 1 ];
  49. then
  50. calibrate_point $strat $nblocks $prefetch
  51. fi
  52. for iter in `seq 1 $maxiter`
  53. do
  54. echo "$iter / $maxiter"
  55. export STARPU_SCHED=$strat
  56. export STARPU_CALIBRATE=$docalibrate
  57. export STARPU_PREFETCH=$prefetch
  58. val=`$ROOTDIR/examples/heat/heat -pin -nblocks $nblocks -size $size -v3 2> /dev/null`
  59. echo "$val"
  60. echo "$val" >> $filename
  61. done
  62. }
  63. trace_sched()
  64. {
  65. strat=$1
  66. prefetch=$2
  67. docalibrate=$3
  68. for nblocks in `seq 2 2 30`
  69. do
  70. trace_point $strat $nblocks $docalibrate $prefetch
  71. done
  72. }
  73. DIR=$PWD
  74. ROOTDIR=$DIR/../..
  75. TIMINGDIR=$DIR/timings_sched/
  76. SAMPLINGDIR=$DIR/sampling/
  77. export STARPU_PERF_MODEL_DIR=$SAMPLINGDIR
  78. mkdir -p $TIMINGDIR
  79. mkdir -p $SAMPLINGDIR
  80. #schedlist="ws lws no-prio greedy prio dm random"
  81. #schedlist="random random random random"
  82. export STARPU_NCUDA=3
  83. export STARPU_NCPUS=8
  84. trace_sched "greedy" 0 0;
  85. trace_sched "dm" 0 1;
  86. trace_sched "dm" 1 1;
  87. trace_sched "dmda" 1 1;