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 communicatorsMPI_File_set_errhandlerβ for filesMPI_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; useMPI_Error_stringto 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
- 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