pub enum Layout {
Solo {
n_workers: usize,
},
Multihost {
hosts: Vec<Host>,
local_host_idx: usize,
},
}
Expand description
How a DBSP circuit is laid out across one or more machines.
Variants§
Implementations§
Source§impl Layout
impl Layout
Sourcepub fn new_solo(n_workers: usize) -> Layout
pub fn new_solo(n_workers: usize) -> Layout
Returns a new solo layout with n_workers
worker threads.
Sourcepub fn new_multihost(
params: &Vec<(SocketAddr, usize)>,
local_address: SocketAddr,
) -> Result<Layout, LayoutError>
pub fn new_multihost( params: &Vec<(SocketAddr, usize)>, local_address: SocketAddr, ) -> Result<Layout, LayoutError>
Returns a new multihost layout with as many hosts as specified in
params
. Each tuple in params
specifies a host’s unique network
address and the number of workers to run on that host. local_address
must be one of the addresses in params
.
To execute such a multihost circuit, one must create a Runtime
for it
on every host in params
, passing the same params
in each case. Each
host must pass its own local_address
. The Runtime
on each host
listens on its own address and connects to all the other addresses.
Sourcepub fn local_workers(&self) -> Range<usize>
pub fn local_workers(&self) -> Range<usize>
Returns the range of IDs for the workers on the local machine.
Sourcepub fn other_hosts(&self) -> impl Iterator<Item = &Host>
pub fn other_hosts(&self) -> impl Iterator<Item = &Host>
Returns an iterator over Host
s in this layout other than this one. If
this is a single-host layout, this will be an empty iterator.
Sourcepub fn local_address(&self) -> Option<SocketAddr>
pub fn local_address(&self) -> Option<SocketAddr>
Returns the network address for the current machine, or None
if this
is a solo layout.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Layout
impl<'de> Deserialize<'de> for Layout
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl From<Layout> for CircuitConfig
impl From<Layout> for CircuitConfig
Auto Trait Implementations§
impl Freeze for Layout
impl RefUnwindSafe for Layout
impl Send for Layout
impl Sync for Layout
impl Unpin for Layout
impl UnwindSafe for Layout
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<F, W, T, D> Deserialize<With<T, W>, D> for F
impl<F, W, T, D> Deserialize<With<T, W>, D> for F
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
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>
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