pub struct MockComm {
pub rank: usize,
pub world_size: usize,
/* private fields */
}Expand description
Mock communication backend for testing distributed operations.
This implementation simulates collective operations in-memory, allowing testing of distributed code paths on a single machine.
Fields§
§rank: usizeThis rank’s ID in the mesh
world_size: usizeTotal number of ranks
Implementations§
Trait Implementations§
Source§impl MeshComm for MockComm
impl MeshComm for MockComm
Source§fn all_reduce(
&self,
buf: &mut [u8],
dtype: DType,
op: ReduceOp,
_group: &str,
) -> Result<(), String>
fn all_reduce( &self, buf: &mut [u8], dtype: DType, op: ReduceOp, _group: &str, ) -> Result<(), String>
All-reduce operation: reduce values across all ranks in a group
Source§fn all_gather(
&self,
local: &[u8],
out: &mut [u8],
_dtype: DType,
_group: &str,
) -> Result<(), String>
fn all_gather( &self, local: &[u8], out: &mut [u8], _dtype: DType, _group: &str, ) -> Result<(), String>
All-gather: gather data from all ranks
Source§fn broadcast(
&self,
buf: &mut [u8],
root_rank: usize,
_group: &str,
) -> Result<(), String>
fn broadcast( &self, buf: &mut [u8], root_rank: usize, _group: &str, ) -> Result<(), String>
Broadcast from root rank to all ranks in group
Source§fn reduce_scatter(
&self,
buf: &mut [u8],
out: &mut [u8],
op: ReduceOp,
group: &str,
) -> Result<(), String>
fn reduce_scatter( &self, buf: &mut [u8], out: &mut [u8], op: ReduceOp, group: &str, ) -> Result<(), String>
Reduce-scatter: reduce and distribute results
Auto Trait Implementations§
impl Freeze for MockComm
impl RefUnwindSafe for MockComm
impl Send for MockComm
impl Sync for MockComm
impl Unpin for MockComm
impl UnsafeUnpin for MockComm
impl UnwindSafe for MockComm
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