Add more structure to the topology by adding an intermediate Group.
The caller should first allocate a new Group object with hwloc_topology_alloc_group_object(). Then it must setup at least one of its CPU or node sets to specify the final location of the Group in the topology. Then the object can be passed to this function for actual insertion in the topology.
The group dont_merge
attribute may be set to prevent the core from ever merging this object with another object hierarchically-identical.
Either the cpuset or nodeset field (or both, if compatible) must be set to a non-empty bitmap. The complete_cpuset or complete_nodeset may be set instead if inserting with respect to the complete topology (including disallowed, offline or unknown objects).
It grouping several objects, hwloc_obj_add_other_obj_sets() is an easy way to build the Group sets iteratively.
These sets cannot be larger than the current topology, or they would get restricted silently.
The core will setup the other sets after actual insertion.
- Returns
- The inserted object if it was properly inserted.
-
An existing object if the Group was discarded because the topology already contained an object at the same location (the Group did not add any locality information). Any name/info key pair set before inserting is appended to the existing object.
-
NULL
if the insertion failed because of conflicting sets in topology tree.
-
NULL
if Group objects are filtered-out of the topology (HWLOC_TYPE_FILTER_KEEP_NONE).
-
NULL
if the object was discarded because no set was initialized in the Group before insert, or all of them were empty.