MPI_File_read_ordered_begin(3)
π« MPI_File_read_ordered_begin(3) π«
okay bestie, welcome to the MPI manual page for MPI_File_read_ordered_begin β no cap, this one's a lil niche but it's lowkey iconic once you get it π«Ά
β¨ NAME β¨
MPI_File_read_ordered_begin β start a split collective read using the shared file pointer πΈ
π¦ SYNOPSIS π¦
int MPI_File_read_ordered_begin(MPI_File fh, void *buf, int count,
MPI_Datatype datatype)
int MPI_File_read_ordered_begin_c(MPI_File fh, void *buf, MPI_Count count,
MPI_Datatype datatype)
π INPUT PARAMETERS π
fhβ the file handle (a handle, babe)countβ how many elements are chillin' in the buffer (an integer)datatypeβ the datatype of each buffer element (a handle)
π OUTPUT PARAMETERS π
bufβ the initial address of the buffer (a choice)
π₯ THREAD AND INTERRUPT SAFETY π₯
This routine is thread-safe. what that means: multiple threads can use it at the same time and you do not need to bring your own thread locks, she handles herself π
BUT β and this is the important bit β it is not interrupt safe. typically that's because it uses memory allocation routines like malloc, or other non-MPICH runtime routines that are themselves not interrupt-safe. so like, don't interrupt her mid-glow-up, okay? π
π§ NOTES FOR FORTRAN π§
Every single MPI routine in Fortran (except MPI_WTIME and MPI_WTICK) gets an extra argument called ierr tacked on at the end of the argument list. ierr is an integer and it means exactly the same thing as the return value of the routine in C.
Also, in Fortran, MPI routines are subroutines and you invoke them with the call statement, periodt.
And all MPI objects (like MPI_Datatype, MPI_Comm) are of type INTEGER in Fortran. yes, all of them. it's giving classic π«Ά
π ERRORS π
Every MPI routine (except MPI_Wtime and MPI_Wtick) returns an error value β C routines hand it back as the value of the function, and Fortran routines put it in that last argument.
Before the value even comes back, the current MPI error handler gets called. By default, that error handler aborts the MPI job π. You can swap the error handler out 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 β so like, iykyk, don't.
The predefined error handler MPI_ERRORS_RETURN may be used to cause error values to be returned instead. And note: 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 giving "we'll try our best" energy π
MPI_SUCCESSβ no error; the MPI routine completed successfully. slay β¨MPI_ERR_BUFFERβ invalid buffer pointer. usually a null buffer where one is not valid.MPI_ERR_COUNTβ invalidcountargument.countarguments 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.MPI_ERR_OTHERβ other error; useMPI_Error_stringto get more information about this error code.
that's the whole page, bestie β every flag, every error code, every vibe, all accounted for π go forth and read ordered, you absolute icon π
this was MPI_File_read_ordered_begin(3) from the MPI manual, dated 4/10/2026 β mwah, thanks for reading, ily πβ¨
π¦ 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