Open MPI logo

Portable Hardware Locality (hwloc) Documentation: v1.11.13

  |   Home   |   Support   |   FAQ   |  
Topology Creation and Destruction


typedef struct hwloc_topology * hwloc_topology_t


int hwloc_topology_init (hwloc_topology_t *topologyp)
int hwloc_topology_load (hwloc_topology_t topology)
void hwloc_topology_destroy (hwloc_topology_t topology)
int hwloc_topology_dup (hwloc_topology_t *newtopology, hwloc_topology_t oldtopology)
void hwloc_topology_check (hwloc_topology_t topology)

Detailed Description

Typedef Documentation

◆ hwloc_topology_t

typedef struct hwloc_topology* hwloc_topology_t

Topology context.

To be initialized with hwloc_topology_init() and built with hwloc_topology_load().

Function Documentation

◆ hwloc_topology_check()

void hwloc_topology_check ( hwloc_topology_t  topology)

Run internal checks on a topology structure.

The program aborts if an inconsistency is detected in the given topology.

topologyis the topology to be checked
This routine is only useful to developers.
The input topology should have been previously loaded with hwloc_topology_load().

◆ hwloc_topology_destroy()

void hwloc_topology_destroy ( hwloc_topology_t  topology)

Terminate and free a topology context.

topologyis the topology to be freed

◆ hwloc_topology_dup()

int hwloc_topology_dup ( hwloc_topology_t newtopology,
hwloc_topology_t  oldtopology 

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.

Object 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.

◆ hwloc_topology_init()

int hwloc_topology_init ( hwloc_topology_t topologyp)

Allocate a topology context.

[out]topologypis assigned a pointer to the new allocated context.
0 on success, -1 on error.

◆ hwloc_topology_load()

int hwloc_topology_load ( hwloc_topology_t  topology)

Build the actual topology.

Build the actual topology once initialized with hwloc_topology_init() and tuned with Topology Detection Configuration and Query routines. No other routine may be called earlier using this topology context.

topologyis the topology to be loaded with objects.
0 on success, -1 on error.
On failure, the topology is reinitialized. It should be either destroyed with hwloc_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.
See also
Topology Detection Configuration and Query