Struct mpi::datatype::UncommittedUserDatatype
source · pub struct UncommittedUserDatatype(/* private fields */);
Expand description
Represents an MPI datatype that has not yet been committed. Can be used to build up more complex datatypes before committing.
UncommittedUserDatatype does not implement Datatype - it cannot be used as a datatype, and must be commited to retrieve a UserDatatype that implements Datatype.
§Standard section(s)
4.1.9
Implementations§
source§impl UncommittedUserDatatype
impl UncommittedUserDatatype
sourcepub fn contiguous<D>(count: Count, oldtype: &D) -> Selfwhere
D: UncommittedDatatype,
pub fn contiguous<D>(count: Count, oldtype: &D) -> Selfwhere
D: UncommittedDatatype,
Constructs a new datatype by concatenating count
repetitions of oldtype
§Examples
See examples/contiguous.rs
§Standard section(s)
4.1.2
Examples found in repository?
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
fn equivalent_datatype() -> Self::Out {
UserDatatype::structured(
&[1, 1, 1],
&[
offset_of!(ComplexDatatype, b) as Address,
offset_of!(ComplexDatatype, ints) as Address,
offset_of!(ComplexDatatype, tuple) as Address,
],
&[
bool::equivalent_datatype().into(),
UncommittedUserDatatype::contiguous(4, &i32::equivalent_datatype()).as_ref(),
UncommittedUserDatatype::structured(
&[2, 1],
&[
offset_of!(TupleType, 0) as Address,
offset_of!(TupleType, 1) as Address,
],
&[f32::equivalent_datatype(), u8::equivalent_datatype()],
)
.as_ref(),
],
)
}
sourcepub fn vector<D>(
count: Count,
blocklength: Count,
stride: Count,
oldtype: &D
) -> Selfwhere
D: UncommittedDatatype,
pub fn vector<D>(
count: Count,
blocklength: Count,
stride: Count,
oldtype: &D
) -> Selfwhere
D: UncommittedDatatype,
sourcepub fn heterogeneous_vector<D>(
count: Count,
blocklength: Count,
stride: Address,
oldtype: &D
) -> Selfwhere
D: UncommittedDatatype,
pub fn heterogeneous_vector<D>(
count: Count,
blocklength: Count,
stride: Address,
oldtype: &D
) -> Selfwhere
D: UncommittedDatatype,
Like vector()
but stride
is given in bytes rather than elements of oldtype
.
§Standard section(s)
4.1.2
sourcepub fn indexed<D>(
blocklengths: &[Count],
displacements: &[Count],
oldtype: &D
) -> Selfwhere
D: UncommittedDatatype,
pub fn indexed<D>(
blocklengths: &[Count],
displacements: &[Count],
oldtype: &D
) -> Selfwhere
D: UncommittedDatatype,
Constructs a new type out of multiple blocks of individual length and displacement.
Block i
will be blocklengths[i]
items of datytpe oldtype
long and displaced by
dispplacements[i]
items of the oldtype
.
§Standard section(s)
4.1.2
sourcepub fn heterogeneous_indexed<D>(
blocklengths: &[Count],
displacements: &[Address],
oldtype: &D
) -> Selfwhere
D: UncommittedDatatype,
pub fn heterogeneous_indexed<D>(
blocklengths: &[Count],
displacements: &[Address],
oldtype: &D
) -> Selfwhere
D: UncommittedDatatype,
Constructs a new type out of multiple blocks of individual length and displacement.
Block i
will be blocklengths[i]
items of datytpe oldtype
long and displaced by
dispplacements[i]
bytes.
§Standard section(s)
4.1.2
sourcepub fn indexed_block<D>(
blocklength: Count,
displacements: &[Count],
oldtype: &D
) -> Selfwhere
D: UncommittedDatatype,
pub fn indexed_block<D>(
blocklength: Count,
displacements: &[Count],
oldtype: &D
) -> Selfwhere
D: UncommittedDatatype,
Construct a new type out of blocks of the same length and individual displacements.
§Standard section(s)
4.1.2
sourcepub fn heterogeneous_indexed_block<D>(
blocklength: Count,
displacements: &[Address],
oldtype: &D
) -> Selfwhere
D: UncommittedDatatype,
pub fn heterogeneous_indexed_block<D>(
blocklength: Count,
displacements: &[Address],
oldtype: &D
) -> Selfwhere
D: UncommittedDatatype,
Construct a new type out of blocks of the same length and individual displacements. Displacements are in bytes.
§Standard section(s)
4.1.2
sourcepub fn structured<D>(
blocklengths: &[Count],
displacements: &[Address],
types: &[D]
) -> Self
pub fn structured<D>( blocklengths: &[Count], displacements: &[Address], types: &[D] ) -> Self
Constructs a new datatype out of blocks of different length, displacement and datatypes
§Examples
See examples/structured.rs
§Standard section(s)
4.1.2
Examples found in repository?
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
fn equivalent_datatype() -> Self::Out {
UserDatatype::structured(
&[1, 1, 1],
&[
offset_of!(ComplexDatatype, b) as Address,
offset_of!(ComplexDatatype, ints) as Address,
offset_of!(ComplexDatatype, tuple) as Address,
],
&[
bool::equivalent_datatype().into(),
UncommittedUserDatatype::contiguous(4, &i32::equivalent_datatype()).as_ref(),
UncommittedUserDatatype::structured(
&[2, 1],
&[
offset_of!(TupleType, 0) as Address,
offset_of!(TupleType, 1) as Address,
],
&[f32::equivalent_datatype(), u8::equivalent_datatype()],
)
.as_ref(),
],
)
}
sourcepub fn commit(self) -> UserDatatype
pub fn commit(self) -> UserDatatype
Commits a datatype to a specific representation so that it can be used in MPI calls.
§Standard section(s)
4.1.9
sourcepub fn as_ref(&self) -> UncommittedDatatypeRef<'_>
pub fn as_ref(&self) -> UncommittedDatatypeRef<'_>
Creates an UncommittedDatatypeRef from this datatype object.
Examples found in repository?
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
fn equivalent_datatype() -> Self::Out {
UserDatatype::structured(
&[1, 1, 1],
&[
offset_of!(ComplexDatatype, b) as Address,
offset_of!(ComplexDatatype, ints) as Address,
offset_of!(ComplexDatatype, tuple) as Address,
],
&[
bool::equivalent_datatype().into(),
UncommittedUserDatatype::contiguous(4, &i32::equivalent_datatype()).as_ref(),
UncommittedUserDatatype::structured(
&[2, 1],
&[
offset_of!(TupleType, 0) as Address,
offset_of!(TupleType, 1) as Address,
],
&[f32::equivalent_datatype(), u8::equivalent_datatype()],
)
.as_ref(),
],
)
}