Hardware Locality (hwloc)
master-20230831.0905.git364652f8b
|
Functions | |
const char * | hwloc_obj_type_string (hwloc_obj_type_t type) |
int | hwloc_obj_type_snprintf (char *restrict string, size_t size, hwloc_obj_t obj, unsigned long flags) |
int | hwloc_obj_attr_snprintf (char *restrict string, size_t size, hwloc_obj_t obj, const char *restrict separator, unsigned long flags) |
int | hwloc_type_sscanf (const char *string, hwloc_obj_type_t *typep, union hwloc_obj_attr_u *attrp, size_t attrsize) |
Flags to be given to hwloc_obj_type_snprintf() and hwloc_obj_attr_snprintf().
int hwloc_obj_attr_snprintf | ( | char *restrict | string, |
size_t | size, | ||
hwloc_obj_t | obj, | ||
const char *restrict | separator, | ||
unsigned long | flags | ||
) |
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
.
Flags flags
is a OR'ed set of hwloc_obj_snprintf_flag_e. By default, only important attributes such as memory and cache sizes are shown. Sizes are reported in units such as GiB or KiB.
int hwloc_obj_type_snprintf | ( | char *restrict | string, |
size_t | size, | ||
hwloc_obj_t | obj, | ||
unsigned long | flags | ||
) |
Stringify the type of a given topology object into a human-readable form.
Contrary to hwloc_obj_type_string(), this function includes object-specific attributes (such as the Group depth, the Bridge type, or OS device type) in the output, and it requires the caller to provide the output buffer.
The output is guaranteed to be the same for all objects of a same topology level.
The output string may be parsed back by hwloc_type_sscanf().
If size
is 0, string
may safely be NULL
.
Flags flags
is a OR'ed set of hwloc_obj_snprintf_flag_e. By default, short names are used.
const char* hwloc_obj_type_string | ( | hwloc_obj_type_t | type | ) |
Return a constant stringified object type.
This function is the basic way to convert a generic type into a string. The output string may be parsed back by hwloc_type_sscanf().
hwloc_obj_type_snprintf() may return a more precise output for a specific object, but it requires the caller to provide the output buffer.
"Unknown"
. int hwloc_type_sscanf | ( | const char * | string, |
hwloc_obj_type_t * | typep, | ||
union hwloc_obj_attr_u * | attrp, | ||
size_t | attrsize | ||
) |
Return an object type and attributes from a type string.
Convert strings such as "Package" or "L1iCache" into the corresponding types. Matching is case-insensitive, and only the first letters are actually required to match.
The matched object type is set in typep
(which cannot be NULL
).
Type-specific attributes, for instance Cache type, Cache depth, Group depth, Bridge type or OS Device type may be returned in attrp
. Attributes that are not specified in the string (for instance "Group" without a depth, or "L2Cache" without a cache type) are set to -1.
attrp
is only filled if not NULL
and if its size specified in attrsize
is large enough. It should be at least as large as union hwloc_obj_attr_u.