References:
Up to this point, all examples have used already defined MPI types, but you can create your own to pass and receive messages.
All types created with the routines shown below need to call this function before using them in communication, in order to submit the created type.
int MPI_Type_commit(
MPI_Datatype *type //Created type address
);
It deallocates the resources assigned to an MPI_Datatype and sets it to MPI_DATATYPE_NULL, ****which is a const. Communications that are currently using it will complete normally and MPI datatypes built on the freed one are not affected.
int MPI_Type_free(
MPI_Datatype *type //Created type address
);
Note: The codes shown below are just examples; they do not use MPI_Type_free, but it is important to always free the type's memory after finishing their use.