gflops_sched.sh 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  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. DIR=$PWD
  19. ROOTDIR=$DIR/../..
  20. TIMINGDIR=$DIR/timings/
  21. mkdir -p $TIMINGDIR
  22. #tilelist="128 256 512 1024"
  23. #sizelist="256 512 1024 2048 3072 4096 5120 6144 7168 8192 9216 10240 11264 12288 13312 14336 15360 16384 17408 18432 19456 20480 21504 22528 23552 24576 25600"
  24. tilelist="1024"
  25. sizelist="1024 2048 3072 4096 5120 6144 7168 8192 9216 10240 11264 16384 20480 22528 24576 25600"
  26. #sizelist="18432 20480 22528 24576 25600"
  27. # 16384 20480 24576 25600"
  28. heat_ret=0
  29. policy=none
  30. measure_heat()
  31. {
  32. thick=$1
  33. theta=$2
  34. nblocks=$3
  35. size=$4
  36. if [ $size -le 16384 ]
  37. then
  38. nsample=1
  39. else
  40. nsample=1
  41. fi
  42. total=0
  43. for i in `seq 1 $nsample`
  44. do
  45. echo "iter $i/$nsample"
  46. val=`STARPU_SCHED=$policy $ROOTDIR/examples/heat/heat -nthick $thick -ntheta $theta -nblocks $nblocks -pin -v2 2>/dev/null`
  47. total=`echo "$val + $total" |bc -l`
  48. done
  49. heat_ret=`echo "$total / $nsample"|bc -l`
  50. }
  51. trace_header()
  52. {
  53. line="# size "
  54. for tile in $tilelist
  55. do
  56. line="$line $tile"
  57. done
  58. echo "$line" > $filename
  59. }
  60. trace_size()
  61. {
  62. size=$1
  63. echo "Computing size $size"
  64. line="$size"
  65. for tile in $tilelist
  66. do
  67. nblocks=$(($size / $tile))
  68. theta=$(($(($size / 32)) + 2))
  69. thick=34
  70. if [ $tile -le $size -a $nblocks -le 32 -a $(($size % $tile)) == 0 ];
  71. then
  72. echo "STARPU_SCHED=$policy $ROOTDIR/examples/heat/heat -nthick $thick -ntheta $theta -nblocks $nblocks -pin -v2"
  73. measure_heat $thick $theta $nblocks $size;
  74. timing=$heat_ret
  75. else
  76. timing="x"
  77. fi
  78. echo "size : $size tile $tile => $timing us"
  79. line="$line $timing"
  80. done
  81. echo "$line" >> $filename
  82. }
  83. cd $ROOTDIR
  84. make clean 1> /dev/null 2> /dev/null
  85. make examples STARPU_ATLAS=1 CUDA=1 CPUS=3 1> /dev/null 2> log
  86. cd $DIR
  87. filename=$TIMINGDIR/gflops.greedy.data
  88. policy=greedy
  89. trace_header
  90. for size in $sizelist
  91. do
  92. trace_size $size;
  93. done
  94. cd $DIR
  95. filename=$TIMINGDIR/gflops.prio.data
  96. policy=prio
  97. trace_header
  98. for size in $sizelist
  99. do
  100. trace_size $size;
  101. done
  102. filename=$TIMINGDIR/gflops.ws.data
  103. policy=ws
  104. trace_header
  105. for size in $sizelist
  106. do
  107. trace_size $size;
  108. done
  109. filename=$TIMINGDIR/gflops.lws.data
  110. policy=lws
  111. trace_header
  112. for size in $sizelist
  113. do
  114. trace_size $size;
  115. done
  116. filename=$TIMINGDIR/gflops.noprio.data
  117. policy=no-prio
  118. trace_header
  119. for size in $sizelist
  120. do
  121. trace_size $size;
  122. done
  123. paste $TIMINGDIR/gflops.greedy.data $TIMINGDIR/gflops.prio.data $TIMINGDIR/gflops.ws.data $TIMINGDIR/gflops.noprio.data > $TIMINGDIR/gflops.merged.data