Module mpi::datatype
[−]
[src]
Describing data
The core function of MPI is getting data from point A to point B (where A and B are e.g. single processes, multiple processes, the filesystem, ...). It offers facilities to describe that data (layout in memory, behavior under certain operators) that go beyound a start address and a number of bytes.
An MPI datatype describes a memory layout and semantics (e.g. in a collective reduce
operation). There are several pre-defined SystemDatatype
s which directly correspond to Rust
primitive types, such as MPI_DOUBLE
and f64
. A direct relationship between a Rust type and
an MPI datatype is covered by the Equivalence
trait. Starting from the
SystemDatatype
s, the user can build various UserDatatype
s, e.g. to describe the layout of a
struct (which should then implement Equivalence
) or to intrusively describe parts of
an object in memory like all elements below the diagonal of a dense matrix stored in row-major
order.
A Buffer
describes a specific piece of data in memory that MPI should operate on. In addition
to specifying the datatype of the data. It knows the address in memory where the data begins
and how many instances of the datatype are contained in the data. The Buffer
trait is
implemented for slices that contain types implementing Equivalence
.
In order to use arbitrary datatypes to describe the contents of a slice, the View
type is
provided. However, since it can be used to instruct the underlying MPI implementation to
rummage around arbitrary parts of memory, its constructors are currently marked unsafe.
Unfinished features
- 4.1.2: Datatype constructors,
MPI_Type_create_struct()
- 4.1.3: Subarray datatype constructors,
MPI_Type_create_subarray()
, - 4.1.4: Distributed array datatype constructors,
MPI_Type_create_darray()
- 4.1.5: Address and size functions,
MPI_Get_address()
,MPI_Aint_add()
,MPI_Aint_diff()
,MPI_Type_size()
,MPI_Type_size_x()
- 4.1.7: Extent and bounds of datatypes:
MPI_Type_get_extent()
,MPI_Type_get_extent_x()
,MPI_Type_create_resized()
- 4.1.8: True extent of datatypes,
MPI_Type_get_true_extent()
,MPI_Type_get_true_extent_x()
- 4.1.10: Duplicating a datatype,
MPI_Type_dup()
- 4.1.11:
MPI_Get_elements()
,MPI_Get_elements_x()
- 4.1.13: Decoding a datatype,
MPI_Type_get_envelope()
,MPI_Type_get_contents()
- 4.2: Pack and unpack,
MPI_Pack()
,MPI_Unpack()
,MPI_Pack_size()
- 4.3: Canonical pack and unpack,
MPI_Pack_external()
,MPI_Unpack_external()
,MPI_Pack_external_size()
Modules
traits |
Datatype traits |
Structs
DatatypeRef |
A reference to an MPI data type. |
DynBuffer |
An immutable dynamically-typed buffer. |
DynBufferMut |
A mutable dynamically-typed buffer. |
MutView |
A buffer with a user specified count and datatype |
Partition |
Adds a partitioning to an existing |
PartitionMut |
Adds a partitioning to an existing |
UserDatatype |
A user defined MPI datatype |
View |
A buffer with a user specified count and datatype |
Traits
AsDatatype |
Something that has an associated datatype |
Buffer |
A buffer is a region in memory that starts at |
BufferMut |
A mutable buffer is a region in memory that starts at |
Collection |
A countable collection of things. |
Datatype |
A Datatype describes the layout of messages in memory. |
Equivalence |
A direct equivalence exists between the implementing type and an MPI datatype |
Partitioned |
Describes how a |
PartitionedBuffer |
A buffer that is |
PartitionedBufferMut |
A mutable buffer that is |
Pointer |
Provides a pointer to the starting address in memory. |
PointerMut |
Provides a mutable pointer to the starting address in memory. |
Functions
address_of |
Returns the address of the argument in a format suitable for use with datatype constructors |
Type Definitions
SystemDatatype |
A system datatype, e.g. |