浏览代码

give an idea of what the scheduler API looks like

Samuel Thibault 9 年之前
父节点
当前提交
b4ba3961ff
共有 1 个文件被更改,包括 12 次插入0 次删除
  1. 12 0
      doc/doxygen/chapters/08scheduling.doxy

+ 12 - 0
doc/doxygen/chapters/08scheduling.doxy

@@ -175,6 +175,8 @@ provides a list of the available functions for writing advanced schedulers, such
 as starpu_task_expected_length, starpu_task_expected_data_transfer_time,
 starpu_task_expected_power, starpu_prefetch_task_input_node, etc.
 
+The scheduler has to provide methods:
+
 \code{.c}
 static struct starpu_sched_policy dummy_sched_policy = {
     .init_sched = init_dummy_sched,
@@ -188,6 +190,16 @@ static struct starpu_sched_policy dummy_sched_policy = {
 };
 \endcode
 
+The idea is that when a task becomes ready for execution, the
+starpu_sched_policy::push_task method is called. When a worker is idle, the
+starpu_sched_policy::pop_task method is called to get a task. It is up to the
+scheduler to implement what is between. A simple eager scheduler is for instance
+to make starpu_sched_policy::push_task push the task to a global list, and make
+starpu_sched_policy::pop_task pop from that list.
+
+The \ref starpu_sched_policy section provides the exact rules that govern the
+methods of the policy.
+
 \section GraphScheduling Graph-based scheduling
 
 For performance reasons, most of the schedulers shipped with StarPU use simple