|
@@ -19,12 +19,34 @@ This structure contains all the methods that implement a
|
|
|
scheduling policy. An application may specify which scheduling
|
|
|
strategy in the field starpu_conf::sched_policy passed to the function
|
|
|
starpu_init().
|
|
|
+
|
|
|
+For each task going through the scheduler, the following methods get called in the given order:
|
|
|
+
|
|
|
+<ul>
|
|
|
+<li>starpu_sched_policy::submit_hook when the task is submitted</li>
|
|
|
+<li>starpu_sched_policy::push_task when the task becomes ready. The scheduler is here <b>given</b> the task</li>
|
|
|
+<li>starpu_sched_policy::pop_task when a worker is idle. The scheduler here <b>gives</b> back the task to the core</li>
|
|
|
+<li>starpu_sched_policy::pre_exec_hook right before the worker actually starts the task computation (after transferring any missing data).</li>
|
|
|
+<li>starpu_sched_policy::post_exec_hook right after the worker actually completed the task computation.</li>
|
|
|
+</ul>
|
|
|
+
|
|
|
+For each task not going through the scheduler (because starpu_task::execute_on_a_specific_worker was set), these get called:
|
|
|
+
|
|
|
+<ul>
|
|
|
+<li>starpu_sched_policy::submit_hook when the task is submitted</li>
|
|
|
+<li>starpu_sched_policy::push_task_notify when the task becomes ready. This is just a notification, the scheduler does not have to do anything about the task.</li>
|
|
|
+<li>starpu_sched_policy::pre_exec_hook right before the worker actually starts the task computation (after transferring any missing data).</li>
|
|
|
+<li>starpu_sched_policy::post_exec_hook right after the worker actually completed the task computation.</li>
|
|
|
+</ul>
|
|
|
+
|
|
|
+
|
|
|
\var void (*starpu_sched_policy::init_sched)(unsigned sched_ctx_id)
|
|
|
- Initialize the scheduling policy.
|
|
|
+ Initialize the scheduling policy, called before any other method.
|
|
|
\var void (*starpu_sched_policy::deinit_sched)(unsigned sched_ctx_id)
|
|
|
- Cleanup the scheduling policy.
|
|
|
+ Cleanup the scheduling policy, called before any other method.
|
|
|
\var int (*starpu_sched_policy::push_task)(struct starpu_task *)
|
|
|
- Insert a task into the scheduler.
|
|
|
+ Insert a task into the scheduler, called when the task becomes ready for
|
|
|
+ execution.
|
|
|
\var void (*starpu_sched_policy::push_task_notify)(struct starpu_task *, int workerid, int perf_workerid, unsigned sched_ctx_id)
|
|
|
Notify the scheduler that a task was pushed on a given worker.
|
|
|
This method is called when a task that was explicitly
|
|
@@ -44,11 +66,17 @@ starpu_init().
|
|
|
chained by the means of the field starpu_task::prev and
|
|
|
starpu_task::next). The mutex associated to the worker is
|
|
|
already taken when this method is called. This is currently
|
|
|
- not used.
|
|
|
+ not used and can be discarded.
|
|
|
+\var void (*starpu_sched_policy::submit_hook)(struct starpu_task *)
|
|
|
+ Optional field. This method is called when a task is submitted.
|
|
|
\var void (*starpu_sched_policy::pre_exec_hook)(struct starpu_task *)
|
|
|
Optional field. This method is called every time a task is starting.
|
|
|
\var void (*starpu_sched_policy::post_exec_hook)(struct starpu_task *)
|
|
|
Optional field. This method is called every time a task has been executed.
|
|
|
+\var void (*starpu_sched_policy::do_schedule)(unsigned sched_ctx_id)
|
|
|
+ Optional field. This method is called when it is a good time to start
|
|
|
+ scheduling tasks. This is notably called when the application calls
|
|
|
+ starpu_task_wait_for_all.
|
|
|
\var void (*starpu_sched_policy::add_workers)(unsigned sched_ctx_id, int *workerids, unsigned nworkers)
|
|
|
Initialize scheduling structures corresponding to each worker used by the policy.
|
|
|
\var void (*starpu_sched_policy::remove_workers)(unsigned sched_ctx_id, int *workerids, unsigned nworkers)
|