pub struct MockMPI { /* private fields */ }Expand description
Minimal rank/size-only stub, for tests of logic that only reads
MPIInterface::rank/MPIInterface::size (e.g. the crate-private
WorkDistribution) and never actually exercises cross-rank communication.
Its collective methods are deliberately no-ops (broadcast/gather leave
data untouched; send/recv never actually transfer anything) — with
only one instance in existence there is no “other side” to communicate
with, so pretending otherwise would silently fabricate results. Using
this with size > 1 to drive an actual algorithm (e.g.
algorithms::DistributedDifferentialEvolution) will silently skip all
cross-rank exchange. For real multi-rank end-to-end testing, use
ThreadRankMpi, which backs every collective with genuine
cross-thread synchronization.
Implementations§
Trait Implementations§
Source§impl MPIInterface for MockMPI
impl MPIInterface for MockMPI
Source§fn broadcast<T>(&self, _data: &mut [T], _root: i32) -> ScirsResult<()>
fn broadcast<T>(&self, _data: &mut [T], _root: i32) -> ScirsResult<()>
Source§fn gather<T>(
&self,
_send_data: &[T],
_recv_data: Option<&mut [T]>,
_root: i32,
) -> ScirsResult<()>
fn gather<T>( &self, _send_data: &[T], _recv_data: Option<&mut [T]>, _root: i32, ) -> ScirsResult<()>
Source§fn allreduce<T>(
&self,
send_data: &[T],
recv_data: &mut [T],
_op: ReductionOp,
) -> ScirsResult<()>
fn allreduce<T>( &self, send_data: &[T], recv_data: &mut [T], _op: ReductionOp, ) -> ScirsResult<()>
Source§fn barrier(&self) -> ScirsResult<()>
fn barrier(&self) -> ScirsResult<()>
Auto Trait Implementations§
impl Freeze for MockMPI
impl RefUnwindSafe for MockMPI
impl Send for MockMPI
impl Sync for MockMPI
impl Unpin for MockMPI
impl UnsafeUnpin for MockMPI
impl UnwindSafe for MockMPI
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
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>
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.