schedulers.sh 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. #!/bin/bash
  2. # StarPU --- Runtime system for heterogeneous multicore architectures.
  3. #
  4. # Copyright (C) 2012-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. check_success()
  18. {
  19. if [ $1 -ne 0 ] ; then
  20. echo "failure" >&2
  21. exit $1
  22. fi
  23. }
  24. basedir=$(dirname $0)
  25. if test ! -x $basedir/../cholesky/cholesky_tag
  26. then
  27. echo "Application $basedir/../cholesky/cholesky_tag unavailable"
  28. exit 77
  29. fi
  30. if [ -n "$STARPU_SCHED" ]
  31. then
  32. SCHEDULERS=$STARPU_SCHED
  33. else
  34. SCHEDULERS=`$basedir/../../tools/starpu_sched_display | grep -v heteroprio`
  35. fi
  36. run()
  37. {
  38. sched=$1
  39. echo "cholesky.$sched"
  40. STARPU_SCHED=$sched $STARPU_LAUNCH $basedir/../cholesky/cholesky_tag -size $((320*3)) -nblocks 3
  41. check_success $?
  42. }
  43. printenv | grep MAKEFLAGS
  44. case "$MAKEFLAGS" in
  45. *\ -j1[0-9]*\ *|*\ -j[2-9]*\ *)
  46. for sched in $SCHEDULERS
  47. do
  48. run $sched &
  49. done
  50. while true
  51. do
  52. wait -n
  53. RET=$?
  54. if [ $RET = 127 ] ; then break ; fi
  55. check_success $RET
  56. done
  57. ;;
  58. *)
  59. for sched in $SCHEDULERS
  60. do
  61. run $sched
  62. done
  63. ;;
  64. esac