Expand description
This module defines parallel operations that are implemented in one way for the serial compiler, and another way the parallel compiler.
Re-exportsΒ§
use std::any::Any;πuse std::ops::Index;πuse std::ops::Range;πuse std::panic::AssertUnwindSafe;πuse std::panic::catch_unwind;πuse std::panic::resume_unwind;πuse parking_lot::Mutex;πuse crate::FatalErrorMarker;πuse crate::sync::DynSend;πuse crate::sync::DynSync;πuse crate::sync::FromDyn;πuse crate::sync::IntoDynSyncSend;πuse crate::sync::mode;π
StructsΒ§
- Parallel
Guard - A guard used to hold panics that occur during a parallel section to later by unwound. This is used for the parallel compiler to prevent fatal errors from non-deterministically hiding errors by ensuring that everything in the section has completed executing before continuing with unwinding. Itβs also used for the non-parallel code to ensure error message output match the parallel compiler for testing purposes.
ConstantsΒ§
- MAX_
GROUP_ πCOUNT
TraitsΒ§
FunctionsΒ§
- broadcast
- par_fns
- Runs the functions in parallel.
- par_
for_ each_ in - par_
for_ each_ slice - par_
join - par_map
- par_
range - Executes the given action
opwith each index from rangerangein parallel if the parallel frontend is enabled, otherwise executes them sequentially. Action is executed with each index under parallel guard in both scenarios so if one of them panics all others will be executed anyway. - par_
range_ πinternal - par_
slice_ πmut - parallel_
guard - This gives access to a fresh parallel guard in the closure and will unwind any panics caught in it after the closure returns.
- serial_
join π - spawn
- try_
par_ for_ each_ in - This runs
for_eachin parallel for each iterator item. If one or more of thefor_eachcalls returnsErr, the function will also returnErr. The error returned will be non-deterministic, but this is expected to be used withErrorGuaranteedwhich are all equivalent.