gflops.sh 1.6 KB

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