PyHwloc Low Level API

This page provides the reference for the low level interface. This low level interface is a direct mapping from the hwloc C API to the Python environment. Function and enum names in the Python binding omit the hwloc_ prefix for brevity.

The bitmap API

pyhwloc.hwloc.bitmap.bitmap_allbut(bitmap: c_void_p, id: int) None

See hwloc_bitmap_allbut()

pyhwloc.hwloc.bitmap.bitmap_alloc() c_void_p

See hwloc_bitmap_alloc()

pyhwloc.hwloc.bitmap.bitmap_alloc_full() c_void_p

See hwloc_bitmap_alloc_full()

pyhwloc.hwloc.bitmap.bitmap_and(res: c_void_p, bitmap1: c_void_p, bitmap2: c_void_p) None

See hwloc_bitmap_and()

pyhwloc.hwloc.bitmap.bitmap_andnot(res: c_void_p, bitmap1: c_void_p, bitmap2: c_void_p) None

See hwloc_bitmap_andnot()

pyhwloc.hwloc.bitmap.bitmap_asprintf(bitmap: c_void_p) str

See hwloc_bitmap_asprintf()

pyhwloc.hwloc.bitmap.bitmap_clr(bitmap: c_void_p, id: int) None

See hwloc_bitmap_clr()

pyhwloc.hwloc.bitmap.bitmap_clr_range(bitmap: c_void_p, begin: int, end: int) None

See hwloc_bitmap_clr_range()

pyhwloc.hwloc.bitmap.bitmap_compare(bitmap1: c_void_p, bitmap2: c_void_p) int

See hwloc_bitmap_compare()

pyhwloc.hwloc.bitmap.bitmap_compare_first(bitmap1: c_void_p, bitmap2: c_void_p) int

See hwloc_bitmap_compare_first()

pyhwloc.hwloc.bitmap.bitmap_copy(dst: c_void_p, src: c_void_p) None

See hwloc_bitmap_copy()

pyhwloc.hwloc.bitmap.bitmap_dup(bitmap: c_void_p) c_void_p

See hwloc_bitmap_dup()

pyhwloc.hwloc.bitmap.bitmap_fill(bitmap: c_void_p) None

See hwloc_bitmap_fill()

pyhwloc.hwloc.bitmap.bitmap_first(bitmap: c_void_p) int

See hwloc_bitmap_first()

pyhwloc.hwloc.bitmap.bitmap_first_unset(bitmap: c_void_p) int

See hwloc_bitmap_first_unset()

pyhwloc.hwloc.bitmap.bitmap_free(bitmap: c_void_p) None

See hwloc_bitmap_free()

pyhwloc.hwloc.bitmap.bitmap_from_ith_ulong(bitmap: c_void_p, i: int, mask: int) None

See hwloc_bitmap_from_ith_ulong()

pyhwloc.hwloc.bitmap.bitmap_from_ulong(bitmap: c_void_p, mask: int) None

See hwloc_bitmap_from_ulong()

pyhwloc.hwloc.bitmap.bitmap_from_ulongs(bitmap: c_void_p, nr: int, masks: _Pointer | Array) None

See hwloc_bitmap_from_ulongs()

pyhwloc.hwloc.bitmap.bitmap_intersects(bitmap1: c_void_p, bitmap2: c_void_p) bool

See hwloc_bitmap_intersects()

pyhwloc.hwloc.bitmap.bitmap_isequal(bitmap1: c_void_p, bitmap2: c_void_p) bool

See hwloc_bitmap_isequal()

pyhwloc.hwloc.bitmap.bitmap_isfull(bitmap: c_void_p) bool

See hwloc_bitmap_isfull()

pyhwloc.hwloc.bitmap.bitmap_isincluded(sub_bitmap: c_void_p, super_bitmap: c_void_p) bool

See hwloc_bitmap_isincluded()

pyhwloc.hwloc.bitmap.bitmap_isset(bitmap: c_void_p, i: int) bool

See hwloc_bitmap_isset()

pyhwloc.hwloc.bitmap.bitmap_iszero(bitmap: c_void_p) bool

See hwloc_bitmap_iszero()

pyhwloc.hwloc.bitmap.bitmap_last(bitmap: c_void_p) int

See hwloc_bitmap_last()

pyhwloc.hwloc.bitmap.bitmap_last_unset(bitmap: c_void_p) int

See hwloc_bitmap_last_unset()

pyhwloc.hwloc.bitmap.bitmap_list_asprintf(bitmap: c_void_p) str

See hwloc_bitmap_list_asprintf()

pyhwloc.hwloc.bitmap.bitmap_list_snprintf(buf: c_char_p | Array, buflen: int, bitmap: c_void_p) int

See hwloc_bitmap_list_snprintf()

pyhwloc.hwloc.bitmap.bitmap_list_sscanf(bitmap: c_void_p, string: str) None

See hwloc_bitmap_list_sscanf()

pyhwloc.hwloc.bitmap.bitmap_next(bitmap: c_void_p, prev: int) int

See hwloc_bitmap_next()

pyhwloc.hwloc.bitmap.bitmap_next_unset(bitmap: c_void_p, prev: int) int

See hwloc_bitmap_next_unset()

pyhwloc.hwloc.bitmap.bitmap_nr_ulongs(bitmap: c_void_p) int

See hwloc_bitmap_nr_ulongs()

pyhwloc.hwloc.bitmap.bitmap_only(bitmap: c_void_p, id: int) None

See hwloc_bitmap_only()

pyhwloc.hwloc.bitmap.bitmap_or(res: c_void_p, bitmap1: c_void_p, bitmap2: c_void_p) None

See hwloc_bitmap_or()

pyhwloc.hwloc.bitmap.bitmap_set(bitmap: c_void_p, id: int) None

See hwloc_bitmap_set()

pyhwloc.hwloc.bitmap.bitmap_set_ith_ulong(bitmap: c_void_p, i: int, mask: int) None

See hwloc_bitmap_set_ith_ulong()

pyhwloc.hwloc.bitmap.bitmap_set_range(bitmap: c_void_p, begin: int, end: int) None

See hwloc_bitmap_set_range()

pyhwloc.hwloc.bitmap.bitmap_singlify(bitmap: c_void_p) None

See hwloc_bitmap_singlify()

pyhwloc.hwloc.bitmap.bitmap_snprintf(buf: c_char_p | Array, buflen: int, bitmap: c_void_p) int

See hwloc_bitmap_snprintf()

pyhwloc.hwloc.bitmap.bitmap_sscanf(bitmap: c_void_p, string: str) None

See hwloc_bitmap_sscanf()

pyhwloc.hwloc.bitmap.bitmap_taskset_asprintf(bitmap: c_void_p) str

See hwloc_bitmap_taskset_asprintf()

pyhwloc.hwloc.bitmap.bitmap_taskset_snprintf(buf: c_char_p | Array, buflen: int, bitmap: c_void_p) int

See hwloc_bitmap_taskset_snprintf()

pyhwloc.hwloc.bitmap.bitmap_taskset_sscanf(bitmap: c_void_p, string: str) None

See hwloc_bitmap_taskset_sscanf()

pyhwloc.hwloc.bitmap.bitmap_to_ith_ulong(bitmap: c_void_p, i: int) int

See hwloc_bitmap_to_ith_ulong()

pyhwloc.hwloc.bitmap.bitmap_to_ulong(bitmap: c_void_p) int

See hwloc_bitmap_to_ulong()

pyhwloc.hwloc.bitmap.bitmap_to_ulongs(bitmap: c_void_p, nr: int, masks: _Pointer) None

See hwloc_bitmap_to_ulongs()

pyhwloc.hwloc.bitmap.bitmap_weight(bitmap: c_void_p) int

See hwloc_bitmap_weight()

pyhwloc.hwloc.bitmap.bitmap_xor(res: c_void_p, bitmap1: c_void_p, bitmap2: c_void_p) None

See hwloc_bitmap_xor()

pyhwloc.hwloc.bitmap.bitmap_zero(bitmap: c_void_p) None

See hwloc_bitmap_zero()

Core API

class pyhwloc.hwloc.core.AllowFlags(*values)

See hwloc_allow_flags_e.

class pyhwloc.hwloc.core.BridgeAttr

See hwloc_obj_attr_u.hwloc_bridge_attr_s

class pyhwloc.hwloc.core.BridgeDownstream

See hwloc_obj_attr_u.name

class pyhwloc.hwloc.core.BridgeDownstreamPci

See hwloc_obj_attr_u.BridgeDownstream.hwloc_bridge_downstream_pci_s

class pyhwloc.hwloc.core.BridgeUpstream

See hwloc_obj_attr_u.hwloc_bridge_attr_s.name

class pyhwloc.hwloc.core.CacheAttr

See hwloc_obj_attr_u.hwloc_cache_attr_s

class pyhwloc.hwloc.core.CpuBindFlags(*values)

See hwloc_cpubind_flags_t.

class pyhwloc.hwloc.core.Distances

See hwloc_distances_s

class pyhwloc.hwloc.core.DistancesAddFlag(*values)

See hwloc_distances_add_flag_e.

class pyhwloc.hwloc.core.DistancesKind(*values)

See hwloc_distances_kind_e.

class pyhwloc.hwloc.core.DistancesTransform(*values)

See hwloc_distances_transform_e.

class pyhwloc.hwloc.core.DistribFlags(*values)

See hwloc_allow_flags_e.

class pyhwloc.hwloc.core.ExportSyntheticFlags(*values)

See hwloc_topology_export_synthetic_flags_e.

class pyhwloc.hwloc.core.ExportXmlFlags(*values)

See hwloc_topology_export_xml_flags_e.

class pyhwloc.hwloc.core.GetTypeDepth(*values)

See hwloc_get_type_depth_e.

class pyhwloc.hwloc.core.GroupAttr

See hwloc_obj_attr_u.hwloc_group_attr_s

class pyhwloc.hwloc.core.Info

See hwloc_info_s

class pyhwloc.hwloc.core.Infos

See hwloc_infos_s

class pyhwloc.hwloc.core.LocalNumaNodeFlag(*values)

See hwloc_local_numanode_flag_e.

class pyhwloc.hwloc.core.Location

See hwloc_location

class pyhwloc.hwloc.core.LocationType(*values)

See hwloc_location_type_e.

class pyhwloc.hwloc.core.MemAttrFlag(*values)

See hwloc_memattr_flag_e.

class pyhwloc.hwloc.core.MemAttrId(*values)

See hwloc_memattr_id_e.

class pyhwloc.hwloc.core.MemBindFlags(*values)

See hwloc_membind_flags_t.

class pyhwloc.hwloc.core.MemBindPolicy(*values)

See hwloc_membind_policy_t.

class pyhwloc.hwloc.core.NumanodeAttr

See hwloc_obj_attr_u.hwloc_numanode_attr_s

class pyhwloc.hwloc.core.Obj

See hwloc_obj

class pyhwloc.hwloc.core.ObjAttr

See hwloc_obj_attr_u

class pyhwloc.hwloc.core.ObjBridgeType(*values)

See hwloc_obj_bridge_type_e.

class pyhwloc.hwloc.core.ObjCacheType(*values)

See hwloc_obj_cache_type_e.

class pyhwloc.hwloc.core.ObjOsdevType(*values)

See hwloc_obj_osdev_type_e.

class pyhwloc.hwloc.core.ObjSnprintfFlag(*values)

See hwloc_obj_snprintf_flag_e.

class pyhwloc.hwloc.core.ObjType(*values)

See hwloc_obj_type_t.

class pyhwloc.hwloc.core.OsdevAttr

See hwloc_obj_attr_u.hwloc_osdev_attr_s

class pyhwloc.hwloc.core.PcidevAttr

See hwloc_obj_attr_u.hwloc_pcidev_attr_s

class pyhwloc.hwloc.core.RestrictFlags(*values)

See hwloc_restrict_flags_e.

class pyhwloc.hwloc.core.TopologyComponentsFlag(*values)
class pyhwloc.hwloc.core.TopologyCpubindSupport

See hwloc_topology_cpubind_support

class pyhwloc.hwloc.core.TopologyDiscoverySupport

See hwloc_topology_discovery_support

class pyhwloc.hwloc.core.TopologyFlags(*values)

See hwloc_topology_flags_e.

class pyhwloc.hwloc.core.TopologyMembindSupport

See hwloc_topology_membind_support

class pyhwloc.hwloc.core.TopologyMiscSupport

See hwloc_topology_misc_support

class pyhwloc.hwloc.core.TopologySupport

See hwloc_topology_support

class pyhwloc.hwloc.core.TypeFilter(*values)

See hwloc_type_filter_e.

pyhwloc.hwloc.core.alloc(topology: c_void_p, length: int) c_void_p

See hwloc_alloc()

pyhwloc.hwloc.core.alloc_membind(topology: c_void_p, length: int, set: c_void_p, policy: MemBindPolicy, flags: int) c_void_p

See hwloc_alloc_membind()

pyhwloc.hwloc.core.alloc_membind_policy(topology: c_void_p, length: int, set: c_void_p, policy: MemBindPolicy, flags: int) c_void_p

See hwloc_alloc_membind_policy()

pyhwloc.hwloc.core.bitmap_singlify_per_core(topology: c_void_p, cpuset: c_void_p, which: int) None

See hwloc_bitmap_singlify_per_core()

pyhwloc.hwloc.core.bridge_covers_pcibus(bridge: _Pointer, domain: int, bus: int) int

See hwloc_bridge_covers_pcibus()

pyhwloc.hwloc.core.compare_types(type1: ObjType, type2: ObjType) int

See hwloc_compare_types()

pyhwloc.hwloc.core.cpukinds_get_by_cpuset(topology: c_void_p, cpuset: c_void_p) int

See hwloc_cpukinds_get_by_cpuset()

pyhwloc.hwloc.core.cpukinds_get_info(topology: c_void_p, kind_index: int) tuple[c_void_p, int, _Pointer]

See hwloc_cpukinds_get_info()

pyhwloc.hwloc.core.cpukinds_get_nr(topology: c_void_p) int

See hwloc_cpukinds_get_nr()

pyhwloc.hwloc.core.cpukinds_register(topology: c_void_p, cpuset: c_void_p, forced_efficiency: int, infos: Infos | None) None

See hwloc_cpukinds_register()

pyhwloc.hwloc.core.cpuset_from_nodeset(topology: c_void_p, cpuset: c_void_p, nodeset: c_void_p) None

See hwloc_cpuset_from_nodeset()

pyhwloc.hwloc.core.cpuset_to_nodeset(topology: c_void_p, cpuset: c_void_p, nodeset: c_void_p) None

See hwloc_cpuset_to_nodeset()

pyhwloc.hwloc.core.distances_add_commit(topology: c_void_p, handle: c_void_p, flags: int) None

See hwloc_distances_add_commit()

pyhwloc.hwloc.core.distances_add_create(topology: c_void_p, name: str, kind: int) c_void_p

See hwloc_distances_add_create()

pyhwloc.hwloc.core.distances_add_values(topology: c_void_p, handle: c_void_p, nbobjs: int, objs: Array, values: Array) None

See hwloc_distances_add_values()

pyhwloc.hwloc.core.distances_get(topology: c_void_p, nr: _Pointer, distances: _Pointer, kind: int) None

See hwloc_distances_get()

pyhwloc.hwloc.core.distances_get_by_depth(topology: c_void_p, depth: int, nr: _Pointer, distances: _Pointer, kind: int, flags: int) None

See hwloc_distances_get_by_depth()

pyhwloc.hwloc.core.distances_get_by_name(topology: c_void_p, name: bytes, nr: _Pointer, distances: _Pointer, flags: int) None

See hwloc_distances_get_by_name()

pyhwloc.hwloc.core.distances_get_by_type(topology: c_void_p, obj_type: ObjType, nr: _Pointer, distances: _Pointer, kind: int) None

See hwloc_distances_get_by_type()

pyhwloc.hwloc.core.distances_get_name(topology: c_void_p, distances: _Pointer) str | None

See hwloc_distances_get_name()

pyhwloc.hwloc.core.distances_obj_index(distances: _Pointer, obj: _Pointer) int

See hwloc_distances_obj_index()

pyhwloc.hwloc.core.distances_obj_pair_values(distances: _Pointer, obj1: _Pointer, obj2: _Pointer) tuple[int, int]

See hwloc_distances_obj_pair_values()

pyhwloc.hwloc.core.distances_release(topology: c_void_p, distances: _Pointer) None

See hwloc_distances_release()

pyhwloc.hwloc.core.distances_release_remove(topology: c_void_p, distances: _Pointer) None

See hwloc_distances_release_remove()

pyhwloc.hwloc.core.distances_remove(topology: c_void_p) None

See hwloc_distances_remove()

pyhwloc.hwloc.core.distances_remove_by_depth(topology: c_void_p, depth: int) None

See hwloc_distances_remove_by_depth()

pyhwloc.hwloc.core.distances_remove_by_type(topology: c_void_p, obj_type: ObjType) None

See hwloc_distances_remove_by_type()

pyhwloc.hwloc.core.distances_transform(topology: c_void_p, distances: _Pointer, transform: DistancesTransform, transform_attr: c_void_p, flags: int) None

See hwloc_distances_transform()

pyhwloc.hwloc.core.distrib(topology: c_void_p, roots: _Pointer, n_roots: int, cpuset: _Pointer, n: int, until: int, flags: int) None

See hwloc_distrib()

pyhwloc.hwloc.core.export_obj_userdata(reserved: c_void_p, topology: c_void_p, obj: _Pointer, name: str, buf: c_void_p, length: int) None

See hwloc_export_obj_userdata()

pyhwloc.hwloc.core.export_obj_userdata_base64(reserved: c_void_p, topology: c_void_p, obj: _Pointer, name: str, buffer: c_void_p, length: int) None

See hwloc_export_obj_userdata_base64()

pyhwloc.hwloc.core.free(topology: c_void_p, addr: c_void_p, length: int) None

See hwloc_free()

pyhwloc.hwloc.core.get_ancestor_obj_by_depth(topology: c_void_p, depth: int, obj: _Pointer) _Pointer | None

See hwloc_get_ancestor_obj_by_depth()

pyhwloc.hwloc.core.get_ancestor_obj_by_type(topology: c_void_p, obj_type: ObjType, obj: _Pointer) _Pointer | None

See hwloc_get_ancestor_obj_by_type()

pyhwloc.hwloc.core.get_api_version() int

See hwloc_get_api_version()

pyhwloc.hwloc.core.get_area_membind(topology: c_void_p, addr: c_void_p, length: int, set: c_void_p, flags: int) MemBindPolicy

See hwloc_get_area_membind()

pyhwloc.hwloc.core.get_area_memlocation(topology: c_void_p, addr: c_void_p, length: int, set: c_void_p, flags: int) None

See hwloc_get_area_memlocation()

pyhwloc.hwloc.core.get_cache_covering_cpuset(topology: c_void_p, cpuset: c_void_p) _Pointer | None

See hwloc_get_cache_covering_cpuset()

pyhwloc.hwloc.core.get_cache_type_depth(topology: c_void_p, cachelevel: int, cachetype: ObjCacheType) int

See hwloc_get_cache_type_depth()

pyhwloc.hwloc.core.get_child_covering_cpuset(topology: c_void_p, cpuset: c_void_p, parent: _Pointer) _Pointer | None

See hwloc_get_child_covering_cpuset()

pyhwloc.hwloc.core.get_closest_objs(topology: c_void_p, src: _Pointer, objs: Array, max_objs: int) int

See hwloc_get_closest_objs()

pyhwloc.hwloc.core.get_common_ancestor_obj(topology: c_void_p, obj1: _Pointer, obj2: _Pointer) _Pointer

See hwloc_get_common_ancestor_obj()

pyhwloc.hwloc.core.get_cpubind(topology: c_void_p, cpuset: c_void_p, flags: int) None

See hwloc_get_cpubind()

pyhwloc.hwloc.core.get_depth_type(topology: c_void_p, depth: int) ObjType

See hwloc_get_depth_type()

pyhwloc.hwloc.core.get_first_largest_obj_inside_cpuset(topology: c_void_p, cpuset: c_void_p) _Pointer | None

See hwloc_get_first_largest_obj_inside_cpuset()

pyhwloc.hwloc.core.get_largest_objs_inside_cpuset(topology: c_void_p, cpuset: c_void_p, objs: Array, max_objs: int) int

See hwloc_get_largest_objs_inside_cpuset()

pyhwloc.hwloc.core.get_last_cpu_location(topology: c_void_p, cpuset: c_void_p, flags: int) None

See hwloc_get_last_cpu_location()

pyhwloc.hwloc.core.get_local_numanode_objs(topology: c_void_p, location: _Pointer, nr: _Pointer, nodes: _Pointer | Array | None, flags: int) None

See hwloc_get_local_numanode_objs()

pyhwloc.hwloc.core.get_membind(topology: c_void_p, set: c_void_p, flags: int) MemBindPolicy

See hwloc_get_membind()

pyhwloc.hwloc.core.get_memory_parents_depth(topology: c_void_p) int

See hwloc_get_memory_parents_depth()

pyhwloc.hwloc.core.get_nbobjs_by_depth(topology: c_void_p, depth: int) int

See hwloc_get_nbobjs_by_depth()

pyhwloc.hwloc.core.get_nbobjs_by_type(topology: c_void_p, obj_type: ObjType) int

See hwloc_get_nbobjs_by_type()

pyhwloc.hwloc.core.get_nbobjs_inside_cpuset_by_depth(topology: c_void_p, cpuset: c_void_p, depth: int) int

See hwloc_get_nbobjs_inside_cpuset_by_depth()

pyhwloc.hwloc.core.get_nbobjs_inside_cpuset_by_type(topology: c_void_p, cpuset: c_void_p, obj_type: ObjType) int

See hwloc_get_nbobjs_inside_cpuset_by_type()

pyhwloc.hwloc.core.get_next_bridge(topology: c_void_p, prev: _Pointer | None) _Pointer | None

See hwloc_get_next_bridge()

pyhwloc.hwloc.core.get_next_child(topology: c_void_p, parent: _Pointer, prev: _Pointer | None) _Pointer | None

See hwloc_get_next_child()

pyhwloc.hwloc.core.get_next_obj_by_depth(topology: c_void_p, depth: int, prev: _Pointer | None) _Pointer | None

See hwloc_get_next_obj_by_depth()

pyhwloc.hwloc.core.get_next_obj_by_type(topology: c_void_p, obj_type: ObjType, prev: _Pointer | None) _Pointer | None

See hwloc_get_next_obj_by_type()

pyhwloc.hwloc.core.get_next_obj_covering_cpuset_by_depth(topology: c_void_p, cpuset: c_void_p, depth: int, prev: _Pointer) _Pointer | None

See hwloc_get_next_obj_covering_cpuset_by_depth()

pyhwloc.hwloc.core.get_next_obj_covering_cpuset_by_type(topology: c_void_p, cpuset: c_void_p, obj_type: ObjType, prev: _Pointer) _Pointer | None

See hwloc_get_next_obj_covering_cpuset_by_type()

pyhwloc.hwloc.core.get_next_obj_inside_cpuset_by_depth(topology: c_void_p, cpuset: c_void_p, depth: int, prev: _Pointer) _Pointer | None

See hwloc_get_next_obj_inside_cpuset_by_depth()

pyhwloc.hwloc.core.get_next_obj_inside_cpuset_by_type(topology: c_void_p, cpuset: c_void_p, obj_type: ObjType, prev: _Pointer) _Pointer | None

See hwloc_get_next_obj_inside_cpuset_by_type()

pyhwloc.hwloc.core.get_next_osdev(topology: c_void_p, prev: _Pointer | None) _Pointer | None

See hwloc_get_next_osdev()

pyhwloc.hwloc.core.get_next_pcidev(topology: c_void_p, prev: _Pointer | None) _Pointer | None

See hwloc_get_next_pcidev()

pyhwloc.hwloc.core.get_non_io_ancestor_obj(topology: c_void_p, ioobj: _Pointer) _Pointer

See hwloc_get_non_io_ancestor_obj()

pyhwloc.hwloc.core.get_numanode_obj_by_os_index(topology: c_void_p, os_index: int) _Pointer | None

See hwloc_get_numanode_obj_by_os_index()

pyhwloc.hwloc.core.get_obj_below_array_by_type(topology: c_void_p, nr: int, typev: Array, idxv: Array) _Pointer | None

See hwloc_get_obj_below_array_by_type()

pyhwloc.hwloc.core.get_obj_below_by_type(topology: c_void_p, type1: ObjType, idx1: int, type2: ObjType, idx2: int) _Pointer | None

See hwloc_get_obj_below_by_type()

pyhwloc.hwloc.core.get_obj_by_depth(topology: c_void_p, depth: int, idx: int) _Pointer | None

See hwloc_get_obj_by_depth()

pyhwloc.hwloc.core.get_obj_by_type(topology: c_void_p, obj_type: ObjType, idx: int) _Pointer | None

See hwloc_get_obj_by_type()

pyhwloc.hwloc.core.get_obj_covering_cpuset(topology: c_void_p, cpuset: c_void_p) _Pointer | None

See hwloc_get_obj_covering_cpuset()

pyhwloc.hwloc.core.get_obj_index_inside_cpuset(topology: c_void_p, cpuset: c_void_p, obj: _Pointer) int

See hwloc_get_obj_index_inside_cpuset()

pyhwloc.hwloc.core.get_obj_inside_cpuset_by_depth(topology: c_void_p, cpuset: c_void_p, depth: int, idx: int) _Pointer | None

See hwloc_get_obj_inside_cpuset_by_depth()

pyhwloc.hwloc.core.get_obj_inside_cpuset_by_type(topology: c_void_p, cpuset: c_void_p, obj_type: ObjType, idx: int) _Pointer | None

See hwloc_get_obj_inside_cpuset_by_type()

pyhwloc.hwloc.core.get_obj_with_same_locality(topology: c_void_p, src: _Pointer, obj_type: ObjType, subtype: str | None, nameprefix: str | None, flags: int) _Pointer | None

See hwloc_get_obj_with_same_locality()

pyhwloc.hwloc.core.get_pcidev_by_busid(topology: c_void_p, domain: int, bus: int, dev: int, func: int) _Pointer | None

See hwloc_get_pcidev_by_busid()

pyhwloc.hwloc.core.get_pcidev_by_busidstring(topology: c_void_p, busid: str) _Pointer | None

See hwloc_get_pcidev_by_busidstring()

pyhwloc.hwloc.core.get_proc_cpubind(topology: c_void_p, pid: c_int, cpuset: c_void_p, flags: int) None

See hwloc_get_proc_cpubind()

pyhwloc.hwloc.core.get_proc_last_cpu_location(topology: c_void_p, pid: c_int, cpuset: c_void_p, flags: int) None

See hwloc_get_proc_last_cpu_location()

pyhwloc.hwloc.core.get_proc_membind(topology: c_void_p, pid: c_int, set: c_void_p, flags: int) MemBindPolicy

See hwloc_get_proc_membind()

pyhwloc.hwloc.core.get_pu_obj_by_os_index(topology: c_void_p, os_index: int) _Pointer | None

See hwloc_get_pu_obj_by_os_index()

pyhwloc.hwloc.core.get_root_obj(topology: c_void_p) _Pointer

See hwloc_get_root_obj()

pyhwloc.hwloc.core.get_shared_cache_covering_obj(topology: c_void_p, obj: _Pointer) _Pointer | None

See hwloc_get_shared_cache_covering_obj()

pyhwloc.hwloc.core.get_thread_cpubind(topology: c_void_p, thread: c_ulong, cpuset: c_void_p, flags: int) None

See hwloc_get_thread_cpubind()

pyhwloc.hwloc.core.get_type_depth(topology: c_void_p, obj_type: ObjType) int

See hwloc_get_type_depth()

pyhwloc.hwloc.core.get_type_depth_with_attr(topology: c_void_p, obj_type: ObjType, attr: _Pointer, attrsize: int) int

See hwloc_get_type_depth_with_attr()

pyhwloc.hwloc.core.get_type_or_above_depth(topology: c_void_p, obj_type: ObjType) int

See hwloc_get_type_or_above_depth()

pyhwloc.hwloc.core.get_type_or_below_depth(topology: c_void_p, obj_type: ObjType) int

See hwloc_get_type_or_below_depth()

class pyhwloc.hwloc.core.hwloc_location_u

See hwloc_location.name

pyhwloc.hwloc.core.hwloc_obj_cache_type_t

alias of ObjCacheType

pyhwloc.hwloc.core.hwloc_obj_type_string(obj_type: ObjType) bytes

See hwloc_hwloc_obj_type_string()

pyhwloc.hwloc.core.memattr_get_best_initiator(topology: c_void_p, attribute: c_uint, target_node: _Pointer) tuple[Location, int]

See hwloc_memattr_get_best_initiator()

pyhwloc.hwloc.core.memattr_get_best_target(topology: c_void_p, attribute: c_uint, initiator: _Pointer | None) tuple[_Pointer, int]

See hwloc_memattr_get_best_target()

pyhwloc.hwloc.core.memattr_get_by_name(topology: c_void_p, name: bytes) int

See hwloc_memattr_get_by_name()

pyhwloc.hwloc.core.memattr_get_flags(topology: c_void_p, attribute: c_uint) int

See hwloc_memattr_get_flags()

pyhwloc.hwloc.core.memattr_get_initiators(topology: c_void_p, attribute: c_uint, target_node: _Pointer, nr: _Pointer, initiators: _Pointer | Array | None, values: _Pointer | Array | None) None

See hwloc_memattr_get_initiators()

pyhwloc.hwloc.core.memattr_get_name(topology: c_void_p, attribute: c_uint) str

See hwloc_memattr_get_name()

pyhwloc.hwloc.core.memattr_get_targets(topology: c_void_p, attribute: c_uint, initiator: _Pointer | None, nr: _Pointer, targets: _Pointer | Array | None, values: _Pointer | Array | None) None

See hwloc_memattr_get_targets()

pyhwloc.hwloc.core.memattr_get_value(topology: c_void_p, attribute: c_uint, target_node: _Pointer, initiator: _Pointer | None) int

See hwloc_memattr_get_value()

pyhwloc.hwloc.core.memattr_register(topology: c_void_p, name: str, flags: int) c_uint

See hwloc_memattr_register()

pyhwloc.hwloc.core.memattr_set_value(topology: c_void_p, attribute: c_uint, target_node: _Pointer, initiator: _Pointer | None, value: int) None

See hwloc_memattr_set_value()

pyhwloc.hwloc.core.obj_add_info(obj: _Pointer, name: str, value: str) None

See hwloc_obj_add_info()

pyhwloc.hwloc.core.obj_add_other_obj_sets(dst: _Pointer, src: _Pointer) None

See hwloc_obj_add_other_obj_sets()

pyhwloc.hwloc.core.obj_attr_snprintf(string: c_char_p | Array, size: int, obj: _Pointer, separator: str, flags: int) int

See hwloc_obj_attr_snprintf()

pyhwloc.hwloc.core.obj_get_info_by_name(obj: _Pointer, name: str) str | None

See hwloc_obj_get_info_by_name()

pyhwloc.hwloc.core.obj_is_in_subtree(topology: c_void_p, obj: _Pointer, subtree_root: _Pointer) bool

See hwloc_obj_is_in_subtree()

pyhwloc.hwloc.core.obj_set_subtype(topology: c_void_p, obj: _Pointer, subtype: str) None

See hwloc_obj_set_subtype()

pyhwloc.hwloc.core.obj_t

alias of LP_Obj

pyhwloc.hwloc.core.obj_type_is_cache(obj_type: ObjType) bool

See hwloc_obj_type_is_cache()

pyhwloc.hwloc.core.obj_type_is_dcache(obj_type: ObjType) bool

See hwloc_obj_type_is_dcache()

pyhwloc.hwloc.core.obj_type_is_icache(obj_type: ObjType) bool

See hwloc_obj_type_is_icache()

pyhwloc.hwloc.core.obj_type_is_io(obj_type: ObjType) bool

See hwloc_obj_type_is_io()

pyhwloc.hwloc.core.obj_type_is_memory(obj_type: ObjType) bool

See hwloc_obj_type_is_memory()

pyhwloc.hwloc.core.obj_type_is_normal(obj_type: ObjType) bool

See hwloc_obj_type_is_normal()

pyhwloc.hwloc.core.obj_type_snprintf(string: c_char_p | Array, size: int, obj: _Pointer, flags: int) int

See hwloc_obj_type_snprintf()

pyhwloc.hwloc.core.set_area_membind(topology: c_void_p, addr: c_void_p, length: int, set: c_void_p, policy: MemBindPolicy, flags: int) None

See hwloc_set_area_membind()

pyhwloc.hwloc.core.set_cpubind(topology: c_void_p, cpuset: c_void_p, flags: int) None

See hwloc_set_cpubind()

pyhwloc.hwloc.core.set_membind(topology: c_void_p, set: c_void_p, policy: MemBindPolicy, flags: int) None

See hwloc_set_membind()

pyhwloc.hwloc.core.set_proc_cpubind(topology: c_void_p, pid: c_int, cpuset: c_void_p, flags: int) None

See hwloc_set_proc_cpubind()

pyhwloc.hwloc.core.set_proc_membind(topology: c_void_p, pid: c_int, set: c_void_p, policy: MemBindPolicy, flags: int) None

See hwloc_set_proc_membind()

pyhwloc.hwloc.core.set_thread_cpubind(topology: c_void_p, thread: c_ulong, cpuset: c_void_p, flags: int) None

See hwloc_set_thread_cpubind()

pyhwloc.hwloc.core.topology_abi_check(topology: c_void_p) None

See hwloc_topology_abi_check()

pyhwloc.hwloc.core.topology_alloc_group_object(topology: c_void_p) _Pointer

See hwloc_topology_alloc_group_object()

pyhwloc.hwloc.core.topology_allow(topology: c_void_p, cpuset: c_void_p | None, nodeset: c_void_p | None, flags: int) None

See hwloc_topology_allow()

pyhwloc.hwloc.core.topology_check(topology: c_void_p) None

See hwloc_topology_check()

pyhwloc.hwloc.core.topology_destroy(topology: c_void_p) None

See hwloc_topology_destroy()

pyhwloc.hwloc.core.topology_dup(topology: c_void_p) c_void_p

See hwloc_topology_dup()

pyhwloc.hwloc.core.topology_export_synthetic(topology: c_void_p, buf: c_char_p | Array, buflen: int, flags: int) int

See hwloc_topology_export_synthetic()

pyhwloc.hwloc.core.topology_export_xml(topology: c_void_p, xmlpath: str, flags: int) None

See hwloc_topology_export_xml()

pyhwloc.hwloc.core.topology_export_xmlbuffer(topology: c_void_p, flags: int) str

See hwloc_topology_export_xmlbuffer()

pyhwloc.hwloc.core.topology_free_group_object(topology: c_void_p, group: _Pointer) None

See hwloc_topology_free_group_object()

pyhwloc.hwloc.core.topology_get_allowed_cpuset(topology: c_void_p) c_void_p

See hwloc_topology_get_allowed_cpuset()

pyhwloc.hwloc.core.topology_get_allowed_nodeset(topology: c_void_p) c_void_p

See hwloc_topology_get_allowed_nodeset()

pyhwloc.hwloc.core.topology_get_complete_cpuset(topology: c_void_p) c_void_p

See hwloc_topology_get_complete_cpuset()

pyhwloc.hwloc.core.topology_get_complete_nodeset(topology: c_void_p) c_void_p

See hwloc_topology_get_complete_nodeset()

pyhwloc.hwloc.core.topology_get_default_nodeset(topology: c_void_p, nodeset: c_void_p, flags: int) None

See hwloc_topology_get_default_nodeset()

pyhwloc.hwloc.core.topology_get_depth(topology: c_void_p) int

See hwloc_topology_get_depth()

pyhwloc.hwloc.core.topology_get_flags(topology: c_void_p) int

See hwloc_topology_get_flags()

pyhwloc.hwloc.core.topology_get_infos(topology: c_void_p) _Pointer

See hwloc_topology_get_infos()

pyhwloc.hwloc.core.topology_get_support(topology: c_void_p) _Pointer

See hwloc_topology_get_support()

pyhwloc.hwloc.core.topology_get_topology_cpuset(topology: c_void_p) c_void_p

See hwloc_topology_get_topology_cpuset()

pyhwloc.hwloc.core.topology_get_topology_nodeset(topology: c_void_p) c_void_p

See hwloc_topology_get_topology_nodeset()

pyhwloc.hwloc.core.topology_get_type_filter(topology: c_void_p, obj_type: ObjType) TypeFilter

See hwloc_topology_get_type_filter()

pyhwloc.hwloc.core.topology_get_userdata(topology: c_void_p) int

See hwloc_topology_get_userdata()

pyhwloc.hwloc.core.topology_init(topology: c_void_p) None

See hwloc_topology_init()

pyhwloc.hwloc.core.topology_insert_group_object(topology: c_void_p, group: _Pointer) _Pointer | None

See hwloc_topology_insert_group_object()

pyhwloc.hwloc.core.topology_insert_misc_object(topology: c_void_p, parent: _Pointer, name: str) _Pointer | None

See hwloc_topology_insert_misc_object()

pyhwloc.hwloc.core.topology_is_thissystem(topology: c_void_p) bool

See hwloc_topology_is_thissystem()

pyhwloc.hwloc.core.topology_load(topology: c_void_p) None

See hwloc_topology_load()

pyhwloc.hwloc.core.topology_refresh(topology: c_void_p) None

See hwloc_topology_refresh()

pyhwloc.hwloc.core.topology_restrict(topology: c_void_p, cpuset: c_void_p, flags: int) None

See hwloc_topology_restrict()

pyhwloc.hwloc.core.topology_set_all_types_filter(topology: c_void_p, f: TypeFilter) None

See hwloc_topology_set_all_types_filter()

pyhwloc.hwloc.core.topology_set_cache_types_filter(topology: c_void_p, f: TypeFilter) None

See hwloc_topology_set_cache_types_filter()

pyhwloc.hwloc.core.topology_set_components(topology: c_void_p, flags: int, name: str) None

See hwloc_topology_set_components()

pyhwloc.hwloc.core.topology_set_flags(topology: c_void_p, flags: int) None

See hwloc_topology_set_flags()

pyhwloc.hwloc.core.topology_set_icache_types_filter(topology: c_void_p, f: TypeFilter) None

See hwloc_topology_set_icache_types_filter()

pyhwloc.hwloc.core.topology_set_io_types_filter(topology: c_void_p, f: TypeFilter) None

See hwloc_topology_set_io_types_filter()

pyhwloc.hwloc.core.topology_set_pid(topology: c_void_p, pid: int) None

See hwloc_topology_set_pid()

pyhwloc.hwloc.core.topology_set_synthetic(topology: c_void_p, description: str) None

See hwloc_topology_set_synthetic()

pyhwloc.hwloc.core.topology_set_type_filter(topology: c_void_p, obj_type: ObjType, f: TypeFilter) None

See hwloc_topology_set_type_filter()

pyhwloc.hwloc.core.topology_set_userdata(topology: c_void_p, userdata: int) None

See hwloc_topology_set_userdata()

pyhwloc.hwloc.core.topology_set_userdata_export_callback(topology: c_void_p, export_cb: Callable) None

See hwloc_topology_set_userdata_export_callback()

pyhwloc.hwloc.core.topology_set_userdata_import_callback(topology: c_void_p, import_cb: Callable) None

See hwloc_topology_set_userdata_import_callback()

pyhwloc.hwloc.core.topology_set_xml(topology: c_void_p, xmlpath: str) None

See hwloc_topology_set_xml()

pyhwloc.hwloc.core.topology_set_xmlbuffer(topology: c_void_p, buf: str) None

See hwloc_topology_set_xmlbuffer()

pyhwloc.hwloc.core.type_sscanf(string: str) tuple[ObjType, ObjAttr | None]

See hwloc_type_sscanf()

pyhwloc.hwloc.core.type_sscanf_as_depth(string: str, topology: c_void_p) tuple[ObjType, int]

See hwloc_type_sscanf_as_depth()

Interoperability with the CUDA Driver API

pyhwloc.hwloc.cudadr.get_device_cpuset(topology: c_void_p, cudevice: CUdevice, cpuset: c_void_p) None

See hwloc_cuda_get_device_cpuset()

pyhwloc.hwloc.cudadr.get_device_osdev(topology: c_void_p, device: CUdevice) _Pointer | None

See hwloc_cuda_get_device_osdev()

pyhwloc.hwloc.cudadr.get_device_osdev_by_index(topology: c_void_p, idx: int) _Pointer | None

See hwloc_cuda_get_device_osdev_by_index()

pyhwloc.hwloc.cudadr.get_device_pci_ids(topology: c_void_p, cudevice: CUdevice) tuple[int, int, int]

See hwloc_cuda_get_device_pci_ids()

pyhwloc.hwloc.cudadr.get_device_pcidev(topology: c_void_p, cudevice: CUdevice) _Pointer | None

See hwloc_cuda_get_device_pcidev()

Interoperability with the CUDA Runtime API

pyhwloc.hwloc.cudart.get_device_cpuset(topology: c_void_p, idx: int, cpuset: c_void_p) None

See hwloc_cudart_get_device_cpuset()

pyhwloc.hwloc.cudart.get_device_osdev_by_index(topology: c_void_p, idx: int) _Pointer | None

See hwloc_cudart_get_device_osdev_by_index()

pyhwloc.hwloc.cudart.get_device_pci_ids(topology: c_void_p, idx: int) tuple[int, int, int]

See hwloc_cudart_get_device_pci_ids()

pyhwloc.hwloc.cudart.get_device_pcidev(topology: c_void_p, idx: int) _Pointer | None

See hwloc_cudart_get_device_pcidev()

Linux-specific helpers

pyhwloc.hwloc.linux.get_tid_cpubind(topology: c_void_p, tid: int, cpuset: c_void_p) None

See hwloc_linux_get_tid_cpubind()

pyhwloc.hwloc.linux.get_tid_last_cpu_location(topology: c_void_p, tid: int, cpuset: c_void_p) None

See hwloc_linux_get_tid_last_cpu_location()

pyhwloc.hwloc.linux.read_path_as_cpumask(path: str, cpuset: c_void_p) None

See hwloc_linux_read_path_as_cpumask()

pyhwloc.hwloc.linux.set_tid_cpubind(topology: c_void_p, tid: int, cpuset: c_void_p) None

See hwloc_linux_set_tid_cpubind()

Interoperability with the NVIDIA Management Library

pyhwloc.hwloc.nvml.get_device_cpuset(topology: c_void_p, device: LP_struct_c_nvmlDevice_t, cpuset: c_void_p) None

See hwloc_nvml_get_device_cpuset()

pyhwloc.hwloc.nvml.get_device_osdev(topology: c_void_p, device: LP_struct_c_nvmlDevice_t) _Pointer | None

See hwloc_nvml_get_device_osdev()

pyhwloc.hwloc.nvml.get_device_osdev_by_index(topology: c_void_p, idx: int) _Pointer | None

See hwloc_nvml_get_device_osdev_by_index()

Interoperability with Python sched affinity

pyhwloc.hwloc.sched.cpuset_from_sched_affinity(affinity: set[int]) c_void_p

Convert the Python sched affinity set to a bitmap. The caller needs to free the returned cpuset.

pyhwloc.hwloc.sched.cpuset_to_sched_affinity(cpuset: c_void_p) set[int]

Convert the bitmap to the Python sched affinity set.

Windows-specific helpers

pyhwloc.hwloc.windows.get_nr_processor_groups(topology: c_void_p) int

See hwloc_windows_get_nr_processor_groups()

pyhwloc.hwloc.windows.get_processor_group_cpuset(topology: c_void_p, pg_index: int, cpuset: c_void_p) None

See hwloc_windows_get_processor_group_cpuset()