Provided by: libhwloc-doc_2.11.0-2_all

**NAME**

hwlocality_creation - Topology Creation and Destruction

**SYNOPSIS**

Typedefstypedef struct hwloc_topology *hwloc_topology_tFunctionsinthwloc_topology_init(hwloc_topology_t*topologyp) inthwloc_topology_load(hwloc_topology_ttopology) voidhwloc_topology_destroy(hwloc_topology_ttopology) inthwloc_topology_dup(hwloc_topology_t*newtopology,hwloc_topology_toldtopology) inthwloc_topology_abi_check(hwloc_topology_ttopology) voidhwloc_topology_check(hwloc_topology_ttopology)

**Detailed** **Description**

**Typedef** **Documentation**

typedefstructhwloc_topology*hwloc_topology_tTopology context. To be initialized withhwloc_topology_init()and built withhwloc_topology_load().

**Function** **Documentation**

inthwloc_topology_abi_check(hwloc_topology_ttopology)Verify that the topology is compatible with the current hwloc library. This is useful when using the same topology structure (in memory) in different libraries that may use different hwloc installations (for instance if one library embeds a specific version of hwloc, while another library uses a default system-wide hwloc installation). If all libraries/programs use the same hwloc installation, this function always returns success.Returns0 on success. -1 with errno set to EINVAL if incompatible.NoteIf sharing between processes withhwloc_shmem_topology_write(), the relevant check is already performed insidehwloc_shmem_topology_adopt().voidhwloc_topology_check(hwloc_topology_ttopology)Run internal checks on a topology structure. The program aborts if an inconsistency is detected in the given topology.Parameterstopologyis the topology to be checkedNoteThis routine is only useful to developers. The input topology should have been previously loaded withhwloc_topology_load().voidhwloc_topology_destroy(hwloc_topology_ttopology)Terminate and free a topology context.Parameterstopologyis the topology to be freedinthwloc_topology_dup(hwloc_topology_t*newtopology,hwloc_topology_toldtopology)Duplicate a topology. The entire topology structure as well as its objects are duplicated into a new one. This is useful for keeping a backup while modifying a topology.Returns0 on success, -1 on error.NoteObject userdata is not duplicated since hwloc does not know what it point to. The objects of both old and new topologies will point to the same userdata.inthwloc_topology_init(hwloc_topology_t*topologyp)Allocate a topology context.Parameterstopologypis assigned a pointer to the new allocated context.Returns0 on success, -1 on error.inthwloc_topology_load(hwloc_topology_ttopology)Build the actual topology. Build the actual topology once initialized withhwloc_topology_init()and tuned withTopologyDetectionConfigurationandQueryandChangingtheSourceofTopologyDiscoveryroutines. No other routine may be called earlier using this topology context.Parameterstopologyis the topology to be loaded with objects.Returns0 on success, -1 on error.NoteOn failure, the topology is reinitialized. It should be either destroyed withhwloc_topology_destroy()or configured and loaded again. This function may be called only once per topology. The binding of the current thread or process may temporarily change during this call but it will be restored before it returns.SeealsoTopologyDetectionConfigurationandQueryandChangingtheSourceofTopologyDiscovery

**Author**

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