sched_one_gpu.sh 1.9 KB

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