MPI_TYPE_GET_NAME(3)

🌸 MPI_TYPE_GET_NAME 🌸

okay bestie, close the group chat for two seconds β€” this is a page from the Open MPI manual, section 3, and it's literally about getting the name of a data type. yeah. that's it. that's the whole vibe. πŸ’…


✨ NAME ✨

MPI_Type_get_name β€” gets the name of a data type. like, it goes and fetches the little label you stuck on your datatype. iconic behavior honestly πŸŽ€


πŸ“œ SYNTAX πŸ“œ

πŸ’– C Syntax

#include <mpi.h>

int MPI_Type_get_name(MPI_Datatype type, char *type_name,
     int *resultlen)

πŸ’– Fortran Syntax

USE MPI
! or the older form: INCLUDE 'mpif.h'
MPI_TYPE_GET_NAME(TYPE, TYPE_NAME, RESULTLEN, IERROR)
     INTEGER TYPE, RESULTLEN, IERROR
     CHARACTER*(*) TYPE_NAME

πŸ’– Fortran 2008 Syntax

USE mpi_f08
MPI_Type_get_name(datatype, type_name, resultlen, ierror)
     TYPE(MPI_Datatype), INTENT(IN) :: datatype
     CHARACTER(LEN=MPI_MAX_OBJECT_NAME), INTENT(OUT) :: type_name
     INTEGER, INTENT(OUT) :: resultlen
     INTEGER, OPTIONAL, INTENT(OUT) :: ierror

🫢 INPUT PARAMETER 🫢

  • type β€” the data type whose name is to be returned (handle). yeah, you gotta tell it which datatype you're being nosy about, bestie.

πŸŽ€ OUTPUT PARAMETERS πŸŽ€

  • type_name β€” the name previously stored on the data type, or an empty string if not such name exists (string). so if nobody ever named it, you get nothing. empty. void. the silence of an unnamed type 😭
  • resultlen β€” length of returned name (integer).
  • ierror β€” Fortran only: error status (integer).

πŸ’« DESCRIPTION πŸ’«

MPI_Type_get_name returns the printable identifier associated with an MPI data type. that's it, that's the function. it's giving "hi bestie what's your name" but for datatypes ✨


πŸ’€ ERRORS πŸ’€

okay so this part is long but DO NOT skip it, it's highkey important. almost all MPI routines return an error value; C routines as the return result of the function and Fortran routines in the last argument.

before the error value is returned, the current MPI error handler associated with the communication object (e.g., communicator, window, file) is called. if no communication object is 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 is not 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. the initial error handler can be changed by calling MPI_Comm_set_errhandler on MPI_COMM_SELF when using the World model, or the mpi_initial_errhandler CLI argument to mpiexec or 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.

Open MPI includes three predefined error handlers that can be used:

  • MPI_ERRORS_ARE_FATAL β€” causes the program to abort all connected MPI processes. everyone's gone. periodt πŸ’€
  • 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 if MPI_Abort was called on that communicator. if called on a window or file, acts as if MPI_Abort was called on a communicator containing the group of processes in the corresponding window or file. if called on a session, aborts only the local process.
  • MPI_ERRORS_RETURN β€” returns an error code to the application. polite of it honestly.

MPI applications can also implement their own error handlers by calling:

  • MPI_Comm_create_errhandler then MPI_Comm_set_errhandler
  • MPI_File_create_errhandler then MPI_File_set_errhandler
  • MPI_Session_create_errhandler then MPI_Session_set_errhandler or at MPI_Session_init
  • MPI_Win_create_errhandler then MPI_Win_set_errhandler
⚠️ note that MPI does not guarantee that an MPI program can continue past an error. so like, don't bank on it. no cap.

see the MPI man page for a full list of MPI error codes.

see the Error Handling section of the MPI-3.1 standard for more information.

see also:

  • MPI_Type_set_name

πŸ‘‘ SEE ALSO πŸ‘‘

  • MPI_Type_set_name β€” the other half of this duo, the one that sets the name. they're a package deal, iykyk πŸ¦‹

2003-2026, The Open MPI Community


and that's the whole page bestie!! Open MPI, page MPI_TYPE_GET_NAME(3), dated Sep 10, 2026. go forth and name your datatypes, you absolute main character πŸ‘‘βœ¨πŸŒΈ

πŸ“¦ where this page comes from