MPI_Status_set_error(3)
β¨ NAME β¨
MPI_Status_set_error β bestie, this one sets the MPI_ERROR field inside the status π
(this page lives in the MPI manual, section 3, okurrr π«Ά)
πΈ SYNOPSIS πΈ
int MPI_Status_set_error(MPI_Status *status, int error)
π INPUT PARAMETERS π
errorβ the error you wanna set into theMPI_ERRORfield. It's an integer, okay? π
π¦ INPUT/OUTPUT PARAMETERS π¦
statusβ the status you're associating that error with. Yes babe, it gets touched, that's why it's input and output (it's aStatus) π
π§ THREAD AND INTERRUPT SAFETY π§
This routine is thread-safe π― which means you can use it from multiple threads at the same time with zero user-provided thread locks, no cap. So slay, go off.
But it is not interrupt safe π typically because of memory allocation routines like malloc or other non-MPICH runtime routines that are themselves not interrupt-safe. So like, threads? yes. Interrupts? absolutely not, periodt.
π NOTES FOR FORTRAN π
Every MPI routine in Fortran (except for MPI_WTIME and MPI_WTICK) has an extra argument ierr at the very 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 π
Also, all MPI objects (like MPI_Datatype, MPI_Comm) are of type INTEGER in Fortran. Yes, all of them. That's just the vibe π€·ββοΈ
π ERRORS π
Okay so, all MPI routines (except MPI_Wtime and MPI_Wtick) return an error value β C routines as the value of the function, and Fortran routines in the last argument. Before that value comes back, the current MPI error handler gets called. By default? that error handler aborts the MPI job π₯ so like, heads up.
You can change 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 π β grandfathered in, not it.
You can also use the predefined error handler MPI_ERRORS_RETURN to make error values actually get returned to you instead. And note: MPI does not guarantee that an MPI program can continue past an error, but MPI implementations will attempt to continue whenever possible π«Ά
MPI_SUCCESSβ no error, the MPI routine completed successfully. We love to see it βMPI_ERR_OTHERβ some other error; useMPI_Error_stringto get more info about this error code π
ngl bestie the whole point here is just writing an error code into a status field. Tiny function, big energy π
okay that's the whole page, you ate that π
mwah! this was the MPI manual, MPI_Status_set_error(3), dated 4/10/2026 β go forth and set those errors, queen πβ¨
π¦ 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