6.1.10. Duplicating a Datatype

PreviousUpNext
Up: Derived Datatypes Next: Use of General Datatypes in Communication Previous: Commit and Free

MPI_TYPE_DUP(oldtype, newtype)
IN oldtypedatatype (handle)
OUT newtypecopy of oldtype (handle)
C binding
int MPI_Type_dup(MPI_Datatype oldtype, MPI_Datatype *newtype)
Fortran 2008 binding
MPI_Type_dup(oldtype, newtype, ierror)

TYPE(MPI_Datatype), INTENT(IN) :: oldtype
TYPE(MPI_Datatype), INTENT(OUT) :: newtype
INTEGER, OPTIONAL, INTENT(OUT) :: ierror
Fortran binding
MPI_TYPE_DUP(OLDTYPE, NEWTYPE, IERROR)

INTEGER OLDTYPE, NEWTYPE, IERROR

MPI_TYPE_DUP is a type constructor that duplicates the existing oldtype with associated key values. For each key value, the respective copy callback function determines the attribute value associated with this key in the new datatype; one particular action that a copy callback may take is to delete the attribute from the new datatype. Returns in newtype a new datatype with exactly the same properties as oldtype and any copied cached information, see Section Datatypes. The new datatype has identical upper bound and lower bound and yields the same net result when fully decoded with the procedures in Section Decoding a Datatype. The newtype has the same committed state as the old oldtype.


PreviousUpNext
Up: Derived Datatypes Next: Use of General Datatypes in Communication Previous: Commit and Free


Return to MPI-4.1 Standard Index
Return to MPI Forum Home Page

(Unofficial) MPI-4.1 of November 2, 2023
HTML Generated on November 19, 2023