pub struct ParallelConfig {
pub n_workers: Option<usize>,
pub chunk_size: Option<usize>,
}
Expand description
Configuration for parallel execution
Fields§
§n_workers: Option<usize>
Number of worker threads to use If None, uses Rayon’s default (usually the number of logical CPUs)
chunk_size: Option<usize>
Chunk size for parallel iterators If None, Rayon chooses automatically
Implementations§
Source§impl ParallelConfig
impl ParallelConfig
Sourcepub fn with_workers(self, n_workers: usize) -> Self
pub fn with_workers(self, n_workers: usize) -> Self
Set the number of worker threads
Sourcepub fn with_chunk_size(self, chunk_size: usize) -> Self
pub fn with_chunk_size(self, chunk_size: usize) -> Self
Set the chunk size for parallel iterators
Sourcepub fn init_thread_pool(&self) -> InterpolateResult<()>
pub fn init_thread_pool(&self) -> InterpolateResult<()>
Thread pool initialization is now handled globally by scirs2-core This method is kept for compatibility but no longer creates a new pool
Sourcepub fn get_chunk_size(&self, total_size: usize) -> usize
pub fn get_chunk_size(&self, total_size: usize) -> usize
Get the chunk size to use for a given total size
Trait Implementations§
Source§impl Clone for ParallelConfig
impl Clone for ParallelConfig
Source§fn clone(&self) -> ParallelConfig
fn clone(&self) -> ParallelConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for ParallelConfig
impl Debug for ParallelConfig
Source§impl Default for ParallelConfig
impl Default for ParallelConfig
Source§fn default() -> ParallelConfig
fn default() -> ParallelConfig
Returns the “default value” for a type. Read more
impl Copy for ParallelConfig
Auto Trait Implementations§
impl Freeze for ParallelConfig
impl RefUnwindSafe for ParallelConfig
impl Send for ParallelConfig
impl Sync for ParallelConfig
impl Unpin for ParallelConfig
impl UnwindSafe for ParallelConfig
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more