dmda.sh 2.7 KB

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