gflops_sched.sh 3.1 KB

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