Skip to main content

PollingScope

Struct PollingScope 

Source
pub struct PollingScope<'scope, 'env: 'scope, C> { /* private fields */ }
Expand description

A scoped context for posting RDMA operations with automatic lifetime safety.

Created by Channel::scope or Channel::manual_scope. Operations posted through a PollingScope return ScopedPendingWork handles that borrow the data buffers for 'scope, preventing aliasing while the hardware is accessing them.

When the scope ends, all unpolled work is automatically polled to completion, ensuring that buffers are not released while the NIC may still be performing DMA.

This design mirrors std::thread::scope — the scope owns the work request handles internally, so the user cannot leak them via std::mem::forget.

Implementations§

Source§

impl<'scope, 'env> PollingScope<'scope, 'env, Channel>

Source

pub fn post_send( &mut self, wr: SendWorkRequest<'_, 'env>, ) -> TransportResult<ScopedPendingWork<'scope>>

Posts a send operation, returning a handle for manual polling.

Source

pub fn post_receive( &mut self, wr: ReceiveWorkRequest<'_, 'env>, ) -> TransportResult<ScopedPendingWork<'scope>>

Posts a receive operation, returning a handle for manual polling.

Source

pub fn post_write( &mut self, wr: WriteWorkRequest<'_, 'env>, ) -> TransportResult<ScopedPendingWork<'scope>>

Posts an RDMA write operation, returning a handle for manual polling.

Source

pub fn post_read( &mut self, wr: ReadWorkRequest<'_, 'env>, ) -> TransportResult<ScopedPendingWork<'scope>>

Posts an RDMA read operation, returning a handle for manual polling.

Source§

impl<'scope, 'env> PollingScope<'scope, 'env, Channel>

Source

pub fn pd(&self) -> &ProtectionDomain

Returns a reference to the ProtectionDomain of the underlying channel.

Source§

impl<'scope, 'env> PollingScope<'scope, 'env, MultiChannel>

Source

pub fn post_send( &mut self, wr: PeerSendWorkRequest<'_, 'env>, ) -> TransportResult<ScopedPendingWork<'scope>>

Posts a send to the work request’s target peer, returning a handle for manual polling.

Source

pub fn post_receive( &mut self, wr: PeerReceiveWorkRequest<'_, 'env>, ) -> TransportResult<ScopedPendingWork<'scope>>

Posts a receive to the work request’s target peer, returning a handle for manual polling.

Source

pub fn post_write( &mut self, wr: PeerWriteWorkRequest<'_, 'env>, ) -> TransportResult<ScopedPendingWork<'scope>>

Posts an RDMA write to the work request’s target peer, returning a handle for manual polling.

Source

pub fn post_read( &mut self, wr: PeerReadWorkRequest<'_, 'env>, ) -> TransportResult<ScopedPendingWork<'scope>>

Posts an RDMA read to the work request’s target peer, returning a handle for manual polling.

Source§

impl<'scope, 'env> PollingScope<'scope, 'env, MultiChannel>

Source

pub fn post_scatter_send<'wr, I>( &mut self, wrs: I, ) -> TransportResult<Vec<ScopedPendingWork<'scope>>>
where I: IntoIterator<Item = PeerSendWorkRequest<'wr, 'env>>, 'env: 'wr,

Posts sends to multiple peers, returning handles for manual polling.

Source

pub fn post_scatter_write<'wr, I>( &mut self, wrs: I, ) -> TransportResult<Vec<ScopedPendingWork<'scope>>>
where I: IntoIterator<Item = PeerWriteWorkRequest<'wr, 'env>>, 'env: 'wr,

Posts RDMA writes to multiple peers, returning handles for manual polling.

Source

pub fn post_gather_receive<'wr, I>( &mut self, wrs: I, ) -> TransportResult<Vec<ScopedPendingWork<'scope>>>
where I: IntoIterator<Item = PeerReceiveWorkRequest<'wr, 'env>>, 'env: 'wr,

Posts receives from multiple peers, returning handles for manual polling.

Source

pub fn post_gather_read<'wr, I>( &mut self, wrs: I, ) -> TransportResult<Vec<ScopedPendingWork<'scope>>>
where I: IntoIterator<Item = PeerReadWorkRequest<'wr, 'env>>, 'env: 'wr,

Posts RDMA reads from multiple peers, returning handles for manual polling.

Source

pub fn post_multicast_send<'wr, I>( &mut self, peers: I, wr: SendWorkRequest<'wr, 'env>, ) -> TransportResult<Vec<ScopedPendingWork<'scope>>>
where I: IntoIterator<Item = usize>, 'env: 'wr,

Posts the same send to multiple peers, returning handles for manual polling.

Source§

impl<'scope, 'env> PollingScope<'scope, 'env, MultiChannel>

Source

pub fn pd(&self) -> &ProtectionDomain

Returns a reference to the shared ProtectionDomain.

Source

pub fn num_channels(&self) -> usize

Returns the number of channels in the underlying MultiChannel.

Source§

impl<'scope, 'env> PollingScope<'scope, 'env, Node>

Source

pub fn barrier( &mut self, peers: &[usize], timeout: Duration, ) -> Result<(), BarrierError>

Synchronizes with the given peers, blocking until all have reached the barrier or timeout.

Source

pub fn barrier_unchecked( &mut self, peers: &[usize], timeout: Duration, ) -> Result<(), BarrierError>

Like barrier, but skips validation of the peer list.

Source§

impl<'scope, 'env> PollingScope<'scope, 'env, Node>

Source

pub fn post_send( &mut self, wr: PeerSendWorkRequest<'_, 'env>, ) -> TransportResult<ScopedPendingWork<'scope>>

Posts a send to the work request’s target peer, returning a handle for manual polling.

Source

pub fn post_receive( &mut self, wr: PeerReceiveWorkRequest<'_, 'env>, ) -> TransportResult<ScopedPendingWork<'scope>>

Posts a receive to the work request’s target peer, returning a handle for manual polling.

Source

pub fn post_write( &mut self, wr: PeerWriteWorkRequest<'_, 'env>, ) -> TransportResult<ScopedPendingWork<'scope>>

Posts an RDMA write to the work request’s target peer, returning a handle for manual polling.

Source

pub fn post_read( &mut self, wr: PeerReadWorkRequest<'_, 'env>, ) -> TransportResult<ScopedPendingWork<'scope>>

Posts an RDMA read to the work request’s target peer, returning a handle for manual polling.

Source§

impl<'scope, 'env> PollingScope<'scope, 'env, Node>

Source

pub fn post_scatter_send<'wr, I>( &mut self, wrs: I, ) -> TransportResult<Vec<ScopedPendingWork<'scope>>>
where I: IntoIterator<Item = PeerSendWorkRequest<'wr, 'env>>, 'env: 'wr,

Posts sends to multiple peers, returning handles for manual polling.

Source

pub fn post_scatter_write<'wr, I>( &mut self, wrs: I, ) -> TransportResult<Vec<ScopedPendingWork<'scope>>>
where I: IntoIterator<Item = PeerWriteWorkRequest<'wr, 'env>>, 'env: 'wr,

Posts RDMA writes to multiple peers, returning handles for manual polling.

Source

pub fn post_gather_receive<'wr, I>( &mut self, wrs: I, ) -> TransportResult<Vec<ScopedPendingWork<'scope>>>
where I: IntoIterator<Item = PeerReceiveWorkRequest<'wr, 'env>>, 'env: 'wr,

Posts receives from multiple peers, returning handles for manual polling.

Source

pub fn post_gather_read<'wr, I>( &mut self, wrs: I, ) -> TransportResult<Vec<ScopedPendingWork<'scope>>>
where I: IntoIterator<Item = PeerReadWorkRequest<'wr, 'env>>, 'env: 'wr,

Posts RDMA reads from multiple peers, returning handles for manual polling.

Source

pub fn post_multicast_send<'wr, I>( &mut self, peers: I, wr: SendWorkRequest<'wr, 'env>, ) -> TransportResult<Vec<ScopedPendingWork<'scope>>>
where I: IntoIterator<Item = usize>, 'env: 'wr,

Posts the same send to multiple peers, returning handles for manual polling.

Source§

impl<'scope, 'env> PollingScope<'scope, 'env, Node>

Source

pub fn pd(&self) -> &ProtectionDomain

Returns a reference to the shared ProtectionDomain.

Source

pub fn world_size(&self) -> usize

Returns the total number of nodes in the network.

Source

pub fn rank(&self) -> usize

Returns this node’s rank.

Auto Trait Implementations§

§

impl<'scope, 'env, C> Freeze for PollingScope<'scope, 'env, C>

§

impl<'scope, 'env, C> !RefUnwindSafe for PollingScope<'scope, 'env, C>

§

impl<'scope, 'env, C> !Send for PollingScope<'scope, 'env, C>

§

impl<'scope, 'env, C> !Sync for PollingScope<'scope, 'env, C>

§

impl<'scope, 'env, C> Unpin for PollingScope<'scope, 'env, C>

§

impl<'scope, 'env, C> UnsafeUnpin for PollingScope<'scope, 'env, C>

§

impl<'scope, 'env, C> !UnwindSafe for PollingScope<'scope, 'env, C>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.