OpenMPI 0.1.1

- Main Page
- Related Pages
- Modules
- Data Structures
- Files

Functions
Object/String Conversion

## Functions
HWLOC_DECLSPEC const char * | hwloc_obj_type_string (hwloc_obj_type_t type) __hwloc_attribute_const
| Return a stringified topology object type.
HWLOC_DECLSPEC hwloc_obj_type_t | hwloc_obj_type_of_string (const char *string) __hwloc_attribute_pure
| Return an object type from the string. More...
HWLOC_DECLSPEC int | hwloc_obj_type_snprintf (char *__hwloc_restrict string, size_t size, hwloc_obj_t obj, int verbose)
| Stringify the type of a given topology object into a human-readable form. More...
HWLOC_DECLSPEC int | hwloc_obj_attr_snprintf (char *__hwloc_restrict string, size_t size, hwloc_obj_t obj, const char *__hwloc_restrict separator, int verbose)
| Stringify the attributes of a given topology object into a human-readable form. More...
HWLOC_DECLSPEC int | hwloc_obj_snprintf (char *__hwloc_restrict string, size_t size, hwloc_topology_t topology, hwloc_obj_t obj, const char *__hwloc_restrict indexprefix, int verbose)
| Stringify a given topology object into a human-readable form. More...
HWLOC_DECLSPEC int | hwloc_obj_cpuset_snprintf (char *__hwloc_restrict str, size_t size, size_t nobj, const hwloc_obj_t *__hwloc_restrict objs)
| Stringify the cpuset containing a set of objects. More...
static __hwloc_inline const char *__hwloc_attribute_pure | hwloc_obj_get_info_by_name (hwloc_obj_t obj, const char *name)
| Search the given key name in object infos and return the corresponding value. More...
HWLOC_DECLSPEC void | hwloc_obj_add_info (hwloc_obj_t obj, const char *name, const char *value)
| Add the given info name and value pair to the given object. More...

## Detailed Description

## Function Documentation

HWLOC_DECLSPEC void hwloc_obj_add_info | ( | hwloc_obj_t | obj,
|  | const char * | name,
|  | const char * | value
| ) |  |

Add the given info name and value pair to the given object.

The info is appended to the existing info array even if another key with the same name already exists.

The input strings are copied before being added in the object infos.

References hwloc_obj::infos, hwloc_obj::infos_count, hwloc_obj_info_s::name, and hwloc_obj_info_s::value.

HWLOC_DECLSPEC int hwloc_obj_attr_snprintf | ( | char *__hwloc_restrict | string,
|  | size_t | size,
|  | hwloc_obj_t | obj,
|  | const char *__hwloc_restrict | separator,
|  | int | verbose
| ) |  |

Stringify the attributes of a given topology object into a human-readable form.

Attribute values are separated by `separator`.

Only the major attributes are printed in non-verbose mode.

If `size` is 0, `string` may safely be `NULL`.

Returns
  the number of character that were actually written if not truncating, or that would have been written (not including the ending \0).

HWLOC_DECLSPEC int hwloc_obj_cpuset_snprintf | ( | char *__hwloc_restrict | str,
|  | size_t | size,
|  | size_t | nobj,
|  | const hwloc_obj_t *__hwloc_restrict | objs
| ) |  |

Stringify the cpuset containing a set of objects.

If `size` is 0, `string` may safely be `NULL`.

Returns
  the number of character that were actually written if not truncating, or that would have been written (not including the ending \0).

static __hwloc_inline const char* __hwloc_attribute_pure hwloc_obj_get_info_by_name | ( | hwloc_obj_t | obj,
|  | const char * | name
| ) |  |
| static

Search the given key name in object infos and return the corresponding value.

If multiple keys match the given name, only the first one is returned.

Returns
  `NULL` if no such key exists.

References hwloc_obj::infos, hwloc_obj::infos_count, hwloc_obj_info_s::name, and hwloc_obj_info_s::value.

HWLOC_DECLSPEC int hwloc_obj_snprintf | ( | char *__hwloc_restrict | string,
|  | size_t | size,
|  | hwloc_topology_t | topology,
|  | hwloc_obj_t | obj,
|  | const char *__hwloc_restrict | indexprefix,
|  | int | verbose
| ) |  |

Stringify a given topology object into a human-readable form.

Note
  This function is deprecated in favor of hwloc_obj_type_snprintf() and hwloc_obj_attr_snprintf() since it is not very flexible and only prints physical/OS indexes.

Fill string `string` up to `size` characters with the description of topology object `obj` in topology `topology`.

If `verbose` is set, a longer description is used. Otherwise a short description is used.

`indexprefix` is used to prefix the `os_index` attribute number of the object in the description. If `NULL`, the `#` character is used.

If `size` is 0, `string` may safely be `NULL`.

Returns
  the number of character that were actually written if not truncating, or that would have been written (not including the ending \0).

HWLOC_DECLSPEC hwloc_obj_type_t hwloc_obj_type_of_string | ( | const char * | string | ) |

Return an object type from the string.

Returns
  -1 if unrecognized.

References HWLOC_OBJ_BRIDGE, HWLOC_OBJ_CACHE, HWLOC_OBJ_CORE, HWLOC_OBJ_GROUP, HWLOC_OBJ_MACHINE, HWLOC_OBJ_MISC, HWLOC_OBJ_NODE, HWLOC_OBJ_OS_DEVICE, HWLOC_OBJ_PCI_DEVICE, HWLOC_OBJ_PU, HWLOC_OBJ_SOCKET, and HWLOC_OBJ_SYSTEM.

HWLOC_DECLSPEC int hwloc_obj_type_snprintf | ( | char *__hwloc_restrict | string,
|  | size_t | size,
|  | hwloc_obj_t | obj,
|  | int | verbose
| ) |  |

Stringify the type of a given topology object into a human-readable form.

It differs from hwloc_obj_type_string() because it prints type attributes such as cache depth.

If `size` is 0, `string` may safely be `NULL`.

Returns
  the number of character that were actually written if not truncating, or that would have been written (not including the ending \0).

References hwloc_obj::attr, hwloc_obj_attr_u::hwloc_cache_attr_s::depth, hwloc_obj_attr_u::hwloc_group_attr_s::depth, HWLOC_OBJ_BRIDGE, HWLOC_OBJ_BRIDGE_PCI, HWLOC_OBJ_CACHE, HWLOC_OBJ_CORE, HWLOC_OBJ_GROUP, HWLOC_OBJ_MACHINE, HWLOC_OBJ_MISC, HWLOC_OBJ_NODE, HWLOC_OBJ_OS_DEVICE, HWLOC_OBJ_OSDEV_BLOCK, HWLOC_OBJ_OSDEV_DMA, HWLOC_OBJ_OSDEV_GPU, HWLOC_OBJ_OSDEV_NETWORK, HWLOC_OBJ_OSDEV_OPENFABRICS, HWLOC_OBJ_PCI_DEVICE, HWLOC_OBJ_PU, HWLOC_OBJ_SOCKET, HWLOC_OBJ_SYSTEM, hwloc_obj_type_string(), and hwloc_obj::type.