microbench.sh 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. # StarPU --- Runtime system for heterogeneous multicore architectures.
  2. #
  3. # Copyright (C) 2016 Université de Bordeaux
  4. #
  5. # StarPU is free software; you can redistribute it and/or modify
  6. # it under the terms of the GNU Lesser General Public License as published by
  7. # the Free Software Foundation; either version 2.1 of the License, or (at
  8. # your option) any later version.
  9. #
  10. # StarPU is distributed in the hope that it will be useful, but
  11. # WITHOUT ANY WARRANTY; without even the implied warranty of
  12. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  13. #
  14. # See the GNU Lesser General Public License in COPYING.LGPL for more details.
  15. # This provides a helper function to be used for microbenchs that should be run
  16. # under the various schedulers.
  17. #
  18. # The caller should fill either the XFAIL or XSUCCESS variable with the list of
  19. # schedulers which are supposed to fail or succeed, and then call test_scheds
  20. set -e
  21. SCHEDS=`$top_builddir/tools/starpu_sched_display`
  22. test_scheds()
  23. {
  24. TEST=$1
  25. failed=""
  26. pass=""
  27. RESULT=0
  28. for sched in $SCHEDS;
  29. do
  30. if STARPU_SCHED=$sched $top_builddir/tests/microbenchs/$TEST ; then
  31. echo " SUCCESS: STARPU_SCHED=$sched ./microbenchs/$TEST"
  32. pass="$pass $sched"
  33. continue
  34. fi
  35. failed="$failed $sched"
  36. if [ -n "$XSUCCESS" ]
  37. then
  38. # We have a list of schedulers that are expected to
  39. # succeed, others are allowed to fail
  40. case " $XSUCCESS " in
  41. *\ $sched\ *)
  42. echo " FAIL: STARPU_SCHED=$sched ./microbenchs/$TEST" | ( tee /dev/tty || true )
  43. RESULT=1
  44. ;;
  45. *)
  46. echo " XFAIL: STARPU_SCHED=$sched ./microbenchs/$TEST"
  47. ;;
  48. esac
  49. else
  50. # We have a list of schedulers that are expected to
  51. # fail, others are expected to succeed
  52. case " $XFAIL " in
  53. *\ $sched\ *)
  54. echo " XFAIL: STARPU_SCHED=$sched ./microbenchs/$TEST"
  55. ;;
  56. *)
  57. echo " FAIL: STARPU_SCHED=$sched ./microbenchs/$TEST" | ( tee /dev/tty || true )
  58. RESULT=1
  59. ;;
  60. esac
  61. fi
  62. done
  63. echo "passed schedulers:$pass" | ( tee /dev/tty || true )
  64. echo "failed schedulers:$failed" | ( tee /dev/tty || true )
  65. return $RESULT
  66. }