microbench.sh 2.9 KB

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