소스 검색

Minimal documentation of the starpu_sched_policy_s structure

Cédric Augonnet 14 년 전
부모
커밋
1d6bd522d7
2개의 변경된 파일36개의 추가작업 그리고 19개의 파일을 삭제
  1. 18 11
      doc/starpu.texi
  2. 18 8
      include/starpu_scheduler.h

+ 18 - 11
doc/starpu.texi

@@ -3342,27 +3342,34 @@ the StarPU sources in the directory @code{examples/scheduler/}.
 @subsection @code{struct starpu_sched_policy_s} -- Scheduler methods
 @table @asis
 @item @emph{Description}:
-TODO
+This structure contains all the methods that implement a scheduling policy.  An
+application may specify which scheduling strategy in the @code{sched_policy}
+field of the @code{starpu_conf} structure passed to the @code{starpu_init}
+function.
+
 @item @emph{Fields}:
 @table @asis
 @item @code{init_sched}:
-TODO
+Initialize the scheduling policy.
 @item @code{deinit_sched}:
-TODO
+Cleanup the scheduling policy.
 @item @code{push_task}:
-TODO
+Insert a task into the scheduler.
 @item @code{push_prio_task}:
-TODO
+Insert a priority task into the scheduler.
 @item @code{pop_task}:
-TODO
-@item @code{post_exec_hook}:
-TODO
+Get a task from the scheduler. The mutex associated to the worker is already
+taken when this method is called.
 @item @code{pop_every_task}:
-TODO
+Remove all available tasks from the scheduler (tasks are chained by the means
+of the prev and next fields of the starpu_task structure). The mutex associated
+to the worker is already taken when this method is called. 
+@item @code{post_exec_hook} (optionnal):
+This method is called every time a task has been executed.
 @item @code{policy_name}:
-TODO
+Name of the policy (optionnal).
 @item @code{policy_description}:
-TODO
+Description of the policy (optionnal).
 @end table
 @end table
 

+ 18 - 8
include/starpu_scheduler.h

@@ -55,29 +55,39 @@ struct starpu_machine_topology_s {
 	unsigned workers_opencl_gpuid[STARPU_NMAXWORKERS];
 };
 
+/* This structure contains all the methods that implement a scheduling policy.
+ * An application may specify which scheduling strategy in the "sched_policy"
+ * field of the starpu_conf structure passed to the starpu_init function. */
 struct starpu_sched_policy_s {
-	/* create all the queues */
+	/* Initialize the scheduling policy. */
 	void (*init_sched)(struct starpu_machine_topology_s *, struct starpu_sched_policy_s *);
 
-	/* cleanup method at termination */
+	/* Cleanup the scheduling policy. */
 	void (*deinit_sched)(struct starpu_machine_topology_s *, struct starpu_sched_policy_s *);
 
-	/* some methods to manipulate the previous queue */
+	/* Insert a task into the scheduler. */
 	int (*push_task)(struct starpu_task *);
+
+	/* Insert a priority task into the scheduler. */
 	int (*push_prio_task)(struct starpu_task *);
-	struct starpu_task *(*pop_task)(void);
 
-	void (*post_exec_hook)(struct starpu_task *);
+	/* Get a task from the scheduler. The mutex associated to the worker is
+	 * already taken when this method is called. */
+	struct starpu_task *(*pop_task)(void);
 
 	 /* Remove all available tasks from the scheduler (tasks are chained by
 	  * the means of the prev and next fields of the starpu_task
-	  * structure). */
+	  * structure). The mutex associated to the worker is already taken
+	  * when this method is called. */
 	struct starpu_task *(*pop_every_task)(uint32_t where);
 
-	/* name of the policy (optionnal) */
+	/* This method is called every time a task has been executed. (optionnal) */
+	void (*post_exec_hook)(struct starpu_task *);
+
+	/* Name of the policy (optionnal) */
 	const char *policy_name;
 
-	/* description of the policy (optionnal) */
+	/* Description of the policy (optionnal) */
 	const char *policy_description;
 };