modularized_scheduler.doxy 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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 locally 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 functions.
  19. A father can be set to allow him to be reachable by a starpu_sched_node::pop_task
  20. call.
  21. Underlyings 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 AddingAndRemovingWorkers Adding and removing workers
  25. The hypervisor can balance load between contexts by adding or removing workers from a scheduler.
  26. \section Push
  27. All scheduler node must define a starpu_sched_node::push_task
  28. function. The caller ensure that the node can actually execute the task.
  29. \section Pop
  30. starpu_sched_node::push_task should either return a local task or
  31. perform a recursive call on
  32. starpu_sched_node::fathers[sched_ctx_id], or \c NULL if its a root
  33. node.
  34. \section WorkersAndCombinedWorkers Workers and Combined workers
  35. Leafs are either a worker node that is bind to a starpu workers or a
  36. combined worker node that is bind to several worker nodes.
  37. Pushing a task on a combined worker node will in fact push a copy of
  38. that task on each worker node of the combined worker.
  39. A push call simply enqueue task in worker queue, no sort is performed
  40. here.
  41. If a worker call pop and get a parallel task, it will execute it with the
  42. combined worker it belong to.
  43. */