11debugging_tools.doxy 4.0 KB

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