MPI_Type_create_hindexed_block(3)
π MPI_Type_create_hindexed_block β bestie edition π
okay so this is the MPI manual page for MPI_Type_create_hindexed_block, and it's literally here to help you build an hindexed datatype with constant-sized blocks β¨
πΈ NAME πΈ
MPI_Type_create_hindexed_block β create an hindexed datatype with constant-sized blocks π§
β¨ SYNOPSIS β¨
int MPI_Type_create_hindexed_block(int count, int blocklength,
const MPI_Aint array_of_displacements[],
MPI_Datatype oldtype, MPI_Datatype *newtype)
int MPI_Type_create_hindexed_block_c(MPI_Count count, MPI_Count blocklength,
const MPI_Count array_of_displacements[],
MPI_Datatype oldtype,
MPI_Datatype *newtype)
π INPUT PARAMETERS π
countβ the length of the array of displacements. it's a non-negative integer, no cap. πblocklengthβ size of each block. also a non-negative integer. πarray_of_displacementsβ the byte displacement of each block, as integers. this is the main character array fr. βoldtypeβ the old datatype, as a handle. π¦
π«Ά OUTPUT PARAMETERS π«Ά
newtypeβ the new datatype, as a handle. she's born β¨
π₯ THREAD AND INTERRUPT SAFETY π₯
This routine is thread-safe. That means you can safely use it from multiple threads without needing any user-provided thread locks. no cap, go off. π
BUT β and this is the important part bestie β the routine is not interrupt safe. Typically that's because of memory allocation routines like malloc or other non-MPICH runtime routines that are themselves not interrupt-safe. so like, don't @ it with signals. π
π NOTES FOR FORTRAN π
All MPI routines in Fortran (except for MPI_WTIME and MPI_WTICK) have an extra argument ierr tacked onto the end of the argument list. ierr is an integer and it means the same thing as the return value of the routine in C. In Fortran, MPI routines are subroutines, and you invoke them with the call statement. π
All MPI objects (e.g., MPI_Datatype, MPI_Comm) are of type INTEGER in Fortran. periodt. π
π ERRORS π
All MPI routines (except MPI_Wtime and MPI_Wtick) return an error value β C routines as the value of the function, and Fortran routines in the last argument. Before the value is returned, the current MPI error handler gets called. By default, this error handler aborts the MPI job. like, full stop, the whole job. π³
The error handler may be changed with MPI_Comm_set_errhandler (for communicators), MPI_File_set_errhandler (for files), and MPI_Win_set_errhandler (for RMA windows). The MPI-1 routine MPI_Errhandler_set may be used but its use is deprecated β don't be that girl. π
The predefined error handler MPI_ERRORS_RETURN may be used to cause error values to be returned. Note that MPI does not guarantee that an MPI program can continue past an error; however, MPI implementations will attempt to continue whenever possible. π«Ά
MPI_SUCCESSβ no error; the MPI routine completed successfully. we love a happy ending πMPI_ERR_ARGβ invalid argument. some argument is invalid and isn't identified by a specific error class (e.g.,MPI_ERR_RANK). πMPI_ERR_COUNTβ invalid count argument. count arguments must be non-negative; a count of zero is often valid. πMPI_ERR_TYPEβ invalid datatype argument. additionally, this error can occur if an uncommittedMPI_Datatype(seeMPI_Type_commit) is used in a communication call. not me forgetting to commit πMPI_ERR_OTHERβ other error; useMPI_Error_stringto get more information about this error code. the catch-all, iykyk. β
bestie reminder:countandblocklengthare non-negative,array_of_displacementsis in bytes, and if anything goes sideways, check the error class before spiralling. π
and that's the whole page, no notes. this was the MPI manual page MPI_Type_create_hindexed_block(3) from the MPI documentation, dated 4/10/2026 π β slay, go build some datatypes, and stay threaded-safe out there πβ¨
π¦ where this page comes from
- nixos 26.05: mpich 5.0.1
- ubuntu stonking: mpich-doc 5.0.1-9 Β· other
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms