obj = hwloc_alloc_setup_object(HWLOC_OBJ_GROUP, -1);
obj->attr->group.depth = groupdepth;
+ hwloc_obj_add_info(obj, "Backend", "Custom");
hwloc_insert_object_by_parent(topology, parent, obj);
/* insert_object_by_parent() doesn't merge during insert, so obj is still valid */
hwloc_look_custom(struct hwloc_backend *backend)
{
struct hwloc_topology *topology = backend->topology;
+ hwloc_obj_t root = topology->levels[0][0];
- assert(!topology->levels[0][0]->cpuset);
+ assert(!root->cpuset);
- if (!topology->levels[0][0]->first_child) {
+ if (!root->first_child) {
errno = EINVAL;
return -1;
}
- topology->levels[0][0]->type = HWLOC_OBJ_SYSTEM;
+ root->type = HWLOC_OBJ_SYSTEM;
+ hwloc_obj_add_info(root, "Backend", "Custom");
return 1;
}
<!DOCTYPE topology SYSTEM "hwloc.dtd">
<topology>
<object type="System" os_index="0">
+ <info name="Backend" value="Custom"/>
<object type="Machine" os_index="0" cpuset="0x0000000f" complete_cpuset="0x0000000f" online_cpuset="0x0000000f" allowed_cpuset="0x0000000f" name="machine1" local_memory="4014239744">
<page_type size="4096" count="980039"/>
<page_type size="2097152" count="0"/>