MPI_TYPE_SET_ATTR(3)
π MPI_TYPE_SET_ATTR(3) β like, the Open MPI manual page, bestie β¨
okay so this is the MPI_TYPE_SET_ATTR page from Open MPI, and it's literally about attaching attribute vibes to datatypes. let's get into it π
πΈ NAME πΈ
MPI_Type_set_attr β sets a key value/attribute pair to a data type. that's it. that's the whole job. iconic of it honestly π«Ά
β¨ SYNTAX β¨
π C Syntax
#include <mpi.h>
int MPI_Type_set_attr(MPI_Datatype type, int type_keyval,
void *attribute_val)
π Fortran Syntax
USE MPI
! or the older form: INCLUDE 'mpif.h'
MPI_TYPE_SET_ATTR(TYPE, TYPE_KEYVAL, ATTRIBUTE_VAL, IERROR)
INTEGER TYPE, TYPE_KEYVAL, IERROR
INTEGER(KIND=MPI_ADDRESS_KIND) ATTRIBUTE_VAL
π Fortran 2008 Syntax
USE mpi_f08
MPI_Type_set_attr(datatype, type_keyval, attribute_val, ierror)
TYPE(MPI_Datatype), INTENT(IN) :: datatype
INTEGER, INTENT(IN) :: type_keyval
INTEGER(KIND=MPI_ADDRESS_KIND), INTENT(IN) :: attribute_val
INTEGER, OPTIONAL, INTENT(OUT) :: ierror
π INPUT/OUTPUT PARAMETER π
typeβ the data type we're attaching the attribute to (it's a handle). yes bestie it's both input and output, she contains multitudes π
π§ INPUT PARAMETERS π§
type_keyvalβ the key value (an integer). the little name-tag for your attribute fr fr.attribute_valβ the attribute value itself. the actual content. the main character π
π¦ OUTPUT PARAMETER π¦
ierrorβ Fortran only: the error status (integer). Fortran girlies get their errors handed to them in the last argument, no cap.
π DESCRIPTION π
so for the given data type, MPI_Type_set_attr sets the key value to the value of the specified attribute. that's the tea β β key value in, attribute value attached, slay.
π ERRORS π
almost all MPI routines return an error value, okay? C routines give it back as the return result of the function, and Fortran routines put it in that last argument. both valid, both slay π
before the error value gets returned, the current MPI error handler associated with the communication object (think: communicator, window, file) gets called. and if there's no communication object associated with the MPI call? then the call gets treated as attached to MPI_COMM_SELF and it calls the associated MPI error handler. periodt.
when MPI_COMM_SELF is not initialized (i.e., before MPI_Init/MPI_Init_thread, after MPI_Finalize, or when you're using the Sessions Model exclusively) the error raises the initial error handler. and you can change that initial error handler:
- by calling
MPI_Comm_set_errhandleronMPI_COMM_SELFwhen using the World model, or - with the
mpi_initial_errhandlerCLI argument tompiexec, or - with the info key to
MPI_Comm_spawn/MPI_Comm_spawn_multiple.
and 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 π«
Open MPI ships three predefined error handlers you can use:
MPI_ERRORS_ARE_FATALβ causes the program to abort all connected MPI processes. like, everyone. dramatic but effective π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. versatile queen πMPI_ERRORS_RETURNβ returns an error code to the application. the chill one π
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, no promises bestie, be careful out there π
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 π
π SEE ALSO: π
MPI_Type_get_attr
π COPYRIGHT π
2003-2026, The Open MPI Community
and that's the whole page, bestie!! π¦β¨ this was Open MPI, MPI_TYPE_SET_ATTR(3), dated Sep 11, 2026 β go forth and attach those attributes, you absolute icon πππ
π¦ 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