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>
impl<'scope, 'env> PollingScope<'scope, 'env, Channel>
Sourcepub fn post_send(
&mut self,
wr: SendWorkRequest<'_, 'env>,
) -> TransportResult<ScopedPendingWork<'scope>>
pub fn post_send( &mut self, wr: SendWorkRequest<'_, 'env>, ) -> TransportResult<ScopedPendingWork<'scope>>
Posts a send operation, returning a handle for manual polling.
Sourcepub fn post_receive(
&mut self,
wr: ReceiveWorkRequest<'_, 'env>,
) -> TransportResult<ScopedPendingWork<'scope>>
pub fn post_receive( &mut self, wr: ReceiveWorkRequest<'_, 'env>, ) -> TransportResult<ScopedPendingWork<'scope>>
Posts a receive operation, returning a handle for manual polling.
Sourcepub fn post_write(
&mut self,
wr: WriteWorkRequest<'_, 'env>,
) -> TransportResult<ScopedPendingWork<'scope>>
pub fn post_write( &mut self, wr: WriteWorkRequest<'_, 'env>, ) -> TransportResult<ScopedPendingWork<'scope>>
Posts an RDMA write operation, returning a handle for manual polling.
Sourcepub fn post_read(
&mut self,
wr: ReadWorkRequest<'_, 'env>,
) -> TransportResult<ScopedPendingWork<'scope>>
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>
impl<'scope, 'env> PollingScope<'scope, 'env, Channel>
Sourcepub fn pd(&self) -> &ProtectionDomain
pub fn pd(&self) -> &ProtectionDomain
Returns a reference to the ProtectionDomain of the underlying channel.
Source§impl<'scope, 'env> PollingScope<'scope, 'env, MultiChannel>
impl<'scope, 'env> PollingScope<'scope, 'env, MultiChannel>
Sourcepub fn post_send(
&mut self,
wr: PeerSendWorkRequest<'_, 'env>,
) -> TransportResult<ScopedPendingWork<'scope>>
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.
Sourcepub fn post_receive(
&mut self,
wr: PeerReceiveWorkRequest<'_, 'env>,
) -> TransportResult<ScopedPendingWork<'scope>>
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.
Sourcepub fn post_write(
&mut self,
wr: PeerWriteWorkRequest<'_, 'env>,
) -> TransportResult<ScopedPendingWork<'scope>>
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.
Sourcepub fn post_read(
&mut self,
wr: PeerReadWorkRequest<'_, 'env>,
) -> TransportResult<ScopedPendingWork<'scope>>
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>
impl<'scope, 'env> PollingScope<'scope, 'env, MultiChannel>
Sourcepub fn post_scatter_send<'wr, I>(
&mut self,
wrs: I,
) -> TransportResult<Vec<ScopedPendingWork<'scope>>>where
I: IntoIterator<Item = PeerSendWorkRequest<'wr, 'env>>,
'env: 'wr,
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.
Sourcepub fn post_scatter_write<'wr, I>(
&mut self,
wrs: I,
) -> TransportResult<Vec<ScopedPendingWork<'scope>>>where
I: IntoIterator<Item = PeerWriteWorkRequest<'wr, 'env>>,
'env: 'wr,
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.
Sourcepub fn post_gather_receive<'wr, I>(
&mut self,
wrs: I,
) -> TransportResult<Vec<ScopedPendingWork<'scope>>>where
I: IntoIterator<Item = PeerReceiveWorkRequest<'wr, 'env>>,
'env: 'wr,
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.
Sourcepub fn post_gather_read<'wr, I>(
&mut self,
wrs: I,
) -> TransportResult<Vec<ScopedPendingWork<'scope>>>where
I: IntoIterator<Item = PeerReadWorkRequest<'wr, 'env>>,
'env: 'wr,
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.
Sourcepub 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,
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>
impl<'scope, 'env> PollingScope<'scope, 'env, MultiChannel>
Sourcepub fn pd(&self) -> &ProtectionDomain
pub fn pd(&self) -> &ProtectionDomain
Returns a reference to the shared ProtectionDomain.
Sourcepub fn num_channels(&self) -> usize
pub fn num_channels(&self) -> usize
Returns the number of channels in the underlying MultiChannel.
Source§impl<'scope, 'env> PollingScope<'scope, 'env, Node>
impl<'scope, 'env> PollingScope<'scope, 'env, Node>
Sourcepub fn barrier(
&mut self,
peers: &[usize],
timeout: Duration,
) -> Result<(), BarrierError>
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.
Sourcepub fn barrier_unchecked(
&mut self,
peers: &[usize],
timeout: Duration,
) -> Result<(), BarrierError>
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>
impl<'scope, 'env> PollingScope<'scope, 'env, Node>
Sourcepub fn post_send(
&mut self,
wr: PeerSendWorkRequest<'_, 'env>,
) -> TransportResult<ScopedPendingWork<'scope>>
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.
Sourcepub fn post_receive(
&mut self,
wr: PeerReceiveWorkRequest<'_, 'env>,
) -> TransportResult<ScopedPendingWork<'scope>>
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.
Sourcepub fn post_write(
&mut self,
wr: PeerWriteWorkRequest<'_, 'env>,
) -> TransportResult<ScopedPendingWork<'scope>>
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.
Sourcepub fn post_read(
&mut self,
wr: PeerReadWorkRequest<'_, 'env>,
) -> TransportResult<ScopedPendingWork<'scope>>
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>
impl<'scope, 'env> PollingScope<'scope, 'env, Node>
Sourcepub fn post_scatter_send<'wr, I>(
&mut self,
wrs: I,
) -> TransportResult<Vec<ScopedPendingWork<'scope>>>where
I: IntoIterator<Item = PeerSendWorkRequest<'wr, 'env>>,
'env: 'wr,
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.
Sourcepub fn post_scatter_write<'wr, I>(
&mut self,
wrs: I,
) -> TransportResult<Vec<ScopedPendingWork<'scope>>>where
I: IntoIterator<Item = PeerWriteWorkRequest<'wr, 'env>>,
'env: 'wr,
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.
Sourcepub fn post_gather_receive<'wr, I>(
&mut self,
wrs: I,
) -> TransportResult<Vec<ScopedPendingWork<'scope>>>where
I: IntoIterator<Item = PeerReceiveWorkRequest<'wr, 'env>>,
'env: 'wr,
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.
Sourcepub fn post_gather_read<'wr, I>(
&mut self,
wrs: I,
) -> TransportResult<Vec<ScopedPendingWork<'scope>>>where
I: IntoIterator<Item = PeerReadWorkRequest<'wr, 'env>>,
'env: 'wr,
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.
Sourcepub 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,
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>
impl<'scope, 'env> PollingScope<'scope, 'env, Node>
Sourcepub fn pd(&self) -> &ProtectionDomain
pub fn pd(&self) -> &ProtectionDomain
Returns a reference to the shared ProtectionDomain.
Sourcepub fn world_size(&self) -> usize
pub fn world_size(&self) -> usize
Returns the total number of nodes in the network.