pub struct Collectives<D: CollectiveDriver> { /* private fields */ }Expand description
The groups this device has joined.
One per server, unlike the identifiers behind
group_id: an identifier is what every rank
of a group agrees on, a communicator is one rank’s membership of it.
Implementations§
Source§impl<D: CollectiveDriver> Collectives<D>
impl<D: CollectiveDriver> Collectives<D>
Sourcepub fn mark_broken(&mut self, group: &CommunicationId, cause: ServerError)
pub fn mark_broken(&mut self, group: &CommunicationId, cause: ServerError)
Records that this device’s part of a collective over group failed with cause. Its
peers wait in that collective, and another one over the group would pair with theirs.
Sourcepub fn ensure_intact(&self, group: &CommunicationId) -> Result<(), ServerError>
pub fn ensure_intact(&self, group: &CommunicationId) -> Result<(), ServerError>
Refuses a collective over group once a part of one here has failed.
§Errors
ServerError::Generic naming the failure that broke the group.
Sourcepub fn join(
&mut self,
devices: Vec<DeviceId>,
) -> Result<Option<CommunicationId>, ServerError>
pub fn join( &mut self, devices: Vec<DeviceId>, ) -> Result<Option<CommunicationId>, ServerError>
Join the group over devices, and answer with the id it is known by.
A group already joined is joined once: Ok(None) says there was
nothing to do, so the caller does not announce a membership twice.
§Errors
ServerError::Generic when this device is not among devices — it
would have no rank in a group it is not in — and whatever the driver
says about agreeing an identifier or joining.
Sourcepub fn transfers_with(
&mut self,
peer: DeviceId,
) -> Result<&D::Communicator, ServerError>
pub fn transfers_with( &mut self, peer: DeviceId, ) -> Result<&D::Communicator, ServerError>
The communicator for transfers between this device and peer, joined on first use.
§Errors
Whatever the driver says about agreeing an identifier or joining.
Sourcepub fn get(
&self,
devices: &CommunicationId,
) -> Result<&D::Communicator, ServerError>
pub fn get( &self, devices: &CommunicationId, ) -> Result<&D::Communicator, ServerError>
This device’s membership of the group over devices.
§Errors
ServerError::Generic when this device never joined that group, which
is a missing join rather than anything the device did.
Sourcepub fn rank(
&self,
device: DeviceId,
devices: &[DeviceId],
) -> Result<usize, ServerError>
pub fn rank( &self, device: DeviceId, devices: &[DeviceId], ) -> Result<usize, ServerError>
The rank of device in the group over devices.
§Errors
ServerError::Generic when device is not among devices.
Sourcepub fn peer_rank(&self, devices: &[DeviceId]) -> Result<usize, ServerError>
pub fn peer_rank(&self, devices: &[DeviceId]) -> Result<usize, ServerError>
The rank of the one device in devices that is not this one.
For the two-device operations — a send has exactly one peer, and its rank is whichever position this device does not occupy.
§Errors
ServerError::Generic when every device in the pair is this one, so
there is no peer to name.
Trait Implementations§
Auto Trait Implementations§
impl<D> Freeze for Collectives<D>
impl<D> RefUnwindSafe for Collectives<D>
impl<D> Send for Collectives<D>
impl<D> Sync for Collectives<D>
impl<D> Unpin for Collectives<D>
impl<D> UnsafeUnpin for Collectives<D>
impl<D> UnwindSafe for Collectives<D>
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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
impl<T> ErasedDestructor for Twhere
T: 'static,
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 more