380_offline_performance_tools.doxy 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645
  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, 2016 CNRS
  5. * Copyright (C) 2011, 2012 INRIA
  6. * See the file version.doxy for copying conditions.
  7. */
  8. /*! \page OfflinePerformanceTools Offline Performance Tools
  9. To get an idea of what is happening, a lot of performance feedback is available,
  10. detailed in this chapter. The various informations should be checked for.
  11. <ul>
  12. <li>
  13. What does the Gantt diagram look like? (see \ref CreatingAGanttDiagram)
  14. <ul>
  15. <li> If it's mostly green (tasks running in the initial context) or context specific
  16. color prevailing, then the machine is properly
  17. utilized, and perhaps the codelets are just slow. Check their performance, see
  18. \ref PerformanceOfCodelets.
  19. </li>
  20. <li> If it's mostly purple (FetchingInput), tasks keep waiting for data
  21. transfers, do you perhaps have far more communication than computation? Did
  22. you properly use CUDA streams to make sure communication can be
  23. overlapped? Did you use data-locality aware schedulers to avoid transfers as
  24. much as possible?
  25. </li>
  26. <li> If it's mostly red (Blocked), tasks keep waiting for dependencies,
  27. do you have enough parallelism? It might be a good idea to check what the DAG
  28. looks like (see \ref CreatingADAGWithGraphviz).
  29. </li>
  30. <li> If only some workers are completely red (Blocked), for some reason the
  31. scheduler didn't assign tasks to them. Perhaps the performance model is bogus,
  32. check it (see \ref PerformanceOfCodelets). Do all your codelets have a
  33. performance model? When some of them don't, the schedulers switches to a
  34. greedy algorithm which thus performs badly.
  35. </li>
  36. </ul>
  37. </li>
  38. </ul>
  39. You can also use the Temanejo task debugger (see \ref UsingTheTemanejoTaskDebugger) to
  40. visualize the task graph more easily.
  41. \section Off-linePerformanceFeedback Off-line Performance Feedback
  42. \subsection GeneratingTracesWithFxT Generating Traces With FxT
  43. StarPU can use the FxT library (see
  44. https://savannah.nongnu.org/projects/fkt/) to generate traces
  45. with a limited runtime overhead.
  46. You can either get a tarball:
  47. \verbatim
  48. $ wget http://download.savannah.gnu.org/releases/fkt/fxt-0.2.11.tar.gz
  49. \endverbatim
  50. or use the FxT library from CVS (autotools are required):
  51. \verbatim
  52. $ cvs -d :pserver:anonymous\@cvs.sv.gnu.org:/sources/fkt co FxT
  53. $ ./bootstrap
  54. \endverbatim
  55. Compiling and installing the FxT library in the <c>$FXTDIR</c> path is
  56. done following the standard procedure:
  57. \verbatim
  58. $ ./configure --prefix=$FXTDIR
  59. $ make
  60. $ make install
  61. \endverbatim
  62. In order to have StarPU to generate traces, StarPU should be configured with
  63. the option \ref with-fxt "--with-fxt" :
  64. \verbatim
  65. $ ./configure --with-fxt=$FXTDIR
  66. \endverbatim
  67. Or you can simply point the <c>PKG_CONFIG_PATH</c> to
  68. <c>$FXTDIR/lib/pkgconfig</c> and pass
  69. \ref with-fxt "--with-fxt" to <c>./configure</c>
  70. When FxT is enabled, a trace is generated when StarPU is terminated by calling
  71. starpu_shutdown(). The trace is a binary file whose name has the form
  72. <c>prof_file_XXX_YYY</c> where <c>XXX</c> is the user name, and
  73. <c>YYY</c> is the pid of the process that used StarPU. This file is saved in the
  74. <c>/tmp/</c> directory by default, or by the directory specified by
  75. the environment variable \ref STARPU_FXT_PREFIX.
  76. The additional configure option \ref enable-fxt-lock "--enable-fxt-lock" can
  77. be used to generate trace events which describes the locks behaviour during
  78. the execution.
  79. \subsection CreatingAGanttDiagram Creating a Gantt Diagram
  80. When the FxT trace file <c>prof_file_something</c> has been generated, it is possible to
  81. generate a trace in the Paje format by calling:
  82. \verbatim
  83. $ starpu_fxt_tool -i /tmp/prof_file_something
  84. \endverbatim
  85. Or alternatively, setting the environment variable \ref STARPU_GENERATE_TRACE
  86. to <c>1</c> before application execution will make StarPU do it automatically at
  87. application shutdown.
  88. This will create a file <c>paje.trace</c> in the current directory that
  89. can be inspected with the ViTE (http://vite.gforge.inria.fr/) trace
  90. visualizing open-source tool. It is possible to open the
  91. file <c>paje.trace</c> with ViTE by using the following command:
  92. \verbatim
  93. $ vite paje.trace
  94. \endverbatim
  95. To get names of tasks instead of "unknown", fill the optional
  96. starpu_codelet::name, or use a performance model for them.
  97. Details of the codelet execution can be obtained by passing
  98. \ref enable-paje-codelet-details "--enable-paje-codelet-details" when
  99. configuring StarPU and using a recent enough version of ViTE (at least
  100. r1430).
  101. In the MPI execution case, \ref STARPU_GENERATE_TRACE will not work as expected
  102. (each node will try to generate paje.trace, thus mixing outputs...), you have to
  103. collect the trace files from the MPI nodes, and
  104. specify them all on the command <c>starpu_fxt_tool</c>, for instance:
  105. \verbatim
  106. $ starpu_fxt_tool -i /tmp/prof_file_something1 -i /tmp/prof_file_something2
  107. \endverbatim
  108. By default, all tasks are displayed using a green color. To display tasks with
  109. varying colors, pass option <c>-c</c> to <c>starpu_fxt_tool</c>.
  110. To identify tasks precisely, the application can set the starpu_task::tag_id field of the
  111. task (or use \ref STARPU_TAG_ONLY when using starpu_task_insert()), and with a recent
  112. enough version of vite (>= r1430) and the
  113. \ref enable-paje-codelet-details "--enable-paje-codelet-details"
  114. StarPU configure option, the value of the tag will show up in the trace.
  115. It can also set the starpu_task::name field of the task (or use \ref STARPU_NAME)
  116. when using starpu_task_insert()), to replace in traces the name of the codelet
  117. with an arbitrarily chosen name.
  118. Traces can also be inspected by hand by using the tool <c>fxt_print</c>, for instance:
  119. \verbatim
  120. $ fxt_print -o -f /tmp/prof_file_something
  121. \endverbatim
  122. Timings are in nanoseconds (while timings as seen in <c>vite</c> are in milliseconds).
  123. \subsection CreatingADAGWithGraphviz Creating a DAG With Graphviz
  124. When the FxT trace file <c>prof_file_something</c> has been generated, it is possible to
  125. generate a task graph in the DOT format by calling:
  126. \verbatim
  127. $ starpu_fxt_tool -i /tmp/prof_file_something
  128. \endverbatim
  129. This will create a <c>dag.dot</c> file in the current directory. This file is a
  130. task graph described using the DOT language. It is possible to get a
  131. graphical output of the graph by using the graphviz library:
  132. \verbatim
  133. $ dot -Tpdf dag.dot -o output.pdf
  134. \endverbatim
  135. \subsection TraceTaskDetails Getting task details
  136. When the FxT trace file <c>prof_file_something</c> has been generated, details on the
  137. executed tasks can be retrieved by calling:
  138. \verbatim
  139. $ starpu_fxt_tool -i /tmp/prof_file_something
  140. \endverbatim
  141. This will create a <c>tasks.rec</c> file in the current directory. This file
  142. is in the recutils format, i.e. <c>Field: value</c> lines, and empty lines to
  143. separate each task. This can be used as a convenient input for various ad-hoc
  144. analysis tools. The performance models can be opened for instance by using
  145. starpu_perfmodel_load_symbol() and then using
  146. starpu_perfmodel_history_based_expected_perf().
  147. \subsection MonitoringActivity Monitoring Activity
  148. When the FxT trace file <c>prof_file_something</c> has been generated, it is possible to
  149. generate an activity trace by calling:
  150. \verbatim
  151. $ starpu_fxt_tool -i /tmp/prof_file_something
  152. \endverbatim
  153. This will create a file <c>activity.data</c> in the current
  154. directory. A profile of the application showing the activity of StarPU
  155. during the execution of the program can be generated:
  156. \verbatim
  157. $ starpu_workers_activity activity.data
  158. \endverbatim
  159. This will create a file named <c>activity.eps</c> in the current directory.
  160. This picture is composed of two parts.
  161. The first part shows the activity of the different workers. The green sections
  162. indicate which proportion of the time was spent executed kernels on the
  163. processing unit. The red sections indicate the proportion of time spent in
  164. StartPU: an important overhead may indicate that the granularity may be too
  165. low, and that bigger tasks may be appropriate to use the processing unit more
  166. efficiently. The black sections indicate that the processing unit was blocked
  167. because there was no task to process: this may indicate a lack of parallelism
  168. which may be alleviated by creating more tasks when it is possible.
  169. The second part of the picture <c>activity.eps</c> is a graph showing the
  170. evolution of the number of tasks available in the system during the execution.
  171. Ready tasks are shown in black, and tasks that are submitted but not
  172. schedulable yet are shown in grey.
  173. \subsection Animation Getting modular schedular animation
  174. When using modular schedulers (i.e. schedulers which use a modular architecture,
  175. and whose name start with "modular-"), the command
  176. \verbatim
  177. $ starpu_fxt_tool -i /tmp/prof_file_something
  178. \endverbatim
  179. will also produce a <c>trace.html</c> file which can be viewed in a
  180. javascript-enabled web browser. It shows the flow of tasks between the
  181. components of the modular scheduler.
  182. \subsection Limiting the scope of the trace
  183. For computing statistics, it is useful to limit the trace to a given portion of
  184. the time of the whole execution. This can be achieved by calling
  185. \verbatim
  186. starpu_fxt_autostart_profiling(0);
  187. \endverbatim
  188. before calling starpu_init(), to prevent tracing from starting immediately. Then
  189. \verbatim
  190. starpu_fxt_start_profiling();
  191. \endverbatim
  192. and
  193. \verbatim
  194. starpu_fxt_stop_profiling();
  195. \endverbatim
  196. can be used around the portion of code to be traced. This will show up as marks
  197. in the trace, and states of workers will only show up for that portion.
  198. \section PerformanceOfCodelets Performance Of Codelets
  199. The performance model of codelets (see \ref PerformanceModelExample)
  200. can be examined by using the tool <c>starpu_perfmodel_display</c>:
  201. \verbatim
  202. $ starpu_perfmodel_display -l
  203. file: <malloc_pinned.hannibal>
  204. file: <starpu_slu_lu_model_21.hannibal>
  205. file: <starpu_slu_lu_model_11.hannibal>
  206. file: <starpu_slu_lu_model_22.hannibal>
  207. file: <starpu_slu_lu_model_12.hannibal>
  208. \endverbatim
  209. Here, the codelets of the example <c>lu</c> are available. We can examine the
  210. performance of the kernel <c>22</c> (in micro-seconds), which is history-based:
  211. \verbatim
  212. $ starpu_perfmodel_display -s starpu_slu_lu_model_22
  213. performance model for cpu
  214. # hash size mean dev n
  215. 57618ab0 19660800 2.851069e+05 1.829369e+04 109
  216. performance model for cuda_0
  217. # hash size mean dev n
  218. 57618ab0 19660800 1.164144e+04 1.556094e+01 315
  219. performance model for cuda_1
  220. # hash size mean dev n
  221. 57618ab0 19660800 1.164271e+04 1.330628e+01 360
  222. performance model for cuda_2
  223. # hash size mean dev n
  224. 57618ab0 19660800 1.166730e+04 3.390395e+02 456
  225. \endverbatim
  226. We can see that for the given size, over a sample of a few hundreds of
  227. execution, the GPUs are about 20 times faster than the CPUs (numbers are in
  228. us). The standard deviation is extremely low for the GPUs, and less than 10% for
  229. CPUs.
  230. This tool can also be used for regression-based performance models. It will then
  231. display the regression formula, and in the case of non-linear regression, the
  232. same performance log as for history-based performance models:
  233. \verbatim
  234. $ starpu_perfmodel_display -s non_linear_memset_regression_based
  235. performance model for cpu_impl_0
  236. Regression : #sample = 1400
  237. Linear: y = alpha size ^ beta
  238. alpha = 1.335973e-03
  239. beta = 8.024020e-01
  240. Non-Linear: y = a size ^b + c
  241. a = 5.429195e-04
  242. b = 8.654899e-01
  243. c = 9.009313e-01
  244. # hash size mean stddev n
  245. a3d3725e 4096 4.763200e+00 7.650928e-01 100
  246. 870a30aa 8192 1.827970e+00 2.037181e-01 100
  247. 48e988e9 16384 2.652800e+00 1.876459e-01 100
  248. 961e65d2 32768 4.255530e+00 3.518025e-01 100
  249. ...
  250. \endverbatim
  251. The same can also be achieved by using StarPU's library API, see
  252. \ref API_Performance_Model and notably the function
  253. starpu_perfmodel_load_symbol(). The source code of the tool
  254. <c>starpu_perfmodel_display</c> can be a useful example.
  255. The tool <c>starpu_perfmodel_plot</c> can be used to draw performance
  256. models. It writes a <c>.gp</c> file in the current directory, to be
  257. run with the tool <c>gnuplot</c>, which shows the corresponding curve.
  258. \image html starpu_non_linear_memset_regression_based.png
  259. \image latex starpu_non_linear_memset_regression_based.eps "" width=\textwidth
  260. When the field starpu_task::flops is set (or \ref STARPU_FLOPS is passed to
  261. starpu_task_insert()), <c>starpu_perfmodel_plot</c> can directly draw a GFlops
  262. curve, by simply adding the <c>-f</c> option:
  263. \verbatim
  264. $ starpu_perfmodel_plot -f -s chol_model_11
  265. \endverbatim
  266. This will however disable displaying the regression model, for which we can not
  267. compute GFlops.
  268. \image html starpu_chol_model_11_type.png
  269. \image latex starpu_chol_model_11_type.eps "" width=\textwidth
  270. When the FxT trace file <c>prof_file_something</c> has been generated, it is possible to
  271. get a profiling of each codelet by calling:
  272. \verbatim
  273. $ starpu_fxt_tool -i /tmp/prof_file_something
  274. $ starpu_codelet_profile distrib.data codelet_name
  275. \endverbatim
  276. This will create profiling data files, and a <c>distrib.data.gp</c> file in the current
  277. directory, which draws the distribution of codelet time over the application
  278. execution, according to data input size.
  279. \image html distrib_data.png
  280. \image latex distrib_data.eps "" width=\textwidth
  281. This is also available in the tool <c>starpu_perfmodel_plot</c>, by passing it
  282. the fxt trace:
  283. \verbatim
  284. $ starpu_perfmodel_plot -s non_linear_memset_regression_based -i /tmp/prof_file_foo_0
  285. \endverbatim
  286. It will produce a <c>.gp</c> file which contains both the performance model
  287. curves, and the profiling measurements.
  288. \image html starpu_non_linear_memset_regression_based_2.png
  289. \image latex starpu_non_linear_memset_regression_based_2.eps "" width=\textwidth
  290. If you have the statistical tool <c>R</c> installed, you can additionally use
  291. \verbatim
  292. $ starpu_codelet_histo_profile distrib.data
  293. \endverbatim
  294. Which will create one <c>.pdf</c> file per codelet and per input size, showing a
  295. histogram of the codelet execution time distribution.
  296. \image html distrib_data_histo.png
  297. \image latex distrib_data_histo.eps "" width=\textwidth
  298. \section TraceStatistics Trace statistics
  299. More than just codelet performance, it is interesting to get statistics over all
  300. kinds of StarPU states (allocations, data transfers, etc.). This is particularly
  301. useful to check what may have gone wrong in the accurracy of the simgrid
  302. simulation.
  303. This requires the <c>R</c> statistical tool, with the plyr, ggplot2 and
  304. data.table packages. If your system distribution does not have packages for
  305. these, one can fetch them from CRAN:
  306. \verbatim
  307. $ R
  308. > install.packages("plyr")
  309. > install.packages("ggplot2")
  310. > install.packages("data.table")
  311. > install.packages("knitr")
  312. \endverbatim
  313. The pj_dump tool from pajeng is also needed (see
  314. https://github.com/schnorr/pajeng)
  315. One can then get textual or .csv statistics over the trace states:
  316. \verbatim
  317. $ starpu_paje_state_stats -v native.trace simgrid.trace
  318. "Value" "Events_native.csv" "Duration_native.csv" "Events_simgrid.csv" "Duration_simgrid.csv"
  319. "Callback" 220 0.075978 220 0
  320. "chol_model_11" 10 565.176 10 572.8695
  321. "chol_model_21" 45 9184.828 45 9170.719
  322. "chol_model_22" 165 64712.07 165 64299.203
  323. $ starpu_paje_state_stats native.trace simgrid.trace
  324. \endverbatim
  325. An other way to get statistics of StarPU states (without installing R and
  326. pj_dump) is to use the <c>starpu_trace_state_stats.py</c> script which parses the
  327. generated trace.rec file instead of the paje.trace file. The output is similar
  328. to the previous script but it doesn't need any dependencies.
  329. The different prefixes used in trace.rec are:
  330. \verbatim
  331. E: Event type
  332. N: Event name
  333. C: Event category
  334. W: Worker ID
  335. T: Thread ID
  336. S: Start time
  337. \endverbatim
  338. Here's an example how to use it:
  339. \verbatim
  340. $ python starpu_trace_state_stats.py trace.rec | column -t -s ","
  341. "Name" "Count" "Type" "Duration"
  342. "Callback" 220 Runtime 0.075978
  343. "chol_model_11" 10 Task 565.176
  344. "chol_model_21" 45 Task 9184.828
  345. "chol_model_22" 165 Task 64712.07
  346. \endverbatim
  347. <c>starpu_trace_state_stats.py</c> can also be used to compute the different
  348. efficiencies. Refer to the usage description to show some examples.
  349. And one can plot histograms of execution times, of several states for instance:
  350. \verbatim
  351. $ starpu_paje_draw_histogram -n chol_model_11,chol_model_21,chol_model_22 native.trace simgrid.trace
  352. \endverbatim
  353. and see the resulting pdf file:
  354. \image html paje_draw_histogram.png
  355. \image latex paje_draw_histogram.eps "" width=\textwidth
  356. A quick statistical report can be generated by using:
  357. \verbatim
  358. $ starpu_paje_summary native.trace simgrid.trace
  359. \endverbatim
  360. it includes gantt charts, execution summaries, as well as state duration charts
  361. and time distribution histograms.
  362. Other external Pajé analysis tools can be used on these traces, one just needs
  363. to sort the traces by timestamp order (which not guaranteed to make recording
  364. more efficient):
  365. \verbatim
  366. $ starpu_paje_sort paje.trace
  367. \endverbatim
  368. \section TheoreticalLowerBoundOnExecutionTime Theoretical Lower Bound On Execution Time
  369. StarPU can record a trace of what tasks are needed to complete the
  370. application, and then, by using a linear system, provide a theoretical lower
  371. bound of the execution time (i.e. with an ideal scheduling).
  372. The computed bound is not really correct when not taking into account
  373. dependencies, but for an application which have enough parallelism, it is very
  374. near to the bound computed with dependencies enabled (which takes a huge lot
  375. more time to compute), and thus provides a good-enough estimation of the ideal
  376. execution time.
  377. \ref TheoreticalLowerBoundOnExecutionTimeExample provides an example on how to
  378. use this.
  379. \section TheoreticalLowerBoundOnExecutionTimeExample Theoretical Lower Bound On Execution Time Example
  380. For kernels with history-based performance models (and provided that
  381. they are completely calibrated), StarPU can very easily provide a
  382. theoretical lower bound for the execution time of a whole set of
  383. tasks. See for instance <c>examples/lu/lu_example.c</c>: before
  384. submitting tasks, call the function starpu_bound_start(), and after
  385. complete execution, call starpu_bound_stop().
  386. starpu_bound_print_lp() or starpu_bound_print_mps() can then be used
  387. to output a Linear Programming problem corresponding to the schedule
  388. of your tasks. Run it through <c>lp_solve</c> or any other linear
  389. programming solver, and that will give you a lower bound for the total
  390. execution time of your tasks. If StarPU was compiled with the library
  391. <c>glpk</c> installed, starpu_bound_compute() can be used to solve it
  392. immediately and get the optimized minimum, in ms. Its parameter
  393. <c>integer</c> allows to decide whether integer resolution should be
  394. computed and returned
  395. The <c>deps</c> parameter tells StarPU whether to take tasks, implicit
  396. data, and tag dependencies into account. Tags released in a callback
  397. or similar are not taken into account, only tags associated with a task are.
  398. It must be understood that the linear programming
  399. problem size is quadratic with the number of tasks and thus the time to solve it
  400. will be very long, it could be minutes for just a few dozen tasks. You should
  401. probably use <c>lp_solve -timeout 1 test.pl -wmps test.mps</c> to convert the
  402. problem to MPS format and then use a better solver, <c>glpsol</c> might be
  403. better than <c>lp_solve</c> for instance (the <c>--pcost</c> option may be
  404. useful), but sometimes doesn't manage to converge. <c>cbc</c> might look
  405. slower, but it is parallel. For <c>lp_solve</c>, be sure to try at least all the
  406. <c>-B</c> options. For instance, we often just use <c>lp_solve -cc -B1 -Bb
  407. -Bg -Bp -Bf -Br -BG -Bd -Bs -BB -Bo -Bc -Bi</c> , and the <c>-gr</c> option can
  408. also be quite useful. The resulting schedule can be observed by using
  409. the tool <c>starpu_lp2paje</c>, which converts it into the Paje
  410. format.
  411. Data transfer time can only be taken into account when <c>deps</c> is set. Only
  412. data transfers inferred from implicit data dependencies between tasks are taken
  413. into account. Other data transfers are assumed to be completely overlapped.
  414. Setting <c>deps</c> to 0 will only take into account the actual computations
  415. on processing units. It however still properly takes into account the varying
  416. performances of kernels and processing units, which is quite more accurate than
  417. just comparing StarPU performances with the fastest of the kernels being used.
  418. The <c>prio</c> parameter tells StarPU whether to simulate taking into account
  419. the priorities as the StarPU scheduler would, i.e. schedule prioritized
  420. tasks before less prioritized tasks, to check to which extend this results
  421. to a less optimal solution. This increases even more computation time.
  422. \section MemoryFeedback Memory Feedback
  423. It is possible to enable memory statistics. To do so, you need to pass
  424. the option \ref enable-memory-stats "--enable-memory-stats" when running <c>configure</c>. It is then
  425. possible to call the function starpu_data_display_memory_stats() to
  426. display statistics about the current data handles registered within StarPU.
  427. Moreover, statistics will be displayed at the end of the execution on
  428. data handles which have not been cleared out. This can be disabled by
  429. setting the environment variable \ref STARPU_MEMORY_STATS to <c>0</c>.
  430. For example, if you do not unregister data at the end of the complex
  431. example, you will get something similar to:
  432. \verbatim
  433. $ STARPU_MEMORY_STATS=0 ./examples/interface/complex
  434. Complex[0] = 45.00 + 12.00 i
  435. Complex[0] = 78.00 + 78.00 i
  436. Complex[0] = 45.00 + 12.00 i
  437. Complex[0] = 45.00 + 12.00 i
  438. \endverbatim
  439. \verbatim
  440. $ STARPU_MEMORY_STATS=1 ./examples/interface/complex
  441. Complex[0] = 45.00 + 12.00 i
  442. Complex[0] = 78.00 + 78.00 i
  443. Complex[0] = 45.00 + 12.00 i
  444. Complex[0] = 45.00 + 12.00 i
  445. #---------------------
  446. Memory stats:
  447. #-------
  448. Data on Node #3
  449. #-----
  450. Data : 0x553ff40
  451. Size : 16
  452. #--
  453. Data access stats
  454. /!\ Work Underway
  455. Node #0
  456. Direct access : 4
  457. Loaded (Owner) : 0
  458. Loaded (Shared) : 0
  459. Invalidated (was Owner) : 0
  460. Node #3
  461. Direct access : 0
  462. Loaded (Owner) : 0
  463. Loaded (Shared) : 1
  464. Invalidated (was Owner) : 0
  465. #-----
  466. Data : 0x5544710
  467. Size : 16
  468. #--
  469. Data access stats
  470. /!\ Work Underway
  471. Node #0
  472. Direct access : 2
  473. Loaded (Owner) : 0
  474. Loaded (Shared) : 1
  475. Invalidated (was Owner) : 1
  476. Node #3
  477. Direct access : 0
  478. Loaded (Owner) : 1
  479. Loaded (Shared) : 0
  480. Invalidated (was Owner) : 0
  481. \endverbatim
  482. \section DataStatistics Data Statistics
  483. Different data statistics can be displayed at the end of the execution
  484. of the application. To enable them, you need to define the environment
  485. variable \ref STARPU_ENABLE_STATS. When calling
  486. starpu_shutdown() various statistics will be displayed,
  487. execution, MSI cache statistics, allocation cache statistics, and data
  488. transfer statistics. The display can be disabled by setting the
  489. environment variable \ref STARPU_STATS to <c>0</c>.
  490. \verbatim
  491. $ ./examples/cholesky/cholesky_tag
  492. Computation took (in ms)
  493. 518.16
  494. Synthetic GFlops : 44.21
  495. #---------------------
  496. MSI cache stats :
  497. TOTAL MSI stats hit 1622 (66.23 %) miss 827 (33.77 %)
  498. ...
  499. \endverbatim
  500. \verbatim
  501. $ STARPU_STATS=0 ./examples/cholesky/cholesky_tag
  502. Computation took (in ms)
  503. 518.16
  504. Synthetic GFlops : 44.21
  505. \endverbatim
  506. // TODO: data transfer stats are similar to the ones displayed when
  507. // setting STARPU_BUS_STATS
  508. */