MPI_Abi_get_fortran_booleans(3)

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

πŸ’– MPI_Abi_get_fortran_booleans(3) πŸ’–

okay bestie, welcome to the MPI manual, section 3, and today's main character is MPI_Abi_get_fortran_booleans. yes she's giving niche ABI energy but she's important 🫢


✨ NAME ✨

MPI_Abi_get_fortran_booleans β€” get the size of the Fortran logical type, plus the .TRUE. and .FALSE. values. literally the whole truth-and-lies situation, but for your ABI πŸŽ€


✨ SYNOPSIS ✨

int MPI_Abi_get_fortran_booleans(int logical_size, void *logical_true,
       void *logical_false, int *is_set)

✨ INPUT PARAMETERS ✨

  • logical_size β€” the size of Fortran LOGICAL in bytes, and yeah it's an integer πŸ’…

✨ OUTPUT PARAMETERS ✨

  • logical_true β€” the Fortran literal value .TRUE., and it's a logical 🧚
  • logical_false β€” the Fortran literal value .FALSE., also a logical 🌸
  • is_set β€” a flag that tells you whether those logical boolean values were set previously. it's a logical too. she's just checking in on the vibes ⭐

✨ THREAD AND INTERRUPT SAFETY ✨

so this routine is thread-safe, which is the good news β€” multiple threads can use it at the same time with zero user-provided thread locks, no cap, she handles herself πŸ‘‘

but she is not interrupt safe. not even a little. πŸ™ˆ typically that's because of memory allocation routines like malloc or other non-MPICH runtime routines that are themselves not interrupt-safe. it's giving "not her fault, it's the company she keeps" 😭


✨ NOTES FOR FORTRAN ✨

every MPI routine in Fortran (except MPI_WTIME and MPI_WTICK, they're special) gets an extra argument called ierr tacked onto the end of the argument list. ierr is an integer and it means the exact 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 (like MPI_Datatype, MPI_Comm) are of type INTEGER in Fortran. yes really. all of them. πŸ¦‹


✨ ERRORS ✨

all MPI routines (except MPI_Wtime and MPI_Wtick) return an error value β€” C routines hand it back as the value of the function, Fortran routines put it in that last argument. before the value is returned, the current MPI error handler gets called. by default, this error handler aborts the MPI job, which is dramatic but true πŸ’€

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 can be used but its use is deprecated β€” so maybe don't, bestie πŸ™ˆ

the predefined error handler MPI_ERRORS_RETURN can be used to make error values get returned instead. and note: MPI does not guarantee that an MPI program can continue past an error; however, MPI implementations will attempt to continue whenever possible. fingers crossed energy 🀞

here's the error lineup:

  • MPI_SUCCESS β€” no error, the routine completed successfully, we ate and left no crumbs πŸ”₯
  • MPI_ERR_ARG β€” invalid argument. some argument is invalid and it's not identified by a specific error class (like MPI_ERR_RANK). she's being vague on purpose 😭
  • MPI_ERR_OTHER β€” other error; use MPI_Error_string to get more information about this error code. go ask her sister πŸ’œ

reminder bestie: logical_size is the size in bytes of Fortran LOGICAL, and is_set tells you whether the true/false values were set previously. keep those straight and you're golden ✨

that's the whole page, no notes πŸ’… this was MPI, version MPI_Abi_get_fortran_booleans(3), dated 4/10/2026 β€” so if you're reading this from the future, hi, you're iconic, bye πŸŽ€πŸŒˆπŸ‘‘

πŸ“¦ where this page comes from