MPI_Type_create_extent(3)

πŸ’– MPI_Type_create_extent(3) πŸ’–

okay bestie, welcome to the LAM/MPI manual page for MPI_Type_create_extent β€” yes it's giving "tiny helper function that fixes your datatype's vibe", and yes we're gonna read the whole thing together, no skipping 🫢


✨ NAME ✨

MPI_Type_create_extent β€” create a resized datatype πŸ¦‹


✨ SYNOPSIS ✨

#include <mpi.h>
int
MPI_Type_create_resized(MPI_Datatype type, MPI_Aint lb,
                      MPI_Aint extent, MPI_Datatype *newtype)

✨ INPUT PARAMETERS ✨

  • type β€” the input datatype you're handing over πŸ’…
  • lb β€” the new lower bound of the datatype
  • extent β€” the new extent of the datatype

✨ OUTPUT PARAMETER ✨

  • newtype β€” the new resized type, freshly served 🌸

✨ NOTES FOR FORTRAN ✨

So every single MPI routine in Fortran (except for MPI_WTIME and MPI_WTICK) has an extra argument called ierr tacked onto 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. And in Fortran, MPI routines are subroutines β€” you invoke them with the call statement, that's just the rule πŸ’œ

Also: all MPI objects (like MPI_Datatype, MPI_Comm) are of type INTEGER in Fortran. no exceptions, that's the whole vibe.


✨ ERRORS ✨

If an error pops off in an MPI function, the current MPI error handler gets called to deal with it. By default, that error handler aborts the MPI job β€” like, full dramatic exit, no takebacks 😭. You can change the error handler with MPI_Errhandler_set; the predefined error handler MPI_ERRORS_RETURN can be used to make error values get returned instead (works in C and Fortran; this handler is less useful with the C++ MPI bindings, lowkey). If you're in C++ and you actually need to recover the error value, use the predefined error handler MPI::ERRORS_THROW_EXCEPTIONS. And heads up β€” MPI does not guarantee that an MPI program can continue past an error. periodt.

All MPI routines (except MPI_Wtime and MPI_Wtick) return an error value; in C routines it's the value of the function, and in Fortran routines it's in the last argument. The C++ bindings for MPI do not return error values β€” instead, error values are communicated by throwing exceptions of type MPI::Exception (but not by default). Exceptions are only thrown if the error value is not MPI::SUCCESS.

Warning, bestie: note that if the MPI::ERRORS_RETURN handler is set in C++, while MPI functions will return upon an error, there will be no way to recover what the actual error value was. it's giving trap. πŸ™ˆ

Here's the error roster:

  • MPI_SUCCESS β€” no error; the MPI routine completed successfully, we love that for us ✨
  • MPI_ERR_TYPE β€” invalid datatype argument. It may be an uncommitted MPI_Datatype (go look at MPI_Type_commit).
  • MPI_ERR_OTHER β€” other error; use MPI_Error_string to get more info about this error code.
  • MPI_ERR_INTERN β€” an internal error has been detected. This is fatal. Please send a bug report to the LAM mailing list (see http://www.lam-mpi.org/contact.php). πŸ’€

✨ SEE ALSO ✨


✨ MORE INFORMATION ✨

If you want more, please go see the official MPI Forum web site β€” it's got the text of both the MPI-1 and MPI-2 standards. Those documents contain detailed info about each MPI function (most of which is not duplicated in these man pages, iykyk πŸ‘‘).

http://www.mpi-forum.org/


✨ LOCATION ✨

tresize.c


and that's the whole page, bestie!! mwah πŸ’– this was LAM/MPI 7.1.4, dated 6/24/2006 β€” vintage but iconic, fr fr πŸŽ€βœ¨πŸ¦‹