18#ifndef REALM_TOPOLOGY_H
19#define REALM_TOPOLOGY_H
90 const std::vector<MemoryInfo> &memories,
const size_t host_memory);
199 size_t sys_memory_size{0};
200 unsigned physical_cores{0};
202 typedef std::map<ProcID, Proc> ProcMap;
210 std::set<ProcID> logical_cores;
213 typedef std::map<int, DomainInfo> DomainMap;
Represents the topology of the host processor cores and memory.
Definition hardware_topology.h:38
void remove_hyperthreads(void)
Removes hyperthreads from the topology.
int ProcID
A unique integer identifier for a processor.
Definition hardware_topology.h:45
size_t system_memory(void) const
Returns the size of system memory in bytes.
const std::set< ProcID > & get_processors_share_alu(ProcID proc_id) const
Gets processors sharing an ALU with a specified processor.
HardwareTopology & operator=(const HardwareTopology &rhs)=default
std::vector< ProcID > distribute_processors_across_domains(void) const
Distributes processors across NUMA domains.
const std::set< ProcID > & get_processors_by_domain(int domain_id) const
Gets the processors in a specific NUMA domain.
HardwareTopology(void)
Constructs an empty HardwareTopology instance.
bool numa_domain_has_processors(int domain_id) const
Checks if a NUMA domain exists in the topology and has processors.
friend std::ostream & operator<<(std::ostream &os, const HardwareTopology &topo)
Outputs the topology information to a stream.
HardwareTopology(const std::vector< Proc > &logical_cores, const std::vector< MemoryInfo > &memories, const size_t host_memory)
Constructs a HardwareTopology instance.
static HardwareTopology create_topology(void)
Creates a topology instance based on the system's hardware.
bool has_processor(ProcID proc_id) const
Checks if a processor exists in the topology.
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.
~HardwareTopology(void)
Destructor for HardwareTopology.
unsigned num_logical_cores(void) const
Returns the number of logical cores.
unsigned num_numa_domains(void) const
Returns the number of NUMA domains.
unsigned num_physical_cores(void) const
Returns the number of physical cores.
const std::set< ProcID > & get_processors_share_ldst(ProcID proc_id) const
Gets processors sharing LD/ST with a specified processor.
void get_logical_cores(std::set< ProcID > &cores) const
Retrieves the set of logical core IDs.
const std::set< ProcID > & get_processors_share_fpu(ProcID proc_id) const
Gets processors sharing an FPU with a specified processor.
Definition activemsg.h:38
Represents memory information for a NUMA domain.
Definition hardware_topology.h:67
int domain
NUMA domain associated with the memory.
Definition hardware_topology.h:69
size_t bytes
Size of memory in bytes.
Definition hardware_topology.h:68
Represents a processor core with sharing relationships.
Definition hardware_topology.h:51
int domain
NUMA domain the processor belongs to.
Definition hardware_topology.h:53
std::set< ProcID > shares_alu
Set of processors sharing an ALU with this processor.
Definition hardware_topology.h:56
std::set< ProcID > shares_fpu
Set of processors sharing an FPU with this processor.
Definition hardware_topology.h:58
std::set< ProcID > kernel_proc_ids
Set of kernel processor IDs (may be empty).
Definition hardware_topology.h:54
ProcID id
Unique processor identifier.
Definition hardware_topology.h:52
std::set< ProcID > shares_ldst
Set of processors sharing LD/ST paths with this processor.
Definition hardware_topology.h:60