pub struct ParReduce {
pub size: usize,
pub op: ReduceOp,
pub config: ParallelConfig,
}Expand description
Parallel reduce descriptor.
result = parReduce(combine, map_fn, input)
// Equivalent to: result = combine(map_fn(input[0]), map_fn(input[1]), ...)Fields§
§size: usizeNumber of elements.
op: ReduceOpReduction operation.
config: ParallelConfigParallel configuration.
Implementations§
Source§impl ParReduce
impl ParReduce
Sourcepub fn deterministic(self, det: bool) -> Self
pub fn deterministic(self, det: bool) -> Self
Set deterministic mode.
Sourcepub fn chunk_assignments(&self) -> Vec<Range>
pub fn chunk_assignments(&self) -> Vec<Range>
Generate chunk assignments for workers.
For deterministic mode, chunks are assigned in order:
- Worker 0 gets elements [0, chunk_size)
- Worker 1 gets elements [chunk_size, 2*chunk_size)
- etc.
Final reduction combines partial results in worker order.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ParReduce
impl RefUnwindSafe for ParReduce
impl Send for ParReduce
impl Sync for ParReduce
impl Unpin for ParReduce
impl UnsafeUnpin for ParReduce
impl UnwindSafe for ParReduce
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more