MPI_Buffer_iflush(3)
π MPI_Buffer_iflush(3) π
okay bestie, welcome to the MPI manual, page MPI_Buffer_iflush(3) β yes that's the whole title, we're in the MPI corner of the man pages and it's giving parallel excellence. sit down, hydrate, let's go πΈ
β¨ NAME β¨
MPI_Buffer_iflush β start a nonblocking flush in the globally shared buffer π«§
like. it starts the flush. it does not wait around for the flush to be done. it's the "i'll text you later" of flushing, no cap.
β¨ SYNOPSIS β¨
int MPI_Buffer_iflush(MPI_Request *request)
one line, one function, one little handle falling out of it. iconic behavior honestly π
β¨ OUTPUT PARAMETERS β¨
requestβ communication request (handle) π
that's it, that's the whole output. it hands you a request handle so you can later be like "hey are we done yet" about the flush you just launched. main character energy.
π THREAD AND INTERRUPT SAFETY π
This routine is thread-safe. translation: multiple threads can call it at the same time and you do not need to bring your own thread locks. no babysitting required, she's self-sufficient β¨
BUT β and this is the part where we pay attention, bestie β the routine is not interrupt safe. and the reason is typically the use of memory allocation routines like malloc, or other non-MPICH runtime routines that are themselves not interrupt-safe. so it's giving "safe with friends, not safe with signals" π
π¦ NOTES FOR FORTRAN π¦
Fortran babes, this one's for you:
- Every MPI routine in Fortran (except
MPI_WTIMEandMPI_WTICK) has an additional argumentierrtacked on at the end of the argument list. it's an integer and it means exactly the same thing as the return value of the routine in C. same vibe, different language π - In Fortran, MPI routines are subroutines, and you invoke them with the
callstatement. yes,call. periodt. - All MPI objects (like
MPI_Datatype,MPI_Comm) are of typeINTEGERin Fortran. no structs, no pointers, just integers slaying in a trench coat π§
π ERRORS π
so, all MPI routines (except MPI_Wtime and MPI_Wtick) return an error value. in C it's the value of the function, in Fortran it's that last argument we just talked about. before the value comes back to you, the current MPI error handler gets called. by default, this error handler aborts the MPI job. yes, ABORTS. the whole job. so if you're out here ignoring error codes, the default handler will simply end you π
You can change the error handler with:
MPI_Comm_set_errhandlerβ for communicatorsMPI_File_set_errhandlerβ for filesMPI_Win_set_errhandlerβ for RMA windows
and there's MPI_Errhandler_set, the MPI-1 era routine, which still works but whose use is deprecated. lowkey retire her, she did her time π«Ά
You can also use the predefined error handler MPI_ERRORS_RETURN to make error values actually be returned to you instead of just... ending everything. and note this, it matters: MPI does not guarantee that an MPI program can continue past an error. however, MPI implementations will attempt to continue whenever possible. so it's a "we'll try our best" situation, not a promise. fr fr.
Here are the actual error codes for this routine:
MPI_SUCCESSβ no error; MPI routine completed successfully. we love her, she ate π₯MPI_ERR_ARGβ invalid argument. some argument is invalid and is not identified by a specific error class (likeMPI_ERR_RANK). so it's a general "something's wrong and we're not telling you which thing" πMPI_ERR_OTHERβ other error; useMPI_Error_stringto get more information about this error code. the classic "it's complicated, ask the string" π
π SEE ALSO π
MPI_Buffer_flushβ the blocking sibling. ifMPI_Buffer_iflushis the "i'll text you later", this one is the "no actually let's finish this conversation right now" π
bestie reminder: it's thread-safe but not interrupt safe, and that default error handler aborts your whole job. set your errhandler, check your error codes, live your truth π
and that's the page!! πβ¨ this was MPI_Buffer_iflush(3) from the MPI manual, dated 4/10/2026 β go forth and flush nonblockingly, you gorgeous parallel legend ππ¦ππ
<div style="display:none">ignore</div>
π¦ 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