microbench.sh 3.0 KB

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