浏览代码

rename starpu_init_parallel_task_barrier to starpu_parallel_task_barrier_init and document it

Nathalie Furmento 12 年之前
父节点
当前提交
f6e82c3561

+ 5 - 0
doc/chapters/api.texi

@@ -3692,6 +3692,11 @@ Get the description of a combined worker
 Variant of starpu_worker_can_execute_task compatible with combined workers
 @end deftypefun
 
+@deftypefun void starpu_parallel_task_barrier_init ({struct starpu_task* }@var{task}, int @var{best_workerid})
+Initialise the barrier for the parallel task, and dispatch the task
+between the different combined workers
+@end deftypefun
+
 @deftp {Data Type} {struct starpu_machine_topology}
 @table @asis
 @item @code{unsigned nworkers}

+ 1 - 1
include/starpu_task.h

@@ -355,7 +355,7 @@ struct starpu_task *starpu_task_get_current(void);
 
 /* initialise the barrier for the parallel task, st all workers start it 
  * at the same time */
-void starpu_init_parallel_task_barrier(struct starpu_task* task, int best_workerid);
+void starpu_parallel_task_barrier_init(struct starpu_task* task, int workerid);
 
 /* create task alias to dispatch it to the workers of a combined workers */
 struct starpu_task *starpu_create_task_alias(struct starpu_task *task);

+ 6 - 6
src/core/parallel_task.c

@@ -34,20 +34,20 @@ struct starpu_task *starpu_create_task_alias(struct starpu_task *task)
 	return task_dup;
 }
 
-void starpu_init_parallel_task_barrier(struct starpu_task* task, int best_workerid)
+void starpu_parallel_task_barrier_init(struct starpu_task* task, int workerid)
 {
 	/* The master needs to dispatch the task between the
 	 * different combined workers */
-	struct _starpu_combined_worker *combined_worker =  _starpu_get_combined_worker_struct(best_workerid);
+	struct _starpu_combined_worker *combined_worker =  _starpu_get_combined_worker_struct(workerid);
 	int worker_size = combined_worker->worker_size;
-	
+
 	struct _starpu_job *j = _starpu_get_job_associated_to_task(task);
 	j->task_size = worker_size;
-	j->combined_workerid = best_workerid;
+	j->combined_workerid = workerid;
 	j->active_task_alias_count = 0;
-	
+
 	//fprintf(stderr, "POP -> size %d best_size %d\n", worker_size, best_size);
-	
+
 	_STARPU_PTHREAD_BARRIER_INIT(&j->before_work_barrier, NULL, worker_size);
 	_STARPU_PTHREAD_BARRIER_INIT(&j->after_work_barrier, NULL, worker_size);
 

+ 1 - 1
src/sched_policies/parallel_eager.c

@@ -257,7 +257,7 @@ static struct starpu_task *pop_task_peager_policy(unsigned sched_ctx_id)
 		}
 		else
 		{
-			starpu_init_parallel_task_barrier(task, best_workerid);
+			starpu_parallel_task_barrier_init(task, best_workerid);
 			int worker_size = 0;
 			int *combined_workerid;
 			starpu_combined_worker_get_description(best_workerid, &worker_size, &combined_workerid);

+ 1 - 1
src/sched_policies/parallel_heft.c

@@ -140,7 +140,7 @@ static int push_task_on_best_worker(struct starpu_task *task, int best_workerid,
 		task->predicted = 0;
 		task->predicted_transfer = 0;
 
-		starpu_init_parallel_task_barrier(task, best_workerid);
+		starpu_parallel_task_barrier_init(task, best_workerid);
 		int worker_size = 0;
 		int *combined_workerid;
 		starpu_combined_worker_get_description(best_workerid, &worker_size, &combined_workerid);