extendr_api::prelude::utils::thread

Function par_split_indices

pub fn par_split_indices(
    n: usize,
    idx: usize,
    chunk_count: usize,
) -> (usize, usize)
Expand description

Returns the start and length of a subsegment of 0..n, split between chunk_count consumers, for the consumer at index idx.

For the same n and chunk_count, different values of idx between in 0..chunk_count will represent distinct subsegments.