pub struct Communicator<F: IntegrateFloat> { /* private fields */ }Expand description
Communicator for all-to-all and collective operations
Implementations§
Source§impl<F: IntegrateFloat> Communicator<F>
impl<F: IntegrateFloat> Communicator<F>
Sourcepub fn new(
local_node_id: NodeId,
channel: Arc<MessageChannel<F>>,
boundary_exchanger: Arc<BoundaryExchanger<F>>,
) -> Self
pub fn new( local_node_id: NodeId, channel: Arc<MessageChannel<F>>, boundary_exchanger: Arc<BoundaryExchanger<F>>, ) -> Self
Create a new communicator
Sourcepub fn add_peer(&self, node_id: NodeId) -> DistributedResult<()>
pub fn add_peer(&self, node_id: NodeId) -> DistributedResult<()>
Add a peer node
Sourcepub fn remove_peer(&self, node_id: NodeId) -> DistributedResult<()>
pub fn remove_peer(&self, node_id: NodeId) -> DistributedResult<()>
Remove a peer node
Sourcepub fn send_work(
&self,
target: NodeId,
chunk: WorkChunk<F>,
deadline: Option<Duration>,
) -> DistributedResult<u64>
pub fn send_work( &self, target: NodeId, chunk: WorkChunk<F>, deadline: Option<Duration>, ) -> DistributedResult<u64>
Send work chunk to a node
Sourcepub fn send_result(
&self,
target: NodeId,
result: ChunkResult<F>,
) -> DistributedResult<u64>
pub fn send_result( &self, target: NodeId, result: ChunkResult<F>, ) -> DistributedResult<u64>
Send chunk result back to coordinator
Sourcepub fn send_boundary(
&self,
target: NodeId,
source_chunk: ChunkId,
target_chunk: ChunkId,
boundary_data: BoundaryData<F>,
) -> DistributedResult<u64>
pub fn send_boundary( &self, target: NodeId, source_chunk: ChunkId, target_chunk: ChunkId, boundary_data: BoundaryData<F>, ) -> DistributedResult<u64>
Send boundary data to a neighbor
Sourcepub fn broadcast(
&self,
message: DistributedMessage<F>,
) -> DistributedResult<Vec<u64>>
pub fn broadcast( &self, message: DistributedMessage<F>, ) -> DistributedResult<Vec<u64>>
Broadcast a message to all peers
Sourcepub fn create_barrier(&self, expected_count: usize) -> DistributedResult<u64>
pub fn create_barrier(&self, expected_count: usize) -> DistributedResult<u64>
Create a new synchronization barrier
Sourcepub fn barrier(
&self,
barrier_id: u64,
timeout: Duration,
) -> DistributedResult<()>
pub fn barrier( &self, barrier_id: u64, timeout: Duration, ) -> DistributedResult<()>
Synchronize at a barrier
Sourcepub fn process_barrier_message(
&self,
barrier_id: u64,
node_id: NodeId,
) -> DistributedResult<()>
pub fn process_barrier_message( &self, barrier_id: u64, node_id: NodeId, ) -> DistributedResult<()>
Process incoming barrier messages
Sourcepub fn receive_boundary(
&self,
target_chunk: ChunkId,
source_chunk: ChunkId,
data: BoundaryData<F>,
) -> DistributedResult<()>
pub fn receive_boundary( &self, target_chunk: ChunkId, source_chunk: ChunkId, data: BoundaryData<F>, ) -> DistributedResult<()>
Receive boundary data
Sourcepub fn get_boundary_conditions(
&self,
chunk_id: ChunkId,
left_neighbor: Option<ChunkId>,
right_neighbor: Option<ChunkId>,
) -> BoundaryConditions<F>
pub fn get_boundary_conditions( &self, chunk_id: ChunkId, left_neighbor: Option<ChunkId>, right_neighbor: Option<ChunkId>, ) -> BoundaryConditions<F>
Get boundary conditions for a chunk
Auto Trait Implementations§
impl<F> !Freeze for Communicator<F>
impl<F> RefUnwindSafe for Communicator<F>
impl<F> Send for Communicator<F>
impl<F> Sync for Communicator<F>
impl<F> Unpin for Communicator<F>
impl<F> UnsafeUnpin for Communicator<F>
impl<F> UnwindSafe for Communicator<F>
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> 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>
Converts
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>
Converts
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