MPI_File_iwrite_at_all(3)
π MPI_File_iwrite_at_all(3) π
okay bestie, welcome to the MPI manual page for MPI_File_iwrite_at_all β yes it's a whole mouthful, yes it's iconic, and yes we're gonna get through it together π«Ά
β¨ NAME β¨
MPI_File_iwrite_at_all β nonblocking collective write using an explicit offset. that's it, that's the girl π
πΈ SYNOPSIS πΈ
int MPI_File_iwrite_at_all(MPI_File fh, MPI_Offset offset, const void *buf,
int count, MPI_Datatype datatype,
MPI_Request *request)
int MPI_File_iwrite_at_all_c(MPI_File fh, MPI_Offset offset, const void *buf,
MPI_Count count, MPI_Datatype datatype,
MPI_Request *request)
look at her. two whole flavours. the OG and the _c version. we love range π
π INPUT PARAMETERS π
fhβ the file handle (handle). it's giving "which file are we doing this to" energy.offsetβ the file offset (integer). where in the file the chaos begins, bestie.bufβ initial address of the buffer (choice). your data lives here fr fr.countβ number of elements in the buffer (integer). how many of them.datatypeβ datatype of each buffer element (handle). what kind of element they are.
π OUTPUT PARAMETERS π
requestβ the request object (handle). you get a lil ticket back so you can check on it later, no cap.
π₯ THREAD AND INTERRUPT SAFETY π₯
this routine is thread-safe, and that's lowkey a big deal. what it means: multiple threads can call it at the same time with zero user-provided thread locks required. you don't have to babysit it, she's independent π
β οΈ BUT β and this is the important part β the routine is not interrupt safe. typically this is because of memory allocation routines like malloc, or other non-MPICH runtime routines, which are themselves not interrupt-safe. so like, don't go interrupting her mid-slay, okay? π
π NOTES FOR FORTRAN π
every MPI routine in Fortran (except for MPI_WTIME and MPI_WTICK) has an extra argument called ierr tacked onto the end of the argument list. ierr is an integer and means exactly the same thing as the return value of the routine in C. bestie, it's the same vibe, just a different outfit β¨
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. periodt.
π ERRORS π
okay so every single MPI routine (except MPI_Wtime and MPI_Wtick) returns 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 comes back to you, the current MPI error handler gets called. and by default? that error handler aborts the MPI job. yeah. dramatic. π
the error handler can be changed 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 also be used, but its use is deprecated (ngl, don't do it).
there's also a predefined error handler, MPI_ERRORS_RETURN, which you can use to make error values get returned instead of the whole thing going up in flames.
π note that MPI does not guarantee an MPI program can continue past an error. however, MPI implementations will attempt to continue whenever possible. so likeβ¦ maybe? no promises. π
here's the roster of error codes, bestie:
MPI_SUCCESSβ no error; the MPI routine completed successfully. the dream. the goal. she ate. πMPI_ERR_ARGβ invalid argument. some argument is invalid and isn't identified by a specific error class (e.g.,MPI_ERR_RANK). vague queen.MPI_ERR_BUFFERβ invalid buffer pointer. usually a null buffer where one is not valid. πMPI_ERR_COUNTβ invalid count argument. count arguments must be non-negative; a count of zero is often valid.MPI_ERR_TYPEβ invalid datatype argument. additionally, this error can occur if an uncommittedMPI_Datatype(seeMPI_Type_commit) is used in a communication call. commit your types bestie!!MPI_ERR_OTHERβ other error; useMPI_Error_stringto get more information about this error code. the "idk, something" of error codes π«Ά
π¦ SEE ALSO π¦
okay technically this page didn't hand me a SEE ALSO section, so nothing to link here β but you already know I'd send you straight to the rest of the MPI file I/O girlies if I could π
and that's the whole page, bestie!! written by the MPI crew, page rendered 4/10/2026, and the footer says it's MPI_File_iwrite_at_all(3) β so go forth, write collectively, nonblocking, no cap. you're the main character of your own parallel program now π
β¨ππ
π¦ 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