microbench.sh 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. # StarPU --- Runtime system for heterogeneous multicore architectures.
  2. #
  3. # Copyright (C) 2016 Université de Bordeaux
  4. # Copyright (C) 2016 CNRS
  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. # This provides a helper function to be used for microbenchs that should be run
  17. # under the various schedulers.
  18. #
  19. # The caller should fill either the XFAIL or XSUCCESS variable with the list of
  20. # schedulers which are supposed to fail or succeed, and then call test_scheds
  21. set -e
  22. SCHEDS=`$(dirname $0)/../../tools/starpu_sched_display`
  23. test_scheds()
  24. {
  25. TEST=$1
  26. xfailed=""
  27. failed=""
  28. pass=""
  29. RESULT=0
  30. for sched in $SCHEDS;
  31. do
  32. if STARPU_SCHED=$sched $(dirname $0)/$TEST
  33. then
  34. echo "SUCCESS: STARPU_SCHED=$sched ./microbenchs/$TEST"
  35. pass="$pass $sched"
  36. continue
  37. fi
  38. if [ -n "$XSUCCESS" ]
  39. then
  40. # We have a list of schedulers that are expected to
  41. # succeed, others are allowed to fail
  42. case " $XSUCCESS " in
  43. *\ $sched\ *)
  44. echo "FAIL: STARPU_SCHED=$sched ./microbenchs/$TEST" | ( tee /dev/tty || true )
  45. failed="$failed $sched"
  46. RESULT=1
  47. ;;
  48. *)
  49. echo "XFAIL: STARPU_SCHED=$sched ./microbenchs/$TEST"
  50. xfailed="$xfailed $sched"
  51. ;;
  52. esac
  53. else
  54. # We have a list of schedulers that are expected to
  55. # fail, others are expected to succeed
  56. case " $XFAIL " in
  57. *\ $sched\ *)
  58. echo "XFAIL: STARPU_SCHED=$sched ./microbenchs/$TEST"
  59. xfailed="$xfailed $sched"
  60. ;;
  61. *)
  62. echo "FAIL: STARPU_SCHED=$sched ./microbenchs/$TEST" | ( tee /dev/tty || true )
  63. failed="$failed $sched"
  64. RESULT=1
  65. ;;
  66. esac
  67. fi
  68. done
  69. echo "passed schedulers:$pass"| ( tee /dev/tty || true )
  70. echo "failed schedulers:$failed"| ( tee /dev/tty || true )
  71. echo "xfailed schedulers:$xfailed"| ( tee /dev/tty || true )
  72. return $RESULT
  73. }