Open MPI logo

Portable Hardware Locality (hwloc) Documentation: v1.5.2

  |   Home   |   Support   |   FAQ   |  
Tinker With Topologies.

Enumerations

enum  hwloc_restrict_flags_e { HWLOC_RESTRICT_FLAG_ADAPT_DISTANCES, HWLOC_RESTRICT_FLAG_ADAPT_MISC, HWLOC_RESTRICT_FLAG_ADAPT_IO }
 

Functions

int hwloc_topology_export_xml (hwloc_topology_t topology, const char *xmlpath)
 
int hwloc_topology_export_xmlbuffer (hwloc_topology_t topology, char **xmlbuffer, int *buflen)
 
void hwloc_free_xmlbuffer (hwloc_topology_t topology, char *xmlbuffer)
 
hwloc_obj_t hwloc_topology_insert_misc_object_by_cpuset (hwloc_topology_t topology, hwloc_const_cpuset_t cpuset, const char *name)
 
hwloc_obj_t hwloc_topology_insert_misc_object_by_parent (hwloc_topology_t topology, hwloc_obj_t parent, const char *name)
 
int hwloc_topology_restrict (hwloc_topology_t restrict topology, hwloc_const_cpuset_t cpuset, unsigned long flags)
 

Detailed Description

Enumeration Type Documentation

Flags to be given to hwloc_topology_restrict().

Enumerator
HWLOC_RESTRICT_FLAG_ADAPT_DISTANCES 

Adapt distance matrices according to objects being removed during restriction. If this flag is not set, distance matrices are removed.

HWLOC_RESTRICT_FLAG_ADAPT_MISC 

Move Misc objects to ancestors if their parents are removed during restriction. If this flag is not set, Misc objects are removed when their parents are removed.

HWLOC_RESTRICT_FLAG_ADAPT_IO 

Move I/O objects to ancestors if their parents are removed during restriction. If this flag is not set, I/O devices and bridges are removed when their parents are removed.

Function Documentation

void hwloc_free_xmlbuffer ( hwloc_topology_t  topology,
char *  xmlbuffer 
)

Free a buffer allocated by hwloc_topology_export_xmlbuffer()

int hwloc_topology_export_xml ( hwloc_topology_t  topology,
const char *  xmlpath 
)

Export the topology into an XML file.

This file may be loaded later through hwloc_topology_set_xml().

Returns
-1 if a failure occured.
Note
Only printable characters may be exported to XML string attributes. Any other character, especially any non-ASCII character, will be silently dropped.
int hwloc_topology_export_xmlbuffer ( hwloc_topology_t  topology,
char **  xmlbuffer,
int *  buflen 
)

Export the topology into a newly-allocated XML memory buffer.

xmlbuffer is allocated by the callee and should be freed with hwloc_free_xmlbuffer() later in the caller.

This memory buffer may be loaded later through hwloc_topology_set_xmlbuffer().

Returns
-1 if a failure occured.
Note
Only printable characters may be exported to XML string attributes. Any other character, especially any non-ASCII character, will be silently dropped.
hwloc_obj_t hwloc_topology_insert_misc_object_by_cpuset ( hwloc_topology_t  topology,
hwloc_const_cpuset_t  cpuset,
const char *  name 
)

Add a MISC object to the topology.

A new MISC object will be created and inserted into the topology at the position given by bitmap cpuset. This offers a way to add new intermediate levels to the topology hierarchy.

cpuset and name will be copied to setup the new object attributes.

Returns
the newly-created object.
NULL if the insertion conflicts with the existing topology tree.
Note
If name contains some non-printable characters, they will be dropped when exporting to XML, see hwloc_topology_export_xml().
hwloc_obj_t hwloc_topology_insert_misc_object_by_parent ( hwloc_topology_t  topology,
hwloc_obj_t  parent,
const char *  name 
)

Add a MISC object as a leaf of the topology.

A new MISC object will be created and inserted into the topology at the position given by parent. It is appended to the list of existing children, without ever adding any intermediate hierarchy level. This is useful for annotating the topology without actually changing the hierarchy.

name will be copied to the setup the new object attributes. However, the new leaf object will not have any cpuset.

Returns
the newly-created object
Note
If name contains some non-printable characters, they will be dropped when exporting to XML, see hwloc_topology_export_xml().
int hwloc_topology_restrict ( hwloc_topology_t restrict  topology,
hwloc_const_cpuset_t  cpuset,
unsigned long  flags 
)

Restrict the topology to the given CPU set.

Topology topology is modified so as to remove all objects that are not included (or partially included) in the CPU set cpuset. All objects CPU and node sets are restricted accordingly.

flags is a OR'ed set of hwloc_restrict_flags_e.

Note
This call may not be reverted by restricting back to a larger cpuset. Once dropped during restriction, objects may not be brought back, except by reloading the entire topology with hwloc_topology_load().