memstress.sh 1.7 KB

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