MPITypecreateh
MPI_Type_create_hindexed is a function in the Message Passing Interface (MPI) standard, designed for creating a new MPI datatype by indexing into an existing datatype. This function is particularly useful when dealing with non-contiguous data structures, such as sparse matrices or irregular arrays.
The function prototype is as follows:
int MPI_Type_create_hindexed(int count, const int array_of_blocklengths[], const MPI_Aint array_of_displacements[], MPI_Datatype oldtype, MPI_Datatype *newtype)
Here's a breakdown of the parameters:
- count: The number of blocks in the new datatype.
- array_of_blocklengths: An array of integers, where each element specifies the number of elements in the corresponding
- array_of_displacements: An array of MPI_Aint, where each element specifies the displacement (in bytes) of the corresponding
- oldtype: The existing MPI datatype from which the new datatype is derived.
- newtype: A pointer to the new MPI datatype that is created.
The function returns an error code, which is MPI_SUCCESS if the operation is successful.
After creating the new datatype, it is typically committed using MPI_Type_commit before it can be used
MPI_Type_create_hindexed is a powerful tool for handling complex data structures in parallel computing, enabling efficient and