Open MPI logo

Portable Hardware Locality (hwloc) Documentation: v1.0.3

  |   Home   |   Support   |   FAQ   |  

Object/String Conversion

Functions

const char * hwloc_obj_type_string (hwloc_obj_type_t type)
 Return a stringified topology object type.
hwloc_obj_type_t hwloc_obj_type_of_string (const char *string)
 Return an object type from the string.
int hwloc_obj_type_snprintf (char *restrict string, size_t size, hwloc_obj_t obj, int verbose)
 Stringify the type of a given topology object into a human-readable form.
int hwloc_obj_attr_snprintf (char *restrict string, size_t size, hwloc_obj_t obj, const char *restrict separator, int verbose)
 Stringify the attributes of a given topology object into a human-readable form.
int hwloc_obj_snprintf (char *restrict string, size_t size, hwloc_topology_t topology, hwloc_obj_t obj, const char *restrict indexprefix, int verbose)
 Stringify a given topology object into a human-readable form.
int hwloc_obj_cpuset_snprintf (char *restrict str, size_t size, size_t nobj, const hwloc_obj_t *restrict objs)
 Stringify the cpuset containing a set of objects.

Function Documentation

int hwloc_obj_attr_snprintf ( char *restrict  string,
size_t  size,
hwloc_obj_t  obj,
const char *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.

Returns:
how many characters were actually written (not including the ending \0), or -1 on error.
int hwloc_obj_cpuset_snprintf ( char *restrict  str,
size_t  size,
size_t  nobj,
const hwloc_obj_t *restrict  objs 
)

Stringify the cpuset containing a set of objects.

Returns:
how many characters were actually written (not including the ending \0).
int hwloc_obj_snprintf ( char *restrict  string,
size_t  size,
hwloc_topology_t  topology,
hwloc_obj_t  obj,
const char *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.

Returns:
how many characters were actually written (not including the ending \0), or -1 on error.
hwloc_obj_type_t hwloc_obj_type_of_string ( const char *  string  ) 

Return an object type from the string.

Returns:
-1 if unrecognized.
int hwloc_obj_type_snprintf ( char *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.

Returns:
how many characters were actually written (not including the ending \0), or -1 on error.
const char* hwloc_obj_type_string ( hwloc_obj_type_t  type  )  const

Return a stringified topology object type.