MCPcopy Create free account
hub / github.com/argumentcomputer/ix / balanced_partition

Function balanced_partition

crates/kernel/src/shard.rs:2082–2091  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2080
2081/// Per-shard predicted full STEPS (floor + member step-cost + cross-ingress),
2082/// indexed by shard id, from a built manifest and its block assignment.
2083fn per_shard_steps(
2084 profile: &BlockProfile,
2085 shard_of: &[u32],
2086 manifest: &ShardManifest,
2087) -> Vec<u64> {
2088 let mut steps = vec![0u64; manifest.shards.len()];
2089 for (b, &s) in shard_of.iter().enumerate() {
2090 steps[s as usize] = steps[s as usize]
2091 .saturating_add(block_step_cost(profile.block(b as u32)));
2092 }
2093 for sh in &manifest.shards {
2094 let i = sh.id as usize;

Callers

nothing calls this directly

Calls 2

two_clustersFunction · 0.85
partitionMethod · 0.80

Tested by

no test coverage detected