gflops.sh 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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="256 512 1024 2048"
  24. sizelist="1024 2048 4096 8192 16384"
  25. trace_header()
  26. {
  27. line="# size "
  28. for tile in $tilelist
  29. do
  30. line="$line $tile"
  31. done
  32. echo "$line" > $filename
  33. }
  34. trace_size()
  35. {
  36. size=$1
  37. echo "Computing size $size"
  38. line="$size"
  39. for tile in $tilelist
  40. do
  41. nblocks=$(($size / $tile))
  42. if [ $tile -lt $size -a $nblocks -lt 32 -a $(($size % $tile)) == 0 ];
  43. then
  44. echo "start tile $tile size $size nblocks $nblocks "
  45. timing=`$ROOTDIR/examples/mult/dw_mult -pin -x $size -y $size -z $size -nblocks $nblocks 2>/dev/null`
  46. else
  47. timing="x"
  48. fi
  49. echo "size : $size tile $tile => $timing us"
  50. line="$line $timing"
  51. done
  52. echo "$line" >> $filename
  53. }
  54. cd $ROOTDIR
  55. make clean 1> /dev/null 2> /dev/null
  56. make examples STARPU_ATLAS=1 CUDA=1 CPUS=3 1> /dev/null 2> /dev/null
  57. cd $DIR
  58. trace_header
  59. for size in $sizelist
  60. do
  61. trace_size $size;
  62. done