MPI_Type_create_hvector(3)
π MPI_Type_create_hvector(3) π
okay bestie, welcome to the MPI corner of the manual, this one's MPI_Type_create_hvector and she is so useful. π¦
β¨ NAME β¨
MPI_Type_create_hvector β create a datatype with a constant stride given in bytes
πΈ SYNOPSIS πΈ
int MPI_Type_create_hvector(int count, int blocklength, MPI_Aint stride,
MPI_Datatype oldtype, MPI_Datatype *newtype)
int MPI_Type_create_hvector_c(MPI_Count count, MPI_Count blocklength,
MPI_Count stride, MPI_Datatype oldtype,
MPI_Datatype *newtype)
π INPUT PARAMETERS π
countβ number of blocks (non-negative integer) πblocklengthβ number of elements in each block (non-negative integer)strideβ number of bytes between start of each block (integer). yes bestie, bytes, that's the whole point of theh, no cap π§oldtypeβ old datatype (handle)
π OUTPUT PARAMETERS π
newtypeβ new datatype (handle) β the shiny new baby you just made β¨
π₯ THREAD AND INTERRUPT SAFETY π₯
This routine is thread-safe. That means it's totally fine to use it from multiple threads at the same time, and you don't gotta bring your own thread locks, no user-provided locks needed, periodt. π
But lowkey, it is not interrupt safe though. π Typically that's because it uses memory allocation routines like malloc, or other non-MPICH runtime routines, and those are themselves not interrupt-safe. so yeah, threads = yes, interrupts = absolutely not.
π NOTES FOR FORTRAN π
All MPI routines in Fortran (except for MPI_WTIME and MPI_WTICK) have an additional argument ierr at the end of the argument list. ierr is an integer and has the same meaning as the return value of the routine in C. In Fortran, MPI routines are subroutines, and they're invoked with the call statement.
All MPI objects (e.g., MPI_Datatype, MPI_Comm) are of type INTEGER in Fortran. iconic behavior honestly. π
π 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 is called. By default, this error handler aborts the MPI job. π (yeah, dramatic, but true.)
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 β like, use the new ones please. 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; MPI routine completed successfully. slay β¨MPI_ERR_ARGβ Invalid argument. Some argument is invalid and is not 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. commit ur types bestie, fr fr πMPI_ERR_OTHERβ Other error; useMPI_Error_stringto get more information about this error code.
and that's the whole vibe check, babe. π
this page came from the MPI manual, dated 4/10/2026, and it's titled MPI_Type_create_hvector(3). go forth and stride in bytes, queen ππΈ
π¦ 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