Skip to main content

compute_load_balance

Function compute_load_balance 

Source
pub fn compute_load_balance(
    n: usize,
    num_workers: usize,
    strategy: LoadBalanceStrategy,
    item_weights: Option<&[f64]>,
) -> LoadBalancePlan
Expand description

Compute a load balance plan for n items across num_workers workers.

For Static strategy, item_weights is ignored. For Weighted strategy, items are assigned sequentially to workers to balance the total weight per worker. For Guided strategy, chunks start large and shrink.