pub trait Transport: Collectives {
// Required method
fn exchange_layer<P, F, R>(
&self,
send: Vec<Option<P>>,
spare: &mut Vec<P>,
map: &ChunkMap,
body: F,
) -> (Vec<Option<P>>, R)
where P: Payload,
F: FnOnce(&[Option<P>], &dyn ChunkWait) -> R;
// Provided methods
fn exchange<P: Payload>(
&self,
send: Vec<Option<P>>,
spare: &mut Vec<P>,
) -> Vec<Option<P>> { ... }
fn gather_to_root(&self, parts: Vec<&[u8]>) -> Option<Vec<Vec<Vec<u8>>>> { ... }
}Expand description
The per-layer all-to-all exchange between the partitions of a group.
Sealed through Collectives; not object-safe, so the layer loop monomorphizes over it.
Required Methods§
Sourcefn exchange_layer<P, F, R>(
&self,
send: Vec<Option<P>>,
spare: &mut Vec<P>,
map: &ChunkMap,
body: F,
) -> (Vec<Option<P>>, R)
fn exchange_layer<P, F, R>( &self, send: Vec<Option<P>>, spare: &mut Vec<P>, map: &ChunkMap, body: F, ) -> (Vec<Option<P>>, R)
Send send[q] to partition q, run body on what the partners sent here, and return the received payloads with body’s result.
Two-phase: the early_parts have arrived before body starts, and body calls ChunkWait::wait_chunk before reading a chunk’s bulk rows.
send.len() must be the group size with None in the own slot and for any partner with nothing to send; every partition passes the same map.
spare is a payload pool in unspecified state, possibly empty: the transport takes receive payloads from it and returns finished send payloads to it.
Provided Methods§
Sourcefn exchange<P: Payload>(
&self,
send: Vec<Option<P>>,
spare: &mut Vec<P>,
) -> Vec<Option<P>>
fn exchange<P: Payload>( &self, send: Vec<Option<P>>, spare: &mut Vec<P>, ) -> Vec<Option<P>>
The blocking exchange_layer under an empty ChunkMap, for payloads whose every part is early.
Sourcefn gather_to_root(&self, parts: Vec<&[u8]>) -> Option<Vec<Vec<Vec<u8>>>>
fn gather_to_root(&self, parts: Vec<&[u8]>) -> Option<Vec<Vec<Vec<u8>>>>
Collect every partition’s parts on rank 0: Some(v) there with v[q] partition q’s parts, None elsewhere; one collective.
A transport that infers its partner set from the Some positions, as the MPI one does, must override this asymmetric call.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.