modularized_scheduler.doxy 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /*! \page ModularizedScheduler Modularized Scheduler
  2. \section Introduction
  3. Scheduler are a tree-like structure of homogeneous nodes that each
  4. provides push and pop primitives. Each node may have one father by
  5. context, specially worker nodes as they are shared between all contexts.
  6. Tasks make a top bottom traversal of tree.
  7. A push call on a node make either a recursive call on one of its
  8. childs or make the task stored in the node and made available to a
  9. pop, in this case that node should call starpu_sched_node_available to wake workers
  10. up. Push must be called on a child, and only if this child can execute
  11. the task.
  12. A pop call on a node can either return a localy stored task or perform
  13. a recursive call on its father in its current context. Only workers
  14. should call pop.
  15. \section Initialization
  16. Scheduler node are created with the starpu_sched_node_foo_create() functions
  17. and then must be assembled using them starpu_sched_node::add_child and
  18. starpu_sched_node::remove_child function.
  19. A father can be set in order to allow him to be reacheable by a starpu_sched_node::pop_task
  20. call.
  21. Underlayings workers are memoized in starpu_sched_node::workers. Hence the
  22. function starpu_sched_tree_update_workers should be called when the scheduler is
  23. finished, or modified.
  24. \section Adding and removing workers
  25. \section Push
  26. All scheduler node must define a starpu_sched_node::push_task
  27. function. The caller ensure that the node can realy execute the task.
  28. \section Pop
  29. starpu_sched_node::push_task should either return a local task or
  30. perform a recursive call on
  31. starpu_sched_node::fathers[sched_ctx_id], or \c NULL if its a root
  32. node.
  33. \section WorkersAndCombinedWorkers Workers and Combined workers
  34. Leafs are either a worker node that is bind to a starpu workers or a
  35. combined worker node that is bind to several worker nodes.
  36. Pushing a task on a combined worker node will in fact push a copy of
  37. that task on each worker node of the combined worker.
  38. A push call simply enqueue task in worker queue, no sort is performed
  39. here.
  40. If a worker call pop and get a parallel task, it will execute it with the
  41. combined worker it belong to.
  42. */