#[non_exhaustive]pub enum Parallelism {
#[non_exhaustive] Dynamic {
batchsize: NonZeroUsize,
ntasks: NonZeroUsize,
},
#[non_exhaustive] Sequential {
batchsize: NonZeroUsize,
},
#[non_exhaustive] Fixed {
batchsize: Option<NonZeroUsize>,
ntasks: NonZeroUsize,
},
}Expand description
Control the parallel partitioning strategy for build and build_tracked.
Many aspects of this enum are #[non_exhaustive] to allow for future extension.
Users should use the associated constructors instead to create instances.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
#[non_exhaustive]Dynamic
Use dynamic load balancing to partition the work into batches of at most batchsize.
When the batchsize is 1, the implementation guarantees sequential execution.
The batches assigned to each task can be assumed to be monotonically increasing.
See: Parallelism::dynamic.
Fields
This variant is marked as non-exhaustive
batchsize: NonZeroUsizentasks: NonZeroUsize#[non_exhaustive]Sequential
Run the build with just a single task. Input data is still batched.
See: Parallelism::sequential.
Fields
This variant is marked as non-exhaustive
batchsize: NonZeroUsize#[non_exhaustive]Fixed
Create a fixed parallelism strategy with ntasks executors. This strategy
partitions the problem space into roughly ntasks balanced contiguous chunks.
If batchsize is Some, than each chunk will be further subdivided into at most
batchsize sized subchunks which are then provided to Build::build.
If batchsize is None, then the entire task partition is supplied in a single call
to Build::build.
See: Parallelism::fixed.
Fields
This variant is marked as non-exhaustive
batchsize: Option<NonZeroUsize>ntasks: NonZeroUsizeImplementations§
Source§impl Parallelism
impl Parallelism
Sourcepub fn dynamic(batchsize: NonZeroUsize, ntasks: NonZeroUsize) -> Self
pub fn dynamic(batchsize: NonZeroUsize, ntasks: NonZeroUsize) -> Self
Create a dynamic parallelism strategy with the specified batchsize and ntasks.
Returns Self::Dynamic.
Sourcepub fn fixed(batchsize: Option<NonZeroUsize>, ntasks: NonZeroUsize) -> Self
pub fn fixed(batchsize: Option<NonZeroUsize>, ntasks: NonZeroUsize) -> Self
Create a fixed parallelism strategy with ntasks executors and possible
sub-partitioning into the specified batchsize.
Returns Self::Fixed.
Sourcepub fn sequential(batchsize: NonZeroUsize) -> Self
pub fn sequential(batchsize: NonZeroUsize) -> Self
Create a sequential parallelism strategy with the specified batchsize.
Returns Self::Sequential.
Trait Implementations§
Source§impl Clone for Parallelism
impl Clone for Parallelism
Source§fn clone(&self) -> Parallelism
fn clone(&self) -> Parallelism
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for Parallelism
impl Debug for Parallelism
Source§impl PartialEq for Parallelism
impl PartialEq for Parallelism
impl Copy for Parallelism
impl StructuralPartialEq for Parallelism
Auto Trait Implementations§
impl Freeze for Parallelism
impl RefUnwindSafe for Parallelism
impl Send for Parallelism
impl Sync for Parallelism
impl Unpin for Parallelism
impl UnsafeUnpin for Parallelism
impl UnwindSafe for Parallelism
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> DispatchRule<T> for T
impl<T> DispatchRule<T> for T
Source§type Error = Infallible
type Error = Infallible
convert.Source§fn try_match(_from: &T) -> Result<MatchScore, FailureScore>
fn try_match(_from: &T) -> Result<MatchScore, FailureScore>
Source§fn convert(from: T) -> Result<T, <T as DispatchRule<T>>::Error>
fn convert(from: T) -> Result<T, <T as DispatchRule<T>>::Error>
Source§fn description(f: &mut Formatter<'_>, from: Option<&T>) -> Result<(), Error>
fn description(f: &mut Formatter<'_>, from: Option<&T>) -> Result<(), Error>
Source§fn try_match_verbose<'a>(
from: &'a From,
) -> Result<MatchScore, TaggedFailureScore<'a>>where
Self: 'a,
fn try_match_verbose<'a>(
from: &'a From,
) -> Result<MatchScore, TaggedFailureScore<'a>>where
Self: 'a,
try_match but returns a reason for a failed score. Read more