MPI_File_iwrite_shared(3)
π MPI_File_iwrite_shared(3) π
okay bestie, welcome to the MPI manual, and welcome to MPI_File_iwrite_shared β the nonblocking write that uses the shared file pointer. yes, the whole crew shares one pointer. it's giving group project, but the good kind. π«Ά
β¨ NAME β¨
MPI_File_iwrite_shared β nonblocking write using shared file pointer. lowkey iconic, highkey asynchronous. π
πΈ SYNOPSIS πΈ
int MPI_File_iwrite_shared(MPI_File fh, const void *buf, int count,
MPI_Datatype datatype, MPI_Request *request)
int MPI_File_iwrite_shared_c(MPI_File fh, const void *buf, MPI_Count count,
MPI_Datatype datatype, MPI_Request *request)
π INPUT PARAMETERS π
fhβ file handle (handle). it's your lil key to the file, your VIP pass fr.bufβ initial address of buffer (choice). this is where the goods live that you're about to write out.countβ number of elements in buffer (integer). how many of them, exactly.datatypeβ datatype of each buffer element (handle). tells MPI what each lil element actually is.
π¦ OUTPUT PARAMETERS π¦
requestβ request object (handle). hold onto this one, bestie β it's your receipt for the operation. π
π₯ THREAD AND INTERRUPT SAFETY π₯
this routine is thread-safe. what that means for you: multiple threads can use it at the same time, and you do not need to bring your own thread locks. no cap, she handles it.
but β and this is the part where we hold hands β the routine is not interrupt safe. typically that's because it uses memory allocation routines like malloc or other non-MPICH runtime routines, and those are themselves not interrupt-safe. so don't @ her with interrupts, she was not built for that. π
π NOTES FOR FORTRAN π
all MPI routines in Fortran (except MPI_WTIME and MPI_WTICK) have an extra little guy at the end of the argument list named ierr. ierr is an integer and it means exactly the same thing as the return value of the routine in C. iykyk.
in Fortran, MPI routines are subroutines, and you invoke them with the call statement. periodt.
also: all MPI objects (like MPI_Datatype, MPI_Comm) are of type INTEGER in Fortran. every single one. slay.
π ERRORS π
every MPI routine (except MPI_Wtime and MPI_Wtick) returns an error value β C routines as the value of the function, Fortran routines 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. π
you can swap the error handler with MPI_Comm_set_errhandler (for communicators), MPI_File_set_errhandler (for files), and MPI_Win_set_errhandler (for RMA windows). the MPI-1 routine MPI_Errhandler_set may be used but its use is deprecated (we don't do that anymore, babe). and the predefined error handler MPI_ERRORS_RETURN may be used to cause error values to be returned instead of the whole job getting yeeted.
heads up: MPI does not guarantee that an MPI program can continue past an error. the implementations will attempt to continue whenever possible, but no promises. π«
here's the error code lineup:
MPI_SUCCESSβ No error; MPI routine completed successfully. ate. β¨MPI_ERR_ARGβ Invalid argument. some argument is invalid and it's not identified by a specific error class (e.g.,MPI_ERR_RANK).MPI_ERR_BUFFERβ Invalid buffer pointer. usually a null buffer where one is not valid. bestie where is the buffer π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, girl.MPI_ERR_OTHERβ Other error; useMPI_Error_stringto get more information about this error code.
β SEE ALSO β
literally the entire MPI manual, go read it, it's your moment. π
and that's the page, bestie!! π this was MPI_File_iwrite_shared(3) from the MPI manual, dated 4/10/2026 β go forth and iwrite_shared your little heart out. ππΈπ¦
π¦ 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