starpu_check.sh 2.3 KB

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