hwlocality_creation(3)

hey bestie, this is hwlocality_creation(3) from the Library Functions Manual β€” the page all about Topology Creation and Destruction πŸ’…βœ¨


🌸 NAME 🌸

hwlocality_creation β€” Topology Creation and Destruction πŸ’–


πŸ¦‹ SYNOPSIS πŸ¦‹

Typedefs

typedef struct hwloc_topology * hwloc_topology_t

Functions

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)
int hwloc_topology_abi_check (hwloc_topology_t topology)
void hwloc_topology_check (hwloc_topology_t topology)

🌈 Detailed Description 🌈

bestie, this section is literally just a heading in the source β€” no extra description text hiding here, no secret lore. Moving on! 🫢


πŸŽ€ Typedef Documentation πŸŽ€

typedef struct hwloc_topology* hwloc_topology_t

This is the topology context πŸ’–. It gets initialized with hwloc_topology_init() and built with hwloc_topology_load().


πŸ’œ Function Documentation πŸ’œ

int hwloc_topology_abi_check (hwloc_topology_t topology)

okay so this one checks that your topology is compatible with the current hwloc library ✨. It’s highkey useful when the same topology structure is being used (in memory) by different libraries that may use different hwloc installations β€” for example, if one library embeds a specific version of hwloc while another library uses a default system-wide hwloc installation πŸ‘€.

If all libraries/programs use the same hwloc installation, this function always returns success. Slay.

Returns

  • 0 on success.
  • -1 with errno set to EINVAL if incompatible.
Note: if you’re sharing between processes with hwloc_shmem_topology_write(), the relevant check is already performed inside hwloc_shmem_topology_adopt() πŸ’…

void hwloc_topology_check (hwloc_topology_t topology)

Runs internal checks on a topology structure 🧚. The program aborts if an inconsistency is detected in the given topology β€” like, literally aborts, no cap 😭.

Parameters

  • topology is the topology to be checked.
Note: this routine is only useful to developers. The input topology should have been previously loaded with hwloc_topology_load().

void hwloc_topology_destroy (hwloc_topology_t topology)

Terminates and frees a topology context 🫢. Basically the cleanup era.

Parameters

  • topology is the topology to be freed.

int hwloc_topology_dup (hwloc_topology_t * newtopology, hwloc_topology_t oldtopology)

Duplicates 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 β€” main character backup energy πŸ‘‘.

Returns

  • 0 on success, -1 on error.
Note: 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 πŸ™ˆ.

int hwloc_topology_init (hwloc_topology_t * topologyp)

Allocates a topology context ✨.

Parameters

  • topologyp is assigned a pointer to the new allocated context.

Returns

  • 0 on success, -1 on error.

int hwloc_topology_load (hwloc_topology_t topology)

Builds the actual topology 🌈. Build the actual topology once initialized with hwloc_topology_init() and tuned with Topology Detection Configuration and Query and Changing the Source of Topology Discovery routines. No other routine may be called earlier using this topology context β€” fr fr, that’s the rule.

Parameters

  • topology is the topology to be loaded with objects.

Returns

  • 0 on success, -1 on error.
Note: 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 and Changing the Source of Topology Discovery


πŸ‘‘ Author πŸ‘‘

Generated automatically by Doxygen for Hardware Locality (hwloc) from the source code πŸ€–πŸ’–


okay that’s the whole page, bestie β€” source/version vibes are Hardware Locality (hwloc), Version 2.15.0, and hwlocality_creation(3); the footer doesn’t print a separate date, so I’m not inventing one, periodt πŸ’‹βœ¨

πŸ“¦ where this page comes from