Struct vrp_core::utils::Parallelism
source · [−]pub struct Parallelism { /* private fields */ }Expand description
Specifies data parallelism settings.
Implementations
sourceimpl Parallelism
impl Parallelism
sourcepub fn new(num_thread_pools: usize, threads_per_pool: usize) -> Parallelism
pub fn new(num_thread_pools: usize, threads_per_pool: usize) -> Parallelism
Creates an instance of Parallelism.
sourcepub fn available_cpus(&self) -> usize
pub fn available_cpus(&self) -> usize
Amount of total available CPUs.
sourcepub fn thread_pool_execute<OP, R>(&self, idx: usize, op: OP) -> R where
OP: FnOnce() -> R + Send,
R: Send,
pub fn thread_pool_execute<OP, R>(&self, idx: usize, op: OP) -> R where
OP: FnOnce() -> R + Send,
R: Send,
Executes operation on thread pool with given index. If there is no thread pool with such index, then executes it without using any of thread pools.
sourcepub fn thread_pool_size(&self) -> usize
pub fn thread_pool_size(&self) -> usize
Returns amount of thread pools used. Returns zero if default thread pool is used.
Trait Implementations
sourceimpl Clone for Parallelism
impl Clone for Parallelism
sourcefn clone(&self) -> Parallelism
fn clone(&self) -> Parallelism
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more
sourceimpl Default for Parallelism
impl Default for Parallelism
sourcefn default() -> Parallelism
fn default() -> Parallelism
Returns the “default value” for a type. Read more
Auto Trait Implementations
impl !RefUnwindSafe for Parallelism
impl Send for Parallelism
impl Sync for Parallelism
impl Unpin for Parallelism
impl !UnwindSafe for Parallelism
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T> Pointable for T
impl<T> Pointable for T
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into)Uses borrowed data to replace owned data, usually by cloning. Read more