dmda.sh 2.6 KB

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