sched.sh 2.3 KB

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