profiling.doxy 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203
  1. /* StarPU --- Runtime system for heterogeneous multicore architectures.
  2. *
  3. * Copyright (C) 2010-2015,2017 CNRS
  4. * Copyright (C) 2009-2011,2014,2016,2018-2019 Université de Bordeaux
  5. * Copyright (C) 2011,2012 Inria
  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. /*! \defgroup API_Profiling Profiling
  19. \struct starpu_profiling_task_info
  20. \ingroup API_Profiling
  21. This structure contains information about the execution of a
  22. task. It is accessible from the field starpu_task::profiling_info if
  23. profiling was enabled.
  24. \var struct timespec starpu_profiling_task_info::submit_time
  25. Date of task submission (relative to the initialization of StarPU).
  26. \var struct timespec starpu_profiling_task_info::push_start_time
  27. Time when the task was submitted to the scheduler.
  28. \var struct timespec starpu_profiling_task_info::push_end_time
  29. Time when the scheduler finished with the task submission.
  30. \var struct timespec starpu_profiling_task_info::pop_start_time
  31. Time when the scheduler started to be requested for a task, and eventually gave that task.
  32. \var struct timespec starpu_profiling_task_info::pop_end_time
  33. Time when the scheduler finished providing the task for execution.
  34. \var struct timespec starpu_profiling_task_info::acquire_data_start_time
  35. Time when the worker started fetching input data.
  36. \var struct timespec starpu_profiling_task_info::acquire_data_end_time
  37. Time when the worker finished fetching input data.
  38. \var struct timespec starpu_profiling_task_info::start_time
  39. Date of task execution beginning (relative to the initialization of StarPU).
  40. \var struct timespec starpu_profiling_task_info::end_time
  41. Date of task execution termination (relative to the initialization of StarPU).
  42. \var struct timespec starpu_profiling_task_info::release_data_start_time
  43. Time when the worker started releasing data.
  44. \var struct timespec starpu_profiling_task_info::release_data_end_time
  45. Time when the worker finished releasing data.
  46. \var struct timespec starpu_profiling_task_info::callback_start_time
  47. Time when the worker started the application callback for the task.
  48. \var struct timespec starpu_profiling_task_info::callback_end_time
  49. Time when the worker finished the application callback for the task.
  50. \var int starpu_profiling_task_info::workerid
  51. Identifier of the worker which has executed the task.
  52. \var uint64_t starpu_profiling_task_info::used_cycles
  53. Number of cycles used by the task, only available in the MoviSim
  54. \var uint64_t starpu_profiling_task_info::stall_cycles
  55. Number of cycles stalled within the task, only available in the MoviSim
  56. \var double starpu_profiling_task_info::energy_consumed
  57. Energy consumed by the task, in Joules
  58. \struct starpu_profiling_worker_info
  59. This structure contains the profiling information associated to
  60. a worker. The timing is provided since the previous call to
  61. starpu_profiling_worker_get_info()
  62. \ingroup API_Profiling
  63. \var struct timespec starpu_profiling_worker_info::start_time
  64. Starting date for the reported profiling measurements.
  65. \var struct timespec starpu_profiling_worker_info::total_time
  66. Duration of the profiling measurement interval.
  67. \var struct timespec starpu_profiling_worker_info::executing_time
  68. Time spent by the worker to execute tasks during the profiling measurement interval.
  69. \var struct timespec starpu_profiling_worker_info::sleeping_time
  70. Time spent idling by the worker during the profiling measurement interval.
  71. \var int starpu_profiling_worker_info::executed_tasks
  72. Number of tasks executed by the worker during the profiling measurement interval.
  73. \var uint64_t starpu_profiling_worker_info::used_cycles
  74. Number of cycles used by the worker, only available in the MoviSim
  75. \var uint64_t starpu_profiling_worker_info::stall_cycles
  76. Number of cycles stalled within the worker, only available in the MoviSim
  77. \var double starpu_profiling_worker_info::energy_consumed
  78. Energy consumed by the worker, in Joules
  79. \struct starpu_profiling_bus_info
  80. todo
  81. \ingroup API_Profiling
  82. \var struct timespec starpu_profiling_bus_info::start_time
  83. Time of bus profiling startup.
  84. \var struct timespec starpu_profiling_bus_info::total_time
  85. Total time of bus profiling.
  86. \var int long long starpu_profiling_bus_info::transferred_bytes
  87. Number of bytes transferred during profiling.
  88. \var int starpu_profiling_bus_info::transfer_count
  89. Number of transfers during profiling.
  90. \typedef STARPU_PROFILING_DISABLE
  91. \ingroup API_Profiling
  92. Used when calling the function starpu_profiling_status_set() to disable profiling.
  93. \typedef STARPU_PROFILING_ENABLE
  94. \ingroup API_Profiling
  95. Used when calling the function starpu_profiling_status_set() to enable profiling.
  96. \fn int starpu_profiling_status_set(int status)
  97. \ingroup API_Profiling
  98. Set the profiling status. Profiling is activated
  99. by passing \ref STARPU_PROFILING_ENABLE in \p status. Passing
  100. \ref STARPU_PROFILING_DISABLE disables profiling. Calling this function
  101. resets all profiling measurements. When profiling is enabled, the
  102. field starpu_task::profiling_info points to a valid structure
  103. starpu_profiling_task_info containing information about the execution
  104. of the task. Negative return values indicate an error, otherwise the
  105. previous status is returned.
  106. \fn int starpu_profiling_status_get(void)
  107. \ingroup API_Profiling
  108. Return the current profiling status or a negative value in case
  109. there was an error.
  110. \fn void starpu_profiling_init(void)
  111. \ingroup API_Profiling
  112. Reset performance counters and enable profiling if the
  113. environment variable \ref STARPU_PROFILING is set to a positive value.
  114. \fn void starpu_profiling_set_id(int new_id)
  115. \ingroup API_Profiling
  116. Set the ID used for profiling trace filename. HAS to be called before starpu_init().
  117. \fn int starpu_profiling_worker_get_info(int workerid, struct starpu_profiling_worker_info *worker_info)
  118. \ingroup API_Profiling
  119. Get the profiling info associated to the worker identified by
  120. \p workerid, and reset the profiling measurements. If the argument \p
  121. worker_info is <c>NULL</c>, only reset the counters associated to worker
  122. \p workerid. Upon successful completion, this function returns 0.
  123. Otherwise, a negative value is returned.
  124. \fn int starpu_bus_get_profiling_info(int busid, struct starpu_profiling_bus_info *bus_info)
  125. \ingroup API_Profiling
  126. todo
  127. See _starpu_profiling_bus_helper_display_summary in src/profiling/profiling_helpers.c for a usage example.
  128. Note that calling starpu_bus_get_profiling_info resets the counters to zero.
  129. \fn int starpu_bus_get_count(void)
  130. \ingroup API_Profiling
  131. Return the number of buses in the machine
  132. \fn int starpu_bus_get_id(int src, int dst)
  133. \ingroup API_Profiling
  134. Return the identifier of the bus between \p src and \p dst
  135. \fn int starpu_bus_get_src(int busid)
  136. \ingroup API_Profiling
  137. Return the source point of bus \p busid
  138. \fn int starpu_bus_get_dst(int busid)
  139. \ingroup API_Profiling
  140. Return the destination point of bus \p busid
  141. \fn double starpu_timing_timespec_delay_us(struct timespec *start, struct timespec *end)
  142. \ingroup API_Profiling
  143. Return the time elapsed between \p start and \p end in microseconds.
  144. \fn double starpu_timing_timespec_to_us(struct timespec *ts)
  145. \ingroup API_Profiling
  146. Convert the given timespec \p ts into microseconds
  147. \fn void starpu_profiling_bus_helper_display_summary(void)
  148. \ingroup API_Profiling
  149. Display statistics about the bus on \c stderr. if the environment
  150. variable \ref STARPU_BUS_STATS is defined. The function is called
  151. automatically by starpu_shutdown().
  152. \fn void starpu_profiling_worker_helper_display_summary(void)
  153. \ingroup API_Profiling
  154. Displays statistic about the workers on \c stderr if the
  155. environment variable \ref STARPU_WORKER_STATS is defined. The function is
  156. called automatically by starpu_shutdown().
  157. \fn void starpu_data_display_memory_stats()
  158. \ingroup API_Profiling
  159. Display statistics about the current data handles registered
  160. within StarPU. StarPU must have been configured with the configure
  161. option \ref enable-memory-stats "--enable-memory-stats" (see \ref MemoryFeedback).
  162. */