Explorar o código

switch back to trunk/src/core/workers.c to partialy undo early initialization of combined workers
idem for src/core/jobs.c because of a bad modification

Simon Archipoff %!s(int64=12) %!d(string=hai) anos
pai
achega
a87877109c
Modificáronse 2 ficheiros con 8 adicións e 22 borrados
  1. 1 1
      src/core/jobs.c
  2. 7 21
      src/core/workers.c

+ 1 - 1
src/core/jobs.c

@@ -444,7 +444,7 @@ int _starpu_push_local_task(struct _starpu_worker *worker, struct starpu_task *t
 
 
 	STARPU_PTHREAD_MUTEX_LOCK(&worker->sched_mutex);
 	STARPU_PTHREAD_MUTEX_LOCK(&worker->sched_mutex);
 
 
-	if (prio == starpu_sched_get_max_priority())
+	if (prio)
 		starpu_task_list_push_front(&worker->local_tasks, task);
 		starpu_task_list_push_front(&worker->local_tasks, task);
 	else
 	else
 		starpu_task_list_push_back(&worker->local_tasks, task);
 		starpu_task_list_push_back(&worker->local_tasks, task);

+ 7 - 21
src/core/workers.c

@@ -956,30 +956,10 @@ int starpu_initialize(struct starpu_conf *user_conf, int *argc, char ***argv)
 	     config.conf = user_conf;
 	     config.conf = user_conf;
 	     config.default_conf = 0;
 	     config.default_conf = 0;
 	}
 	}
-	/* Depending on whether we are a MP sink or not, we must build the
-	 * topology with MP nodes or not. */
-	ret = _starpu_build_topology(&config, is_a_sink);
-	_starpu_conf_check_environment(config.conf);
-
-
-	int nworkers = starpu_worker_get_count();
-	int workerid_array[nworkers];
-	int i,j;
-	
-	for(i = j = 0; i < nworkers; i++)
-		if(STARPU_CPU_WORKER == starpu_worker_get_type(i))
-			workerid_array[j++] = i;
-	nworkers = j;
 
 
-	/* Launch "basic" workers (ie. non-combined workers) */
-	if (!is_a_sink)
-		_starpu_launch_drivers(&config);
-
-	starpu_combined_worker_assign_workerid(nworkers, workerid_array);
+	_starpu_conf_check_environment(config.conf);
 
 
 	_starpu_init_all_sched_ctxs(&config);
 	_starpu_init_all_sched_ctxs(&config);
-
-
 	_starpu_init_progression_hooks();
 	_starpu_init_progression_hooks();
 
 
 	_starpu_init_tags();
 	_starpu_init_tags();
@@ -998,6 +978,9 @@ int starpu_initialize(struct starpu_conf *user_conf, int *argc, char ***argv)
 
 
 	_starpu_load_bus_performance_files();
 	_starpu_load_bus_performance_files();
 
 
+	/* Depending on whether we are a MP sink or not, we must build the
+	 * topology with MP nodes or not. */
+	ret = _starpu_build_topology(&config, is_a_sink ? 1 : 0);
 	if (ret)
 	if (ret)
 	{
 	{
 		STARPU_PTHREAD_MUTEX_LOCK(&init_mutex);
 		STARPU_PTHREAD_MUTEX_LOCK(&init_mutex);
@@ -1022,6 +1005,9 @@ int starpu_initialize(struct starpu_conf *user_conf, int *argc, char ***argv)
 
 
 	_starpu_initialize_registered_performance_models();
 	_starpu_initialize_registered_performance_models();
 
 
+	/* Launch "basic" workers (ie. non-combined workers) */
+	if (!is_a_sink)
+		_starpu_launch_drivers(&config);
 
 
 	STARPU_PTHREAD_MUTEX_LOCK(&init_mutex);
 	STARPU_PTHREAD_MUTEX_LOCK(&init_mutex);
 	initialized = INITIALIZED;
 	initialized = INITIALIZED;