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 SystemDatatypes 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 SystemDatatypes, the user can build various UserDatatypes, 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

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 Buffer so that it becomes Partitioned

PartitionMut

Adds a partitioning to an existing BufferMut so that it becomes Partitioned

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 pointer() and contains count() copies of as_datatype().

BufferMut

A mutable buffer is a region in memory that starts at pointer_mut() and contains count() copies of as_datatype().

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 Buffer is partitioned by specifying the count of elements and displacement from the start of the buffer for each partition.

PartitionedBuffer

A buffer that is Partitioned

PartitionedBufferMut

A mutable buffer that is Partitioned

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. MPI_FLOAT