schedulers.sh 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. #!/bin/bash
  2. # StarPU --- Runtime system for heterogeneous multicore architectures.
  3. #
  4. # Copyright (C) 2012-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. 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. case "$MAKEFLAGS" in
  44. *\ -j1[0-9]*\ *|*\ -j[2-9]*\ *)
  45. for sched in $SCHEDULERS
  46. do
  47. run $sched &
  48. done
  49. while true
  50. do
  51. wait -n
  52. RET=$?
  53. if [ $RET = 127 ] ; then break ; fi
  54. check_success $RET
  55. done
  56. ;;
  57. *)
  58. for sched in $SCHEDULERS
  59. do
  60. run $sched
  61. done
  62. ;;
  63. esac