Module view

Source
Expand description

Types to describe extents, points and views. The purpose of this module is to provide data structures to efficiently describe subsets of nonnegative integers, called ranks, represented by usize values. Ranks are organized into multi-dimensional spaces in which each discrete point is a rank, mapped in row-major order.

These dimensions represent a space that carry semantic meaning, such that ranks are usually sub-set along some dimension of the space. For example, ranks may be organized into a space with dimensions “replica”, “host”, “gpu”, and we’d expect to subset along these dimensions, for example to select all GPUs in a given replica.

This alignment helps provide a simple and efficient representation, internally in the form of crate::Slice, comprising an offset, sizes, and strides that index into the space.

  • Extent: the shape of the space, naming each dimension and specifying their sizes.
  • Point: a specific coordinate in an extent, together with its linearized rank.
  • Region: a (possibly sparse) hyper-rectangle of ranks within a larger extent. Since it is always rectangular, it also defines its own extent.
  • View: a collection of items indexed by Region. Views provide standard manipulation operations and use ranks as an efficient indexing scheme.

Structs§

CoordIter
An iterator over the coordinates of a Point in row-major order.
Extent
Extent defines the logical shape of a multidimensional space by assigning a size to each named dimension. It abstracts away memory layout and focuses solely on structure — what dimensions exist and how many elements each contains.
ExtentPointsIterator
An iterator for points in an extent.
InvalidCardinality
A canonical cardinality mismatch descriptor.
Point
Point represents a specific coordinate within the multi-dimensional space defined by an Extent.
Region
Region describes a region of a possibly-larger space of ranks, organized into a hyperrect.
ViewIterator
An iterator over views.

Enums§

ExtentError
Errors that can occur when constructing or validating an Extent.
PointError
Errors that can occur when constructing or evaluating a Point.
RegionError
Errors that occur while operating on Region.
RegionParseError
ViewError
Errors that occur while operating on views.

Traits§

BuildFromRegion
Dense builder: constructs a mesh from a complete sequence of values in the canonical order for region.
BuildFromRegionIndexed
Indexed builder: constructs a mesh from sparse (rank, value) pairs.
CollectExactMeshExt
Exact-size, mesh-aware collecting adapter.
CollectIndexedMeshExt
Indexed collecting adapter.
CollectMeshExt
Mesh-aware collecting adapter.
InExtent
Extension trait for creating a Point from a coordinate vector and an Extent.
MapIntoExt
Map into any mesh M.
Ranked
Ranked is a helper trait to implement View on a ranked collection of items.
RankedSliceable
Extension of Ranked for types that can materialize a new owned view.
View
A View is a collection of items in a space indexed by a Region.
ViewExt
Extension methods for view construction.