MPI_Remove_error_string(3)
π MPI_Remove_error_string β bestie edition π
okay so this one lives in the MPI manual, and it's literally the β¨ cleanup crew β¨ of error strings. Let's get into it π«Ά
πΈ NAME πΈ
MPI_Remove_error_string β Remove the error string associated with an MPI error code or class π
β¨ SYNOPSIS β¨
int MPI_Remove_error_string(int errorcode)
like. one argument. that's it. we love a low-maintenance icon π
π INPUT PARAMETERS π
errorcodeβ value of the error code whose string is to be removed (integer). that's the one you're evicting from the string roster π¦
π NOTES π
so per the MPI 4.1 standard, it is erroneous to call MPI_Remove_error_string for an error code or class with a value less than or equal to MPI_ERR_LASTCODE π ngl that's the whole caveat and it matters!!
which means: you cannot replace the predefined error messages with this routine. they're protected. legacy. untouchable. periodt π
bestie do NOT try to remove the built-in ones. the standard said no and we listen π
π₯ THREAD AND INTERRUPT SAFETY π₯
this routine is thread-safe β¨ meaning you can absolutely have multiple threads hitting it at once, no user-provided thread locks required, no drama, no chaos. she's safe π«Ά
however. it is not interrupt safe π and 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, signal-interrupt-safe no. two different vibe checks, bestie π
π NOTES FOR FORTRAN π
every MPI routine in Fortran (except for MPI_WTIME and MPI_WTICK) has an additional argument ierr at the end of the argument list π ierr is an integer and has the exact same meaning as the return value of the routine in C. fr fr, same energy, different font.
also in Fortran, MPI routines are subroutines, and they get invoked with the call statement π
and!! all MPI objects (e.g., MPI_Datatype, MPI_Comm) are of type INTEGER in Fortran. iconic behavior honestly π§
π 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 the value is returned, the current MPI error handler is called. β
by default, this error handler aborts the MPI job π so yeah, it does not play.
the error handler may be changed with:
MPI_Comm_set_errhandler(for communicators)MPI_File_set_errhandler(for files)MPI_Win_set_errhandler(for RMA windows)
the MPI-1 routine MPI_Errhandler_set may be used but its use is deprecated β so, like, it's giving vintage, not in a cute way π
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. slay for trying π«Ά
the actual error codes
MPI_SUCCESSβ No error; MPI routine completed successfully. πMPI_ERR_OTHERβ Other error; useMPI_Error_stringto get more information about this error code. π
and that's the whole page bestie!! this was the MPI_Remove_error_string(3) page from the MPI manual, dated 4/10/2026, and it's literally just "remove one error string, don't touch the predefined ones, and remember Fortran has ierr at the end." iykyk πβ¨πΈ
bye ily, go free those strings 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