starpu_check.sh 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. #!/bin/sh
  2. #
  3. # StarPU
  4. # Copyright (C) Université Bordeaux 1, CNRS 2008-2010 (see AUTHORS file)
  5. #
  6. # This program 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. # This program 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. TEST_DIR=$PWD
  18. ntests=0
  19. nfailed=0
  20. nsucess=0
  21. print_summary() {
  22. if test $nfailed = 0; then
  23. echo "**** All tests are successful ****"
  24. else
  25. echo "$nfailed test(s) failed out of $ntests"
  26. fi
  27. }
  28. test_with_timeout() {
  29. timeout=$1
  30. application=$2
  31. ntests=$(($ntests + 1))
  32. echo "$application"
  33. $application > /dev/null 2> /dev/null & _pid_appli=$!;
  34. (sleep $timeout ; kill -9 $_pid_appli 2> /dev/null) & _pid_killer=$!
  35. wait $_pid_appli
  36. ret=$?
  37. kill $_pid_killer 2> /dev/null
  38. if test $ret = 0; then
  39. echo " SUCCESS"
  40. nsuccess=$(($nsuccess + 1))
  41. else
  42. case $ret in
  43. 137) # sigkill
  44. echo " TEST TIMEOUT"
  45. ;;
  46. 139)
  47. echo " TEST FAILED: SIGSEV"
  48. ;;
  49. *)
  50. echo " TEST FAILED (ret = $ret)"
  51. esac
  52. nfailed=$(($nfailed + 1))
  53. fi
  54. }
  55. echo
  56. echo "**********************"
  57. echo "TEST synchronous tasks"
  58. echo "**********************"
  59. echo
  60. test_with_timeout 10 "./sync_tasks_overhead -i 10000" 2> /dev/null
  61. echo
  62. echo "***********************"
  63. echo "TEST asynchronous tasks"
  64. echo "***********************"
  65. echo
  66. test_with_timeout 10 "./async_tasks_overhead -i 20000" 2> /dev/null
  67. echo
  68. echo "**************"
  69. echo "TEST increment"
  70. echo "**************"
  71. echo
  72. test_with_timeout 10 "../../examples/incrementer/incrementer" 2> /dev/null
  73. echo
  74. echo "**********"
  75. echo "TEST tag 1"
  76. echo "**********"
  77. echo
  78. test_with_timeout 60 "../../examples/tag_example/tag_example -iter 1000" 2> /dev/null
  79. echo
  80. echo "**********"
  81. echo "TEST tag 2"
  82. echo "**********"
  83. echo
  84. test_with_timeout 10 "../../examples/tag_example/tag_example2 -iter 100" 2> /dev/null
  85. echo
  86. echo "*******"
  87. echo "SUMMARY"
  88. echo "*******"
  89. echo
  90. print_summary