MPI_Abi_get_fortran_booleans(3)
π 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 FortranLOGICALin 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 (likeMPI_ERR_RANK). she's being vague on purpose πMPI_ERR_OTHERβ other error; useMPI_Error_stringto get more information about this error code. go ask her sister π
reminder bestie:logical_sizeis the size in bytes of FortranLOGICAL, andis_settells 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
- 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