codelet_and_tasks.doxy 44 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011
  1. /* StarPU --- Runtime system for heterogeneous multicore architectures.
  2. *
  3. * Copyright (C) 2011-2013,2015,2017 Inria
  4. * Copyright (C) 2010-2017 CNRS
  5. * Copyright (C) 2009-2011,2013-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. /*! \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::flags
  361. Various flags for the codelet.
  362. \fn void starpu_codelet_init(struct starpu_codelet *cl)
  363. \ingroup API_Codelet_And_Tasks
  364. Initialize \p cl with default values. Codelets should
  365. preferably be initialized statically as shown in
  366. \ref DefiningACodelet. However such a initialisation is not always
  367. possible, e.g. when using C++.
  368. \struct starpu_data_descr
  369. \ingroup API_Codelet_And_Tasks
  370. This type is used to describe a data handle along with an access mode.
  371. \var starpu_data_handle_t starpu_data_descr::handle
  372. describes a data
  373. \var enum starpu_data_access_mode starpu_data_descr::mode
  374. describes its access mode
  375. \struct starpu_task
  376. \ingroup API_Codelet_And_Tasks
  377. The structure describes a task that can be offloaded on the
  378. various processing units managed by StarPU. It instantiates a codelet.
  379. It can either be allocated dynamically with the function
  380. starpu_task_create(), or declared statically. In the latter case, the
  381. programmer has to zero the structure starpu_task and to fill the
  382. different fields properly. The indicated default values correspond to
  383. the configuration of a task allocated with starpu_task_create().
  384. \var const char *starpu_task::name
  385. Optional name of the task. This can be useful for debugging
  386. purposes.
  387. \var struct starpu_codelet *starpu_task::cl
  388. Is a pointer to the corresponding structure starpu_codelet. This
  389. describes where the kernel should be executed, and supplies the
  390. appropriate implementations. When set to <c>NULL</c>, no code is
  391. executed during the tasks, such empty tasks can be useful for
  392. synchronization purposes.
  393. This field has been made deprecated. One should use instead the
  394. field starpu_task::handles to specify the data handles accessed by
  395. the task. The access modes are now defined in the field
  396. starpu_codelet::modes.
  397. \var uint32_t starpu_task::where
  398. When set, specifies where the task is allowed to be executed.
  399. When unset, it takes the value of starpu_codelet::where.
  400. \var int starpu_task::nbuffers
  401. Specifies the number of buffers. This is only used when
  402. starpu_codelet::nbuffers is \ref STARPU_VARIABLE_NBUFFERS.
  403. \var starpu_data_handle_t starpu_task::handles[STARPU_NMAXBUFS]
  404. Is an array of ::starpu_data_handle_t. It specifies the handles to
  405. the different pieces of data accessed by the task. The number of
  406. entries in this array must be specified in the field
  407. starpu_codelet::nbuffers, and should not exceed
  408. \ref STARPU_NMAXBUFS. If unsufficient, this value can be set with
  409. the configure option \ref enable-maxbuffers "--enable-maxbuffers".
  410. \var starpu_data_handle_t *starpu_task::dyn_handles
  411. Is an array of ::starpu_data_handle_t. It specifies the handles to
  412. the different pieces of data accessed by the task. The number of
  413. entries in this array must be specified in the field
  414. starpu_codelet::nbuffers. This field should be used for tasks
  415. having a number of datas greater than \ref STARPU_NMAXBUFS (see
  416. \ref SettingManyDataHandlesForATask).
  417. When defining a task, one should either define this field or the
  418. field starpu_task::handles defined above.
  419. \var void *starpu_task::interfaces[STARPU_NMAXBUFS]
  420. The actual data pointers to the memory node where execution will
  421. happen, managed by the DSM.
  422. \var void **starpu_task::dyn_interfaces
  423. The actual data pointers to the memory node where execution will
  424. happen, managed by the DSM. Is used when the field
  425. starpu_task::dyn_handles is defined.
  426. \var enum starpu_data_access_mode starpu_task::modes[STARPU_NMAXBUFS]
  427. Is used only when starpu_codelet::nbuffers is
  428. \ref STARPU_VARIABLE_NBUFFERS.
  429. It is an array of ::starpu_data_access_mode. It describes the
  430. required access modes to the data neeeded by the codelet (e.g.
  431. ::STARPU_RW). The number of entries in this array must be
  432. specified in the field starpu_task::nbuffers, and should not
  433. exceed \ref STARPU_NMAXBUFS. If unsufficient, this value can be
  434. set with the configure option
  435. \ref enable-maxbuffers "--enable-maxbuffers".
  436. \var enum starpu_data_access_mode *starpu_task::dyn_modes
  437. Is used only when starpu_codelet::nbuffers is \ref
  438. STARPU_VARIABLE_NBUFFERS. It is an array of
  439. ::starpu_data_access_mode. It describes the required access modes
  440. to the data needed by the codelet (e.g. ::STARPU_RW). The number
  441. of entries in this array must be specified in the field
  442. starpu_codelet::nbuffers. This field should be used for codelets
  443. having a number of datas greater than \ref STARPU_NMAXBUFS
  444. (see \ref SettingManyDataHandlesForATask). When defining a
  445. codelet, one should either define this field or the field
  446. starpu_task::modes defined above.
  447. \var void *starpu_task::cl_arg
  448. Optional pointer which is passed to the codelet through the second
  449. argument of the codelet implementation (e.g.
  450. starpu_codelet::cpu_func or starpu_codelet::cuda_func). The
  451. default value is <c>NULL</c>. starpu_codelet_pack_args() and
  452. starpu_codelet_unpack_args() are helpers that can can be used to
  453. respectively pack and unpack data into and from it, but the
  454. application can manage it any way, the only requirement is that
  455. the size of the data must be set in starpu_task::cl_arg_size .
  456. \var size_t starpu_task::cl_arg_size
  457. Optional field. For some specific drivers, the pointer
  458. starpu_task::cl_arg cannot not be directly given to the driver
  459. function. A buffer of size starpu_task::cl_arg_size needs to be
  460. allocated on the driver. This buffer is then filled with the
  461. starpu_task::cl_arg_size bytes starting at address
  462. starpu_task::cl_arg. In this case, the argument given to the
  463. codelet is therefore not the starpu_task::cl_arg pointer, but the
  464. address of the buffer in local store (LS) instead. This field is
  465. ignored for CPU, CUDA and OpenCL codelets, where the
  466. starpu_task::cl_arg pointer is given as such.
  467. \var unsigned starpu_task::cl_arg_free
  468. Optional field. In case starpu_task::cl_arg was allocated by the
  469. application through <c>malloc()</c>, setting
  470. starpu_task::cl_arg_free to 1 makes StarPU automatically call
  471. <c>free(cl_arg)</c> when destroying the task. This saves the user
  472. from defining a callback just for that. This is mostly useful when
  473. targetting MIC or SCC, where the codelet does not execute in the
  474. same memory space as the main thread.
  475. \var void (*starpu_task::callback_func)(void *)
  476. Optional field, the default value is <c>NULL</c>. This is a
  477. function pointer of prototype <c>void (*f)(void *)</c> which
  478. specifies a possible callback. If this pointer is non-<c>NULL</c>,
  479. the callback function is executed on the host after the execution
  480. of the task. Tasks which depend on it might already be executing.
  481. The callback is passed the value contained in the
  482. starpu_task::callback_arg field. No callback is executed if the
  483. field is set to <c>NULL</c>.
  484. \var void *starpu_task::callback_arg (optional) (default: <c>NULL</c>)
  485. Optional field, the default value is <c>NULL</c>. This is the
  486. pointer passed to the callback function. This field is ignored if
  487. the field starpu_task::callback_func is set to <c>NULL</c>.
  488. \var unsigned starpu_task::callback_arg_free
  489. Optional field. In case starpu_task::callback_arg was allocated by
  490. the application through <c>malloc()</c>, setting
  491. starpu_task::callback_arg_free to 1 makes StarPU automatically
  492. call <c>free(callback_arg)</c> when destroying the task.
  493. \var void (*starpu_task::prologue_callback_func)(void *)
  494. Optional field, the default value is <c>NULL</c>. This is a
  495. function pointer of prototype <c>void (*f)(void *)</c> which
  496. specifies a possible callback.
  497. If this pointer is non-<c>NULL</c>, the callback function is
  498. executed on the host when the task becomes ready for execution,
  499. before getting scheduled. The callback is passed the value
  500. contained in the starpu_task::prologue_callback_arg field. No
  501. callback is executed if the field is set to <c>NULL</c>.
  502. \var void *starpu_task::prologue_callback_arg (optional) (default: <c>NULL</c>)
  503. Optional field, the default value is <c>NULL</c>. This is the
  504. pointer passed to the prologue callback function. This field is
  505. ignored if the field starpu_task::prologue_callback_func is set to
  506. <c>NULL</c>.
  507. \var unsigned starpu_task::prologue_callback_arg_free
  508. Optional field. In case starpu_task::prologue_callback_arg was
  509. allocated by the application through <c>malloc()</c>, setting
  510. starpu_task::prologue_callback_arg_free to 1 makes StarPU
  511. automatically call <c>free(prologue_callback_arg)</c> when
  512. destroying the task.
  513. \var void (*starpu_task::prologue_callback_pop_func)(void *)
  514. todo
  515. \var void *starpu_task::prologue_callback_pop_arg (optional) (default: <c>NULL</c>)
  516. todo
  517. \var unsigned starpu_task::prologue_callback_pop_arg_free
  518. todo
  519. \var unsigned starpu_task::use_tag
  520. Optional field, the default value is 0. If set, this flag
  521. indicates that the task should be associated with the tag
  522. contained in the starpu_task::tag_id field. Tag allow the
  523. application to synchronize with the task and to express task
  524. dependencies easily.
  525. \var starpu_tag_t starpu_task::tag_id
  526. This optional field contains the tag associated to the task if the
  527. field starpu_task::use_tag is set, it is ignored otherwise.
  528. \var unsigned starpu_task::sequential_consistency
  529. If this flag is set (which is the default), sequential consistency
  530. is enforced for the data parameters of this task for which
  531. sequential consistency is enabled. Clearing this flag permits to
  532. disable sequential consistency for this task, even if data have it
  533. enabled.
  534. \var unsigned starpu_task::synchronous
  535. If this flag is set, the function starpu_task_submit() is blocking
  536. and returns only when the task has been executed (or if no worker
  537. is able to process the task). Otherwise, starpu_task_submit()
  538. returns immediately.
  539. \var int starpu_task::priority
  540. Optional field, the default value is ::STARPU_DEFAULT_PRIO. This
  541. field indicates a level of priority for the task. This is an
  542. integer value that must be set between the return values of the
  543. function starpu_sched_get_min_priority() for the least important
  544. tasks, and that of the function starpu_sched_get_max_priority()
  545. for the most important tasks (included). The ::STARPU_MIN_PRIO and
  546. ::STARPU_MAX_PRIO macros are provided for convenience and
  547. respectively returns the value of starpu_sched_get_min_priority()
  548. and starpu_sched_get_max_priority(). Default priority is
  549. ::STARPU_DEFAULT_PRIO, which is always defined as 0 in order to
  550. allow static task initialization. Scheduling strategies that take
  551. priorities into account can use this parameter to take better
  552. scheduling decisions, but the scheduling policy may also ignore
  553. it.
  554. \var unsigned starpu_task::execute_on_a_specific_worker
  555. Default value is 0. If this flag is set, StarPU will bypass the
  556. scheduler and directly affect this task to the worker specified by
  557. the field starpu_task::workerid.
  558. \var unsigned starpu_task::workerid
  559. Optional field. If the field
  560. starpu_task::execute_on_a_specific_worker is set, this field
  561. indicates the identifier of the worker that should process this
  562. task (as returned by starpu_worker_get_id()). This field is
  563. ignored if the field starpu_task::execute_on_a_specific_worker is
  564. set to 0.
  565. \var unsigned starpu_task::workerorder
  566. Optional field. If the field
  567. starpu_task::execute_on_a_specific_worker is set, this field
  568. indicates the per-worker consecutive order in which tasks should
  569. be executed on the worker. Tasks will be executed in consecutive
  570. starpu_task::workerorder values, thus ignoring the availability
  571. order or task priority. See \ref StaticScheduling for more
  572. details. This field is ignored if the field
  573. starpu_task::execute_on_a_specific_worker is set to 0.
  574. \var unsigned starpu_task::workerids
  575. Optional field. If the field
  576. starpu_task::workerids_len is different from 0, this field indicates an
  577. array of bits (stored as uint32_t values) which indicate the set of workers
  578. which are allowed to execute the task. starpu_task::workerid takes
  579. precedence over this.
  580. \var unsigned starpu_task::workerids_len
  581. Optional field. This provides the number of uint32_t values in the
  582. starpu_task::workerids array.
  583. \var starpu_task_bundle_t starpu_task::bundle
  584. Optional field. The bundle that includes this task. If no bundle
  585. is used, this should be <c>NULL</c>.
  586. \var unsigned starpu_task::detach
  587. Optional field, default value is 1. If this flag is set, it is not
  588. possible to synchronize with the task by the means of
  589. starpu_task_wait() later on. Internal data structures are only
  590. guaranteed to be freed once starpu_task_wait() is called if the
  591. flag is not set.
  592. \var unsigned starpu_task::destroy
  593. Optional value. Default value is 0 for starpu_task_init(), and 1
  594. for starpu_task_create(). If this flag is set, the task structure
  595. will automatically be freed, either after the execution of the
  596. callback if the task is detached, or during starpu_task_wait()
  597. otherwise. If this flag is not set, dynamically allocated data
  598. structures will not be freed until starpu_task_destroy() is called
  599. explicitly. Setting this flag for a statically allocated task
  600. structure will result in undefined behaviour. The flag is set to 1
  601. when the task is created by calling starpu_task_create(). Note
  602. that starpu_task_wait_for_all() will not free any task.
  603. \var unsigned starpu_task::regenerate
  604. Optional field. If this flag is set, the task will be re-submitted
  605. to StarPU once it has been executed. This flag must not be set if
  606. the flag starpu_task::destroy is set. This flag must be set before
  607. making another task depend on this one.
  608. \var enum starpu_task_status starpu_task::status
  609. Optional field. Current state of the task.
  610. \var struct starpu_profiling_task_info *starpu_task::profiling_info
  611. Optional field. Profiling information for the task.
  612. \var double starpu_task::predicted
  613. Output field. Predicted duration of the task. This field is only
  614. set if the scheduling strategy uses performance models.
  615. \var double starpu_task::predicted_transfer
  616. Optional field. Predicted data transfer duration for the task in
  617. microseconds. This field is only valid if the scheduling strategy
  618. uses performance models.
  619. \var double starpu_task::predicted_start
  620. todo
  621. \var struct starpu_task *starpu_task::prev
  622. \private
  623. A pointer to the previous task. This should only be used by
  624. StarPU.
  625. \var struct starpu_task *starpu_task::next
  626. \private
  627. A pointer to the next task. This should only be used by StarPU.
  628. \var unsigned int starpu_task::mf_skip
  629. \private
  630. This is only used for tasks that use multiformat handle. This
  631. should only be used by StarPU.
  632. \var double starpu_task::flops
  633. This can be set to the number of floating points operations that
  634. the task will have to achieve. This is useful for easily getting
  635. GFlops curves from the tool <c>starpu_perfmodel_plot</c>, and for
  636. the hypervisor load balancing.
  637. \var void *starpu_task::starpu_private
  638. \private
  639. This is private to StarPU, do not modify. If the task is allocated
  640. by hand (without starpu_task_create()), this field should be set
  641. to <c>NULL</c>.
  642. \var int starpu_task::magic
  643. \private
  644. This field is set when initializing a task. The function
  645. starpu_task_submit() will fail if the field does not have the
  646. right value. This will hence avoid submitting tasks which have not
  647. been properly initialised.
  648. \var unsigned starpu_task::sched_ctx
  649. Scheduling context.
  650. \var int starpu_task::hypervisor_tag
  651. Helps the hypervisor monitor the execution of this task.
  652. \var unsigned starpu_task::possibly_parallel
  653. todo
  654. \var unsigned starpu_task::prefetched
  655. todo
  656. \var unsigned starpu_task::scheduled
  657. Whether the scheduler has pushed the task on some queue
  658. \var struct starpu_omp_task *starpu_task::omp_task
  659. todo
  660. \fn void starpu_task_init(struct starpu_task *task)
  661. \ingroup API_Codelet_And_Tasks
  662. Initialize \p task with default values. This function is
  663. implicitly called by starpu_task_create(). By default, tasks initialized
  664. with starpu_task_init() must be deinitialized explicitly with
  665. starpu_task_clean(). Tasks can also be initialized statically, using
  666. ::STARPU_TASK_INITIALIZER.
  667. \def STARPU_TASK_INITIALIZER
  668. \ingroup API_Codelet_And_Tasks
  669. It is possible to initialize statically allocated tasks with
  670. this value. This is equivalent to initializing a structure starpu_task
  671. with the function starpu_task_init().
  672. \def STARPU_TASK_GET_NBUFFERS(task)
  673. \ingroup API_Codelet_And_Tasks
  674. Return the number of buffers for \p task, i.e. starpu_codelet::nbuffers, or
  675. starpu_task::nbuffers if the former is \ref STARPU_VARIABLE_NBUFFERS.
  676. \def STARPU_TASK_GET_HANDLE(task, i)
  677. \ingroup API_Codelet_And_Tasks
  678. Return the \p i -th data handle of \p task. If \p task
  679. is defined with a static or dynamic number of handles, will either
  680. return the \p i -th element of the field starpu_task::handles or the \p
  681. i -th element of the field starpu_task::dyn_handles
  682. (see \ref SettingManyDataHandlesForATask)
  683. \def STARPU_TASK_SET_HANDLE(task, handle, i)
  684. \ingroup API_Codelet_And_Tasks
  685. Set the \p i -th data handle of \p task with \p handle.
  686. If \p task is defined with a static or dynamic number of
  687. handles, will either set the \p i -th element of the field
  688. starpu_task::handles or the \p i -th element of the field
  689. starpu_task::dyn_handles
  690. (see \ref SettingManyDataHandlesForATask)
  691. \def STARPU_CODELET_GET_MODE(codelet, i)
  692. \ingroup API_Codelet_And_Tasks
  693. Return the access mode of the \p i -th data handle of \p codelet.
  694. If \p codelet is defined with a static or dynamic number of
  695. handles, will either return the \p i -th element of the field
  696. starpu_codelet::modes or the \p i -th element of the field
  697. starpu_codelet::dyn_modes
  698. (see \ref SettingManyDataHandlesForATask)
  699. \def STARPU_CODELET_SET_MODE(codelet, mode, i)
  700. \ingroup API_Codelet_And_Tasks
  701. Set the access mode of the \p i -th data handle of \p codelet.
  702. If \p codelet is defined with a static or dynamic number of
  703. handles, will either set the \p i -th element of the field
  704. starpu_codelet::modes or the \p i -th element of the field
  705. starpu_codelet::dyn_modes
  706. (see \ref SettingManyDataHandlesForATask)
  707. \def STARPU_TASK_GET_MODE(task, i)
  708. \ingroup API_Codelet_And_Tasks
  709. Return the access mode of the \p i -th data handle of \p task.
  710. If \p task is defined with a static or dynamic number of
  711. handles, will either return the \p i -th element of the field
  712. starpu_task::modes or the \p i -th element of the field
  713. starpu_task::dyn_modes
  714. (see \ref SettingManyDataHandlesForATask)
  715. \def STARPU_TASK_SET_MODE(task, mode, i)
  716. \ingroup API_Codelet_And_Tasks
  717. Set the access mode of the \p i -th data handle of \p task.
  718. If \p task is defined with a static or dynamic number of
  719. handles, will either set the \p i -th element of the field
  720. starpu_task::modes or the \p i -th element of the field
  721. starpu_task::dyn_modes
  722. (see \ref SettingManyDataHandlesForATask)
  723. \fn struct starpu_task *starpu_task_create(void)
  724. \ingroup API_Codelet_And_Tasks
  725. Allocate a task structure and initialize it with default
  726. values. Tasks allocated dynamically with starpu_task_create() are
  727. automatically freed when the task is terminated. This means that the
  728. task pointer can not be used any more once the task is submitted,
  729. since it can be executed at any time (unless dependencies make it
  730. wait) and thus freed at any time. If the field starpu_task::destroy is
  731. explicitly unset, the resources used by the task have to be freed by
  732. calling starpu_task_destroy().
  733. \fn struct starpu_task *starpu_task_dup(struct starpu_task *task)
  734. \ingroup API_Codelet_And_Tasks
  735. Allocate a task structure which is the exact duplicate of \p task.
  736. \fn void starpu_task_clean(struct starpu_task *task)
  737. \ingroup API_Codelet_And_Tasks
  738. Release all the structures automatically allocated to execute
  739. \p task, but not the task structure itself and values set by the user
  740. remain unchanged. It is thus useful for statically allocated tasks for
  741. instance. It is also useful when users want to execute the same
  742. operation several times with as least overhead as possible. It is
  743. called automatically by starpu_task_destroy(). It has to be called
  744. only after explicitly waiting for the task or after starpu_shutdown()
  745. (waiting for the callback is not enough, since StarPU still
  746. manipulates the task after calling the callback).
  747. \fn void starpu_task_destroy(struct starpu_task *task)
  748. \ingroup API_Codelet_And_Tasks
  749. Free the resource allocated during starpu_task_create() and
  750. associated with \p task. This function is called automatically
  751. after the execution of a task when the field starpu_task::destroy is
  752. set, which is the default for tasks created by starpu_task_create().
  753. Calling this function on a statically allocated task results in an
  754. undefined behaviour.
  755. \fn int starpu_task_wait(struct starpu_task *task)
  756. \ingroup API_Codelet_And_Tasks
  757. Block until \p task has been executed. It is not
  758. possible to synchronize with a task more than once. It is not possible
  759. to wait for synchronous or detached tasks. Upon successful completion,
  760. this function returns 0. Otherwise, <c>-EINVAL</c> indicates that the
  761. specified task was either synchronous or detached.
  762. \fn int starpu_task_wait_array(struct starpu_task **tasks, unsigned nb_tasks)
  763. \ingroup API_Codelet_And_Tasks
  764. Allow to wait for an array of tasks. Upon successful completion,
  765. this function returns 0. Otherwise, <c>-EINVAL</c> indicates that one of the tasks
  766. was either synchronous or detached.
  767. \fn int starpu_task_submit(struct starpu_task *task)
  768. \ingroup API_Codelet_And_Tasks
  769. Submit \p task to StarPU. Calling this function
  770. does not mean that the task will be executed immediately as there can
  771. be data or task (tag) dependencies that are not fulfilled yet: StarPU
  772. will take care of scheduling this task with respect to such
  773. dependencies. This function returns immediately if the field
  774. starpu_task::synchronous is set to 0, and block until the
  775. termination of the task otherwise.
  776. It is also possible to synchronize
  777. the application with asynchronous tasks by the means of tags, using
  778. the function starpu_tag_wait() function for instance. In case of
  779. success, this function returns 0, a return value of <c>-ENODEV</c>
  780. means that there is no worker able to process this task (e.g. there is
  781. no GPU available and this task is only implemented for CUDA devices).
  782. starpu_task_submit() can be called from anywhere, including codelet
  783. functions and callbacks, provided that the field
  784. starpu_task::synchronous is set to 0.
  785. \fn int starpu_task_submit_to_ctx(struct starpu_task *task, unsigned sched_ctx_id)
  786. \ingroup API_Codelet_And_Tasks
  787. Submit \p task to the context \p sched_ctx_id.
  788. By default, starpu_task_submit() submits the task to a global context that is
  789. created automatically by StarPU.
  790. \fn int starpu_task_wait_for_all(void)
  791. \ingroup API_Codelet_And_Tasks
  792. Block until all the tasks that were submitted (to the
  793. current context or the global one if there is no current context) are terminated.
  794. It does not destroy these tasks.
  795. \fn int starpu_task_wait_for_all_in_ctx(unsigned sched_ctx_id)
  796. \ingroup API_Codelet_And_Tasks
  797. Wait until all the tasks that were already submitted to the context \p
  798. sched_ctx_id have been terminated.
  799. \fn int starpu_task_wait_for_n_submitted(unsigned n)
  800. \ingroup API_Codelet_And_Tasks
  801. Block until there are \p n submitted tasks left (to the
  802. current context or the global one if there is no current context) to be executed. It does
  803. not destroy these tasks.
  804. \fn int starpu_task_wait_for_n_submitted_in_ctx(unsigned sched_ctx_id, unsigned n)
  805. \ingroup API_Codelet_And_Tasks
  806. Wait until there are \p n tasks submitted left to be
  807. executed that were already submitted to the context \p sched_ctx_id.
  808. \fn int starpu_task_nready(void)
  809. \ingroup API_Codelet_And_Tasks
  810. TODO
  811. \fn int starpu_task_nsubmitted(void)
  812. \ingroup API_Codelet_And_Tasks
  813. Return the number of submitted tasks which have not completed yet.
  814. \fn int starpu_task_nready(void)
  815. \ingroup API_Codelet_And_Tasks
  816. Return the number of submitted tasks which are ready for
  817. execution are already executing. It thus does not include tasks
  818. waiting for dependencies.
  819. \fn struct starpu_task *starpu_task_get_current(void)
  820. \ingroup API_Codelet_And_Tasks
  821. Return the task currently executed by the
  822. worker, or <c>NULL</c> if it is called either from a thread that is not a
  823. task or simply because there is no task being executed at the moment.
  824. \fn const char *starpu_task_get_name(struct starpu_task *task)
  825. \ingroup API_Codelet_And_Tasks
  826. Return the name of \p task, i.e. either its starpu_task::name field, or
  827. the name of the corresponding performance model.
  828. \fn const char *starpu_task_get_model_name(struct starpu_task *task)
  829. \ingroup API_Codelet_And_Tasks
  830. Return the name of the performance model of \p task.
  831. \fn void starpu_codelet_display_stats(struct starpu_codelet *cl)
  832. \ingroup API_Codelet_And_Tasks
  833. Output on \c stderr some statistics on the codelet \p cl.
  834. \fn int starpu_task_wait_for_no_ready(void)
  835. \ingroup API_Codelet_And_Tasks
  836. Wait until there is no more ready task.
  837. \fn void starpu_task_set_implementation(struct starpu_task *task, unsigned impl)
  838. \ingroup API_Codelet_And_Tasks
  839. This function should be called by schedulers to specify the
  840. codelet implementation to be executed when executing \p task.
  841. \fn unsigned starpu_task_get_implementation(struct starpu_task *task)
  842. \ingroup API_Codelet_And_Tasks
  843. Return the codelet implementation to be executed
  844. when executing \p task.
  845. \fn void starpu_iteration_push(unsigned long iteration)
  846. \ingroup API_Codelet_And_Tasks
  847. Sets the iteration number for all the tasks to be submitted after
  848. this call. This is typically called at the beginning of a task
  849. submission loop. This number will then show up in tracing tools. A
  850. corresponding starpu_iteration_pop() call must be made to match the call to
  851. starpu_iteration_push(), at the end of the same task submission loop, typically.
  852. Nested calls to starpu_iteration_push and starpu_iteration_pop are allowed, to
  853. describe a loop nest for instance, provided that they match properly.
  854. \fn void starpu_iteration_pop(void)
  855. \ingroup API_Codelet_And_Tasks
  856. Drops the iteration number for submitted tasks. This must match a previous
  857. call to starpu_iteration_push(), and is typically called at the end of a task
  858. submission loop.
  859. \fn void starpu_create_sync_task(starpu_tag_t sync_tag, unsigned ndeps, starpu_tag_t *deps, void (*callback)(void *), void *callback_arg)
  860. \ingroup API_Codelet_And_Tasks
  861. Create (and submit) an empty task that unlocks a tag once all its dependencies are fulfilled.
  862. */