MPI_Abi_set_fortran_info(3)
π MPI_Abi_set_fortran_info(3) β the MPI manual, bestie edition π
okay so today we're learning about MPI_Abi_set_fortran_info, straight out of the MPI manual. yes it's a real section 3 page, yes it's in the MPI manual, and yes we're gonna make it make sense. sit down, get comfy, hydrate π
β¨ NAME β¨
MPI_Abi_set_fortran_info β set Fortran datatype sizes and whether optional Fortran types are supported π
like. that's the whole job. it configures the Fortran ABI details. slay.
β¨ SYNOPSIS β¨
int MPI_Abi_set_fortran_info(MPI_Info info)
that's it. one function, one arg, one int coming back at you. iconic behavior honestly π
β¨ INPUT PARAMETERS β¨
infoβ the Fortran ABI details info object (a handle). this is the little briefcase π§³ carrying all your Fortran ABI details, and you're handing it over so the routine knows what's up.
β¨ THREAD AND INTERRUPT SAFETY β¨
okay this part is important so listen up bestie π
this routine is thread-safe. translation: multiple threads can call it at the same time, no user-provided thread locks needed, no drama, no cap. it just works. π«Ά
but β and this is the plot twist π β it 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 = absolutely not. noted. moving on.
β¨ NOTES FOR FORTRAN β¨
for my Fortran girlies specifically π
- literally all MPI routines in Fortran (with the exception of
MPI_WTIMEandMPI_WTICK) get an extra argument calledierrtacked onto the end of the argument list.ierris an integer and it means exactly the same thing as the return value of the routine in C. same energy, different language. - in Fortran, MPI routines are subroutines, and you invoke them with the
callstatement. not a function call, acall. respect the grammar π - and all MPI objects (like
MPI_Datatype,MPI_Comm) are of typeINTEGERin Fortran. all of them. that's just how it is.
β¨ ERRORS β¨
so basically every MPI routine (except MPI_Wtime and MPI_Wtick) returns an error value. C routines return it as the value of the function; Fortran routines put it in that last argument we just talked about.
before the value even comes back to you, the current MPI error handler gets called. by default? that error handler aborts the MPI job. like, full stop, whole job, gone π. you can change it though:
MPI_Comm_set_errhandlerβ for communicatorsMPI_File_set_errhandlerβ for filesMPI_Win_set_errhandlerβ for RMA windows
and yeah, the MPI-1 routine MPI_Errhandler_set can be used too, but its use is deprecated π« β so don't, bestie, it's giving legacy code.
you can also use the predefined error handler MPI_ERRORS_RETURN to make error values get returned instead. and here's the fine print: MPI does not guarantee that an MPI program can continue past an error. that said, MPI implementations will attempt to continue whenever possible. so like, they'll try, but no promises π
now the actual error codes:
MPI_SUCCESSβ no error, the MPI routine completed successfully. the dream. the goal. we love to see it β¨MPI_ERR_INFOβ invalid Info. your info object is not info-ing π©MPI_ERR_OTHERβ other error, aka the catch-all. useMPI_Error_stringto get more information about this error code, because "other" is not an explanation, it's a vibe π
lowkey reminder: this one's<hotpink>thread-safe</hotpink>but not interrupt-safe, and the default error handler will absolutely end your whole job. set your errhandler accordingly, babe π«Ά
and that's the page! no notes, ate and left no crumbs π
this was MPI_Abi_set_fortran_info(3) from the MPI manual, dated 4/10/2026 β mwah, catch you in the next manpage, bye bestie πππ¦
π¦ 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