chain_width to 50

Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
Jason Volk
2025-04-22 04:42:26 +00:00
parent 9b658d86b2
commit 76509830e6
190 changed files with 3469 additions and 930 deletions

View File

@@ -70,7 +70,9 @@ pub fn get_affinity() -> impl Iterator<Item = Id> { from_mask(CORE_AFFINITY.get(
/// List the cores sharing SMT-tier resources
pub fn smt_siblings() -> impl Iterator<Item = Id> {
from_mask(get_affinity().fold(0_u128, |mask, id| {
mask | SMT_TOPOLOGY.get(id).expect("ID must not exceed max cpus")
mask | SMT_TOPOLOGY
.get(id)
.expect("ID must not exceed max cpus")
}))
}
@@ -78,20 +80,30 @@ pub fn smt_siblings() -> impl Iterator<Item = Id> {
/// affinity.
pub fn node_siblings() -> impl Iterator<Item = Id> {
from_mask(get_affinity().fold(0_u128, |mask, id| {
mask | NODE_TOPOLOGY.get(id).expect("Id must not exceed max cpus")
mask | NODE_TOPOLOGY
.get(id)
.expect("Id must not exceed max cpus")
}))
}
/// Get the cores sharing SMT resources relative to id.
#[inline]
pub fn smt_affinity(id: Id) -> impl Iterator<Item = Id> {
from_mask(*SMT_TOPOLOGY.get(id).expect("ID must not exceed max cpus"))
from_mask(
*SMT_TOPOLOGY
.get(id)
.expect("ID must not exceed max cpus"),
)
}
/// Get the cores sharing Node resources relative to id.
#[inline]
pub fn node_affinity(id: Id) -> impl Iterator<Item = Id> {
from_mask(*NODE_TOPOLOGY.get(id).expect("ID must not exceed max cpus"))
from_mask(
*NODE_TOPOLOGY
.get(id)
.expect("ID must not exceed max cpus"),
)
}
/// Get the number of threads which could execute in parallel based on hardware