diff --git a/common/isched_hwloc.c b/common/isched_hwloc.c
index 645e1c7cef81aa55c09bf8c9907bed86ff1dd8f9..9a002913a3bff9df8428e19fc31ae1bc26bae88f 100644
--- a/common/isched_hwloc.c
+++ b/common/isched_hwloc.c
@@ -227,9 +227,10 @@ int isched_hwloc_numa_id(int core_id )
     }
 }
 
-unsigned int isched_hwloc_nb_cores_per_obj( int level, int index )
+unsigned int isched_hwloc_nb_cores_per_obj( hwloc_obj_type_t type, int index )
 {
-    hwloc_obj_t obj = hwloc_get_obj_by_depth(topology, level, index);
+    hwloc_obj_t obj = hwloc_get_obj_by_type(topology, type, index);
+    fprintf(stderr, "TYPE: %s %d\n", hwloc_obj_type_string( obj->type ), obj->depth );
     assert( obj != NULL );
     return hwloc_get_nbobjs_inside_cpuset_by_type(topology, obj->cpuset, HWLOC_OBJ_CORE);
 }
diff --git a/common/isched_hwloc.h b/common/isched_hwloc.h
index 71bcca2b972bd7cb34578c2ad7cd00adaef8394f..cf59b88af8f2b35fe9badd4921bdf8c623a17a02 100644
--- a/common/isched_hwloc.h
+++ b/common/isched_hwloc.h
@@ -124,7 +124,7 @@ int isched_hwloc_get_nb_objects(int level);
  * Find the number of core under the object number index at the topology depth
  * level.
  */
-unsigned int isched_hwloc_nb_cores_per_obj( int level, int index );
+unsigned int isched_hwloc_nb_cores_per_obj( hwloc_obj_type_t level, int index );
 
 /**
  * Return the number of thread on the machine.