pub struct RayonComm;Expand description
Shared-memory communicator using Rayon for parallelism.
Implements the Comm trait for shared-memory parallelism. All collective operations
are no-ops or local, as there is no inter-process communication.
Implementations§
Trait Implementations§
Source§impl Comm for RayonComm
impl Comm for RayonComm
Source§fn barrier(&self)
fn barrier(&self)
Synchronization barrier (no-op in shared memory, but uses a Rayon scope for API compatibility).
Source§fn scatter<T: Clone>(&self, global: &[T], out: &mut [T], root: usize)
fn scatter<T: Clone>(&self, global: &[T], out: &mut [T], root: usize)
Mimics scatter operation by copying a chunk of the global array to the output buffer.
§Arguments
global- The global data array.out- The output buffer to fill.root- The root rank (used as an offset multiplier).
Source§fn gather<T: Clone>(&self, local: &[T], out: &mut Vec<T>, _root: usize)
fn gather<T: Clone>(&self, local: &[T], out: &mut Vec<T>, _root: usize)
Mimics gather operation by copying the local buffer into the output vector.
§Arguments
local- The local data buffer.out- The output vector to fill._root- The root rank (unused).
Source§fn all_reduce(&self, x: f64) -> f64
fn all_reduce(&self, x: f64) -> f64
All-reduce operation (no-op, returns input value).
In shared memory, all-reduce is unnecessary, so this just returns the input.
Source§fn all_reduce_f64(&self, local: f64) -> f64
fn all_reduce_f64(&self, local: f64) -> f64
All‐reduce a scalar (sum) across ranks - new trait method
Source§fn split(&self, _color: i32, _key: i32) -> UniverseComm
fn split(&self, _color: i32, _key: i32) -> UniverseComm
Split this communicator into sub‐colors
Source§fn parallel_mat_vec(&self, a: &Mat<f64>, x: &[f64], y: &mut [f64])
fn parallel_mat_vec(&self, a: &Mat<f64>, x: &[f64], y: &mut [f64])
Parallel matrix-vector multiplication using Rayon.
§Arguments
a- Matrix (faer::Mat). x- Input vector.y- Output vector (will be overwritten).
type Vec = Vec<f64>
type Request<'a> = ()
Source§fn irecv_from<'a>(&'a self, _buf: &'a mut [f64], _src: i32) -> Self::Request<'a>
fn irecv_from<'a>(&'a self, _buf: &'a mut [f64], _src: i32) -> Self::Request<'a>
Nonblocking receive into
buf from src.Source§fn isend_to<'a>(&'a self, _buf: &'a [f64], _dest: i32) -> Self::Request<'a>
fn isend_to<'a>(&'a self, _buf: &'a [f64], _dest: i32) -> Self::Request<'a>
Nonblocking send of
buf to dest.Source§fn irecv_from_u64<'a>(
&'a self,
_buf: &'a mut [u64],
_src: i32,
) -> Self::Request<'a>
fn irecv_from_u64<'a>( &'a self, _buf: &'a mut [u64], _src: i32, ) -> Self::Request<'a>
Nonblocking receive of u64 words.
Source§fn isend_to_u64<'a>(&'a self, _buf: &'a [u64], _dest: i32) -> Self::Request<'a>
fn isend_to_u64<'a>(&'a self, _buf: &'a [u64], _dest: i32) -> Self::Request<'a>
Nonblocking send of u64 words.
Source§fn allreduce_sum(&self, x: f64) -> f64
fn allreduce_sum(&self, x: f64) -> f64
Reduce one scalar (sum) across ranks.
Source§fn allreduce_sum2(&self, a: f64, b: f64) -> (f64, f64)
fn allreduce_sum2(&self, a: f64, b: f64) -> (f64, f64)
Reduce two scalars (sum) in a single collective. Default: two single reductions.
Source§fn allreduce_sum_slice(&self, v: &mut [f64])
fn allreduce_sum_slice(&self, v: &mut [f64])
Reduce a slice of scalars in place (sum).
fn dot(&self, a: &[f64], b: &[f64]) -> f64
Auto Trait Implementations§
impl Freeze for RayonComm
impl RefUnwindSafe for RayonComm
impl Send for RayonComm
impl Sync for RayonComm
impl Unpin for RayonComm
impl UnwindSafe for RayonComm
Blanket Implementations§
Source§impl<Src, Scheme> ApproxFrom<Src, Scheme> for Srcwhere
Scheme: ApproxScheme,
impl<Src, Scheme> ApproxFrom<Src, Scheme> for Srcwhere
Scheme: ApproxScheme,
Source§fn approx_from(src: Src) -> Result<Src, <Src as ApproxFrom<Src, Scheme>>::Err>
fn approx_from(src: Src) -> Result<Src, <Src as ApproxFrom<Src, Scheme>>::Err>
Convert the given value into an approximately equivalent representation.
Source§impl<Dst, Src, Scheme> ApproxInto<Dst, Scheme> for Srcwhere
Dst: ApproxFrom<Src, Scheme>,
Scheme: ApproxScheme,
impl<Dst, Src, Scheme> ApproxInto<Dst, Scheme> for Srcwhere
Dst: ApproxFrom<Src, Scheme>,
Scheme: ApproxScheme,
Source§type Err = <Dst as ApproxFrom<Src, Scheme>>::Err
type Err = <Dst as ApproxFrom<Src, Scheme>>::Err
The error type produced by a failed conversion.
Source§fn approx_into(self) -> Result<Dst, <Src as ApproxInto<Dst, Scheme>>::Err>
fn approx_into(self) -> Result<Dst, <Src as ApproxInto<Dst, Scheme>>::Err>
Convert the subject into an approximately equivalent representation.
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, Dst> ConvAsUtil<Dst> for T
impl<T, Dst> ConvAsUtil<Dst> for T
Source§impl<T> ConvUtil for T
impl<T> ConvUtil for T
Source§fn approx_as<Dst>(self) -> Result<Dst, Self::Err>where
Self: Sized + ApproxInto<Dst>,
fn approx_as<Dst>(self) -> Result<Dst, Self::Err>where
Self: Sized + ApproxInto<Dst>,
Approximate the subject to a given type with the default scheme.
Source§fn approx_as_by<Dst, Scheme>(self) -> Result<Dst, Self::Err>
fn approx_as_by<Dst, Scheme>(self) -> Result<Dst, Self::Err>
Approximate the subject to a given type with a specific scheme.
Source§impl<T> DistributionExt for Twhere
T: ?Sized,
impl<T> DistributionExt for Twhere
T: ?Sized,
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