MPI_TYPE_GET_TRUE_EXTENT(3)
π MPI_TYPE_GET_TRUE_EXTENT(3) β Open MPI, section 3, bestie edition π
okay so this is the Open MPI man page for MPI_Type_get_true_extent and MPI_Type_get_true_extent_x, and it's literally about finding the true lower bound and extent of a data type's typemap while straight-up ignoring MPI_UB and MPI_LB markers. yes, ignoring. we don't see them. they're not in the group chat. π
β¨ SYNTAX β¨
π©΅ C Syntax
#include <mpi.h>
int MPI_Type_get_true_extent(MPI_Datatype datatype,
MPI_Aint *true_lb, MPI_Aint *true_extent)
int MPI_Type_get_true_extent_x(MPI_Datatype datatype,
MPI_Count *true_lb, MPI_Count *true_extent)
πΈ Fortran Syntax
USE MPI
! or the older form: INCLUDE 'mpif.h'
MPI_TYPE_GET_TRUE_EXTENT(DATATYPE, TRUE_LB, TRUE_EXTENT, IERROR)
INTEGER DATATYPE, IERROR
INTEGER(KIND=MPI_ADDRESS_KIND) TRUE_LB, TRUE_EXTENT
MPI_TYPE_GET_TRUE_EXTENT_X(DATATYPE, TRUE_LB, TRUE_EXTENT, IERROR)
INTEGER DATATYPE, IERROR
INTEGER(KIND=MPI_COUNT_KIND) TRUE_LB, TRUE_EXTENT
π¦ Fortran 2008 Syntax
USE mpi_f08
MPI_Type_get_true_extent(datatype, true_lb, true_extent, ierror)
TYPE(MPI_Datatype), INTENT(IN) :: datatype
INTEGER(KIND=MPI_ADDRESS_KIND), INTENT(OUT) :: true_lb, true_extent
INTEGER, OPTIONAL, INTENT(OUT) :: ierror
MPI_Type_get_true_extent_x(datatype, true_lb, true_extent, ierror)
TYPE(MPI_Datatype), INTENT(IN) :: datatype
INTEGER(KIND = MPI_COUNT_KIND), INTENT(OUT) :: true_lb, true_extent
INTEGER, OPTIONAL, INTENT(OUT) :: ierror
π INPUT PARAMETER π
datatypeβ the data type you're being nosy about, bestie (handle). π΅οΈββοΈ
π OUTPUT PARAMETERS π
true_lbβ the true lower bound of the data type (integer). πtrue_extentβ the true size of the data type (integer). β¨ierrorβ Fortran only: error status (integer). π«Ά
π₯ DESCRIPTION π₯
okay bestie, listen. the true_lb parameter hands you back the offset of the lowest unit of store that is addressed by the data type β that's the lower bound of the corresponding typemap, and it is fully ignoring MPI_LB markers. like, not invited. π
the true_extent parameter gives you the true size of the data type, aka the extent of the corresponding typemap, ignoring MPI_LB and MPI_UB markers, and performing no rounding for alignment. no rounding, no glow-up, just the raw truth. π
for both functions: if either the true_lb or true_extent parameter can't express the value it needs to return (e.g., if the parameter is too small to hold the output value), it gets set to MPI_UNDEFINED. yes, it just gives up and says undefined. relatable. π
and the true_extent is the minimum number of bytes of memory necessary to hold a data type, uncompressed. minimum. bytes. uncompressed. no cap. π§
if you want the full detailed definitions of these parameters in relation to the typemap, go read section 4.1.8 of the MPI-3 standard. it's giving required reading, ngl. π
π ERRORS π
almost all MPI routines return an error value, bestie β C routines as the return result of the function, and Fortran routines in the last argument. classic. π«
before that error value comes back, the current MPI error handler associated with the communication object (e.g., communicator, window, file) gets called. and if there's no communication object associated with the MPI call, then the call is considered attached to MPI_COMM_SELF and will call the associated MPI error handler. when MPI_COMM_SELF isn't initialized (i.e., before MPI_Init/MPI_Init_thread, after MPI_Finalize, or when using the Sessions Model exclusively), the error raises the initial error handler. β¨
that initial error handler can be changed by:
- calling
MPI_Comm_set_errhandleronMPI_COMM_SELFwhen using the World model, or - the
mpi_initial_errhandlerCLI argument tompiexec, or - the info key to
MPI_Comm_spawn/MPI_Comm_spawn_multiple.
if no other appropriate error handler has been set, then the MPI_ERRORS_RETURN error handler is called for MPI I/O functions, and the MPI_ERRORS_ABORT error handler is called for all other MPI functions. that's just how it is. π
π the three predefined error handlers Open MPI ships with π
MPI_ERRORS_ARE_FATALβ causes the program to abort all connected MPI processes. it's giving main character exit. πMPI_ERRORS_ABORTβ an error handler that can be invoked on a communicator, window, file, or session. when called on a communicator, it acts as ifMPI_Abortwas called on that communicator. if called on a window or file, it acts as ifMPI_Abortwas called on a communicator containing the group of processes in the corresponding window or file. if called on a session, it aborts only the local process. spicy but contained. π₯MPI_ERRORS_RETURNβ returns an error code to the application. the chill one. π«Ά
π¦ writing your own error handlers (yes you can, icon behavior) π¦
MPI applications can also implement their own error handlers by calling:
MPI_Comm_create_errhandlerthenMPI_Comm_set_errhandlerMPI_File_create_errhandlerthenMPI_File_set_errhandlerMPI_Session_create_errhandlerthenMPI_Session_set_errhandleror atMPI_Session_initMPI_Win_create_errhandlerthenMPI_Win_set_errhandler
β οΈ note that MPI does not guarantee that an MPI program can continue past an error. like, fr fr, don't count on it. π
see the MPI man page for a full list of MPI error codes, and see the Error Handling section of the MPI-3.1 standard for more information. iykyk. π
π COPYRIGHT π
2003-2026, The Open MPI Community
alright bestie, that's the whole page, you ate it up π
β¨ β and for the record, this was the Open MPI MPI_TYPE_GET_TRUE_EXTENT(3) page, dated Sep 11, 2026. go forth and get those true extents, queen. ππ¦πΈ
π¦ where this page comes from
- arch rolling: openmpi 5.0.11-1 Β· BSD-3-Clause AND LicenseRef-MPICH
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms