starpu_check.sh 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. #!/bin/sh
  2. # StarPU --- Runtime system for heterogeneous multicore architectures.
  3. #
  4. # Copyright (C) 2009-2011,2014 Université de Bordeaux
  5. # Copyright (C) 2010,2011,2015,2017 CNRS
  6. #
  7. # StarPU is free software; you can redistribute it and/or modify
  8. # it under the terms of the GNU Lesser General Public License as published by
  9. # the Free Software Foundation; either version 2.1 of the License, or (at
  10. # your option) any later version.
  11. #
  12. # StarPU is distributed in the hope that it will be useful, but
  13. # WITHOUT ANY WARRANTY; without even the implied warranty of
  14. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  15. #
  16. # See the GNU Lesser General Public License in COPYING.LGPL for more details.
  17. #
  18. TEST_DIR=$PWD
  19. ntests=0
  20. nfailed=0
  21. nsucess=0
  22. print_summary()
  23. {
  24. if test $nfailed = 0; then
  25. echo "**** All tests are successful ****"
  26. else
  27. echo "$nfailed test(s) failed out of $ntests"
  28. fi
  29. }
  30. test_with_timeout()
  31. {
  32. timeout=$1
  33. application=$2
  34. ntests=$(($ntests + 1))
  35. echo "$application"
  36. $application > /dev/null 2> /dev/null & _pid_appli=$!;
  37. (sleep $timeout ; kill -9 $_pid_appli 2> /dev/null) & _pid_killer=$!
  38. wait $_pid_appli
  39. ret=$?
  40. kill $_pid_killer 2> /dev/null
  41. if test $ret = 0; then
  42. echo " SUCCESS"
  43. nsuccess=$(($nsuccess + 1))
  44. else
  45. case $ret in
  46. 137) # sigkill
  47. echo " TEST TIMEOUT"
  48. ;;
  49. 139)
  50. echo " TEST FAILED: SIGSEV"
  51. ;;
  52. *)
  53. echo " TEST FAILED (ret = $ret)"
  54. esac
  55. nfailed=$(($nfailed + 1))
  56. fi
  57. }
  58. echo
  59. echo "**********************"
  60. echo "TEST synchronous tasks"
  61. echo "**********************"
  62. echo
  63. test_with_timeout 10 "./sync_tasks_overhead -i 10000" 2> /dev/null
  64. echo
  65. echo "***********************"
  66. echo "TEST asynchronous tasks"
  67. echo "***********************"
  68. echo
  69. test_with_timeout 10 "./async_tasks_overhead -i 20000" 2> /dev/null
  70. echo
  71. echo "**************"
  72. echo "TEST increment"
  73. echo "**************"
  74. echo
  75. test_with_timeout 10 "../../examples/incrementer/incrementer" 2> /dev/null
  76. echo
  77. echo "**********"
  78. echo "TEST tag 1"
  79. echo "**********"
  80. echo
  81. test_with_timeout 60 "../../examples/tag_example/tag_example -iter 1000" 2> /dev/null
  82. echo
  83. echo "**********"
  84. echo "TEST tag 2"
  85. echo "**********"
  86. echo
  87. test_with_timeout 10 "../../examples/tag_example/tag_example2 -iter 100" 2> /dev/null
  88. echo
  89. echo "*******"
  90. echo "SUMMARY"
  91. echo "*******"
  92. echo
  93. print_summary