microbench.sh 2.9 KB

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