Parcourir la source

Document starpu_worker_set_sched_condition

Cédric Augonnet il y a 15 ans
Parent
commit
abaa246db8
2 fichiers modifiés avec 28 ajouts et 0 suppressions
  1. 21 0
      doc/starpu.texi
  2. 7 0
      include/starpu_scheduler.h

+ 21 - 0
doc/starpu.texi

@@ -3334,6 +3334,7 @@ the StarPU sources in the directory @code{examples/scheduler/}.
 
 @menu
 * struct starpu_sched_policy_s::  
+* starpu_worker_set_sched_condition::
 * Source code::                 
 @end menu
 
@@ -3365,6 +3366,26 @@ TODO
 @end table
 @end table
 
+
+@node starpu_worker_set_sched_condition
+@subsection @code{starpu_worker_set_sched_condition} -- Specify the condition variable associated to a worker
+@table @asis
+@item @emph{Description}:
+When there is no available task for a worker, StarPU blocks this worker on a
+condition variable. This function specifies which condition variable (and the
+associated mutex) should be used to block (and to wake up) a worker. Note that
+multiple workers may use the same condition variable. For instance, in the case
+of a scheduling strategy with a single task queue, the same condition variable
+would be used to block and wake up all workers.
+The initialization method of a scheduling strategy (@code{init_sched}) must
+call this function once per worker.
+
+@item @emph{Prototype}:
+@code{void starpu_worker_set_sched_condition(int workerid, pthread_cond_t *sched_cond, pthread_mutex_t *sched_mutex);}
+@end table
+
+
+
 @node Source code
 @subsection Source code
 

+ 7 - 0
include/starpu_scheduler.h

@@ -81,6 +81,13 @@ struct starpu_sched_policy_s {
 	const char *policy_description;
 };
 
+/* When there is no available task for a worker, StarPU blocks this worker on a
+condition variable. This function specifies which condition variable (and the
+associated mutex) should be used to block (and to wake up) a worker. Note that
+multiple workers may use the same condition variable. For instance, in the case
+of a scheduling strategy with a single task queue, the same condition variable
+would be used to block and wake up all workers.  The initialization method of a
+scheduling strategy (init_sched) must call this function once per worker. */
 void starpu_worker_set_sched_condition(int workerid, pthread_cond_t *sched_cond, pthread_mutex_t *sched_mutex);
 
 #endif // __STARPU_SCHEDULER_H__