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

source

pub fn contiguous<D>(count: Count, oldtype: &D) -> Self

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?
examples/complex_datatype.rs (line 35)
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(),
            ],
        )
    }
source

pub fn vector<D>( count: Count, blocklength: Count, stride: Count, oldtype: &D ) -> Self

Construct a new datatype out of count blocks of blocklength elements of oldtype concatenated with the start of consecutive blocks placed stride elements apart.

§Examples

See examples/vector.rs

§Standard section(s)

4.1.2

source

pub fn heterogeneous_vector<D>( count: Count, blocklength: Count, stride: Address, oldtype: &D ) -> Self

Like vector() but stride is given in bytes rather than elements of oldtype.

§Standard section(s)

4.1.2

source

pub fn indexed<D>( blocklengths: &[Count], displacements: &[Count], oldtype: &D ) -> Self

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

source

pub fn heterogeneous_indexed<D>( blocklengths: &[Count], displacements: &[Address], oldtype: &D ) -> Self

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

source

pub fn indexed_block<D>( blocklength: Count, displacements: &[Count], oldtype: &D ) -> Self

Construct a new type out of blocks of the same length and individual displacements.

§Standard section(s)

4.1.2

source

pub fn heterogeneous_indexed_block<D>( blocklength: Count, displacements: &[Address], oldtype: &D ) -> Self

Construct a new type out of blocks of the same length and individual displacements. Displacements are in bytes.

§Standard section(s)

4.1.2

source

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?
examples/complex_datatype.rs (lines 36-43)
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(),
            ],
        )
    }
source

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

source

pub fn as_ref(&self) -> UncommittedDatatypeRef<'_>

Creates an UncommittedDatatypeRef from this datatype object.

Examples found in repository?
examples/complex_datatype.rs (line 35)
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(),
            ],
        )
    }

Trait Implementations§

source§

impl AsRaw for UncommittedUserDatatype

§

type Raw = *mut ompi_datatype_t

The raw MPI C API type
source§

fn as_raw(&self) -> Self::Raw

The raw value
source§

impl Clone for UncommittedUserDatatype

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Drop for UncommittedUserDatatype

source§

fn drop(&mut self)

Executes the destructor for this type. Read more
source§

impl<'a> From<&'a UncommittedUserDatatype> for UncommittedDatatypeRef<'a>

source§

fn from(datatype: &'a UncommittedUserDatatype) -> Self

Converts to this type from the input type.
source§

impl FromRaw for UncommittedUserDatatype

source§

unsafe fn from_raw(handle: MPI_Datatype) -> Self

Constructs the Rust type, with all its semantics, from the raw MPI type. Read more
source§

impl UncommittedDatatype for UncommittedUserDatatype

§

type DuplicatedDatatype = UncommittedUserDatatype

The type returned when the datatype is duplicated.
source§

fn dup(&self) -> Self::DuplicatedDatatype

Creates a new datatype with the same key-values as this datatype. Read more
source§

impl MatchesRaw for UncommittedUserDatatype

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<Src, Scheme> ApproxFrom<Src, Scheme> for Src
where Scheme: ApproxScheme,

§

type Err = NoError

The error type produced by a failed conversion.
source§

fn approx_from(src: Src) -> Result<Src, <Src as ApproxFrom<Src, Scheme>>::Err>

Convert the given value into an approximately equivalent representation.
source§

impl<Dst, Src, Scheme> ApproxInto<Dst, Scheme> for Src
where Dst: ApproxFrom<Src, Scheme>, Scheme: ApproxScheme,

§

type Err = <Dst as ApproxFrom<Src, Scheme>>::Err

The error type produced by a failed conversion.
source§

fn approx_into(self) -> Result<Dst, <Src as ApproxInto<Dst, Scheme>>::Err>

Convert the subject into an approximately equivalent representation.
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T, Dst> ConvAsUtil<Dst> for T

source§

fn approx(self) -> Result<Dst, Self::Err>
where Self: Sized + ApproxInto<Dst>,

Approximate the subject with the default scheme.
source§

fn approx_by<Scheme>(self) -> Result<Dst, Self::Err>
where Self: Sized + ApproxInto<Dst, Scheme>, Scheme: ApproxScheme,

Approximate the subject with a specific scheme.
source§

impl<T> ConvUtil for T

source§

fn approx_as<Dst>(self) -> Result<Dst, Self::Err>
where Self: Sized + ApproxInto<Dst>,

Approximate the subject to a given type with the default scheme.
source§

fn approx_as_by<Dst, Scheme>(self) -> Result<Dst, Self::Err>
where Self: Sized + ApproxInto<Dst, Scheme>, Scheme: ApproxScheme,

Approximate the subject to a given type with a specific scheme.
source§

fn into_as<Dst>(self) -> Dst
where Self: Sized + Into<Dst>,

Convert the subject to a given type.
source§

fn try_as<Dst>(self) -> Result<Dst, Self::Err>
where Self: Sized + TryInto<Dst>,

Attempt to convert the subject to a given type.
source§

fn value_as<Dst>(self) -> Result<Dst, Self::Err>
where Self: Sized + ValueInto<Dst>,

Attempt a value conversion of the subject to a given type.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<Src> TryFrom<Src> for Src

§

type Err = NoError

The error type produced by a failed conversion.
source§

fn try_from(src: Src) -> Result<Src, <Src as TryFrom<Src>>::Err>

Convert the given value into the subject type.
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<Src, Dst> TryInto<Dst> for Src
where Dst: TryFrom<Src>,

§

type Err = <Dst as TryFrom<Src>>::Err

The error type produced by a failed conversion.
source§

fn try_into(self) -> Result<Dst, <Src as TryInto<Dst>>::Err>

Convert the subject into the destination type.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<Src> ValueFrom<Src> for Src

§

type Err = NoError

The error type produced by a failed conversion.
source§

fn value_from(src: Src) -> Result<Src, <Src as ValueFrom<Src>>::Err>

Convert the given value into an exactly equivalent representation.
source§

impl<Src, Dst> ValueInto<Dst> for Src
where Dst: ValueFrom<Src>,

§

type Err = <Dst as ValueFrom<Src>>::Err

The error type produced by a failed conversion.
source§

fn value_into(self) -> Result<Dst, <Src as ValueInto<Dst>>::Err>

Convert the subject into an exactly equivalent representation.