|
@@ -1291,16 +1291,17 @@ _starpu_init_workers_binding (struct _starpu_machine_config *config, int no_mp_c
|
|
#ifdef STARPU_HAVE_HWLOC
|
|
#ifdef STARPU_HAVE_HWLOC
|
|
/* Put the worker descriptor in the userdata field of the
|
|
/* Put the worker descriptor in the userdata field of the
|
|
* hwloc object describing the CPU */
|
|
* hwloc object describing the CPU */
|
|
- hwloc_obj_t worker_obj;
|
|
|
|
- worker_obj =
|
|
|
|
- hwloc_get_obj_by_depth (config->topology.hwtopology,
|
|
|
|
- config->cpu_depth,
|
|
|
|
- workerarg->bindid);
|
|
|
|
- worker_obj->userdata = &config->workers[worker];
|
|
|
|
|
|
+ hwloc_obj_t worker_obj = hwloc_get_obj_by_depth(config->topology.hwtopology,
|
|
|
|
+ config->cpu_depth,
|
|
|
|
+ workerarg->bindid);
|
|
|
|
+ if (worker_obj->userdata == NULL)
|
|
|
|
+ {
|
|
|
|
+ worker_obj->userdata = _starpu_worker_list_new();
|
|
|
|
+ }
|
|
|
|
+ _starpu_worker_list_push_front(worker_obj->userdata, workerarg);
|
|
|
|
|
|
/* Clear the cpu set and set the cpu */
|
|
/* Clear the cpu set and set the cpu */
|
|
- workerarg->hwloc_cpu_set =
|
|
|
|
- hwloc_bitmap_dup (worker_obj->cpuset);
|
|
|
|
|
|
+ workerarg->hwloc_cpu_set = hwloc_bitmap_dup (worker_obj->cpuset);
|
|
#endif
|
|
#endif
|
|
}
|
|
}
|
|
#ifdef STARPU_SIMGRID
|
|
#ifdef STARPU_SIMGRID
|
|
@@ -1388,6 +1389,13 @@ _starpu_destroy_topology (
|
|
#ifdef STARPU_HAVE_HWLOC
|
|
#ifdef STARPU_HAVE_HWLOC
|
|
struct _starpu_worker *workerarg = &config->workers[worker];
|
|
struct _starpu_worker *workerarg = &config->workers[worker];
|
|
hwloc_bitmap_free(workerarg->hwloc_cpu_set);
|
|
hwloc_bitmap_free(workerarg->hwloc_cpu_set);
|
|
|
|
+ hwloc_obj_t worker_obj = hwloc_get_obj_by_depth(config->topology.hwtopology,
|
|
|
|
+ config->cpu_depth,
|
|
|
|
+ workerarg->bindid);
|
|
|
|
+ if (worker_obj->userdata)
|
|
|
|
+ {
|
|
|
|
+ _starpu_worker_list_delete(worker_obj->userdata);
|
|
|
|
+ }
|
|
#endif
|
|
#endif
|
|
}
|
|
}
|
|
|
|
|