Sfoglia il codice sorgente

remove the functions that force a worker to pop in a certain context, for the moment no need for that we do round robin

Andra Hugo 12 anni fa
parent
commit
e4d5bcda38

+ 1 - 1
examples/sched_ctx/sched_ctx.c

@@ -57,7 +57,7 @@ int main(int argc, char **argv)
 	starpu_pthread_mutex_init(&mut, NULL);
 	int nprocs1 = 1;
 	int nprocs2 = 1;
-	int procs1[20], procs2[20];
+	int procs1[60], procs2[60];
 	procs1[0] = 0;
 	procs2[0] = 0;
 

+ 0 - 4
include/starpu_sched_ctx.h

@@ -60,10 +60,6 @@ unsigned starpu_sched_ctx_contains_type_of_worker(enum starpu_worker_archtype ar
 
 unsigned starpu_sched_ctx_overlapping_ctxs_on_worker(int workerid);
 
-unsigned starpu_sched_ctx_is_ctxs_turn(int workerid, unsigned sched_ctx_id);
-
-void starpu_sched_ctx_set_turn_to_other_ctx(int workerid, unsigned sched_ctx_id);
-
 int starpu_sched_get_min_priority(void);
 
 int starpu_sched_get_max_priority(void);

+ 0 - 32
src/core/sched_ctx.c

@@ -39,7 +39,6 @@ static void _starpu_worker_gets_into_ctx(unsigned sched_ctx_id, struct _starpu_w
 		/* add context to worker */
 		_starpu_sched_ctx_list_add(&worker->sched_ctx_list, sched_ctx_id);
 		worker->nsched_ctxs++;
-		worker->active_ctx = sched_ctx_id;
 	}
 	worker->removed_from_ctx[sched_ctx_id] = 0;
 	return;
@@ -1015,37 +1014,6 @@ unsigned starpu_sched_ctx_overlapping_ctxs_on_worker(int workerid)
 	return worker->nsched_ctxs > 1;
 }
 
-unsigned starpu_sched_ctx_is_ctxs_turn(int workerid, unsigned sched_ctx_id)
-{
-	struct _starpu_worker *worker = _starpu_get_worker_struct(workerid);
-	return worker->active_ctx == sched_ctx_id;
-}
-
-void starpu_sched_ctx_set_turn_to_other_ctx(int workerid, unsigned sched_ctx_id)
-{
-	struct _starpu_worker *worker = _starpu_get_worker_struct(workerid);
-
-	struct _starpu_sched_ctx *other_sched_ctx = NULL;
-	struct _starpu_sched_ctx *active_sched_ctx = NULL;
-	struct _starpu_sched_ctx_list *l = NULL;
-        for (l = worker->sched_ctx_list; l; l = l->next)
-	{
-		other_sched_ctx = _starpu_get_sched_ctx_struct(l->sched_ctx);
-		if(other_sched_ctx != NULL && other_sched_ctx->id != STARPU_NMAX_SCHED_CTXS &&
-		   other_sched_ctx->id != 0 && other_sched_ctx->id != sched_ctx_id)
-		{
-			worker->active_ctx = other_sched_ctx->id;
-			active_sched_ctx = other_sched_ctx;
-			break;
-		}
-	}
-
-	if(active_sched_ctx != NULL && worker->active_ctx != sched_ctx_id)
-	{
-		_starpu_fetch_tasks_from_empty_ctx_list(active_sched_ctx);
-	}
-}
-
 void starpu_sched_ctx_set_inheritor(unsigned sched_ctx_id, unsigned inheritor)
 {
 	STARPU_ASSERT(inheritor < STARPU_NMAX_SCHED_CTXS);

+ 1 - 1
src/core/sched_policy.c

@@ -302,7 +302,7 @@ static int _starpu_nworkers_able_to_execute_task(struct starpu_task *task, struc
 	while(workers->has_next(workers, &it))
 	{
 		worker = workers->get_next(workers, &it);
-		if (starpu_worker_can_execute_task(worker, task, 0) && starpu_sched_ctx_is_ctxs_turn(worker, sched_ctx->id))
+		if (starpu_worker_can_execute_task(worker, task, 0))
 			nworkers++;
 	}
 

+ 0 - 5
src/core/workers.h

@@ -90,11 +90,6 @@ struct _starpu_worker
        
 	unsigned has_prev_init; /* had already been inited in another ctx */
 
-	/* indicated in each ctx the workers can execute tasks on,
-	 used for overlapping ctx in order to determine on which 
-	ctx the worker is allowed to pop */
-	unsigned active_ctx;
-
 	unsigned removed_from_ctx[STARPU_NMAX_SCHED_CTXS];
 
 	/* conditions variables used when parallel sections are executed in contexts */