MPI_Remove_error_code(3)
β¨ MPI_Remove_error_code(3) β the MPI girly's guide β¨
okay bestie, welcome to the MPI manual, section 3 π this one's about MPI_Remove_error_code and honestly? it's giving spring cleaning for your error codes. let's get into it π§Ήβ¨
πΈ NAME πΈ
MPI_Remove_error_code β remove an MPI error code ποΈ
like... it removes an MPI error code. literally what it says on the tin, no cap.
π SYNOPSIS π
int MPI_Remove_error_code(int errorcode)
one function, one argument, so tidy of it π
π¦ INPUT PARAMETERS π¦
errorcodeβ the value of the error code to be removed, and it's an integer babe π’ that's the only thing you pass in. that's it. that's the whole vibe.
π₯ THREAD AND INTERRUPT SAFETY π₯
okay so this routine is thread-safe π which means multiple threads can use it at the same time and you do not need to bring your own thread locks. no user-provided lock situation. she handles herself, main character energy fr fr.
BUT β and this is the important part β the routine is not interrupt safe π typically that's because of memory allocation routines like malloc, or other non-MPICH runtime routines, that are themselves not interrupt-safe. so like, thread-safe yes, interrupt-safe no. don't get it twisted π«Ά
π NOTES FOR FORTRAN π
all MPI routines in Fortran (except for MPI_WTIME and MPI_WTICK) have an extra argument ierr tacked onto the end of the argument list π ierr is an integer and it means the 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. periodt.
also, all MPI objects (e.g. MPI_Datatype, MPI_Comm) are of type INTEGER in Fortran. yes, all of them. Fortran said "integers only" and honestly? ate. π
π ERRORS π
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 to you, the current MPI error handler gets called. by default, this error handler aborts the MPI job π³ so yeah, dramatic much.
the error handler can be changed 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 π« (so... don't, bestie).
the predefined error handler MPI_ERRORS_RETURN may be used to cause error values to be returned. note that MPI does not guarantee that an MPI program can continue past an error; however, MPI implementations will attempt to continue whenever possible. so like, they're trying their best, okay? π
MPI_SUCCESSβ no error; the MPI routine completed successfully. slay βMPI_ERR_OTHERβ other error; useMPI_Error_stringto get more information about this error code. the classic "idk what happened, go ask someone else" π
π side note bestie: error handling is the unglamorous part of MPI but it's so important. know your handler. know your return codes. stay safe out there π
and that's the page π this was rendered from the MPI manual, dated 4/10/2026 β mwah, thanks for reading, ily, go remove some error codes responsibly π«Άβ¨π
π¦ 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