Quellcode durchsuchen

sched_ctx: use sched_ctx_id everywhere

Nathalie Furmento vor 12 Jahren
Ursprung
Commit
e3539ccede

+ 5 - 5
doc/chapters/advanced-api.texi

@@ -546,11 +546,11 @@ The return value represents the identifier of the context that has just been cre
 Delete scheduling context @var{sched_ctx_id} and lets scheduling context @var{inheritor_sched_ctx_id} take over its workers.
 @end deftypefun
 
-@deftypefun void starpu_sched_ctx_add_workers ({int *}@var{workerids_ctx}, int @var{nworkers_ctx}, unsigned @var{sched_ctx})
+@deftypefun void starpu_sched_ctx_add_workers ({int *}@var{workerids_ctx}, int @var{nworkers_ctx}, unsigned @var{sched_ctx_id})
 This function adds dynamically the workers indicated in the first argument to the context indicated in the last argument. The last argument cannot be greater than  @code{STARPU_NMAX_SCHED_CTXS}.
 @end deftypefun
 
-@deftypefun void starpu_sched_ctx_remove_workers ({int *}@var{workerids_ctx}, int @var{nworkers_ctx}, unsigned @var{sched_ctx})
+@deftypefun void starpu_sched_ctx_remove_workers ({int *}@var{workerids_ctx}, int @var{nworkers_ctx}, unsigned @var{sched_ctx_id})
 This function removes the workers indicated in the first argument from the context indicated in the last argument. The last argument cannot be greater than  @code{STARPU_NMAX_SCHED_CTXS}.
 @end deftypefun
 
@@ -602,7 +602,7 @@ Returns the worker collection managed by the indicated context
 @deftypefun pthread_mutex_t* starpu_get_changing_ctx_mutex (unsigned @var{sched_ctx_id})
 @end deftypefun
 
-@deftypefun void starpu_set_sched_ctx (unsigned *@var{sched_ctx})
+@deftypefun void starpu_set_sched_ctx (unsigned *@var{sched_ctx_id})
 Sets the scheduling context the task will be submitted to
 @end deftypefun
 
@@ -610,7 +610,7 @@ Sets the scheduling context the task will be submitted to
 Returns the scheduling contexts the tasks are currently submitted to
 @end deftypefun
 
-@deftypefun unsigned starpu_sched_ctx_get_nworkers (unsigned @var{sched_ctx})
+@deftypefun unsigned starpu_sched_ctx_get_nworkers (unsigned @var{sched_ctx_id})
 Returns the number of workers managed by the specified contexts
 (Usually needed to verify if it manages any workers or if it should be blocked)
 @end deftypefun
@@ -722,7 +722,7 @@ Each scheduling policy uses some specific data (queues, variables, additional co
 It is memorize through a local structure. This function assigns it to a scheduling context.
 @end deftypefun
 
-@deftypefun void* starpu_sched_ctx_get_policy_data (unsigned @var{sched_ctx})
+@deftypefun void* starpu_sched_ctx_get_policy_data (unsigned @var{sched_ctx_id})
 Returns the policy data previously assigned to a context
 @end deftypefun
 

+ 10 - 10
doc/chapters/sched_ctx_hypervisor.texi

@@ -215,16 +215,16 @@ The Scheduling Context Hypervisor Plugin provides a series of performance counte
 @anchor{struct starpu_performance_counters}
 
 @table @asis
-@item @code{void (*notify_idle_cycle)(unsigned sched_ctx, int worker, double idle_time)}
+@item @code{void (*notify_idle_cycle)(unsigned sched_ctx_id, int worker, double idle_time)}
 Informs the hypervisor for how long a worker has been idle in the specified context
-@item @code{void (*notify_idle_end)(unsigned sched_ctx, int worker)}
+@item @code{void (*notify_idle_end)(unsigned sched_ctx_id, int worker)}
 Informs the hypervisor that after a period of idle, the worker has just executed a task in the specified context.
 The idle counter it though reset.
-@item @code{void (*notify_pushed_task)(unsigned sched_ctx, int worker)}
+@item @code{void (*notify_pushed_task)(unsigned sched_ctx_id, int worker)}
 Notifies the hypervisor a task has been scheduled on the queue of the worker corresponding to the specified context
-@item @code{void (*notify_poped_task)(unsigned sched_ctx, int worker, double flops)}
+@item @code{void (*notify_poped_task)(unsigned sched_ctx_id, int worker, double flops)}
 Informs the hypervisor a task executing a specified number of instructions has been poped from the worker
-@item @code{void (*notify_post_exec_hook)(unsigned sched_ctx, int taskid)}
+@item @code{void (*notify_post_exec_hook)(unsigned sched_ctx_id, int taskid)}
 Notifies the hypervisor a task has just been executed
 
 @end table
@@ -256,15 +256,15 @@ This structure contains all the methods that implement a hypervisor resizing pol
 Indicates the name of the policy, if there is not a custom policy, the policy corresponding to this name will be used by the hypervisor
 @item @code{unsigned custom}
 Indicates whether the policy is custom or not
-@item @code{void (*handle_idle_cycle)(unsigned sched_ctx, int worker)}
+@item @code{void (*handle_idle_cycle)(unsigned sched_ctx_id, int worker)}
 It is called whenever the indicated worker executes another idle cycle in @code{sched_ctx}
-@item @code{void (*handle_pushed_task)(unsigned sched_ctx, int worker)}
+@item @code{void (*handle_pushed_task)(unsigned sched_ctx_id, int worker)}
 It is called whenever a task is pushed on the worker's queue corresponding to the context @code{sched_ctx}
-@item @code{void (*handle_poped_task)(unsigned sched_ctx, int worker)}
+@item @code{void (*handle_poped_task)(unsigned sched_ctx_id, int worker)}
 It is called whenever a task is poped from the worker's queue corresponding to the context @code{sched_ctx}
-@item @code{void (*handle_idle_end)(unsigned sched_ctx, int worker)}
+@item @code{void (*handle_idle_end)(unsigned sched_ctx_id, int worker)}
 It is called whenever a task is executed on the indicated worker and context after a long period of idle time
-@item @code{void (*handle_post_exec_hook)(unsigned sched_ctx, struct starpu_htbl32_node* resize_requests, int task_tag)}
+@item @code{void (*handle_post_exec_hook)(unsigned sched_ctx_id, struct starpu_htbl32_node* resize_requests, int task_tag)}
 It is called whenever a tag task has just been executed. The table of resize requests is provided as well as the tag
 @end table
 @end deftp

+ 11 - 11
include/starpu_sched_ctx.h

@@ -62,11 +62,11 @@ struct starpu_sched_ctx_worker_collection
 
 struct starpu_performance_counters
 {
-	void (*notify_idle_cycle)(unsigned sched_ctx, int worker, double idle_time);
-	void (*notify_idle_end)(unsigned sched_ctx, int worker);
-	void (*notify_pushed_task)(unsigned sched_ctx, int worker);
-	void (*notify_poped_task)(unsigned sched_ctx, int worker, double flops);
-	void (*notify_post_exec_hook)(unsigned sched_ctx, int taskid);
+	void (*notify_idle_cycle)(unsigned sched_ctx_id, int worker, double idle_time);
+	void (*notify_idle_end)(unsigned sched_ctx_id, int worker);
+	void (*notify_pushed_task)(unsigned sched_ctx_id, int worker);
+	void (*notify_poped_task)(unsigned sched_ctx_id, int worker, double flops);
+	void (*notify_post_exec_hook)(unsigned sched_ctx_id, int taskid);
 	void (*notify_submitted_job)(struct starpu_task *task, uint32_t footprint);
 };
 
@@ -84,13 +84,13 @@ unsigned starpu_sched_ctx_create_inside_interval(const char *policy_name, const
 
 void starpu_sched_ctx_delete(unsigned sched_ctx_id, unsigned inheritor_sched_ctx_id);
 
-void starpu_sched_ctx_add_workers(int *workerids_ctx, int nworkers_ctx, unsigned sched_ctx);
+void starpu_sched_ctx_add_workers(int *workerids_ctx, int nworkers_ctx, unsigned sched_ctx_id);
 
-void starpu_sched_ctx_remove_workers(int *workerids_ctx, int nworkers_ctx, unsigned sched_ctx);
+void starpu_sched_ctx_remove_workers(int *workerids_ctx, int nworkers_ctx, unsigned sched_ctx_id);
 
 void starpu_sched_ctx_set_policy_data(unsigned sched_ctx_id, void *policy_data);
 
-void* starpu_sched_ctx_get_policy_data(unsigned sched_ctx);
+void* starpu_sched_ctx_get_policy_data(unsigned sched_ctx_id);
 
 /* 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
@@ -123,7 +123,7 @@ struct starpu_sched_ctx_worker_collection* starpu_sched_ctx_get_worker_collectio
 pthread_mutex_t* starpu_get_changing_ctx_mutex(unsigned sched_ctx_id);
 #endif
 
-void starpu_set_sched_ctx(unsigned *sched_ctx);
+void starpu_set_sched_ctx(unsigned *sched_ctx_id);
 
 unsigned starpu_get_sched_ctx(void);
 
@@ -131,7 +131,7 @@ void starpu_notify_hypervisor_exists(void);
 
 unsigned starpu_check_if_hypervisor_exists(void);
 
-unsigned starpu_sched_ctx_get_nworkers(unsigned sched_ctx);
+unsigned starpu_sched_ctx_get_nworkers(unsigned sched_ctx_id);
 
 unsigned starpu_sched_ctx_get_nshared_workers(unsigned sched_ctx_id, unsigned sched_ctx_id2);
 
@@ -147,7 +147,7 @@ double starpu_get_max_time_worker_on_ctx(void);
 
 void starpu_stop_task_submission(void);
 
-void starpu_sched_ctx_set_inheritor(unsigned sched_ctx, unsigned inheritor);
+void starpu_sched_ctx_set_inheritor(unsigned sched_ctx_id, unsigned inheritor);
 
 void starpu_sched_ctx_finished_submit(unsigned sched_ctx_id);
 

+ 2 - 2
include/starpu_scheduler.h

@@ -91,13 +91,13 @@ struct starpu_sched_policy
 
 	/* 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)(unsigned sched_ctx);
+	struct starpu_task *(*pop_task)(unsigned sched_ctx_id);
 
 	 /* 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. */
-	struct starpu_task *(*pop_every_task)(unsigned sched_ctx);
+	struct starpu_task *(*pop_every_task)(unsigned sched_ctx_id);
 
 	/* This method is called every time a task is starting. (optional) */
 	void (*pre_exec_hook)(struct starpu_task *);