gflops.sh 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. #!/bin/bash
  2. # StarPU --- Runtime system for heterogeneous multicore architectures.
  3. #
  4. # Copyright (C) 2008, 2009, 2010 Université de Bordeaux 1
  5. # Copyright (C) 2010 Centre National de la Recherche Scientifique
  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. DIR=$PWD
  18. ROOTDIR=$DIR/../..
  19. TIMINGDIR=$DIR/timings/
  20. mkdir -p $TIMINGDIR
  21. filename=$TIMINGDIR/gflops.data
  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 4096 8192 16384 20480 24576 25600"
  26. heat_ret=0
  27. measure_heat()
  28. {
  29. thick=$1
  30. theta=$2
  31. nblocks=$3
  32. size=$4
  33. if [ $size -le 2048 ]
  34. then
  35. nsample=1
  36. else
  37. nsample=1
  38. fi
  39. total=0
  40. for i in `seq 1 $nsample`
  41. do
  42. echo "iter $i/$nsample"
  43. val=`$ROOTDIR/examples/heat -nthick $thick -ntheta $theta -nblocks $nblocks -pin -v2 2>/dev/null`
  44. total=`echo "$val + $total" |bc -l`
  45. done
  46. heat_ret=`echo "$total / $nsample"|bc -l`
  47. }
  48. trace_header()
  49. {
  50. line="# size "
  51. for tile in $tilelist
  52. do
  53. line="$line $tile"
  54. done
  55. echo "$line" > $filename
  56. }
  57. trace_size()
  58. {
  59. size=$1
  60. echo "Computing size $size"
  61. line="$size"
  62. for tile in $tilelist
  63. do
  64. nblocks=$(($size / $tile))
  65. theta=$(($(($size / 32)) + 2))
  66. thick=34
  67. if [ $tile -le $size -a $nblocks -le 32 -a $(($size % $tile)) == 0 ];
  68. then
  69. echo "$ROOTDIR/examples/heat -nthick $thick -ntheta $theta -nblocks $nblocks -v2 -pin"
  70. measure_heat $thick $theta $nblocks $size;
  71. timing=$heat_ret
  72. else
  73. timing="x"
  74. fi
  75. # timing=`$ROOTDIR/examples/heat -nthick $thick -ntheta $theta -nblocks $nblocks 2>/dev/null`
  76. echo "size : $size tile $tile => $timing us"
  77. line="$line $timing"
  78. done
  79. echo "$line" >> $filename
  80. }
  81. cd $ROOTDIR
  82. make clean 1> /dev/null 2> /dev/null
  83. make STARPU_ATLAS=1 CUDA=1 CPUS=3 1> /dev/null 2> /dev/null
  84. cd $DIR
  85. trace_header
  86. for size in $sizelist
  87. do
  88. trace_size $size;
  89. done