pub struct LocalCluster { /* private fields */ }Expand description
A self-spawning local cluster: re-runs the current executable once per rank as a separate OS process, each pointed at a generated loopback hostfile, capturing one rank’s stdout.
This exercises the real DistConfig::load / connect path over real TCP
sockets in separate address spaces — the genuine deployment shape minus
the physical wire.
Implementations§
Source§impl LocalCluster
impl LocalCluster
Sourcepub fn new(world: u32) -> Self
pub fn new(world: u32) -> Self
A world-rank cluster over loopback TCP, capturing rank 0’s stdout.
Sourcepub fn backend(self, backend: TransportBackend) -> Self
pub fn backend(self, backend: TransportBackend) -> Self
Override the transport backend written into the hostfile.
Sourcepub fn arg(self, a: impl Into<String>) -> Self
pub fn arg(self, a: impl Into<String>) -> Self
Forward an extra CLI argument to every spawned worker (e.g.
--device mlx). Workers also receive --rank i --hostfile <path>.
Sourcepub fn capture_rank(self, rank: u32) -> Self
pub fn capture_rank(self, rank: u32) -> Self
Which rank’s stdout to capture and return from run.
Auto Trait Implementations§
impl Freeze for LocalCluster
impl RefUnwindSafe for LocalCluster
impl Send for LocalCluster
impl Sync for LocalCluster
impl Unpin for LocalCluster
impl UnsafeUnpin for LocalCluster
impl UnwindSafe for LocalCluster
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