dmda.sh 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. #!/bin/bash
  2. # StarPU --- Runtime system for heterogeneous multicore architectures.
  3. #
  4. # Copyright (C) 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. maxiter=2
  18. calibrate_point()
  19. {
  20. strat=$1
  21. nblocks=$2
  22. prefetch=$3
  23. size=$(($nblocks * 1024))
  24. echo "STARPU_CALIBRATE size : $size / blocks : $nblocks strat -> $strat prefetch -> $prefetch"
  25. rm -f $SAMPLINGDIR/*
  26. for iter in `seq 1 $maxiter`
  27. do
  28. echo "$iter / $maxiter"
  29. export STARPU_SCHED=$strat
  30. export STARPU_CALIBRATE=1
  31. export STARPU_PREFETCH=$prefetch
  32. val=`$ROOTDIR/examples/heat/heat -pin -nblocks $nblocks -size $size -v3 2> /dev/null`
  33. echo "$val"
  34. done
  35. }
  36. DIR=$PWD
  37. ROOTDIR=$DIR/../..
  38. TIMINGDIR=$DIR/timings_dmda/
  39. SAMPLINGDIR=$DIR/sampling/
  40. export STARPU_PERF_MODEL_DIR=$SAMPLINGDIR
  41. mkdir -p $TIMINGDIR
  42. mkdir -p $SAMPLINGDIR
  43. #schedlist="ws no-prio greedy prio dm random"
  44. #schedlist="random random random random"
  45. export STARPU_NCUDA=3
  46. export STARPU_NCPUS=8
  47. #sizelist="2048 4096 6144 8192 10240 12288 14336 16384 24576 28672 30720"
  48. sizelist=`seq 2048 2048 30720`
  49. outputfile=dmda.data
  50. rm -f $outputfile
  51. for size in $sizelist
  52. do
  53. nblocks=$(($size / 1024))
  54. calibrate_point "dm" $nblocks 1
  55. export STARPU_SCHED="dm"
  56. export STARPU_CALIBRATE=1
  57. export STARPU_PREFETCH=1
  58. valdm=$($ROOTDIR/examples/heat/heat -pin -size $size -nblocks $nblocks -v3 2> logdm)
  59. calibrate_point "dmda" $nblocks 1
  60. export STARPU_SCHED="dmda"
  61. export STARPU_CALIBRATE=1
  62. export STARPU_PREFETCH=1
  63. valdmda=$($ROOTDIR/examples/heat/heat -pin -size $size -nblocks $nblocks -v3 2> logdmda)
  64. dmmiss=`grep "TOTAL MSI" logdm|sed -e "s/.*miss.*[1-9]* (\(.*\) %)/\1/"`
  65. dmtotal=`grep "TOTAL transfers" logdm|sed -e "s/TOTAL transfers \(.*\) MB/\1/"`
  66. dmdamiss=`grep "TOTAL MSI" logdmda|sed -e "s/.*miss.*[1-9]* (\(.*\) %)/\1/"`
  67. dmdatotal=`grep "TOTAL transfers" logdmda|sed -e "s/TOTAL transfers \(.*\) MB/\1/"`
  68. echo "$size $dmmiss $dmdamiss $dmtotal $dmdatotal $valdm $valdmda" >> $outputfile
  69. echo "$size $dmmiss $dmdamiss $dmtotal $dmdatotal $valdm $valdmda"
  70. done