MPI_Session_iflush_buffer(3)

πŸ’« MPI_Session_iflush_buffer(3) πŸ’«

okay bestie, welcome to the MPI manual, and today's main character is MPI_Session_iflush_buffer 🫢


✨ NAME ✨

MPI_Session_iflush_buffer β€” kick off a nonblocking flush inside the session-specific buffer. that's it, that's the whole vibe. 🌸


πŸ¦‹ SYNOPSIS πŸ¦‹

int MPI_Session_iflush_buffer(MPI_Session session, MPI_Request *request)

πŸ’œ INPUT PARAMETERS πŸ’œ

  • session β€” the session, which is a handle. she's the one you're flushing, periodt.

πŸŽ€ OUTPUT PARAMETERS πŸŽ€

  • request β€” the communication request handle. this is what you get back so you can, y'know, keep track of the nonblocking thing you just set in motion. πŸ‘‘

πŸ”₯ THREAD AND INTERRUPT SAFETY πŸ”₯

good news first: this routine is thread-safe. that means multiple threads can use it at the same time with zero need for any user-provided thread locks. slay. ✨

BUT β€” and this is the part where we take off the heart-shaped glasses β€” the routine is not interrupt safe. the usual reason is that it uses memory allocation stuff like malloc, or other non-MPICH runtime routines that are themselves not interrupt-safe. so like… don't interrupt her mid-glow-up, fr fr. 😭


🌈 NOTES FOR FORTRAN 🌈

every MPI routine in Fortran (except for MPI_WTIME and MPI_WTICK) gets one extra argument tacked on at the end of the argument list, and that's ierr. ierr is an integer, and it means exactly the same thing as the return value of the routine in C. same energy, different language πŸ’…

also, in Fortran, MPI routines are subroutines and you invoke them with the call statement.

and all MPI objects (like MPI_Datatype, MPI_Comm) are of type INTEGER in Fortran. yes, even the ones that look fancy. 🧚


πŸ’€ ERRORS πŸ’€

so here's the deal: all MPI routines (except MPI_Wtime and MPI_Wtick) return an error value. for C routines that's the value of the function, and for Fortran routines it's that last argument we just talked about.

before the value is returned, the current MPI error handler gets called. by default, that error handler aborts the MPI job β€” no cap, it's giving dramatic exit. πŸ’€

you can change the error handler 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 (bestie, please use the new ones πŸ™ˆ). the predefined error handler MPI_ERRORS_RETURN may be used to cause error values to be returned instead.

heads up: MPI does not guarantee that an MPI program can continue past an error. however, MPI implementations will attempt to continue whenever possible. so like, hope for the best, but don't bank on it. 😭

here's the error code menu:

  • MPI_SUCCESS β€” no error; the MPI routine completed successfully. she ate. πŸ’–
  • MPI_ERR_ARG β€” invalid argument. some argument is invalid and is not identified by a specific error class (e.g., MPI_ERR_RANK). πŸ“
  • MPI_ERR_SESSION β€” invalid session handle. 🫢
  • MPI_ERR_OTHER β€” other error; use MPI_Error_string to get more information about this error code. 🌟

πŸ‘‘ SEE ALSO πŸ‘‘

  • MPI_Session_flush_buffer

and that's the whole page, bestie β€” written through-and-through, zero copy-paste energy, all facts intact. 🌈

this little baddie comes from the MPI manual, dated 4/10/2026, and yes, it's officially titled MPI_Session_iflush_buffer(3). go flush something, nonblockingly. mwah. πŸ’…βœ¨

πŸ“¦ where this page comes from