memstress.sh 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. #!/bin/bash
  2. # StarPU --- Runtime system for heterogeneous multicore architectures.
  3. #
  4. # Copyright (C) 2008-2020 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/memstress.data
  22. sizelist="4096 8192"
  23. stresslist="0 50 100 150 200 250 300 350 400 450 500 550 600 650 655 660 665 670 675"
  24. #stresslist="672"
  25. trace_stress()
  26. {
  27. memstress=$1
  28. export STARPU_NCPUS=0
  29. export STARPU_NCUDA=1
  30. export STRESS_MEM=$memstress
  31. line="$memstress"
  32. for size in $sizelist
  33. do
  34. nblocks=$(($size / 1024))
  35. echo "Computing size $size with $memstress MB of memory LESS"
  36. echo "$ROOTDIR/examples/mult/dw_mult -x $size -y $size -z $size -nblocks $nblocks 2>/dev/null"
  37. timing=`$STARPU_LAUNCH $ROOTDIR/examples/mult/dw_mult -x $size -y $size -z $size -nblocks $nblocks 2>/dev/null`
  38. echo "size : $size memstress $memstress => $timing us"
  39. line="$line $timing"
  40. done
  41. echo "$line" >> $filename
  42. }
  43. cd $ROOTDIR
  44. make clean 1> /dev/null 2> /dev/null
  45. make examples STARPU_ATLAS=1 CUDA=1 CPUS=3 1> /dev/null #2> /dev/null
  46. cd $DIR
  47. echo "#memstress $sizelist " > $filename
  48. for memstress in $stresslist
  49. do
  50. trace_stress $memstress;
  51. done