Prechádzať zdrojové kódy

sched_ctx: renaming

	   starpu_set_sched_ctx() --> starpu_task_set_context()
 	   starpu_get_sched_ctx() --> starpu_task_get_context()
Nathalie Furmento 12 rokov pred
rodič
commit
bcd88d9383

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

@@ -603,11 +603,11 @@ Return the worker collection managed by the indicated context
 TODO
 @end deftypefun
 
-@deftypefun void starpu_set_sched_ctx (unsigned *@var{sched_ctx_id})
+@deftypefun void starpu_task_set_context (unsigned *@var{sched_ctx_id})
 Set the scheduling context the subsequent tasks will be submitted to
 @end deftypefun
 
-@deftypefun unsigned starpu_get_sched_ctx (void)
+@deftypefun unsigned starpu_task_get_context (void)
 Return the scheduling context the tasks are currently submitted to
 @end deftypefun
 

+ 1 - 1
doc/chapters/perf-optimization.texi

@@ -222,7 +222,7 @@ int workerids[3] = @{1, 3, 10@};
 int id_ctx = starpu_sched_ctx_create("heft", workerids, 3, "my_ctx");
 
 /* @b{let StarPU know that the folowing tasks will be submitted to this context} */
-starpu_set_sched_ctx(id);
+starpu_task_set_context(id);
 
 /* @b{submit the task to StarPU} */
 starpu_task_submit(task);

+ 1 - 1
examples/sched_ctx_utils/sched_ctx_utils.c

@@ -93,7 +93,7 @@ void* start_bench(void *val)
 	pthread_setspecific(key, &p->id);
 
 	if(p->ctx != 0)
-		starpu_set_sched_ctx(&p->ctx);
+		starpu_task_set_context(&p->ctx);
 
 	for(i = 0; i < NSAMPLES; i++)
 		p->bench(p->size, p->nblocks);

+ 2 - 2
include/starpu_sched_ctx.h

@@ -123,9 +123,9 @@ 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_id);
+void starpu_task_set_context(unsigned *sched_ctx_id);
 
-unsigned starpu_get_sched_ctx(void);
+unsigned starpu_task_get_context(void);
 
 void starpu_notify_hypervisor_exists(void);
 

+ 1 - 1
sched_ctx_hypervisor/examples/app_driven_test/app_driven_test.c

@@ -48,7 +48,7 @@ int tag = 1;
 void* start_thread(void *arg)
 {
 	unsigned sched_ctx = *((unsigned*)arg);
-	starpu_set_sched_ctx(&sched_ctx);
+	starpu_task_set_context(&sched_ctx);
 
 	struct starpu_task *task[10];
 	struct params params[10];

+ 1 - 1
sched_ctx_hypervisor/examples/sched_ctx_utils/sched_ctx_utils.c

@@ -97,7 +97,7 @@ void* start_bench(void *val)
 	pthread_setspecific(key, &p->id);
 
 	if(p->ctx != 0)
-		starpu_set_sched_ctx(&p->ctx);
+		starpu_task_set_context(&p->ctx);
 
 	for(i = 0; i < NSAMPLES; i++)
 		p->bench(p->mat[i], p->size, p->nblocks);

+ 2 - 2
src/core/sched_ctx.c

@@ -691,12 +691,12 @@ void _starpu_increment_nsubmitted_tasks_of_sched_ctx(unsigned sched_ctx_id)
 	_starpu_barrier_counter_increment(&sched_ctx->tasks_barrier);
 }
 
-void starpu_set_sched_ctx(unsigned *sched_ctx)
+void starpu_task_set_context(unsigned *sched_ctx)
 {
 	pthread_setspecific(sched_ctx_key, (void*)sched_ctx);
 }
 
-unsigned starpu_get_sched_ctx()
+unsigned starpu_task_get_context()
 {
 	unsigned *sched_ctx = (unsigned*)pthread_getspecific(sched_ctx_key);
 	if(sched_ctx == NULL)

+ 2 - 2
src/core/task.c

@@ -367,7 +367,7 @@ int starpu_task_submit(struct starpu_task *task)
 	unsigned set_sched_ctx = STARPU_NMAX_SCHED_CTXS;
 
 	if(task->sched_ctx == 0 && nsched_ctxs != 1 && !task->control_task)
-		set_sched_ctx = starpu_get_sched_ctx();
+		set_sched_ctx = starpu_task_get_context();
 	if(set_sched_ctx != STARPU_NMAX_SCHED_CTXS)
 		task->sched_ctx = set_sched_ctx;
 
@@ -643,7 +643,7 @@ void starpu_display_codelet_stats(struct starpu_codelet *cl)
 int starpu_task_wait_for_all(void)
 {
 	unsigned nsched_ctxs = _starpu_get_nsched_ctxs();
-	unsigned sched_ctx = nsched_ctxs == 1 ? 0 : starpu_get_sched_ctx();
+	unsigned sched_ctx = nsched_ctxs == 1 ? 0 : starpu_task_get_context();
 
 	/* if there is no indication about which context to wait,
 	   we wait for all tasks submitted to starpu */

+ 3 - 3
src/sched_policies/detect_combined_workers.c

@@ -125,7 +125,7 @@ static void find_and_assign_combinations(hwloc_obj_t obj, unsigned synthesize_ar
 	if (nworkers > 1)
 	{
 		_STARPU_DEBUG("Adding it\n");
-		unsigned sched_ctx_id  = starpu_get_sched_ctx();
+		unsigned sched_ctx_id  = starpu_task_get_context();
 		if(sched_ctx_id == STARPU_NMAX_SCHED_CTXS)
 			sched_ctx_id = 0;
 
@@ -178,7 +178,7 @@ static void find_and_assign_combinations_with_hwloc(int *workerids, int nworkers
 
 static void find_and_assign_combinations_without_hwloc(int *workerids, int nworkers)
 {
-	unsigned sched_ctx_id  = starpu_get_sched_ctx();
+	unsigned sched_ctx_id  = starpu_task_get_context();
 	if(sched_ctx_id == STARPU_NMAX_SCHED_CTXS)
 		sched_ctx_id = 0;
 
@@ -225,7 +225,7 @@ static void find_and_assign_combinations_without_hwloc(int *workerids, int nwork
 
 static void combine_all_cpu_workers(int *workerids, int nworkers)
 {
-	unsigned sched_ctx_id  = starpu_get_sched_ctx();
+	unsigned sched_ctx_id  = starpu_task_get_context();
 	if(sched_ctx_id == STARPU_NMAX_SCHED_CTXS)
 		sched_ctx_id = 0;
 	struct starpu_sched_ctx_worker_collection* workers = starpu_sched_ctx_get_worker_collection(sched_ctx_id);