![]() |
Realm
A distributed, event-based tasking library
|
Represents the topology of the host processor cores and memory. More...
#include <hardware_topology.h>
Classes | |
| struct | MemoryInfo |
| Represents memory information for a NUMA domain. More... | |
| struct | Proc |
| Represents a processor core with sharing relationships. More... | |
Public Types | |
| typedef int | ProcID |
| A unique integer identifier for a processor. | |
Public Member Functions | |
| HardwareTopology (void) | |
| Constructs an empty HardwareTopology instance. | |
| HardwareTopology (const std::vector< Proc > &logical_cores, const std::vector< MemoryInfo > &memories, const size_t host_memory) | |
| Constructs a HardwareTopology instance. | |
| ~HardwareTopology (void) | |
| Destructor for HardwareTopology. | |
| HardwareTopology & | operator= (const HardwareTopology &rhs)=default |
| void | remove_hyperthreads (void) |
| Removes hyperthreads from the topology. | |
| size_t | system_memory (void) const |
| Returns the size of system memory in bytes. | |
| unsigned | num_logical_cores (void) const |
| Returns the number of logical cores. | |
| unsigned | num_physical_cores (void) const |
| Returns the number of physical cores. | |
| unsigned | num_numa_domains (void) const |
| Returns the number of NUMA domains. | |
| void | get_logical_cores (std::set< ProcID > &cores) const |
| Retrieves the set of logical core IDs. | |
| bool | has_processor (ProcID proc_id) const |
| Checks if a processor exists in the topology. | |
| bool | numa_domain_has_processors (int domain_id) const |
| Checks if a NUMA domain exists in the topology and has processors. | |
| const std::set< ProcID > & | get_processors_by_domain (int domain_id) const |
| Gets the processors in a specific NUMA domain. | |
| const std::set< ProcID > & | get_processors_share_alu (ProcID proc_id) const |
| Gets processors sharing an ALU with a specified processor. | |
| const std::set< ProcID > & | get_processors_share_fpu (ProcID proc_id) const |
| Gets processors sharing an FPU with a specified processor. | |
| const std::set< ProcID > & | get_processors_share_ldst (ProcID proc_id) const |
| Gets processors sharing LD/ST with a specified processor. | |
| const std::set< ProcID > & | get_kernel_processor_ids (ProcID proc_id) const |
| Gets kernel processor IDs (usually assigned by OS) associated with a specified processor. | |
| std::vector< ProcID > | distribute_processors_across_domains (void) const |
| Distributes processors across NUMA domains. | |
Static Public Member Functions | |
| static HardwareTopology | create_topology (void) |
| Creates a topology instance based on the system's hardware. | |
Friends | |
| std::ostream & | operator<< (std::ostream &os, const HardwareTopology &topo) |
| Outputs the topology information to a stream. | |
Represents the topology of the host processor cores and memory.
This class provides an abstraction for enumerating processor cores and the ways in which they share components (e.g., ALU, FPU, LD/ST). It also describes NUMA domains and memory information for optimal resource allocation.
A unique integer identifier for a processor.
| Realm::HardwareTopology::HardwareTopology | ( | void | ) |
Constructs an empty HardwareTopology instance.
| Realm::HardwareTopology::HardwareTopology | ( | const std::vector< Proc > & | logical_cores, |
| const std::vector< MemoryInfo > & | memories, | ||
| const size_t | host_memory | ||
| ) |
Constructs a HardwareTopology instance.
| logical_cores | Vector of logical cores in the system. |
| memories | Vector of memory information for the system. |
| host_memory | Total host memory size. |
| Realm::HardwareTopology::~HardwareTopology | ( | void | ) |
Destructor for HardwareTopology.
|
static |
Creates a topology instance based on the system's hardware.
| std::vector< ProcID > Realm::HardwareTopology::distribute_processors_across_domains | ( | void | ) | const |
Distributes processors across NUMA domains.
| void Realm::HardwareTopology::get_logical_cores | ( | std::set< ProcID > & | cores | ) | const |
Retrieves the set of logical core IDs.
| cores | Output parameter to store the set of logical core IDs. |
| const std::set< ProcID > & Realm::HardwareTopology::get_processors_by_domain | ( | int | domain_id | ) | const |
Gets the processors in a specific NUMA domain.
| domain_id | NUMA domain ID. |
| bool Realm::HardwareTopology::has_processor | ( | ProcID | proc_id | ) | const |
| unsigned Realm::HardwareTopology::num_logical_cores | ( | void | ) | const |
Returns the number of logical cores.
| unsigned Realm::HardwareTopology::num_numa_domains | ( | void | ) | const |
Returns the number of NUMA domains.
| unsigned Realm::HardwareTopology::num_physical_cores | ( | void | ) | const |
Returns the number of physical cores.
| bool Realm::HardwareTopology::numa_domain_has_processors | ( | int | domain_id | ) | const |
Checks if a NUMA domain exists in the topology and has processors.
| domain_id | NUMA domain ID to check. |
|
default |
| void Realm::HardwareTopology::remove_hyperthreads | ( | void | ) |
Removes hyperthreads from the topology.
| size_t Realm::HardwareTopology::system_memory | ( | void | ) | const |
Returns the size of system memory in bytes.
|
friend |
Outputs the topology information to a stream.
| os | Output stream. |
| topo | HardwareTopology instance. |