microbench.sh 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  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. skip=""
  30. RESULT=0
  31. for sched in $SCHEDS;
  32. do
  33. set +e
  34. STARPU_SCHED=$sched $(dirname $0)/$TEST
  35. ret=$?
  36. set -e
  37. if test $ret == 0
  38. then
  39. echo "SUCCESS: STARPU_SCHED=$sched ./microbenchs/$TEST"
  40. pass="$pass $sched"
  41. continue
  42. fi
  43. if test $ret == 77
  44. then
  45. echo "SKIP: STARPU_SCHED=$sched ./microbenchs/$TEST"
  46. skip="$skip $sched"
  47. continue
  48. fi
  49. if [ -n "$XSUCCESS" ]
  50. then
  51. # We have a list of schedulers that are expected to
  52. # succeed, others are allowed to fail
  53. case " $XSUCCESS " in
  54. *\ $sched\ *)
  55. echo "FAIL: STARPU_SCHED=$sched ./microbenchs/$TEST" | ( tee /dev/tty || true )
  56. failed="$failed $sched"
  57. RESULT=1
  58. ;;
  59. *)
  60. echo "XFAIL: STARPU_SCHED=$sched ./microbenchs/$TEST"
  61. xfailed="$xfailed $sched"
  62. ;;
  63. esac
  64. else
  65. # We have a list of schedulers that are expected to
  66. # fail, others are expected to succeed
  67. case " $XFAIL " in
  68. *\ $sched\ *)
  69. echo "XFAIL: STARPU_SCHED=$sched ./microbenchs/$TEST"
  70. xfailed="$xfailed $sched"
  71. ;;
  72. *)
  73. echo "FAIL: STARPU_SCHED=$sched ./microbenchs/$TEST" | ( tee /dev/tty || true )
  74. failed="$failed $sched"
  75. RESULT=1
  76. ;;
  77. esac
  78. fi
  79. done
  80. echo "passed schedulers:$pass"| ( tee /dev/tty || true )
  81. echo "skipped schedulers:$skip"| ( tee /dev/tty || true )
  82. echo "failed schedulers:$failed"| ( tee /dev/tty || true )
  83. echo "xfailed schedulers:$xfailed"| ( tee /dev/tty || true )
  84. return $RESULT
  85. }