---
name: "hwlocality_custom"
section: "3"
platform: "linux"
package: "libhwloc-doc"
version: "1.11.12-3"
release: "Debian 10 (Buster)"
platforms: ["linux"]
url: "https://new.carta.tech/hwlocality_custom"
---

# hwlocality\_custom(3)

## NAME

hwlocality\_custom

## SYNOPSIS

### Functions

int **hwloc\_custom\_insert\_topology** (**hwloc\_topology\_t** newtopology, **hwloc\_obj\_t** newparent, **hwloc\_topology\_t** oldtopology, **hwloc\_obj\_t** oldroot)\
 **hwloc\_obj\_t** **hwloc\_custom\_insert\_group\_object\_by\_parent** (**hwloc\_topology\_t** topology, **hwloc\_obj\_t** parent, int groupdepth)\

## Detailed Description

A custom topology may be initialized by calling **hwloc\_topology\_set\_custom()** after **hwloc\_topology\_init()**. It may then be modified by inserting objects or entire topologies. Once done assembling, **hwloc\_topology\_load()** should be invoked as usual to finalize the topology.

## Function Documentation

### hwloc\_obj\_t hwloc\_custom\_insert\_group\_object\_by\_parent (hwloc\_topology\_t topology, hwloc\_obj\_t parent, int groupdepth)

Insert a new group object inside a custom topology. An object with type **HWLOC\_OBJ\_GROUP** is inserted as a new child of object `parent`.

`groupdepth` is the depth attribute to be given to the new object. It may for instance be 0 for top-level groups, 1 for their children, and so on.

The custom topology `newtopology` must have been prepared with **hwloc\_topology\_set\_custom()** and not loaded with **hwloc\_topology\_load()** yet.

`parent` may be either the root of `topology` or an object that was added earlier through **hwloc\_custom\_insert\_group\_object\_by\_parent()**.

**Note:**

The cpuset and nodeset of the new group object are NULL because these sets are meaningless when assembling multiple topologies.

The cpuset and nodeset of the `parent` object are not modified.

### int hwloc\_custom\_insert\_topology (hwloc\_topology\_t newtopology, hwloc\_obj\_t newparent, hwloc\_topology\_t oldtopology, hwloc\_obj\_t oldroot)

Insert an existing topology inside a custom topology. Duplicate the existing topology `oldtopology` inside a new custom topology `newtopology` as a leaf of object `newparent`.

If `oldroot` is not `NULL`, duplicate `oldroot` and all its children instead of the entire `oldtopology`. Passing the root object of `oldtopology` in `oldroot` is equivalent to passing `NULL`.

The custom topology `newtopology` must have been prepared with **hwloc\_topology\_set\_custom()** and not loaded with **hwloc\_topology\_load()** yet.

`newparent` may be either the root of `newtopology` or an object that was added through **hwloc\_custom\_insert\_group\_object\_by\_parent()**.

**Note:**

The cpuset and nodeset of the `newparent` object are not modified based on the contents of `oldtopology`.

## Author

Generated automatically by Doxygen for Hardware Locality (hwloc) from the source code.
