MPI_Remove_error_string(3)

πŸ“¦
version 5.0.1 Β· 4 versions
, in nixos 26.05, ubuntu stonking

πŸ’– 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; use MPI_Error_string to 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