microbench.sh 2.8 KB

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