codelet_and_tasks.doxy 45 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029
  1. /* StarPU --- Runtime system for heterogeneous multicore architectures.
  2. *
  3. * Copyright (C) 2011-2013,2015,2017 Inria
  4. * Copyright (C) 2010-2018 CNRS
  5. * Copyright (C) 2009-2011,2013-2018 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. /*! \defgroup API_Codelet_And_Tasks Codelet And Tasks
  19. \brief This section describes the interface to manipulate codelets and tasks.
  20. \enum starpu_codelet_type
  21. \ingroup API_Codelet_And_Tasks
  22. Describes the type of parallel task. See \ref ParallelTasks for details.
  23. \var starpu_codelet_type::STARPU_SEQ
  24. (default) for classical sequential tasks.
  25. \var starpu_codelet_type::STARPU_SPMD
  26. for a parallel task whose threads are handled by StarPU, the code
  27. has to use starpu_combined_worker_get_size() and
  28. starpu_combined_worker_get_rank() to distribute the work.
  29. \var starpu_codelet_type::STARPU_FORKJOIN
  30. for a parallel task whose threads are started by the codelet
  31. function, which has to use starpu_combined_worker_get_size() to
  32. determine how many threads should be started.
  33. \enum starpu_task_status
  34. \ingroup API_Codelet_And_Tasks
  35. Task status
  36. \var starpu_task_status::STARPU_TASK_INVALID
  37. The task has just been initialized.
  38. \var starpu_task_status::STARPU_TASK_BLOCKED
  39. The task has just been submitted, and its dependencies has not
  40. been checked yet.
  41. \var starpu_task_status::STARPU_TASK_READY
  42. The task is ready for execution.
  43. \var starpu_task_status::STARPU_TASK_RUNNING
  44. The task is running on some worker.
  45. \var starpu_task_status::STARPU_TASK_FINISHED
  46. The task is finished executing.
  47. \var starpu_task_status::STARPU_TASK_BLOCKED_ON_TAG
  48. The task is waiting for a tag.
  49. \var starpu_task_status::STARPU_TASK_BLOCKED_ON_TASK
  50. The task is waiting for a task.
  51. \var starpu_task_status::STARPU_TASK_BLOCKED_ON_DATA
  52. The task is waiting for some data.
  53. \var starpu_task_status::STARPU_TASK_STOPPED
  54. The task is stopped.
  55. \def STARPU_NOWHERE
  56. \ingroup API_Codelet_And_Tasks
  57. This macro is used when setting the field starpu_codelet::where
  58. to specify that the codelet has no computation part, and thus does not need
  59. to be scheduled, and data does not need to be actually loaded. This is thus
  60. essentially used for synchronization tasks.
  61. \def STARPU_CPU
  62. \ingroup API_Codelet_And_Tasks
  63. This macro is used when setting the field starpu_codelet::where (or starpu_task::where)
  64. to specify the codelet (or the task) may be executed on a CPU processing unit.
  65. \def STARPU_CUDA
  66. \ingroup API_Codelet_And_Tasks
  67. This macro is used when setting the field starpu_codelet::where (or starpu_task::where)
  68. to specify the codelet (or the task) may be executed on a CUDA processing unit.
  69. \def STARPU_OPENCL
  70. \ingroup API_Codelet_And_Tasks
  71. This macro is used when setting the field starpu_codelet::where (or starpu_task::where) to
  72. specify the codelet (or the task) may be executed on a OpenCL processing unit.
  73. \def STARPU_MIC
  74. \ingroup API_Codelet_And_Tasks
  75. This macro is used when setting the field starpu_codelet::where (or starpu_task::where) to
  76. specify the codelet (or the task) may be executed on a MIC processing unit.
  77. \def STARPU_MPI_MS
  78. \ingroup API_Codelet_And_Tasks
  79. This macro is used when setting the field starpu_codelet::where (or starpu_task::where) to
  80. specify the codelet (or the task) may be executed on a MPI Slave processing unit.
  81. \def STARPU_SCC
  82. \ingroup API_Codelet_And_Tasks
  83. This macro is used when setting the field starpu_codelet::where (or starpu_task::where) to
  84. specify the codelet (or the task) may be executed on an SCC processing unit.
  85. \def STARPU_MAIN_RAM
  86. \ingroup API_Codelet_And_Tasks
  87. This macro is used when the RAM memory node is specified.
  88. \def STARPU_MULTIPLE_CPU_IMPLEMENTATIONS
  89. \deprecated
  90. \ingroup API_Codelet_And_Tasks
  91. Setting the field starpu_codelet::cpu_func with this macro
  92. indicates the codelet will have several implementations. The use of
  93. this macro is deprecated. One should always only define the field
  94. starpu_codelet::cpu_funcs.
  95. \def STARPU_MULTIPLE_CUDA_IMPLEMENTATIONS
  96. \deprecated
  97. \ingroup API_Codelet_And_Tasks
  98. Setting the field starpu_codelet::cuda_func with this macro
  99. indicates the codelet will have several implementations. The use of
  100. this macro is deprecated. One should always only define the field
  101. starpu_codelet::cuda_funcs.
  102. \def STARPU_MULTIPLE_OPENCL_IMPLEMENTATIONS
  103. \deprecated
  104. \ingroup API_Codelet_And_Tasks
  105. Setting the field starpu_codelet::opencl_func with
  106. this macro indicates the codelet will have several implementations.
  107. The use of this macro is deprecated. One should always only define the
  108. field starpu_codelet::opencl_funcs.
  109. \def STARPU_NMAXBUFS
  110. \ingroup API_Codelet_And_Tasks
  111. Defines the maximum number of buffers that tasks will be able to take
  112. as parameters. The default value is 8, it can be changed by using the
  113. configure option \ref enable-maxbuffers "--enable-maxbuffers".
  114. \def STARPU_VARIABLE_NBUFFERS
  115. \ingroup API_Codelet_And_Tasks
  116. Value to set in starpu_codelet::nbuffers to specify that the codelet can accept
  117. a variable number of buffers, specified in starpu_task::nbuffers.
  118. \def STARPU_CUDA_ASYNC
  119. \ingroup API_Codelet_And_Tasks
  120. Value to be set in starpu_codelet::cuda_flags to allow asynchronous CUDA kernel execution.
  121. \def STARPU_OPENCL_ASYNC
  122. \ingroup API_Codelet_And_Tasks
  123. Value to be set in starpu_codelet::opencl_flags to allow asynchronous OpenCL kernel execution.
  124. \def STARPU_CODELET_SIMGRID_EXECUTE
  125. \ingroup API_Codelet_And_Tasks
  126. Value to be set in starpu_codelet::flags to execute the codelet functions even in simgrid mode.
  127. \def STARPU_CODELET_SIMGRID_EXECUTE_AND_INJECT
  128. \ingroup API_Codelet_And_Tasks
  129. Value to be set in starpu_codelet::flags to execute the codelet functions even in simgrid mode,
  130. and later inject the measured timing inside the simulation.
  131. \def STARPU_CODELET_NOPLANS
  132. \ingroup API_Codelet_And_Tasks
  133. Value to be set in starpu_codelet::flags to make starpu_task_submit not submit
  134. automatic asynchronous partitioning/unpartitioning.
  135. \typedef starpu_cpu_func_t
  136. \ingroup API_Codelet_And_Tasks
  137. CPU implementation of a codelet.
  138. \typedef starpu_cuda_func_t
  139. \ingroup API_Codelet_And_Tasks
  140. CUDA implementation of a codelet.
  141. \typedef starpu_opencl_func_t
  142. \ingroup API_Codelet_And_Tasks
  143. OpenCL implementation of a codelet.
  144. \typedef starpu_mic_func_t
  145. \ingroup API_Codelet_And_Tasks
  146. MIC implementation of a codelet.
  147. \typedef starpu_mpi_ms_func_t
  148. \ingroup API_Codelet_And_Tasks
  149. MPI Master Slave implementation of a codelet.
  150. \typedef starpu_scc_func_t
  151. \ingroup API_Codelet_And_Tasks
  152. SCC implementation of a codelet.
  153. \typedef starpu_mic_kernel_t
  154. \ingroup API_Codelet_And_Tasks
  155. MIC kernel for a codelet
  156. \typedef starpu_mpi_ms_kernel_t
  157. \ingroup API_Codelet_And_Tasks
  158. MPI Master Slave kernel for a codelet
  159. \typedef starpu_scc_kernel_t
  160. \ingroup API_Codelet_And_Tasks
  161. SCC kernel for a codelet
  162. \struct starpu_codelet
  163. \ingroup API_Codelet_And_Tasks
  164. The codelet structure describes a kernel that is possibly
  165. implemented on various targets. For compatibility, make sure to
  166. initialize the whole structure to zero, either by using explicit
  167. memset, or the function starpu_codelet_init(), or by letting the
  168. compiler implicitly do it in e.g. static storage case.
  169. \var uint32_t starpu_codelet::where
  170. Optional field to indicate which types of processing units are
  171. able to execute the codelet. The different values ::STARPU_CPU,
  172. ::STARPU_CUDA, ::STARPU_OPENCL can be combined to specify on which
  173. types of processing units the codelet can be executed.
  174. ::STARPU_CPU|::STARPU_CUDA for instance indicates that the codelet
  175. is implemented for both CPU cores and CUDA devices while
  176. ::STARPU_OPENCL indicates that it is only available on OpenCL
  177. devices. If the field is unset, its value will be automatically
  178. set based on the availability of the XXX_funcs fields defined
  179. below. It can also be set to ::STARPU_NOWHERE to specify that no
  180. computation has to be actually done.
  181. \var int (*starpu_codelet::can_execute)(unsigned workerid, struct starpu_task *task, unsigned nimpl)
  182. Define a function which should return 1 if the worker designated
  183. by \p workerid can execute the \p nimpl -th implementation of \p
  184. task, 0 otherwise.
  185. \var enum starpu_codelet_type starpu_codelet::type
  186. Optional field to specify the type of the codelet. The default is
  187. ::STARPU_SEQ, i.e. usual sequential implementation. Other values
  188. (::STARPU_SPMD or ::STARPU_FORKJOIN declare that a parallel
  189. implementation is also available. See \ref ParallelTasks for
  190. details.
  191. \var int starpu_codelet::max_parallelism
  192. Optional field. If a parallel implementation is available, this
  193. denotes the maximum combined worker size that StarPU will use to
  194. execute parallel tasks for this codelet.
  195. \var starpu_cpu_func_t starpu_codelet::cpu_func
  196. \deprecated
  197. Optional field which has been made deprecated. One should use
  198. instead the field starpu_codelet::cpu_funcs.
  199. \var starpu_cuda_func_t starpu_codelet::cuda_func
  200. \deprecated
  201. Optional field which has been made deprecated. One should use
  202. instead the starpu_codelet::cuda_funcs field.
  203. \var starpu_opencl_func_t starpu_codelet::opencl_func
  204. \deprecated
  205. Optional field which has been made deprecated. One should use
  206. instead the starpu_codelet::opencl_funcs field.
  207. \var starpu_cpu_func_t starpu_codelet::cpu_funcs[STARPU_MAXIMPLEMENTATIONS]
  208. Optional array of function pointers to the CPU implementations of
  209. the codelet. The functions prototype must be:
  210. \code{.c}
  211. void cpu_func(void *buffers[], void *cl_arg)
  212. \endcode
  213. The first argument being the array of data managed by the data
  214. management library, and the second argument is a pointer to the
  215. argument passed from the field starpu_task::cl_arg. If the field
  216. starpu_codelet::where is set, then the field
  217. starpu_codelet::cpu_funcs is ignored if ::STARPU_CPU does not
  218. appear in the field starpu_codelet::where, it must be
  219. non-<c>NULL</c> otherwise.
  220. \var char *starpu_codelet::cpu_funcs_name[STARPU_MAXIMPLEMENTATIONS]
  221. Optional array of strings which provide the name of the CPU
  222. functions referenced in the array starpu_codelet::cpu_funcs. This
  223. can be used when running on MIC devices or the SCC platform, for
  224. StarPU to simply look up the MIC function implementation through
  225. its name.
  226. \var starpu_cuda_func_t starpu_codelet::cuda_funcs[STARPU_MAXIMPLEMENTATIONS]
  227. Optional array of function pointers to the CUDA implementations of
  228. the codelet. The functions must be host-functions written in the
  229. CUDA runtime API. Their prototype must be:
  230. \code{.c}
  231. void cuda_func(void *buffers[], void *cl_arg)
  232. \endcode
  233. If the field starpu_codelet::where is set, then the field
  234. starpu_codelet::cuda_funcs is ignored if ::STARPU_CUDA does not
  235. appear in the field starpu_codelet::where, it must be
  236. non-<c>NULL</c> otherwise.
  237. \var char starpu_codelet::cuda_flags[STARPU_MAXIMPLEMENTATIONS]
  238. Optional array of flags for CUDA execution. They specify some
  239. semantic details about CUDA kernel execution, such as asynchronous
  240. execution.
  241. \var starpu_opencl_func_t starpu_codelet::opencl_funcs[STARPU_MAXIMPLEMENTATIONS]
  242. Optional array of function pointers to the OpenCL implementations
  243. of the codelet. The functions prototype must be:
  244. \code{.c}
  245. void opencl_func(void *buffers[], void *cl_arg)
  246. \endcode
  247. If the field starpu_codelet::where field is set, then the field
  248. starpu_codelet::opencl_funcs is ignored if ::STARPU_OPENCL does
  249. not appear in the field starpu_codelet::where, it must be
  250. non-<c>NULL</c> otherwise.
  251. \var char starpu_codelet::opencl_flags[STARPU_MAXIMPLEMENTATIONS]
  252. Optional array of flags for OpenCL execution. They specify some
  253. semantic details about OpenCL kernel execution, such as
  254. asynchronous execution.
  255. \var starpu_mic_func_t starpu_codelet::mic_funcs[STARPU_MAXIMPLEMENTATIONS]
  256. Optional array of function pointers to a function which returns
  257. the MIC implementation of the codelet. The functions prototype
  258. must be:
  259. \code{.c}
  260. starpu_mic_kernel_t mic_func(struct starpu_codelet *cl, unsigned nimpl)
  261. \endcode
  262. If the field starpu_codelet::where is set, then the field
  263. starpu_codelet::mic_funcs is ignored if ::STARPU_MIC does not
  264. appear in the field starpu_codelet::where. It can be <c>NULL</c>
  265. if starpu_codelet::cpu_funcs_name is non-<c>NULL</c>, in which
  266. case StarPU will simply make a symbol lookup to get the
  267. implementation.
  268. \var starpu_mpi_ms_func_t starpu_codelet::mpi_ms_funcs[STARPU_MAXIMPLEMENTATIONS]
  269. Optional array of function pointers to a function which returns
  270. the MPI Master Slave implementation of the codelet. The functions
  271. prototype must be:
  272. \code{.c}
  273. starpu_mpi_ms_kernel_t mpi_ms_func(struct starpu_codelet *cl, unsigned nimpl)
  274. \endcode
  275. If the field starpu_codelet::where is set, then the field
  276. starpu_codelet::mpi_ms_funcs is ignored if ::STARPU_MPI_MS does
  277. not appear in the field starpu_codelet::where. It can be
  278. <c>NULL</c> if starpu_codelet::cpu_funcs_name is non-<c>NULL</c>,
  279. in which case StarPU will simply make a symbol lookup to get the
  280. implementation.
  281. \var starpu_scc_func_t starpu_codelet::scc_funcs[STARPU_MAXIMPLEMENTATIONS]
  282. Optional array of function pointers to a function which returns
  283. the SCC implementation of the codelet. The functions prototype
  284. must be:
  285. \code{.c}
  286. starpu_scc_kernel_t scc_func(struct starpu_codelet *cl, unsigned nimpl)
  287. \endcode
  288. If the field starpu_codelet::where is set, then the field
  289. starpu_codelet::scc_funcs is ignored if ::STARPU_SCC does not
  290. appear in the field starpu_codelet::where. It can be <c>NULL</c>
  291. if starpu_codelet::cpu_funcs_name is non-<c>NULL</c>, in which
  292. case StarPU will simply make a symbol lookup to get the
  293. implementation.
  294. \var int starpu_codelet::nbuffers
  295. Specify the number of arguments taken by the codelet. These
  296. arguments are managed by the DSM and are accessed from the <c>void
  297. *buffers[]</c> array. The constant argument passed with the field
  298. starpu_task::cl_arg is not counted in this number. This value
  299. should not be above \ref STARPU_NMAXBUFS. It may be set to \ref
  300. STARPU_VARIABLE_NBUFFERS to specify that the number of buffers and
  301. their access modes will be set in starpu_task::nbuffers and
  302. starpu_task::modes or starpu_task::dyn_modes, which thus permits
  303. to define codelets with a varying number of data.
  304. \var enum starpu_data_access_mode starpu_codelet::modes[STARPU_NMAXBUFS]
  305. Is an array of ::starpu_data_access_mode. It describes the
  306. required access modes to the data neeeded by the codelet (e.g.
  307. ::STARPU_RW). The number of entries in this array must be
  308. specified in the field starpu_codelet::nbuffers, and should not
  309. exceed \ref STARPU_NMAXBUFS. If unsufficient, this value can be
  310. set with the configure option
  311. \ref enable-maxbuffers "--enable-maxbuffers".
  312. \var enum starpu_data_access_mode *starpu_codelet::dyn_modes
  313. Is an array of ::starpu_data_access_mode. It describes the
  314. required access modes to the data needed by the codelet (e.g.
  315. ::STARPU_RW). The number of entries in this array must be
  316. specified in the field starpu_codelet::nbuffers. This field should
  317. be used for codelets having a number of datas greater than
  318. \ref STARPU_NMAXBUFS (see \ref SettingManyDataHandlesForATask).
  319. When defining a codelet, one should either define this field or
  320. the field starpu_codelet::modes defined above.
  321. \var unsigned starpu_codelet::specific_nodes
  322. Default value is 0. If this flag is set, StarPU will not
  323. systematically send all data to the memory node where the task will
  324. be executing, it will read the starpu_codelet::nodes or
  325. starpu_codelet::dyn_nodes array to determine, for each data,
  326. whether to send it on the memory node where the task will be
  327. executing (-1), or on a specific node (!= -1).
  328. \var int starpu_codelet::nodes[STARPU_NMAXBUFS]
  329. Optional field. When starpu_codelet::specific_nodes is 1, this
  330. specifies the memory nodes where each data should be sent to for
  331. task execution. The number of entries in this array is
  332. starpu_codelet::nbuffers, and should not exceed \ref STARPU_NMAXBUFS.
  333. \var int *starpu_codelet::dyn_nodes
  334. Optional field. When starpu_codelet::specific_nodes is 1, this
  335. specifies the memory nodes where each data should be sent to for
  336. task execution. The number of entries in this array is
  337. starpu_codelet::nbuffers. This field should be used for codelets
  338. having a number of datas greater than \ref STARPU_NMAXBUFS
  339. (see \ref SettingManyDataHandlesForATask). When defining a
  340. codelet, one should either define this field or the field
  341. starpu_codelet::nodes defined above.
  342. \var struct starpu_perfmodel *starpu_codelet::model
  343. Optional pointer to the task duration performance model associated
  344. to this codelet. This optional field is ignored when set to
  345. <c>NULL</c> or when its field starpu_perfmodel::symbol is not set.
  346. \var struct starpu_perfmodel *starpu_codelet::energy_model
  347. Optional pointer to the task energy consumption performance model
  348. associated to this codelet. This optional field is ignored when
  349. set to <c>NULL</c> or when its field starpu_perfmodel::symbol is
  350. not set. In the case of parallel codelets, this has to account for
  351. all processing units involved in the parallel execution.
  352. \var unsigned long starpu_codelet::per_worker_stats[STARPU_NMAXWORKERS]
  353. Optional array for statistics collected at runtime: this is filled
  354. by StarPU and should not be accessed directly, but for example by
  355. calling the function starpu_codelet_display_stats() (See
  356. starpu_codelet_display_stats() for details).
  357. \var const char *starpu_codelet::name
  358. Optional name of the codelet. This can be useful for debugging
  359. purposes.
  360. \var const char *starpu_codelet::color
  361. Optional color of the codelet. This can be useful for debugging
  362. purposes.
  363. \var const char *starpu_codelet::flags
  364. Various flags for the codelet.
  365. \fn void starpu_codelet_init(struct starpu_codelet *cl)
  366. \ingroup API_Codelet_And_Tasks
  367. Initialize \p cl with default values. Codelets should
  368. preferably be initialized statically as shown in
  369. \ref DefiningACodelet. However such a initialisation is not always
  370. possible, e.g. when using C++.
  371. \struct starpu_data_descr
  372. \ingroup API_Codelet_And_Tasks
  373. This type is used to describe a data handle along with an access mode.
  374. \var starpu_data_handle_t starpu_data_descr::handle
  375. describes a data
  376. \var enum starpu_data_access_mode starpu_data_descr::mode
  377. describes its access mode
  378. \struct starpu_task
  379. \ingroup API_Codelet_And_Tasks
  380. The structure describes a task that can be offloaded on the
  381. various processing units managed by StarPU. It instantiates a codelet.
  382. It can either be allocated dynamically with the function
  383. starpu_task_create(), or declared statically. In the latter case, the
  384. programmer has to zero the structure starpu_task and to fill the
  385. different fields properly. The indicated default values correspond to
  386. the configuration of a task allocated with starpu_task_create().
  387. \var const char *starpu_task::name
  388. Optional name of the task. This can be useful for debugging
  389. purposes.
  390. \var struct starpu_codelet *starpu_task::cl
  391. Is a pointer to the corresponding structure starpu_codelet. This
  392. describes where the kernel should be executed, and supplies the
  393. appropriate implementations. When set to <c>NULL</c>, no code is
  394. executed during the tasks, such empty tasks can be useful for
  395. synchronization purposes.
  396. This field has been made deprecated. One should use instead the
  397. field starpu_task::handles to specify the data handles accessed by
  398. the task. The access modes are now defined in the field
  399. starpu_codelet::modes.
  400. \var uint32_t starpu_task::where
  401. When set, specifies where the task is allowed to be executed.
  402. When unset, it takes the value of starpu_codelet::where.
  403. \var int starpu_task::nbuffers
  404. Specifies the number of buffers. This is only used when
  405. starpu_codelet::nbuffers is \ref STARPU_VARIABLE_NBUFFERS.
  406. \var starpu_data_handle_t starpu_task::handles[STARPU_NMAXBUFS]
  407. Is an array of ::starpu_data_handle_t. It specifies the handles to
  408. the different pieces of data accessed by the task. The number of
  409. entries in this array must be specified in the field
  410. starpu_codelet::nbuffers, and should not exceed
  411. \ref STARPU_NMAXBUFS. If unsufficient, this value can be set with
  412. the configure option \ref enable-maxbuffers "--enable-maxbuffers".
  413. \var starpu_data_handle_t *starpu_task::dyn_handles
  414. Is an array of ::starpu_data_handle_t. It specifies the handles to
  415. the different pieces of data accessed by the task. The number of
  416. entries in this array must be specified in the field
  417. starpu_codelet::nbuffers. This field should be used for tasks
  418. having a number of datas greater than \ref STARPU_NMAXBUFS (see
  419. \ref SettingManyDataHandlesForATask).
  420. When defining a task, one should either define this field or the
  421. field starpu_task::handles defined above.
  422. \var void *starpu_task::interfaces[STARPU_NMAXBUFS]
  423. The actual data pointers to the memory node where execution will
  424. happen, managed by the DSM.
  425. \var void **starpu_task::dyn_interfaces
  426. The actual data pointers to the memory node where execution will
  427. happen, managed by the DSM. Is used when the field
  428. starpu_task::dyn_handles is defined.
  429. \var enum starpu_data_access_mode starpu_task::modes[STARPU_NMAXBUFS]
  430. Is used only when starpu_codelet::nbuffers is
  431. \ref STARPU_VARIABLE_NBUFFERS.
  432. It is an array of ::starpu_data_access_mode. It describes the
  433. required access modes to the data neeeded by the codelet (e.g.
  434. ::STARPU_RW). The number of entries in this array must be
  435. specified in the field starpu_task::nbuffers, and should not
  436. exceed \ref STARPU_NMAXBUFS. If unsufficient, this value can be
  437. set with the configure option
  438. \ref enable-maxbuffers "--enable-maxbuffers".
  439. \var enum starpu_data_access_mode *starpu_task::dyn_modes
  440. Is used only when starpu_codelet::nbuffers is \ref
  441. STARPU_VARIABLE_NBUFFERS. It is an array of
  442. ::starpu_data_access_mode. It describes the required access modes
  443. to the data needed by the codelet (e.g. ::STARPU_RW). The number
  444. of entries in this array must be specified in the field
  445. starpu_codelet::nbuffers. This field should be used for codelets
  446. having a number of datas greater than \ref STARPU_NMAXBUFS
  447. (see \ref SettingManyDataHandlesForATask). When defining a
  448. codelet, one should either define this field or the field
  449. starpu_task::modes defined above.
  450. \var void *starpu_task::cl_arg
  451. Optional pointer which is passed to the codelet through the second
  452. argument of the codelet implementation (e.g.
  453. starpu_codelet::cpu_func or starpu_codelet::cuda_func). The
  454. default value is <c>NULL</c>. starpu_codelet_pack_args() and
  455. starpu_codelet_unpack_args() are helpers that can can be used to
  456. respectively pack and unpack data into and from it, but the
  457. application can manage it any way, the only requirement is that
  458. the size of the data must be set in starpu_task::cl_arg_size .
  459. \var size_t starpu_task::cl_arg_size
  460. Optional field. For some specific drivers, the pointer
  461. starpu_task::cl_arg cannot not be directly given to the driver
  462. function. A buffer of size starpu_task::cl_arg_size needs to be
  463. allocated on the driver. This buffer is then filled with the
  464. starpu_task::cl_arg_size bytes starting at address
  465. starpu_task::cl_arg. In this case, the argument given to the
  466. codelet is therefore not the starpu_task::cl_arg pointer, but the
  467. address of the buffer in local store (LS) instead. This field is
  468. ignored for CPU, CUDA and OpenCL codelets, where the
  469. starpu_task::cl_arg pointer is given as such.
  470. \var unsigned starpu_task::cl_arg_free
  471. Optional field. In case starpu_task::cl_arg was allocated by the
  472. application through <c>malloc()</c>, setting
  473. starpu_task::cl_arg_free to 1 makes StarPU automatically call
  474. <c>free(cl_arg)</c> when destroying the task. This saves the user
  475. from defining a callback just for that. This is mostly useful when
  476. targetting MIC or SCC, where the codelet does not execute in the
  477. same memory space as the main thread.
  478. \var void (*starpu_task::callback_func)(void *)
  479. Optional field, the default value is <c>NULL</c>. This is a
  480. function pointer of prototype <c>void (*f)(void *)</c> which
  481. specifies a possible callback. If this pointer is non-<c>NULL</c>,
  482. the callback function is executed on the host after the execution
  483. of the task. Tasks which depend on it might already be executing.
  484. The callback is passed the value contained in the
  485. starpu_task::callback_arg field. No callback is executed if the
  486. field is set to <c>NULL</c>.
  487. \var void *starpu_task::callback_arg (optional) (default: <c>NULL</c>)
  488. Optional field, the default value is <c>NULL</c>. This is the
  489. pointer passed to the callback function. This field is ignored if
  490. the field starpu_task::callback_func is set to <c>NULL</c>.
  491. \var unsigned starpu_task::callback_arg_free
  492. Optional field. In case starpu_task::callback_arg was allocated by
  493. the application through <c>malloc()</c>, setting
  494. starpu_task::callback_arg_free to 1 makes StarPU automatically
  495. call <c>free(callback_arg)</c> when destroying the task.
  496. \var void (*starpu_task::prologue_callback_func)(void *)
  497. Optional field, the default value is <c>NULL</c>. This is a
  498. function pointer of prototype <c>void (*f)(void *)</c> which
  499. specifies a possible callback.
  500. If this pointer is non-<c>NULL</c>, the callback function is
  501. executed on the host when the task becomes ready for execution,
  502. before getting scheduled. The callback is passed the value
  503. contained in the starpu_task::prologue_callback_arg field. No
  504. callback is executed if the field is set to <c>NULL</c>.
  505. \var void *starpu_task::prologue_callback_arg (optional) (default: <c>NULL</c>)
  506. Optional field, the default value is <c>NULL</c>. This is the
  507. pointer passed to the prologue callback function. This field is
  508. ignored if the field starpu_task::prologue_callback_func is set to
  509. <c>NULL</c>.
  510. \var unsigned starpu_task::prologue_callback_arg_free
  511. Optional field. In case starpu_task::prologue_callback_arg was
  512. allocated by the application through <c>malloc()</c>, setting
  513. starpu_task::prologue_callback_arg_free to 1 makes StarPU
  514. automatically call <c>free(prologue_callback_arg)</c> when
  515. destroying the task.
  516. \var void (*starpu_task::prologue_callback_pop_func)(void *)
  517. todo
  518. \var void *starpu_task::prologue_callback_pop_arg (optional) (default: <c>NULL</c>)
  519. todo
  520. \var unsigned starpu_task::prologue_callback_pop_arg_free
  521. todo
  522. \var unsigned starpu_task::use_tag
  523. Optional field, the default value is 0. If set, this flag
  524. indicates that the task should be associated with the tag
  525. contained in the starpu_task::tag_id field. Tag allow the
  526. application to synchronize with the task and to express task
  527. dependencies easily.
  528. \var starpu_tag_t starpu_task::tag_id
  529. This optional field contains the tag associated to the task if the
  530. field starpu_task::use_tag is set, it is ignored otherwise.
  531. \var unsigned starpu_task::sequential_consistency
  532. If this flag is set (which is the default), sequential consistency
  533. is enforced for the data parameters of this task for which
  534. sequential consistency is enabled. Clearing this flag permits to
  535. disable sequential consistency for this task, even if data have it
  536. enabled.
  537. \var unsigned starpu_task::synchronous
  538. If this flag is set, the function starpu_task_submit() is blocking
  539. and returns only when the task has been executed (or if no worker
  540. is able to process the task). Otherwise, starpu_task_submit()
  541. returns immediately.
  542. \var int starpu_task::priority
  543. Optional field, the default value is ::STARPU_DEFAULT_PRIO. This
  544. field indicates a level of priority for the task. This is an
  545. integer value that must be set between the return values of the
  546. function starpu_sched_get_min_priority() for the least important
  547. tasks, and that of the function starpu_sched_get_max_priority()
  548. for the most important tasks (included). The ::STARPU_MIN_PRIO and
  549. ::STARPU_MAX_PRIO macros are provided for convenience and
  550. respectively returns the value of starpu_sched_get_min_priority()
  551. and starpu_sched_get_max_priority(). Default priority is
  552. ::STARPU_DEFAULT_PRIO, which is always defined as 0 in order to
  553. allow static task initialization. Scheduling strategies that take
  554. priorities into account can use this parameter to take better
  555. scheduling decisions, but the scheduling policy may also ignore
  556. it.
  557. \var unsigned starpu_task::execute_on_a_specific_worker
  558. Default value is 0. If this flag is set, StarPU will bypass the
  559. scheduler and directly affect this task to the worker specified by
  560. the field starpu_task::workerid.
  561. \var unsigned starpu_task::workerid
  562. Optional field. If the field
  563. starpu_task::execute_on_a_specific_worker is set, this field
  564. indicates the identifier of the worker that should process this
  565. task (as returned by starpu_worker_get_id()). This field is
  566. ignored if the field starpu_task::execute_on_a_specific_worker is
  567. set to 0.
  568. \var unsigned starpu_task::workerorder
  569. Optional field. If the field
  570. starpu_task::execute_on_a_specific_worker is set, this field
  571. indicates the per-worker consecutive order in which tasks should
  572. be executed on the worker. Tasks will be executed in consecutive
  573. starpu_task::workerorder values, thus ignoring the availability
  574. order or task priority. See \ref StaticScheduling for more
  575. details. This field is ignored if the field
  576. starpu_task::execute_on_a_specific_worker is set to 0.
  577. \var unsigned starpu_task::workerids
  578. Optional field. If the field
  579. starpu_task::workerids_len is different from 0, this field indicates an
  580. array of bits (stored as uint32_t values) which indicate the set of workers
  581. which are allowed to execute the task. starpu_task::workerid takes
  582. precedence over this.
  583. \var unsigned starpu_task::workerids_len
  584. Optional field. This provides the number of uint32_t values in the
  585. starpu_task::workerids array.
  586. \var starpu_task_bundle_t starpu_task::bundle
  587. Optional field. The bundle that includes this task. If no bundle
  588. is used, this should be <c>NULL</c>.
  589. \var unsigned starpu_task::detach
  590. Optional field, default value is 1. If this flag is set, it is not
  591. possible to synchronize with the task by the means of
  592. starpu_task_wait() later on. Internal data structures are only
  593. guaranteed to be freed once starpu_task_wait() is called if the
  594. flag is not set.
  595. \var unsigned starpu_task::destroy
  596. Optional value. Default value is 0 for starpu_task_init(), and 1
  597. for starpu_task_create(). If this flag is set, the task structure
  598. will automatically be freed, either after the execution of the
  599. callback if the task is detached, or during starpu_task_wait()
  600. otherwise. If this flag is not set, dynamically allocated data
  601. structures will not be freed until starpu_task_destroy() is called
  602. explicitly. Setting this flag for a statically allocated task
  603. structure will result in undefined behaviour. The flag is set to 1
  604. when the task is created by calling starpu_task_create(). Note
  605. that starpu_task_wait_for_all() will not free any task.
  606. \var unsigned starpu_task::regenerate
  607. Optional field. If this flag is set, the task will be re-submitted
  608. to StarPU once it has been executed. This flag must not be set if
  609. the flag starpu_task::destroy is set. This flag must be set before
  610. making another task depend on this one.
  611. \var enum starpu_task_status starpu_task::status
  612. Optional field. Current state of the task.
  613. \var struct starpu_profiling_task_info *starpu_task::profiling_info
  614. Optional field. Profiling information for the task.
  615. \var double starpu_task::predicted
  616. Output field. Predicted duration of the task. This field is only
  617. set if the scheduling strategy uses performance models.
  618. \var double starpu_task::predicted_transfer
  619. Optional field. Predicted data transfer duration for the task in
  620. microseconds. This field is only valid if the scheduling strategy
  621. uses performance models.
  622. \var double starpu_task::predicted_start
  623. todo
  624. \var struct starpu_task *starpu_task::prev
  625. \private
  626. A pointer to the previous task. This should only be used by
  627. StarPU.
  628. \var struct starpu_task *starpu_task::next
  629. \private
  630. A pointer to the next task. This should only be used by StarPU.
  631. \var unsigned int starpu_task::mf_skip
  632. \private
  633. This is only used for tasks that use multiformat handle. This
  634. should only be used by StarPU.
  635. \var double starpu_task::flops
  636. This can be set to the number of floating points operations that
  637. the task will have to achieve. This is useful for easily getting
  638. GFlops curves from the tool <c>starpu_perfmodel_plot</c>, and for
  639. the hypervisor load balancing.
  640. \var void *starpu_task::starpu_private
  641. \private
  642. This is private to StarPU, do not modify. If the task is allocated
  643. by hand (without starpu_task_create()), this field should be set
  644. to <c>NULL</c>.
  645. \var int starpu_task::magic
  646. \private
  647. This field is set when initializing a task. The function
  648. starpu_task_submit() will fail if the field does not have the
  649. right value. This will hence avoid submitting tasks which have not
  650. been properly initialised.
  651. \var unsigned starpu_task::type
  652. This field allows to specify the type of task, for filtering
  653. out tasks in profiling outputs, whether it is really internal
  654. to StarPU (::STARPU_TASK_TYPE_INTERNAL), a data acquisition
  655. synchronization task (::STARPU_TASK_TYPE_DATA_ACQUIRE), or a normal task
  656. (::STARPU_TASK_TYPE_NORMAL)
  657. \var int starpu_task::color
  658. This field allows to specify the color of the task to be used in dag.dot.
  659. \var unsigned starpu_task::sched_ctx
  660. Scheduling context.
  661. \var int starpu_task::hypervisor_tag
  662. Helps the hypervisor monitor the execution of this task.
  663. \var unsigned starpu_task::possibly_parallel
  664. todo
  665. \var unsigned starpu_task::prefetched
  666. todo
  667. \var unsigned starpu_task::scheduled
  668. Whether the scheduler has pushed the task on some queue
  669. \var struct starpu_omp_task *starpu_task::omp_task
  670. todo
  671. \var struct starpu_omp_task *starpu_task::sched_data
  672. This field is managed by the scheduler, is it allowed to do whatever with
  673. it. Typically, some area would be allocated on push, and released on pop.
  674. \fn void starpu_task_init(struct starpu_task *task)
  675. \ingroup API_Codelet_And_Tasks
  676. Initialize \p task with default values. This function is
  677. implicitly called by starpu_task_create(). By default, tasks initialized
  678. with starpu_task_init() must be deinitialized explicitly with
  679. starpu_task_clean(). Tasks can also be initialized statically, using
  680. ::STARPU_TASK_INITIALIZER.
  681. \def STARPU_TASK_INITIALIZER
  682. \ingroup API_Codelet_And_Tasks
  683. It is possible to initialize statically allocated tasks with
  684. this value. This is equivalent to initializing a structure starpu_task
  685. with the function starpu_task_init().
  686. \def STARPU_TASK_GET_NBUFFERS(task)
  687. \ingroup API_Codelet_And_Tasks
  688. Return the number of buffers for \p task, i.e. starpu_codelet::nbuffers, or
  689. starpu_task::nbuffers if the former is \ref STARPU_VARIABLE_NBUFFERS.
  690. \def STARPU_TASK_GET_HANDLE(task, i)
  691. \ingroup API_Codelet_And_Tasks
  692. Return the \p i -th data handle of \p task. If \p task
  693. is defined with a static or dynamic number of handles, will either
  694. return the \p i -th element of the field starpu_task::handles or the \p
  695. i -th element of the field starpu_task::dyn_handles
  696. (see \ref SettingManyDataHandlesForATask)
  697. \def STARPU_TASK_SET_HANDLE(task, handle, i)
  698. \ingroup API_Codelet_And_Tasks
  699. Set the \p i -th data handle of \p task with \p handle.
  700. If \p task is defined with a static or dynamic number of
  701. handles, will either set the \p i -th element of the field
  702. starpu_task::handles or the \p i -th element of the field
  703. starpu_task::dyn_handles
  704. (see \ref SettingManyDataHandlesForATask)
  705. \def STARPU_CODELET_GET_MODE(codelet, i)
  706. \ingroup API_Codelet_And_Tasks
  707. Return the access mode of the \p i -th data handle of \p codelet.
  708. If \p codelet is defined with a static or dynamic number of
  709. handles, will either return the \p i -th element of the field
  710. starpu_codelet::modes or the \p i -th element of the field
  711. starpu_codelet::dyn_modes
  712. (see \ref SettingManyDataHandlesForATask)
  713. \def STARPU_CODELET_SET_MODE(codelet, mode, i)
  714. \ingroup API_Codelet_And_Tasks
  715. Set the access mode of the \p i -th data handle of \p codelet.
  716. If \p codelet is defined with a static or dynamic number of
  717. handles, will either set the \p i -th element of the field
  718. starpu_codelet::modes or the \p i -th element of the field
  719. starpu_codelet::dyn_modes
  720. (see \ref SettingManyDataHandlesForATask)
  721. \def STARPU_TASK_GET_MODE(task, i)
  722. \ingroup API_Codelet_And_Tasks
  723. Return the access mode of the \p i -th data handle of \p task.
  724. If \p task is defined with a static or dynamic number of
  725. handles, will either return the \p i -th element of the field
  726. starpu_task::modes or the \p i -th element of the field
  727. starpu_task::dyn_modes
  728. (see \ref SettingManyDataHandlesForATask)
  729. \def STARPU_TASK_SET_MODE(task, mode, i)
  730. \ingroup API_Codelet_And_Tasks
  731. Set the access mode of the \p i -th data handle of \p task.
  732. If \p task is defined with a static or dynamic number of
  733. handles, will either set the \p i -th element of the field
  734. starpu_task::modes or the \p i -th element of the field
  735. starpu_task::dyn_modes
  736. (see \ref SettingManyDataHandlesForATask)
  737. \fn struct starpu_task *starpu_task_create(void)
  738. \ingroup API_Codelet_And_Tasks
  739. Allocate a task structure and initialize it with default
  740. values. Tasks allocated dynamically with starpu_task_create() are
  741. automatically freed when the task is terminated. This means that the
  742. task pointer can not be used any more once the task is submitted,
  743. since it can be executed at any time (unless dependencies make it
  744. wait) and thus freed at any time. If the field starpu_task::destroy is
  745. explicitly unset, the resources used by the task have to be freed by
  746. calling starpu_task_destroy().
  747. \fn struct starpu_task *starpu_task_dup(struct starpu_task *task)
  748. \ingroup API_Codelet_And_Tasks
  749. Allocate a task structure which is the exact duplicate of \p task.
  750. \fn void starpu_task_clean(struct starpu_task *task)
  751. \ingroup API_Codelet_And_Tasks
  752. Release all the structures automatically allocated to execute
  753. \p task, but not the task structure itself and values set by the user
  754. remain unchanged. It is thus useful for statically allocated tasks for
  755. instance. It is also useful when users want to execute the same
  756. operation several times with as least overhead as possible. It is
  757. called automatically by starpu_task_destroy(). It has to be called
  758. only after explicitly waiting for the task or after starpu_shutdown()
  759. (waiting for the callback is not enough, since StarPU still
  760. manipulates the task after calling the callback).
  761. \fn void starpu_task_destroy(struct starpu_task *task)
  762. \ingroup API_Codelet_And_Tasks
  763. Free the resource allocated during starpu_task_create() and
  764. associated with \p task. This function is called automatically
  765. after the execution of a task when the field starpu_task::destroy is
  766. set, which is the default for tasks created by starpu_task_create().
  767. Calling this function on a statically allocated task results in an
  768. undefined behaviour.
  769. \fn int starpu_task_wait(struct starpu_task *task)
  770. \ingroup API_Codelet_And_Tasks
  771. Block until \p task has been executed. It is not
  772. possible to synchronize with a task more than once. It is not possible
  773. to wait for synchronous or detached tasks. Upon successful completion,
  774. this function returns 0. Otherwise, <c>-EINVAL</c> indicates that the
  775. specified task was either synchronous or detached.
  776. \fn int starpu_task_wait_array(struct starpu_task **tasks, unsigned nb_tasks)
  777. \ingroup API_Codelet_And_Tasks
  778. Allow to wait for an array of tasks. Upon successful completion,
  779. this function returns 0. Otherwise, <c>-EINVAL</c> indicates that one of the tasks
  780. was either synchronous or detached.
  781. \fn int starpu_task_submit(struct starpu_task *task)
  782. \ingroup API_Codelet_And_Tasks
  783. Submit \p task to StarPU. Calling this function
  784. does not mean that the task will be executed immediately as there can
  785. be data or task (tag) dependencies that are not fulfilled yet: StarPU
  786. will take care of scheduling this task with respect to such
  787. dependencies. This function returns immediately if the field
  788. starpu_task::synchronous is set to 0, and block until the
  789. termination of the task otherwise.
  790. It is also possible to synchronize
  791. the application with asynchronous tasks by the means of tags, using
  792. the function starpu_tag_wait() function for instance. In case of
  793. success, this function returns 0, a return value of <c>-ENODEV</c>
  794. means that there is no worker able to process this task (e.g. there is
  795. no GPU available and this task is only implemented for CUDA devices).
  796. starpu_task_submit() can be called from anywhere, including codelet
  797. functions and callbacks, provided that the field
  798. starpu_task::synchronous is set to 0.
  799. \fn int starpu_task_submit_to_ctx(struct starpu_task *task, unsigned sched_ctx_id)
  800. \ingroup API_Codelet_And_Tasks
  801. Submit \p task to the context \p sched_ctx_id.
  802. By default, starpu_task_submit() submits the task to a global context that is
  803. created automatically by StarPU.
  804. \fn int starpu_task_wait_for_all(void)
  805. \ingroup API_Codelet_And_Tasks
  806. Block until all the tasks that were submitted (to the
  807. current context or the global one if there is no current context) are terminated.
  808. It does not destroy these tasks.
  809. \fn int starpu_task_wait_for_all_in_ctx(unsigned sched_ctx_id)
  810. \ingroup API_Codelet_And_Tasks
  811. Wait until all the tasks that were already submitted to the context \p
  812. sched_ctx_id have been terminated.
  813. \fn int starpu_task_wait_for_n_submitted(unsigned n)
  814. \ingroup API_Codelet_And_Tasks
  815. Block until there are \p n submitted tasks left (to the
  816. current context or the global one if there is no current context) to be executed. It does
  817. not destroy these tasks.
  818. \fn int starpu_task_wait_for_n_submitted_in_ctx(unsigned sched_ctx_id, unsigned n)
  819. \ingroup API_Codelet_And_Tasks
  820. Wait until there are \p n tasks submitted left to be
  821. executed that were already submitted to the context \p sched_ctx_id.
  822. \fn int starpu_task_nready(void)
  823. \ingroup API_Codelet_And_Tasks
  824. TODO
  825. \fn int starpu_task_nsubmitted(void)
  826. \ingroup API_Codelet_And_Tasks
  827. Return the number of submitted tasks which have not completed yet.
  828. \fn int starpu_task_nready(void)
  829. \ingroup API_Codelet_And_Tasks
  830. Return the number of submitted tasks which are ready for
  831. execution are already executing. It thus does not include tasks
  832. waiting for dependencies.
  833. \fn struct starpu_task *starpu_task_get_current(void)
  834. \ingroup API_Codelet_And_Tasks
  835. Return the task currently executed by the
  836. worker, or <c>NULL</c> if it is called either from a thread that is not a
  837. task or simply because there is no task being executed at the moment.
  838. \fn const char *starpu_task_get_name(struct starpu_task *task)
  839. \ingroup API_Codelet_And_Tasks
  840. Return the name of \p task, i.e. either its starpu_task::name field, or
  841. the name of the corresponding performance model.
  842. \fn const char *starpu_task_get_model_name(struct starpu_task *task)
  843. \ingroup API_Codelet_And_Tasks
  844. Return the name of the performance model of \p task.
  845. \fn void starpu_codelet_display_stats(struct starpu_codelet *cl)
  846. \ingroup API_Codelet_And_Tasks
  847. Output on \c stderr some statistics on the codelet \p cl.
  848. \fn int starpu_task_wait_for_no_ready(void)
  849. \ingroup API_Codelet_And_Tasks
  850. Wait until there is no more ready task.
  851. \fn void starpu_task_set_implementation(struct starpu_task *task, unsigned impl)
  852. \ingroup API_Codelet_And_Tasks
  853. This function should be called by schedulers to specify the
  854. codelet implementation to be executed when executing \p task.
  855. \fn unsigned starpu_task_get_implementation(struct starpu_task *task)
  856. \ingroup API_Codelet_And_Tasks
  857. Return the codelet implementation to be executed
  858. when executing \p task.
  859. \fn void starpu_iteration_push(unsigned long iteration)
  860. \ingroup API_Codelet_And_Tasks
  861. Sets the iteration number for all the tasks to be submitted after
  862. this call. This is typically called at the beginning of a task
  863. submission loop. This number will then show up in tracing tools. A
  864. corresponding starpu_iteration_pop() call must be made to match the call to
  865. starpu_iteration_push(), at the end of the same task submission loop, typically.
  866. Nested calls to starpu_iteration_push and starpu_iteration_pop are allowed, to
  867. describe a loop nest for instance, provided that they match properly.
  868. \fn void starpu_iteration_pop(void)
  869. \ingroup API_Codelet_And_Tasks
  870. Drops the iteration number for submitted tasks. This must match a previous
  871. call to starpu_iteration_push(), and is typically called at the end of a task
  872. submission loop.
  873. \fn void starpu_create_sync_task(starpu_tag_t sync_tag, unsigned ndeps, starpu_tag_t *deps, void (*callback)(void *), void *callback_arg)
  874. \ingroup API_Codelet_And_Tasks
  875. Create (and submit) an empty task that unlocks a tag once all its dependencies are fulfilled.
  876. */