Skip to content

open-mpi/pyhwloc

Repository files navigation

Python Interface for the Portable Hardware Locality (hwloc) Library

Quick Start Example

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

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.

About

Python bindings for hwloc

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •