MPI_Type_get_true_extent(3)
π MPI_Type_get_true_extent β the tea β
okay bestie, welcome to the MPI manual, we're doing the whole thing, no skimming, no cap. This one's about MPI_Type_get_true_extent(3) and it's literally just you asking a datatype "hey girl, what's your actual TRUE lower bound and TRUE extent?" π
β¨ NAME β¨
MPI_Type_get_true_extent β get the true lower bound and extent for a datatype π
πΈ SYNOPSIS πΈ
int MPI_Type_get_true_extent(MPI_Datatype datatype, MPI_Aint *true_lb,
MPI_Aint *true_extent)
int MPI_Type_get_true_extent_c(MPI_Datatype datatype, MPI_Count *true_lb,
MPI_Count *true_extent)
two flavours, same vibe, one uses MPI_Aint and one uses MPI_Count π¦
π§ INPUT PARAMETERS π§
datatypeβ the datatype you want the info on, it's a handle π«Ά
π OUTPUT PARAMETERS π
true_lbβ the true lower bound of the datatype, an integer β¨true_extentβ the true size of the datatype, also an integer β¨
π₯ THREAD AND INTERRUPT SAFETY π₯
good news: this routine is thread-safe. That means multiple threads can use it at the same time with zero user-provided thread locks, no baby-sitting required, she's independent, main character energy π
but β and this is the important part β the routine is not interrupt safe. 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 like, don't interrupt her mid-glow-up, fr fr π
π NOTES FOR FORTRAN π
All MPI routines in Fortran (except for MPI_WTIME and MPI_WTICK ) have an extra argument called ierr at the end of the argument list. ierr is an integer and it means the exact 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. periodt.
Also, all MPI objects (like MPI_Datatype, MPI_Comm) are of type INTEGER in Fortran. iykyk π
π ERRORS π
All MPI routines (except MPI_Wtime and MPI_Wtick ) return an error value β C routines as the value of the function itself, and Fortran routines in that last argument. Before the value comes back to you, the current MPI error handler gets called.
β οΈ By default, this error handler aborts the MPI job. That's not a drill bestie, she will end the whole program.
You can swap the error handler 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 β old, dusty, don't do it π«
The predefined error handler MPI_ERRORS_RETURN may be used to make error values get returned instead. And note: MPI does not guarantee that an MPI program can continue past an error; however, MPI implementations will attempt to continue whenever possible. so, like, she'll try her best π₯Ί
here's the error roster:
MPI_SUCCESSβ no error, the MPI routine completed successfully, ate and left no crumbs π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_TYPEβ invalid datatype argument. Also, this error can occur if an uncommittedMPI_Datatype(seeMPI_Type_commit) is used in a communication call. commit your types, bestie, or she's gonna yell πMPI_ERR_OTHERβ other error; useMPI_Error_stringto get more information about this error code.
and that's the whole page, no notes π
sign-off time: this one was living in the MPI manual, dated 4/10/2026, and the page name is MPI_Type_get_true_extent(3). staying hydrated, reading your extents, bye bestie π¦β¨π
π¦ 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