SkillAgentSearch skills...

Pyhwloc

Python bindings for hwloc

Install / Use

/learn @open-mpi/Pyhwloc
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

################################################################### Python Interface for the Portable Hardware Locality (hwloc) Library ###################################################################

  • Documentation <https://pyhwloc.readthedocs.io/>__
  • Official site <https://www.open-mpi.org/projects/hwloc/>__ of the hwloc library.
  • GitHub repository <https://github.com/open-mpi/hwloc>__ of the hwloc library.

Quick Start Example

.. code-block:: python

from pyhwloc import from_this_system

# Create and load system topology
with from_this_system() as topo:
    # Get basic system information
    n_cores = topo.n_cores()
    n_numa = topo.n_numa_nodes()

    print(f"System has {n_cores} CPU cores")
    print(f"System has {n_numa} NUMA nodes")

    # Get the current CPU binding
    cpuset = topo.get_cpubind()
    print(f"Current CPU binding: {cpuset}")

Install

.. code-block:: sh

pip install pyhwloc

Supported platforms:

  • Linux distributions, tested with latest Ubuntu LTS.
  • Latest Windows.

The binaries on PyPI have optional support for CUDA 13 plugins.

Related Skills

View on GitHub
GitHub Stars5
CategoryDevelopment
Updated14h ago
Forks1

Languages

Python

Security Score

85/100

Audited on Mar 30, 2026

No findings