Ver código fonte

bindid fixes

Andra Hugo 11 anos atrás
pai
commit
2e4399f771

+ 1 - 0
include/starpu_worker.h

@@ -84,6 +84,7 @@ unsigned starpu_scc_worker_get_count(void);
 unsigned starpu_mic_device_get_count(void);
 
 int starpu_worker_get_id(void);
+int starpu_worker_get_bindid(int workerid);
 
 int starpu_combined_worker_get_id(void);
 int starpu_combined_worker_get_size(void);

+ 2 - 2
src/core/workers.c

@@ -1342,7 +1342,7 @@ void starpu_shutdown(void)
 	if (_starpu_scc_common_is_mp_initialized())
 		_starpu_scc_src_mp_deinit();
 #endif
-//	_starpu_print_idle_time();
+	_starpu_print_idle_time();
 	_STARPU_DEBUG("Shutdown finished\n");
 }
 
@@ -1608,7 +1608,7 @@ void starpu_worker_get_name(int id, char *dst, size_t maxlen)
 	snprintf(dst, maxlen, "%s", name);
 }
 
-int _starpu_worker_get_bindid(int workerid)
+int starpu_worker_get_bindid(int workerid)
 {
 	return config.workers[workerid].bindid;
 }

+ 0 - 3
src/core/workers.h

@@ -410,9 +410,6 @@ int starpu_worker_get_nids_by_type(enum starpu_worker_archtype type, int *worker
    the list might not be updated */
 int starpu_worker_get_nids_ctx_free_by_type(enum starpu_worker_archtype type, int *workerids, int maxsize);
 
-/* get the os physical id of the worker */
-int _starpu_worker_get_bindid(int workerid);
-
 /* geet starpu workerid corresponding to the os physical id bindid */
 int _starpu_worker_get_workerid(int bindid);
 

+ 4 - 0
src/sched_policies/eager_central_policy.c

@@ -35,7 +35,11 @@ struct _starpu_eager_center_policy_data
 
 static void initialize_eager_center_policy(unsigned sched_ctx_id)
 {
+#ifdef STARPU_HAVE_HWLOC
+	starpu_sched_ctx_create_worker_collection(sched_ctx_id, STARPU_WORKER_TREE);
+#else
 	starpu_sched_ctx_create_worker_collection(sched_ctx_id, STARPU_WORKER_LIST);
+#endif
 
 	struct _starpu_eager_center_policy_data *data = (struct _starpu_eager_center_policy_data*)malloc(sizeof(struct _starpu_eager_center_policy_data));
 

+ 6 - 4
src/worker_collection/worker_tree.c

@@ -73,9 +73,10 @@ static int tree_add(struct starpu_worker_collection *workers, int worker)
 {
 	struct starpu_tree *tree = (struct starpu_tree *)workers->workerids;
 
-	if(!workers->present[worker])
+	int bindid = starpu_worker_get_bindid(worker);
+	if(!workers->present[bindid])
 	{
-		workers->present[worker] = 1;
+		workers->present[bindid] = 1;
 		workers->nworkers++;
 		return worker;
 	}
@@ -88,9 +89,10 @@ static int tree_remove(struct starpu_worker_collection *workers, int worker)
 {
 	struct starpu_tree *tree = (struct starpu_tree *)workers->workerids;
 
-	if(workers->present[worker])
+	int bindid = starpu_worker_get_bindid(worker);
+	if(workers->present[bindid])
 	{
-		workers->present[worker] = 0;
+		workers->present[bindid] = 0;
 		workers->nworkers--;
 		return worker;
 	}