360_debugging_tools.doxy 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. /* StarPU --- Runtime system for heterogeneous multicore architectures.
  2. *
  3. * Copyright (C) 2009-2020 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. /*! \page DebuggingTools Debugging Tools
  17. StarPU provides several tools to help debugging applications. Execution traces
  18. can be generated and displayed graphically, see \ref GeneratingTracesWithFxT.
  19. \section DebuggingInGeneral TroubleShooting In General
  20. Generally-speaking, if you have troubles, pass \ref enable-debug "--enable-debug" to
  21. <c>configure</c> to enable some checks which impact performance, but will
  22. catch common issues, possibly earlier than the actual problem you are observing,
  23. which may just be a consequence of a bug that happened earlier. Also, make sure
  24. not to have the \ref enable-fast "--enable-fast" \c configure option which drops very useful
  25. catchup assertions. If your program is valgrind-safe, you can use it, see \ref
  26. UsingOtherDebugger.
  27. Depending on your toolchain, it might happen that you get
  28. <c>undefined reference to `__stack_chk_guard'</c> errors. In that case, use the
  29. <c>--disable-fstack-protector-all</c> option to avoid the issue.
  30. Then, if your program crashes with an assertion error, a segfault, etc. you can send us the result of
  31. \verbatim
  32. thread apply all bt
  33. \endverbatim
  34. run in <c>gdb</c> at the point of the crash.
  35. In case your program just hangs, but it may also be useful in case of a crash
  36. too, it helps to source <c>gdbinit</c> as described in the next section to be
  37. able to run and send us the output of the following commands:
  38. \verbatim
  39. starpu-workers
  40. starpu-tasks
  41. starpu-print-requests
  42. starpu-print-prequests
  43. starpu-print-frrequests
  44. starpu-print-irrequests
  45. \endverbatim
  46. To give us an idea of what is happening within StarPU. If the outputs are not too long, you can even run
  47. \verbatim
  48. starpu-all-tasks
  49. starpu-print-all-tasks
  50. starpu-print-datas-summary
  51. starpu-print-datas
  52. \endverbatim
  53. \section UsingGdb Using The Gdb Debugger
  54. Some <c>gdb</c> helpers are provided to show the whole StarPU state:
  55. \verbatim
  56. (gdb) source tools/gdbinit
  57. (gdb) help starpu
  58. \endverbatim
  59. For instance,
  60. <ul>
  61. <li> one can print all tasks with <c>starpu-print-all-tasks</c>, </li>
  62. <li> print all datas with <c>starpu-print-datas</c>, </li>
  63. <li> print all pending data transfers with <c>starpu-print-prequests</c>, <c>starpu-print-requests</c>, <c>starpu-print-frequests</c>, <c>starpu-print-irequests</c>,</li>
  64. <li> print pending MPI requests with <c>starpu-mpi-print-detached-requests</c></li>
  65. </ul>
  66. Some functions can only work if \ref enable-debug "--enable-debug"
  67. was passed to <c>configure</c>
  68. (because they impact performance)
  69. \section UsingOtherDebugger Using Other Debugging Tools
  70. Valgrind can be used on StarPU: valgrind.h just needs to be found at <c>configure</c>
  71. time, to tell valgrind about some known false positives and disable host memory
  72. pinning. Other known false positives can be suppressed by giving the suppression
  73. files in <c>tools/valgrind/*.suppr</c> to valgrind's <c>--suppressions</c> option.
  74. The environment variable \ref STARPU_DISABLE_KERNELS can also be set to <c>1</c> to make
  75. StarPU does everything (schedule tasks, transfer memory, etc.) except actually
  76. calling the application-provided kernel functions, i.e. the computation will not
  77. happen. This permits to quickly check that the task scheme is working properly.
  78. \section UsingTheTemanejoTaskDebugger Using The Temanejo Task Debugger
  79. StarPU can connect to Temanejo >= 1.0rc2 (see
  80. http://www.hlrs.de/temanejo), to permit
  81. nice visual task debugging. To do so, build Temanejo's <c>libayudame.so</c>,
  82. install <c>Ayudame.h</c> to e.g. <c>/usr/local/include</c>, apply the
  83. <c>tools/patch-ayudame</c> to it to fix C build, re-<c>configure</c>, make
  84. sure that it found it, rebuild StarPU. Run the Temanejo GUI, give it the path
  85. to your application, any options you want to pass it, the path to <c>libayudame.so</c>.
  86. It permits to visualize the task graph, add breakpoints, continue execution
  87. task-by-task, and run <c>gdb</c> on a given task, etc.
  88. \image html temanejo.png
  89. \image latex temanejo.png "" width=\textwidth
  90. Make sure to specify at least the same number of CPUs in the dialog box as your
  91. machine has, otherwise an error will happen during execution. Future versions
  92. of Temanejo should be able to tell StarPU the number of CPUs to use.
  93. Tag numbers have to be below <c>4000000000000000000ULL</c> to be usable for
  94. Temanejo (so as to distinguish them from tasks).
  95. */