sched.sh 2.3 KB

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