modularized_scheduler.doxy 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235
  1. /*! \defgroup API_Modularized_Scheduler Modularized Scheduler Interface
  2. \struct starpu_sched_node
  3. \ingroup API_Modularized_Scheduler
  4. This structure represent a scheduler module.
  5. \var starpu_sched_node::push_task
  6. push a task in the scheduler module.
  7. \var starpu_sched_node::pop_task
  8. pop a task from the scheduler module, the task returned by this function is executable by the caller if its a worker
  9. \var starpu_sched_node::available
  10. notify workers downstairs that a task is waiting for a pop, this member dont seems to be necessary
  11. \var starpu_sched_node::estimated_load
  12. is an heuristic to compute load of scheduler module
  13. \var starpu_sched_node::estimated_execute_preds
  14. compute executions prediction for a task
  15. \var starpu_sched_node::nchilds
  16. the number of modules downstairs
  17. \var starpu_sched_node::childs
  18. modules downstairs
  19. \var starpu_sched_node::workers
  20. this member contain the set of underlaying workers
  21. \var starpu_sched_node::is_homogeneous
  22. this is set to true iff all underlaying workers are the same
  23. \var starpu_sched_node::data
  24. data used by the scheduler module
  25. \var starpu_sched_node::fathers
  26. the array of scheduler module above indexed by scheduling context index
  27. \var starpu_sched_node::init_data
  28. is called after all the scheduler is created and should init data member
  29. you can store things in node->data while calling _sched_node_create(arg)
  30. and use it with init_data
  31. \var starpu_sched_node::deinit_data
  32. is called just before starpu_sched_node_destroy
  33. \var starpu_sched_node::obj
  34. the hwloc object associed to scheduler module
  35. \struct starpu_task_execute_preds
  36. \ingroup API_Modularized_Scheduler
  37. this structure containt predictions for a task and is filled by starpu_sched_node::estimated_execute_preds
  38. \var starpu_task_execute_preds::state
  39. indicate status of prediction, if several status are possible, in order of priority it will be : CALIBRATING, PERF_MODEL, NO_PERF_MODEL, CANNOT_EXECUTE
  40. \var starpu_task_execute_preds::archtype
  41. \var starpu_task_execute_preds::impl
  42. those members are revelant is state is PERF_MODEL or CALIBRATING and is set to best or uncalibrated archtype and implementation, respectively, or suitable values if state is NO_PERF_MODEL
  43. \var starpu_task_execute_preds::expected_finish_time
  44. expected finish time of task
  45. \var starpu_task_execute_preds::expected_length
  46. expected compute time of task
  47. \var starpu_task_execute_preds::expected_transfer_length
  48. expected time for transfering data to worker's memory node
  49. \var starpu_task_execute_preds::expected_power
  50. expected power consumption for task
  51. \struct starpu_sched_tree
  52. \ingroup API_Modularized_Scheduler
  53. \var starpu_sched_tree::root
  54. this is the entry module of the scheduler
  55. \var starpu_sched_tree::workers
  56. this is the set of workers available in this context, this value is used to mask workers in modules
  57. \var lock
  58. this lock protect the worker member
  59. \fn struct starpu_sched_node * starpu_sched_node_create(void)
  60. \ingroup API_Modularized_Scheduler
  61. allocate and initalise node field with defaults values :
  62. .pop_task make recursive call on father
  63. .available make a recursive call on childrens
  64. .estimated_load compute relative speedup and tasks in subtree
  65. .estimated_execute_preds return the average of recursive call on childs
  66. \fn void starpu_sched_node_destroy(struct starpu_sched_node * node)
  67. \ingroup API_Modularized_Scheduler
  68. free data allocated by starpu_sched_node_create, but dont call node->deinit_data(node)
  69. \fn void starpu_sched_node_set_father(struct starpu_sched_node * node, struct starpu_sched_node * father_node, unsigned sched_ctx_id)
  70. \ingroup API_Modularized_Scheduler
  71. set node->fathers[sched_ctx_id] to father_node
  72. \fn void starpu_sched_node_add_child(struct starpu_sched_node* node, struct starpu_sched_node * child)
  73. \ingroup API_Modularized_Scheduler
  74. add child to node->childs and increment nchilds as well
  75. and dont modify child->fathers
  76. \fn void starpu_sched_node_remove_child(struct starpu_sched_node * node, struct starpu_sched_node * child)
  77. \ingroup API_Modularized_Scheduler
  78. remove child from node->childs and decrement nchilds
  79. \fn int starpu_sched_node_can_execute_task(struct starpu_sched_node * node, struct starpu_task * task)
  80. \ingroup API_Modularized_Scheduler
  81. return true iff \p node can execute \p task, this function take into account the workers available in the scheduling context
  82. \fn struct starpu_sched_node * starpu_sched_node_worker_get(int workerid)
  83. \ingroup API_Modularized_Scheduler
  84. return the struct starpu_sched_node corresponding to \p workerid
  85. \fn int starpu_sched_node_is_worker(struct starpu_sched_node * node)
  86. \ingroup API_Modularized_Scheduler
  87. return true iff \p node is a worker node
  88. \fn int starpu_sched_node_is_simple_worker(struct starpu_sched_node * node)
  89. \ingroup API_Modularized_Scheduler
  90. return true iff \p node is a simple worker node
  91. \fn int starpu_sched_node_is_combined_worker(struct starpu_sched_node * node)
  92. \ingroup API_Modularized_Scheduler
  93. return true iff \p node is a combined worker node
  94. \fn int starpu_sched_node_worker_get_workerid(struct starpu_sched_node * worker_node)
  95. \ingroup API_Modularized_Scheduler
  96. return the workerid of \p worker_node, undefined if starpu_sched_node_is_worker(worker_node) == 0
  97. \fn struct starpu_sched_node * starpu_sched_node_fifo_create(void * arg STARPU_ATTRIBUTE_UNUSED)
  98. \ingroup API_Modularized_Scheduler
  99. return a struct starpu_sched_node with a fifo. A stable sort is performed according to tasks priorities.
  100. a push_task call on this node does not perform recursive calls, underlaying nodes will have to call pop_task to get it.
  101. estimated_execute_preds function compute the estimated length by dividing the sequencial length by the number of underlaying workers
  102. \fn int starpu_sched_node_is_fifo(struct starpu_sched_node * node)
  103. \ingroup API_Modularized_Scheduler
  104. return true iff \p node is a fifo node
  105. \fn struct starpu_sched_node * starpu_sched_node_work_stealing_create(void)
  106. \ingroup API_Modularized_Scheduler
  107. return a node that perform a work stealing scheduling,
  108. a special function may be used instead of starpu_sched_tree_push_task that push tasks in the good fifo
  109. \fn int starpu_sched_node_is_work_stealing(struct starpu_sched_node * node)
  110. \ingroup API_Modularized_Scheduler
  111. return true iff \p node is a work stealing node
  112. \fn struct starpu_sched_node * starpu_sched_node_random_create(void * arg STARPU_ATTRIBUTE_UNUSED)
  113. \ingroup API_Modularized_Scheduler
  114. create a node that perform a random scheduling
  115. \fn int starpu_sched_node_is_random(struct starpu_sched_node *);
  116. \ingroup API_Modularized_Scheduler
  117. return true iff \p node is a random node
  118. \fn struct starpu_sched_node * starpu_sched_node_heft_create(void * arg STARPU_ATTRIBUTE_UNUSED)
  119. \ingroup API_Modularized_Scheduler
  120. this node perform a heft scheduling using data provided by estimated_execute_preds, if no pred_model are available a random node is used to push tasks
  121. \fn void starpu_sched_node_heft_set_no_model_node(struct starpu_sched_node * heft_node, struct starpu_sched_node * (*create_no_model_node)(void * arg), void * arg)
  122. \ingroup API_Modularized_Scheduler
  123. this should disapear and use arg to pass that kind of parameters
  124. \fn int starpu_sched_node_is_heft(struct starpu_sched_node * node)
  125. \ingroup API_Modularized_Scheduler
  126. return true iff \p node is a heft node
  127. \fn double starpu_sched_compute_expected_time(double now, double predicted_end, double predicted_length, double predicted_transfer)
  128. \ingroup API_Modularized_Scheduler
  129. compute expected end of a fifo with a task of \p predicted_length by taking in acount the fact that data may not be ready at \p predicted_end
  130. \fn struct starpu_sched_tree * starpu_sched_tree_create(void)
  131. \ingroup API_Modularized_Scheduler
  132. create a empty initialized starpu_sched_tree
  133. \fn void starpu_sched_tree_destroy(struct starpu_sched_tree * tree, unsigned sched_ctx_id)
  134. \ingroup API_Modularized_Scheduler
  135. destroy tree and free all non shared node in it.
  136. \fn void starpu_sched_node_destroy_rec (struct starpu_sched_node *node, unsigned sched_ctx_id)
  137. \ingroup API_Modularized_Scheduler
  138. recursively destroy non shared parts of a \p node 's tree
  139. \fn int starpu_sched_tree_push_task(struct starpu_task * task)
  140. \ingroup API_Modularized_Scheduler
  141. compatibility with starpu_sched_policy interface
  142. \fn struct starpu_task * starpu_sched_tree_pop_task(unsigned sched_ctx_id)
  143. \ingroup API_Modularized_Scheduler
  144. compatibility with starpu_sched_policy interface
  145. \fn void starpu_sched_tree_add_workers(unsigned sched_ctx_id, int *workerids, unsigned nworkers)
  146. \ingroup API_Modularized_Scheduler
  147. compatibility with starpu_sched_policy interface
  148. \fn void starpu_sched_tree_remove_workers(unsigned sched_ctx_id, int *workerids, unsigned nworkers)
  149. \ingroup API_Modularized_Scheduler
  150. compatibility with starpu_sched_policy interface
  151. \fn void starpu_sched_node_worker_pre_exec_hook(struct starpu_task * task)
  152. \ingroup API_Modularized_Scheduler
  153. compatibility with starpu_sched_policy interface
  154. update predictions for workers
  155. \fn void starpu_sched_node_worker_post_exec_hook(struct starpu_task * task)
  156. \ingroup API_Modularized_Scheduler
  157. compatibility with starpu_sched_policy interface
  158. \fn struct starpu_bitmap * _starpu_get_worker_mask(struct starpu_task *task)
  159. \ingroup API_Modularized_Scheduler
  160. return a ref to bitmap that give available worker to execute \p task
  161. \struct starpu_bitmap;
  162. \ingroup API_Modularized_Scheduler
  163. implement a simple bitmap
  164. \fn struct starpu_bitmap * starpu_bitmap_create(void)
  165. \ingroup API_Modularized_Scheduler
  166. create a empty starpu_bitmap
  167. \fn void starpu_bitmap_destroy(struct starpu_bitmap *)
  168. \ingroup API_Modularized_Scheduler
  169. free a starpu_bitmap
  170. \fn void starpu_bitmap_set(struct starpu_bitmap * bitmap, int e)
  171. \ingroup API_Modularized_Scheduler
  172. set bit \p e in \p bitmap
  173. \fn void starpu_bitmap_unset(struct starpu_bitmap * bitmap, int e)
  174. \ingroup API_Modularized_Scheduler
  175. unset bit \p e in \p bitmap
  176. \fn void starpu_bitmap_unset_all(struct starpu_bitmap * bitmap)
  177. \ingroup API_Modularized_Scheduler
  178. unset all bits in \b bitmap
  179. \fn int starpu_bitmap_get(struct starpu_bitmap * bitmap, int e);
  180. \ingroup API_Modularized_Scheduler
  181. return true iff bit \p e is set in \p bitmap
  182. \fn int starpu_bitmap_cardinal(struct starpu_bitmap * bitmap);
  183. \ingroup API_Modularized_Scheduler
  184. return the number of set bits in \p bitmap
  185. \fn int starpu_bitmap_first(struct starpu_bitmap * bitmap)
  186. \ingroup API_Modularized_Scheduler
  187. return the position of the first set bit of \p bitmap, -1 if none
  188. \fn int starpu_bitmap_last(struct starpu_bitmap * bitmap)
  189. \ingroup API_Modularized_Scheduler
  190. return the position of the last set bit of \p bitmap, -1 if none
  191. \fn int starpu_bitmap_next(struct starpu_bitmap *, int e)
  192. \ingroup API_Modularized_Scheduler
  193. return the position of set bit right after \p e in \p bitmap, -1 if none
  194. */