Przeglądaj źródła

indicate workers sharing tasks lists for all the concerned schedulers

Andra Hugo 12 lat temu
rodzic
commit
dc4e81b588

+ 13 - 0
src/sched_policies/eager_central_priority_policy.c

@@ -239,8 +239,21 @@ static struct starpu_task *_starpu_priority_pop_task(unsigned sched_ctx_id)
 	return chosen_task;
 }
 
+static void eager_center_priority_add_workers(unsigned sched_ctx_id, int *workerids, unsigned nworkers)
+{
+
+        int workerid;
+	unsigned i;
+        for (i = 0; i < nworkers; i++)
+        {
+		workerid = workerids[i];
+                starpu_sched_ctx_worker_shares_tasks_lists(workerid, sched_ctx_id);
+        }
+}
+
 struct starpu_sched_policy _starpu_sched_prio_policy =
 {
+	.add_workers = eager_center_priority_add_workers,
 	.init_sched = initialize_eager_center_priority_policy,
 	.deinit_sched = deinitialize_eager_center_priority_policy,
 	/* we always use priorities in that policy */

+ 1 - 1
src/sched_policies/parallel_eager.c

@@ -58,7 +58,7 @@ static void peager_add_workers(unsigned sched_ctx_id, int *workerids, unsigned n
 	for(i = 0; i < nworkers; i++)
 	{
 		workerid = workerids[i];
-
+		starpu_sched_ctx_worker_shares_tasks_lists(workerid, sched_ctx_id);
 		int cnt = possible_combinations_cnt[workerid]++;
 		possible_combinations[workerid][cnt] = workerid;
 		possible_combinations_size[workerid][cnt] = 1;

+ 1 - 0
src/sched_policies/work_stealing_policy.c

@@ -400,6 +400,7 @@ static void ws_add_workers(unsigned sched_ctx_id, int *workerids,unsigned nworke
 	for (i = 0; i < nworkers; i++)
 	{
 		workerid = workerids[i];
+		starpu_sched_ctx_worker_shares_tasks_lists(workerid, sched_ctx_id);
 		ws->queue_array[workerid] = _starpu_create_deque();
 		/**
 		 * The first WS_POP_TASK will increase NPROCESSED though no task was actually performed yet,