pub struct SimpleCommunicator { /* private fields */ }Expand description
A communicator. In rsmpi 0.8.x this single type replaces the earlier
SystemCommunicator (world) and UserCommunicator (derived) types.
Implementations§
Source§impl SimpleCommunicator
impl SimpleCommunicator
Sourcepub fn world() -> SimpleCommunicator
pub fn world() -> SimpleCommunicator
The world communicator for the current process.
Trait Implementations§
Source§impl AsRaw for SimpleCommunicator
impl AsRaw for SimpleCommunicator
Source§impl Clone for SimpleCommunicator
impl Clone for SimpleCommunicator
Source§impl Communicator for SimpleCommunicator
impl Communicator for SimpleCommunicator
Source§fn target_size(&self) -> Rank
fn target_size(&self) -> Rank
Number of processes on the remote side (equals
Communicator::size
for an intra-communicator).Source§fn process_at_rank(&self, r: Rank) -> Process<'_>
fn process_at_rank(&self, r: Rank) -> Process<'_>
A handle to the process with the given rank.
Source§fn this_process(&self) -> Process<'_>
fn this_process(&self) -> Process<'_>
A handle to this process.
Source§fn any_process(&self) -> AnyProcess<'_>
fn any_process(&self) -> AnyProcess<'_>
A handle matching any source (
MPI_ANY_SOURCE), for receives.Source§fn compare(&self, other: &dyn Communicator) -> CommunicatorRelation
fn compare(&self, other: &dyn Communicator) -> CommunicatorRelation
Compare this communicator to
other (MPI_Comm_compare).Source§fn duplicate(&self) -> SimpleCommunicator
fn duplicate(&self) -> SimpleCommunicator
Duplicate the communicator with a fresh context (
MPI_Comm_dup).
Collective over all members.Source§fn split_by_color(&self, color: Color) -> Option<SimpleCommunicator>
fn split_by_color(&self, color: Color) -> Option<SimpleCommunicator>
Split the communicator by colour (
MPI_Comm_split). Collective.Source§fn split_by_color_with_key(
&self,
color: Color,
key: Key,
) -> Option<SimpleCommunicator>
fn split_by_color_with_key( &self, color: Color, key: Key, ) -> Option<SimpleCommunicator>
Split by colour, ordering new ranks by
key then old rank
(MPI_Comm_split). Collective.Source§fn split_by_subgroup(&self, group: &Group) -> Option<SimpleCommunicator>
fn split_by_subgroup(&self, group: &Group) -> Option<SimpleCommunicator>
Split by an explicit subgroup (
MPI_Comm_create style). Collective;
returns None for processes not in group.Source§fn abort(&self, errorcode: i32) -> !
fn abort(&self, errorcode: i32) -> !
Abort the whole job with an exit code (
MPI_Abort). Notifies every peer
so the entire job exits rather than leaving ranks blocked.Source§fn pack_size(&self, incount: Count, dt: DatatypeRef) -> Count
fn pack_size(&self, incount: Count, dt: DatatypeRef) -> Count
Number of bytes needed to pack
incount elements of datatype dt
(MPI_Pack_size).Source§fn pack<Buf: Buffer + ?Sized>(&self, inbuf: &Buf) -> Vec<u8> ⓘwhere
Self: Sized,
fn pack<Buf: Buffer + ?Sized>(&self, inbuf: &Buf) -> Vec<u8> ⓘwhere
Self: Sized,
Pack a buffer into a freshly allocated byte vector (
MPI_Pack). Since
this implementation uses contiguous native layouts, packing is a copy.Source§fn pack_into<Buf: Buffer + ?Sized>(
&self,
inbuf: &Buf,
outbuf: &mut [u8],
position: Count,
) -> Countwhere
Self: Sized,
fn pack_into<Buf: Buffer + ?Sized>(
&self,
inbuf: &Buf,
outbuf: &mut [u8],
position: Count,
) -> Countwhere
Self: Sized,
Pack a buffer into
outbuf starting at byte offset position, returning
the new position (MPI_Pack).Source§unsafe fn unpack_into<Buf: BufferMut + ?Sized>(
&self,
inbuf: &[u8],
outbuf: &mut Buf,
position: Count,
) -> Countwhere
Self: Sized,
unsafe fn unpack_into<Buf: BufferMut + ?Sized>(
&self,
inbuf: &[u8],
outbuf: &mut Buf,
position: Count,
) -> Countwhere
Self: Sized,
Unpack from
inbuf starting at byte offset position into outbuf,
returning the new position (MPI_Unpack). Read moreSource§fn create_graph_communicator(
&self,
index: &[Count],
edges: &[Count],
) -> Option<GraphCommunicator>
fn create_graph_communicator( &self, index: &[Count], edges: &[Count], ) -> Option<GraphCommunicator>
Create a graph topology communicator (
MPI_Graph_create). Read moreSource§fn create_dist_graph_adjacent(
&self,
sources: &[Rank],
destinations: &[Rank],
) -> DistGraphCommunicator
fn create_dist_graph_adjacent( &self, sources: &[Rank], destinations: &[Rank], ) -> DistGraphCommunicator
Create a distributed-graph topology where this rank receives from
sources and sends to destinations (MPI_Dist_graph_create_adjacent).
Collective; each rank supplies its own adjacency.Source§fn split_intercommunicator(&self, in_group_a: bool) -> InterCommunicator
fn split_intercommunicator(&self, in_group_a: bool) -> InterCommunicator
Collectively split this communicator into an inter-communicator between
two disjoint groups. Ranks passing
true form one group (“A”); the rest
form the other. Each rank’s InterCommunicator has the other group
as its remote group (MPI_Intercomm_create-style, collective).Source§fn create_cartesian_communicator(
&self,
dims: &[Count],
periods: &[bool],
_reorder: bool,
) -> Option<CartesianCommunicator>
fn create_cartesian_communicator( &self, dims: &[Count], periods: &[bool], _reorder: bool, ) -> Option<CartesianCommunicator>
Create a Cartesian topology communicator (
MPI_Cart_create). Read moreSource§fn parent(&self) -> Option<InterCommunicator>
fn parent(&self) -> Option<InterCommunicator>
If this process was created by
crate::collective::Root::spawn,
return the inter-communicator to the parent group (MPI_Comm_get_parent).
The local group is this world; the remote group is the spawner.Auto Trait Implementations§
impl Freeze for SimpleCommunicator
impl RefUnwindSafe for SimpleCommunicator
impl Send for SimpleCommunicator
impl Sync for SimpleCommunicator
impl Unpin for SimpleCommunicator
impl UnsafeUnpin for SimpleCommunicator
impl UnwindSafe for SimpleCommunicator
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<C> CommunicatorAttributes for Cwhere
C: Communicator + ?Sized,
impl<C> CommunicatorAttributes for Cwhere
C: Communicator + ?Sized,
Source§fn set_attr<T: Any + Send + Sync>(&self, key: &CommKeyval, value: T)
fn set_attr<T: Any + Send + Sync>(&self, key: &CommKeyval, value: T)
Cache
value under key on this communicator (MPI_Comm_set_attr).Source§fn get_attr<T: Any + Clone>(&self, key: &CommKeyval) -> Option<T>
fn get_attr<T: Any + Clone>(&self, key: &CommKeyval) -> Option<T>
Retrieve a clone of the attribute cached under
key
(MPI_Comm_get_attr), if present and of type T.Source§fn has_attr(&self, key: &CommKeyval) -> bool
fn has_attr(&self, key: &CommKeyval) -> bool
Whether an attribute is cached under
key.Source§fn delete_attr(&self, key: &CommKeyval)
fn delete_attr(&self, key: &CommKeyval)
Remove the attribute cached under
key (MPI_Comm_delete_attr).Source§impl<C> CommunicatorCollectives for Cwhere
C: Communicator + ?Sized,
impl<C> CommunicatorCollectives for Cwhere
C: Communicator + ?Sized,
Source§fn all_gather_into<S, R>(&self, sendbuf: &S, recvbuf: &mut R)
fn all_gather_into<S, R>(&self, sendbuf: &S, recvbuf: &mut R)
Gather equal-sized contributions from all ranks to all ranks
(
MPI_Allgather).Source§fn try_all_gather_into<S, R>(
&self,
sendbuf: &S,
recvbuf: &mut R,
) -> Result<(), MpiError>
fn try_all_gather_into<S, R>( &self, sendbuf: &S, recvbuf: &mut R, ) -> Result<(), MpiError>
Fallible
all_gather_into.Source§fn all_to_all_into<S, R>(&self, sendbuf: &S, recvbuf: &mut R)
fn all_to_all_into<S, R>(&self, sendbuf: &S, recvbuf: &mut R)
All-to-all scatter/gather with equal block sizes (
MPI_Alltoall).Source§fn try_all_to_all_into<S, R>(
&self,
sendbuf: &S,
recvbuf: &mut R,
) -> Result<(), MpiError>
fn try_all_to_all_into<S, R>( &self, sendbuf: &S, recvbuf: &mut R, ) -> Result<(), MpiError>
Fallible
all_to_all_into.Source§fn all_reduce_into<S, R, O>(&self, sendbuf: &S, recvbuf: &mut R, op: O)
fn all_reduce_into<S, R, O>(&self, sendbuf: &S, recvbuf: &mut R, op: O)
Reduce contributions from all ranks and make the result available on all
ranks (
MPI_Allreduce).Source§fn try_all_reduce_into<S, R, O>(
&self,
sendbuf: &S,
recvbuf: &mut R,
op: O,
) -> Result<(), MpiError>
fn try_all_reduce_into<S, R, O>( &self, sendbuf: &S, recvbuf: &mut R, op: O, ) -> Result<(), MpiError>
Fallible
all_reduce_into.Source§fn all_reduce_into_in_place<R, O>(&self, buf: &mut R, op: O)
fn all_reduce_into_in_place<R, O>(&self, buf: &mut R, op: O)
In-place all-reduce:
buf is both the input and the output
(MPI_Allreduce with MPI_IN_PLACE).Source§fn all_gather_into_in_place<R>(&self, buf: &mut R)
fn all_gather_into_in_place<R>(&self, buf: &mut R)
In-place all-gather:
buf holds this rank’s block at slot rank on
entry and every rank’s block on return (MPI_Allgather with
MPI_IN_PLACE).Source§fn reduce_scatter_block_into<S, R, O>(
&self,
sendbuf: &S,
recvbuf: &mut R,
op: O,
)
fn reduce_scatter_block_into<S, R, O>( &self, sendbuf: &S, recvbuf: &mut R, op: O, )
Reduce, then scatter equal-sized blocks of the result
(
MPI_Reduce_scatter_block).Source§fn scan_into<S, R, O>(&self, sendbuf: &S, recvbuf: &mut R, op: O)
fn scan_into<S, R, O>(&self, sendbuf: &S, recvbuf: &mut R, op: O)
Inclusive prefix reduction (
MPI_Scan).Source§fn try_scan_into<S, R, O>(
&self,
sendbuf: &S,
recvbuf: &mut R,
op: O,
) -> Result<(), MpiError>
fn try_scan_into<S, R, O>( &self, sendbuf: &S, recvbuf: &mut R, op: O, ) -> Result<(), MpiError>
Fallible
scan_into.Source§fn exclusive_scan_into<S, R, O>(&self, sendbuf: &S, recvbuf: &mut R, op: O)
fn exclusive_scan_into<S, R, O>(&self, sendbuf: &S, recvbuf: &mut R, op: O)
Exclusive prefix reduction (
MPI_Exscan).Source§fn all_gather_varcount_into<S, R>(&self, sendbuf: &S, recvbuf: &mut R)
fn all_gather_varcount_into<S, R>(&self, sendbuf: &S, recvbuf: &mut R)
Varying-count all-gather (
MPI_Allgatherv).Source§fn all_to_all_varcount_into<S, R>(&self, sendbuf: &S, recvbuf: &mut R)
fn all_to_all_varcount_into<S, R>(&self, sendbuf: &S, recvbuf: &mut R)
Varying-count all-to-all (
MPI_Alltoallv): rank i sends its j-th
block to rank j, with per-peer counts and displacements on both sides.Source§fn immediate_barrier(&self) -> Request<'static, ()>
fn immediate_barrier(&self) -> Request<'static, ()>
Non-blocking barrier (
MPI_Ibarrier). Progresses on a background thread
using a fresh context, so it genuinely overlaps subsequent work; wait
joins it.Source§fn immediate_all_gather_into<'a, S, R, Sc>(
&self,
scope: Sc,
sendbuf: &'a S,
recvbuf: &'a mut R,
) -> Request<'a, R, Sc>
fn immediate_all_gather_into<'a, S, R, Sc>( &self, scope: Sc, sendbuf: &'a S, recvbuf: &'a mut R, ) -> Request<'a, R, Sc>
Non-blocking all-gather (
MPI_Iallgather).Source§fn immediate_all_to_all_into<'a, S, R, Sc>(
&self,
scope: Sc,
sendbuf: &'a S,
recvbuf: &'a mut R,
) -> Request<'a, R, Sc>
fn immediate_all_to_all_into<'a, S, R, Sc>( &self, scope: Sc, sendbuf: &'a S, recvbuf: &'a mut R, ) -> Request<'a, R, Sc>
Non-blocking all-to-all (
MPI_Ialltoall).Source§fn immediate_all_reduce_into<'a, S, R, O, Sc>(
&self,
scope: Sc,
sendbuf: &'a S,
recvbuf: &'a mut R,
op: O,
) -> Request<'a, R, Sc>
fn immediate_all_reduce_into<'a, S, R, O, Sc>( &self, scope: Sc, sendbuf: &'a S, recvbuf: &'a mut R, op: O, ) -> Request<'a, R, Sc>
Non-blocking all-reduce (
MPI_Iallreduce). Progresses on a background
thread using a fresh context so it overlaps computation; wait joins it.Source§fn immediate_scan_into<'a, S, R, O, Sc>(
&self,
scope: Sc,
sendbuf: &'a S,
recvbuf: &'a mut R,
op: O,
) -> Request<'a, R, Sc>
fn immediate_scan_into<'a, S, R, O, Sc>( &self, scope: Sc, sendbuf: &'a S, recvbuf: &'a mut R, op: O, ) -> Request<'a, R, Sc>
Non-blocking inclusive scan (
MPI_Iscan).Source§impl<C> CommunicatorErrorHandler for Cwhere
C: Communicator + ?Sized,
impl<C> CommunicatorErrorHandler for Cwhere
C: Communicator + ?Sized,
Source§fn set_error_handler(&self, handler: ErrorHandler)
fn set_error_handler(&self, handler: ErrorHandler)
Set this communicator’s error handler (
MPI_Comm_set_errhandler).Source§fn error_handler(&self) -> ErrorHandler
fn error_handler(&self) -> ErrorHandler
Get this communicator’s error handler (
MPI_Comm_get_errhandler).
Defaults to ErrorHandler::Fatal.