Explorar o código

Fix cpuset of combined workers, they have to be physical cpusets, not logical

Samuel Thibault %!s(int64=13) %!d(string=hai) anos
pai
achega
9ba23c408f
Modificáronse 2 ficheiros con 7 adicións e 6 borrados
  1. 4 6
      src/core/topology.c
  2. 3 0
      src/drivers/cpu/driver_cpu.c

+ 4 - 6
src/core/topology.c

@@ -832,17 +832,15 @@ static void _starpu_init_workers_binding(struct _starpu_machine_config *config)
 #endif /* __GLIBC__ */
 
 #ifdef STARPU_HAVE_HWLOC
-		/* Clear the cpu set and set the cpu */
-		workerarg->initial_hwloc_cpu_set = hwloc_bitmap_alloc();
-		hwloc_bitmap_only(workerarg->initial_hwloc_cpu_set, workerarg->bindid);
-		workerarg->current_hwloc_cpu_set = hwloc_bitmap_alloc();
-		hwloc_bitmap_only(workerarg->current_hwloc_cpu_set, workerarg->bindid);
-
 		/* Put the worker descriptor in the userdata field of the 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];
+
+		/* Clear the cpu set and set the cpu */
+		workerarg->initial_hwloc_cpu_set = hwloc_bitmap_dup(worker_obj->cpuset);
+		workerarg->current_hwloc_cpu_set = hwloc_bitmap_dup(worker_obj->cpuset);
 #endif
 	}
 }

+ 3 - 0
src/drivers/cpu/driver_cpu.c

@@ -124,6 +124,9 @@ int _starpu_cpu_driver_init(struct starpu_driver *d)
 	_starpu_bind_thread_on_cpu(cpu_worker->config, cpu_worker->bindid);
 
         _STARPU_DEBUG("cpu worker %d is ready on logical cpu %d\n", devid, cpu_worker->bindid);
+#ifdef STARPU_HAVE_HWLOC
+	_STARPU_DEBUG("cpu worker %d cpuset start at %d\n", devid, hwloc_bitmap_first(cpu_worker->initial_hwloc_cpu_set));
+#endif
 
 	_starpu_set_local_memory_node_key(&cpu_worker->memory_node);