MPIO_Wait(3)

✨ MPIO_Wait β€” the "bestie are we done yet??" of MPI calls ✨

okay so real talk: this is MPIO_Wait, a lil function from the MPI-2 manual, section 3 (the library calls, iykyk). and it does exactly one iconic thing β€” it waits for the completion of a nonblocking read or write. that's it. that's the whole job. queen behavior honestly πŸ’…

like, you kicked off a nonblocking read or write, it's out there vibing doing its thing in the background, and now you're like "hey. are we done. i need to know." that's this function. it's the friend who texts back "ok done βœ…" so you can finally move on with your life.


πŸ“– SYNOPSIS

#include "mpi.h"
int MPIO_Wait(MPIO_Request *request, MPI_Status *status)

she takes two things and returns an int, periodt. πŸŽ€


🌸 INPUT PARAMETERS

  • request β€” the request object (a handle). this is the little ticket you got when you started your nonblocking read/write, and you're handing it back like "hey bestie, remember this? is it finished?"

πŸ’– OUTPUT PARAMETERS

  • status β€” the status object (Status). after the wait is over, this gets filled in with the deets about what actually happened. your lil receipt. 🧾

πŸ¦‹ NOTES FOR FORTRAN

okay so if you're in Fortran land, listen up, because there's one rule that applies to basically everything:

  • All MPI routines in Fortran (except for MPI_WTIME and MPI_WTICK) have an additional argument ierr at the end of the argument list. yes, all of them. those two are the exception, everyone else gets the extra lil guy tacked on the end.
  • ierr is an integer and it means the exact same thing as the return value of the routine in C. so like, same energy, different language.
  • In Fortran, MPI routines are subroutines and you invoke them with the call statement. so it's call o'clock, not function o'clock.

and one more thing that trips people up:

  • All MPI objects (e.g., MPI_Datatype, MPI_Comm, MPI_File) are of type INTEGER in Fortran. no custom types, no structs, just good ol' INTEGER. simple. clean. slay. πŸ’œ
fr fr do not forget the ierr argument, it's giving "why is my code broken" every single time someone forgets it 😭

anyway that's the whole page!! this was written way back on 2/5/1998 (yes, before most of us were born, she's vintage and thriving 🌈) and it comes from the MPIO_Wait(3) page in the MPI-2 manual. hope your nonblocking ops complete fast and your status is always what you wanted. bye bestie, go finish your I/O 🫢⭐