380_offline_performance_tools.doxy 25 KB

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