gflops.sh 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  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. filename=$TIMINGDIR/gflops.data
  23. tilelist="128 256 512 1024"
  24. 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"
  25. #tilelist="1024"
  26. #sizelist="1024 2048 4096 8192 16384 20480 24576 25600"
  27. heat_ret=0
  28. measure_heat()
  29. {
  30. thick=$1
  31. theta=$2
  32. nblocks=$3
  33. size=$4
  34. if [ $size -le 2048 ]
  35. then
  36. nsample=1
  37. else
  38. nsample=1
  39. fi
  40. total=0
  41. for i in `seq 1 $nsample`
  42. do
  43. echo "iter $i/$nsample"
  44. val=`$ROOTDIR/examples/heat -nthick $thick -ntheta $theta -nblocks $nblocks -pin -v2 2>/dev/null`
  45. total=`echo "$val + $total" |bc -l`
  46. done
  47. heat_ret=`echo "$total / $nsample"|bc -l`
  48. }
  49. trace_header()
  50. {
  51. line="# size "
  52. for tile in $tilelist
  53. do
  54. line="$line $tile"
  55. done
  56. echo "$line" > $filename
  57. }
  58. trace_size()
  59. {
  60. size=$1
  61. echo "Computing size $size"
  62. line="$size"
  63. for tile in $tilelist
  64. do
  65. nblocks=$(($size / $tile))
  66. theta=$(($(($size / 32)) + 2))
  67. thick=34
  68. if [ $tile -le $size -a $nblocks -le 32 -a $(($size % $tile)) == 0 ];
  69. then
  70. echo "$ROOTDIR/examples/heat -nthick $thick -ntheta $theta -nblocks $nblocks -v2 -pin"
  71. measure_heat $thick $theta $nblocks $size;
  72. timing=$heat_ret
  73. else
  74. timing="x"
  75. fi
  76. # timing=`$ROOTDIR/examples/heat -nthick $thick -ntheta $theta -nblocks $nblocks 2>/dev/null`
  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 STARPU_ATLAS=1 CUDA=1 CPUS=3 1> /dev/null 2> /dev/null
  85. cd $DIR
  86. trace_header
  87. for size in $sizelist
  88. do
  89. trace_size $size;
  90. done