pub struct CrossNodePartition {
pub border_dim: usize,
pub n_rows: usize,
pub chunk_size: usize,
pub n_ranks: usize,
}Expand description
The deterministic chunk partition + rank-indexed assignment shared by every participant of one cross-node pass. A pure function of its four fields; two participants constructed with the same fields agree on every derived quantity, with no communication.
Fields§
§border_dim: usizeBorder dimension k (columns of every chunk; partials are k·k).
n_rows: usizeTotal row count of the full pass.
chunk_size: usizeFixed chunk size (rows per chunk; the last chunk may be shorter).
n_ranks: usizeNumber of worker ranks in the fleet.
Implementations§
Source§impl CrossNodePartition
impl CrossNodePartition
pub fn new( border_dim: usize, n_rows: usize, chunk_size: usize, n_ranks: usize, ) -> Result<Self, String>
Sourcepub fn n_chunks(&self) -> usize
pub fn n_chunks(&self) -> usize
Total number of chunks of the pass: ceil(n_rows / chunk_size).
Identical to StreamingBorderGram::n_chunks for the same partition
parameters — the global tree this assignment feeds.
Sourcepub fn chunk_rows(&self, chunk_index: usize) -> Range<usize>
pub fn chunk_rows(&self, chunk_index: usize) -> Range<usize>
Row range covered by global chunk chunk_index — the same pure function
as StreamingBorderGram::chunk_rows, duplicated here so a worker can
slice its rows without constructing a coordinator-side accumulator.
Sourcepub fn owner_rank(&self, chunk_index: usize) -> usize
pub fn owner_rank(&self, chunk_index: usize) -> usize
Which rank owns global chunk chunk_index: round-robin by index.
Sourcepub fn chunks_owned_by(&self, rank: usize) -> usize
pub fn chunks_owned_by(&self, rank: usize) -> usize
Number of chunks rank rank owns.
Trait Implementations§
Source§impl Clone for CrossNodePartition
impl Clone for CrossNodePartition
Source§fn clone(&self) -> CrossNodePartition
fn clone(&self) -> CrossNodePartition
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for CrossNodePartition
Source§impl Debug for CrossNodePartition
impl Debug for CrossNodePartition
Source§impl<'de> Deserialize<'de> for CrossNodePartition
impl<'de> Deserialize<'de> for CrossNodePartition
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>,
impl Eq for CrossNodePartition
Source§impl PartialEq for CrossNodePartition
impl PartialEq for CrossNodePartition
Source§fn eq(&self, other: &CrossNodePartition) -> bool
fn eq(&self, other: &CrossNodePartition) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for CrossNodePartition
impl Serialize for CrossNodePartition
impl StructuralPartialEq for CrossNodePartition
Auto Trait Implementations§
impl Freeze for CrossNodePartition
impl RefUnwindSafe for CrossNodePartition
impl Send for CrossNodePartition
impl Sync for CrossNodePartition
impl Unpin for CrossNodePartition
impl UnsafeUnpin for CrossNodePartition
impl UnwindSafe for CrossNodePartition
Blanket Implementations§
impl<T> Allocation for T
impl<T> Boilerplate for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> DistributionExt for Twhere
T: ?Sized,
impl<T> DistributionExt for Twhere
T: ?Sized,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
impl<T, U> Imply<T> for U
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
impl<T> Scalar for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.