mirror of
https://github.com/JakeHillion/scx.git
synced 2024-11-26 11:30:22 +00:00
Merge pull request #585 from hodgesds/topo-node-cores
scx_utils: Add cores helper to node topology
This commit is contained in:
commit
36e81f81d7
@ -265,6 +265,17 @@ impl Node {
|
||||
cpus
|
||||
}
|
||||
|
||||
/// Get the map of all Cores for this NUMA node.
|
||||
pub fn cores(&self) -> BTreeMap<usize, Core> {
|
||||
let mut cores = BTreeMap::new();
|
||||
for (_, llc) in &self.llcs {
|
||||
for (core_id, core) in llc.cores() {
|
||||
cores.insert(*core_id, core.clone());
|
||||
}
|
||||
}
|
||||
cores
|
||||
}
|
||||
|
||||
// Get the map of all GPUs for this NUMA node.
|
||||
pub fn gpus(&self) -> &BTreeMap<GpuIndex, Gpu> {
|
||||
&self.gpus
|
||||
|
Loading…
Reference in New Issue
Block a user