dmda.sh 2.7 KB

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