sched_one_gpu.sh 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. #!/bin/bash
  2. # StarPU --- Runtime system for heterogeneous multicore architectures.
  3. #
  4. # Copyright (C) 2009-2021 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. ROOTDIR=../../
  19. TIMINGDIR=$PWD/timing/
  20. # Testing another specific scheduler, no need to run this
  21. [ -z "$STARPU_SCHED" -o "$STARPU_SCHED" = dm -o "$STARPU_SCHED" = greedy ] || exit 77
  22. export STARPU_WORKERS_CUDAID="1"
  23. trace_sched()
  24. {
  25. sched=$1
  26. use_prio=$2
  27. export STARPU_SCHED=$sched
  28. for blocks in `seq 24 2 24`
  29. do
  30. size=$(($blocks*1024))
  31. echo "size : $size"
  32. OPTIONS="-pin -nblocks $blocks -size $size"
  33. if [ $use_prio -eq 0 ]
  34. then
  35. OPTIONS="$OPTIONS -no-prio"
  36. fi
  37. filename=$TIMINGDIR/sched.$STARPU_SCHED.$size.$use_prio
  38. for iter in `seq 1 $maxiter`
  39. do
  40. echo "$iter / $maxiter"
  41. echo "$ROOTDIR/examples/cholesky/dw_cholesky $OPTIONS 2> /dev/null"
  42. val=`$STARPU_LAUNCH $ROOTDIR/examples/cholesky/dw_cholesky $OPTIONS 2> /dev/null`
  43. echo "$val" >> $filename
  44. echo "$val"
  45. done
  46. done
  47. }
  48. schedlist='dm dm dm dm greedy dm'
  49. export STARPU_NCUDA=1
  50. export STARPU_CALIBRATE=1
  51. mkdir -p $TIMINGDIR
  52. # calibrate
  53. for i in `seq 1 5`
  54. do
  55. STARPU_SCHED="dm" $STARPU_LAUNCH $ROOTDIR/examples/cholesky/dw_cholesky -nblocks 16 -size 16384 2> /dev/null
  56. done
  57. for sched in $schedlist
  58. do
  59. echo "sched : $sched"
  60. trace_sched $sched 0;
  61. trace_sched $sched 1;
  62. done