Struct vrp_core::utils::Parallelism
source · pub struct Parallelism { /* private fields */ }
Expand description
Specifies data parallelism settings.
Implementations§
source§impl 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 new_with_cpus(available_cpus: usize) -> Parallelism
pub fn new_with_cpus(available_cpus: usize) -> Parallelism
Creates an instance of Parallelism
using available cpus as given.
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
pub fn thread_pool_execute<OP, R>(&self, idx: usize, op: OP) -> R
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§
source§impl Clone for Parallelism
impl Clone for Parallelism
source§fn clone(&self) -> Parallelism
fn clone(&self) -> Parallelism
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Default for Parallelism
impl Default for Parallelism
source§fn 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§
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