MPI_Abi_set_fortran_info(3)

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

πŸ’– 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_WTIME and MPI_WTICK) get an extra argument called ierr tacked onto the end of the argument list. ierr is 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 call statement. not a function call, a call. respect the grammar πŸ’…
  • and all MPI objects (like MPI_Datatype, MPI_Comm) are of type INTEGER in 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 communicators
  • MPI_File_set_errhandler β€” for files
  • MPI_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. use MPI_Error_string to 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