microbench.sh 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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. RESULT=0
  26. for sched in $SCHEDS;
  27. do
  28. if STARPU_SCHED=$sched $top_builddir/tests/microbenchs/$TEST ; then
  29. echo " SUCCESS: STARPU_SCHED=$sched ./microbenchs/$TEST"
  30. continue
  31. fi
  32. if [ -n "$XSUCCESS" ]
  33. then
  34. # We have a list of schedulers that are expected to
  35. # succeed, others are allowed to fail
  36. case " $XSUCCESS " in
  37. *\ $sched\ *)
  38. echo " FAIL: STARPU_SCHED=$sched ./microbenchs/$TEST" | tee /dev/tty
  39. RESULT=1
  40. ;;
  41. *)
  42. echo " XFAIL: STARPU_SCHED=$sched ./microbenchs/$TEST"
  43. ;;
  44. esac
  45. else
  46. # We have a list of schedulers that are expected to
  47. # fail, others are expected to succeed
  48. case " $XFAIL " in
  49. *\ $sched\ *)
  50. echo " XFAIL: STARPU_SCHED=$sched ./microbenchs/$TEST"
  51. ;;
  52. *)
  53. echo " FAIL: STARPU_SCHED=$sched ./microbenchs/$TEST" | tee /dev/tty
  54. RESULT=1
  55. ;;
  56. esac
  57. fi
  58. done
  59. return $RESULT
  60. }