sched.sh 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. #!/bin/bash
  2. # StarPU --- Runtime system for heterogeneous multicore architectures.
  3. #
  4. # Copyright (C) 2008-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=5
  18. # Testing another specific scheduler, no need to run this
  19. [ -z "$STARPU_SCHED" -o "$STARPU_SCHED" = random -o "$STARPU_SCHED" = greedy -o "$STARPU_SCHED" = dm ] || exit 77
  20. trace_sched()
  21. {
  22. sched=$1
  23. for blocks in `seq 2 1 24`
  24. do
  25. size=$(($blocks*1024))
  26. echo "size : $size"
  27. OPTIONS="-pin -nblocks $blocks -x $size -y $size -z 1024"
  28. cd $ROOTDIR
  29. filename=$TIMINGDIR/sched.$sched.$size
  30. for iter in `seq 1 $maxiter`
  31. do
  32. echo "$iter / $maxiter"
  33. #echo "$ROOTDIR/examples/mult/sgemm $OPTIONS 2> /dev/null"
  34. STARPU_NCUDA=1 STARPU_CALIBRATE=1 STARPU_SCHED="$sched" $STARPU_LAUNCH $ROOTDIR/examples/mult/sgemm $OPTIONS 2> /dev/null >> $filename
  35. tail -1 $filename
  36. done
  37. done
  38. }
  39. DIR=$PWD
  40. ROOTDIR=$DIR/../..
  41. TIMINGDIR=$DIR/timings-sched/
  42. mkdir -p $TIMINGDIR
  43. schedlist="random random random greedy greedy dm"
  44. for iter in `seq 1 10000`
  45. do
  46. echo "ITER $iter"
  47. for sched in $schedlist
  48. do
  49. trace_sched $sched;
  50. done
  51. done