ComputeResource Class Reference
HiCR
|
#include <computeResource.hpp>

Public Types | |
using | logicalProcessorId_t = unsigned int |
using | physicalProcessorId_t = unsigned int |
using | numaAffinity_t = unsigned int |
Public Member Functions | |
ComputeResource (hwloc_topology_t topology, const logicalProcessorId_t logicalProcessorId) | |
ComputeResource (const logicalProcessorId_t logicalProcessorId, const physicalProcessorId_t physicalProcessorId, const numaAffinity_t numaAffinity, std::unordered_set< std::shared_ptr< backend::hwloc::Cache > > caches) | |
~ComputeResource () override=default | |
ComputeResource () | |
__INLINE__ logicalProcessorId_t | getProcessorId () const |
__INLINE__ physicalProcessorId_t | getPhysicalProcessorId () const |
![]() | |
ComputeResource ()=default | |
ComputeResource (const nlohmann::json &input) | |
__INLINE__ std::string | getType () const |
__INLINE__ nlohmann::json | serialize () const |
__INLINE__ void | deserialize (const nlohmann::json &input) |
Static Public Member Functions | |
static __INLINE__ void | detectThreadPUs (hwloc_topology_t topology, hwloc_obj_t obj, int depth, std::vector< logicalProcessorId_t > &threadPUs) |
static __INLINE__ physicalProcessorId_t | detectPhysicalProcessorId (hwloc_topology_t topology, const logicalProcessorId_t logicalProcessorId) |
static __INLINE__ numaAffinity_t | detectCoreNUMAffinity (hwloc_topology_t topology, const logicalProcessorId_t logicalProcessorId) |
static __INLINE__ std::unordered_set< std::shared_ptr< backend::hwloc::Cache > > | detectCpuCaches (hwloc_topology_t topology, const logicalProcessorId_t logicalProcessorId) |
static __INLINE__ numaAffinity_t | getCpuNumaAffinity (hwloc_topology_t topology, const logicalProcessorId_t logicalProcessorId) |
Protected Member Functions | |
__INLINE__ void | serializeImpl (nlohmann::json &output) const override |
__INLINE__ void | deserializeImpl (const nlohmann::json &input) override |
Additional Inherited Members | |
![]() | |
std::string | _type |
Detailed Description
This class represents a compute resource, visible by HWLoc. That is, a CPU processing unit (core or hyperthread) with information about caches and locality.
Member Typedef Documentation
◆ logicalProcessorId_t
using HiCR::backend::hwloc::ComputeResource::logicalProcessorId_t = unsigned int |
System-given logical processor (core or hyperthread) identifier that this class instance represents
◆ numaAffinity_t
using HiCR::backend::hwloc::ComputeResource::numaAffinity_t = unsigned int |
System-given NUMA affinity identifier
◆ physicalProcessorId_t
using HiCR::backend::hwloc::ComputeResource::physicalProcessorId_t = unsigned int |
System-given physical processor identifier that this class instance represents
Constructor & Destructor Documentation
◆ ComputeResource() [1/3]
|
inline |
Constructor for the compute resource class of the hwloc backend
- Parameters
-
topology HWLoc topology object for discovery logicalProcessorId Os-determied core affinity assigned to this compute resource
◆ ComputeResource() [2/3]
|
inline |
Constructor for the compute resource class of the hwloc backend
- Parameters
-
[in] logicalProcessorId Unique identifier for the core assigned to this compute resource [in] numaAffinity The NUMA domain associated to this core [in] caches The set of caches contained to or accessible by this core [in] physicalProcessorId The identifier of the physical core as assigned by the OS
◆ ~ComputeResource()
|
overridevirtualdefault |
Default destructor
Reimplemented from HiCR::ComputeResource.
◆ ComputeResource() [3/3]
|
inline |
Default constructor for serialization/deserialization purposes
Member Function Documentation
◆ deserializeImpl()
|
inlineoverrideprotectedvirtual |
Backend-specific implementation of the deserialize function
- Parameters
-
[in] input Serialized compute resource information corresponding to the specific backend's topology manager
Reimplemented from HiCR::ComputeResource.
◆ detectCoreNUMAffinity()
|
inlinestatic |
Uses HWloc to discover the NUMA node associated with a given logical processor ID
- Parameters
-
[in] topology An HWLoc topology object, already initialized [in] logicalProcessorId The ID of the processor we are doing the search for
- Returns
- The ID of the associated memory space
◆ detectCpuCaches()
|
inlinestatic |
Uses HWloc to discover all caches associated with a given logical processor ID
- Parameters
-
[in] topology An HWLoc topology object, already initialized [in] logicalProcessorId The logical ID of the processor we are doing the search for
- Returns
- A vector of (type,size) entries, where type is a string describing the cache and size is the respective size in Bytes The 'type' string is has the following form: "Level <I/D/U> <P/S> <associated IDs>", where: Level: may be "L1", "L2, "L3" I/D/U: may be "Instruction", "Data", "Unified" P/S: may be "Private" or "Shared" associated IDs: (optional, for Shared cache) a list of core IDs, e.g. "0 1 2 3"
◆ detectPhysicalProcessorId()
|
inlinestatic |
Uses HWloc to discover the (physical) processor ID, associated with a given logical processor ID
- Parameters
-
[in] topology An HWLoc topology object, already initialized [in] logicalProcessorId The logical ID of the processor we are doing the search for
- Returns
- The ID of the associated physical identifier related to the passed logical processor id
◆ detectThreadPUs()
|
inlinestatic |
Uses HWloc to recursively (tree-like) identify the host's basic processing units (PUs)
- Parameters
-
[in] topology An HWLoc topology object, already initialized [in] obj The root HWLoc object for the start of the exploration tree at every recursion level [in] depth Stores the current exploration depth level, necessary to return only the processing units at the leaf level [out] threadPUs Storage for the found procesing units
◆ getCpuNumaAffinity()
|
inlinestatic |
Uses HWloc to discover the NUMA node associated with a given logical processor ID
- Parameters
-
[in] topology HWLoc topology object [in] logicalProcessorId The ID of the processor we are doing the search for
- Returns
- The ID of the associated memory space
◆ getPhysicalProcessorId()
|
inline |
Obtains the Core ID of the CPU; in non SMT systems that will be the actual id; in SMT it is the id of the actual core the thread belongs to.
- Returns
- The physical ID of the hardware Core
◆ getProcessorId()
|
inline |
Function to return the compute resource processor id
- Returns
- The processor id
◆ serializeImpl()
|
inlineoverrideprotectedvirtual |
Backend-specific implemtation of the serialize function that allows adding more information than the one provided by default by HiCR
- Parameters
-
[out] output JSON-formatted serialized compute resource information
Reimplemented from HiCR::ComputeResource.
The documentation for this class was generated from the following file:
- /home/runner/work/HiCR/HiCR/include/hicr/backends/hwloc/computeResource.hpp
Generated by