MPI_File_iread_at_all(3)
π MPI_File_iread_at_all(3) β the MPI manual, bestie edition π
okay so this is MPI_File_iread_at_all(3) from the MPI manual and I am so excited to tell you about it because this little function is lowkey a whole baddie π¦
β¨ NAME β¨
MPI_File_iread_at_all β Nonblocking collective read using explicit offset
like... it reads your file, it's collective, it's nonblocking, and you get to say exactly where in the file to start. main character energy fr fr π
β¨ SYNOPSIS β¨
int MPI_File_iread_at_all(MPI_File fh, MPI_Offset offset, void *buf, int count,
MPI_Datatype datatype, MPI_Request *request)
int MPI_File_iread_at_all_c(MPI_File fh, MPI_Offset offset, void *buf,
MPI_Count count, MPI_Datatype datatype,
MPI_Request *request)
two flavors, both slay π
the second one is the _c version and it takes an MPI_Count for count instead of an int, iykyk.
β¨ INPUT PARAMETERS β¨
these are the things you gotta hand over, no cap:
fhβ file handle (handle). it's your file, your boo, your connection π«Άoffsetβ file offset (integer). this is the explicit "start reading from here" energy β¨countβ number of elements in buffer (integer). how many you want, bestie, count them out πdatatypeβ datatype of each buffer element (handle)
β¨ OUTPUT PARAMETERS β¨
stuff you get back: π
bufβ initial address of buffer (choice). where the reading magic lands πΈrequestβ request object (handle). hold onto this one, you'll need it later to check on your read π
β¨ THREAD AND INTERRUPT SAFETY β¨
This routine is thread-safe. that means this routine may be safely used by multiple threads without the need for any user-provided thread locks. so go off, multi-threaded queen π
BUT β the routine is not interrupt safe. and why, you ask? typically this is due to the use of memory allocation routines such as malloc or other non-MPICH runtime routines that are themselves not interrupt-safe. so like... thread-safe yes, interrupt-safe no, and that's just the tea π
β¨ NOTES FOR FORTRAN β¨
fortran besties, this one's for you π
All MPI routines in Fortran (except for MPI_WTIME and MPI_WTICK) have an additional argument ierr at the end of the argument list. ierr is an integer and has the same meaning as the return value of the routine in C. In Fortran, MPI routines are subroutines, and they are invoked with the call statement.
All MPI objects (e.g., MPI_Datatype, MPI_Comm) are of type INTEGER in Fortran.
okay and that's just how fortran do π
β¨ ERRORS β¨
All MPI routines (except MPI_Wtime and MPI_Wtick) return an error value; C routines as the value of the function and Fortran routines in the last argument. Before the value is returned, the current MPI error handler is called. By default, this error handler aborts the MPI job. π
that's not a vibe check you want to fail, bestie. the default handler will literally end your whole program. no cap.
The error handler may be changed 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. The predefined error handler MPI_ERRORS_RETURN may be used to cause error values to be returned. Note that MPI does not guarantee that an MPI program can continue past an error; however, MPI implementations will attempt to continue whenever possible.
here's the error code menu, take your pick π:
MPI_SUCCESSβ No error; MPI routine completed successfully. (the slay outcome β¨)MPI_ERR_ARGβ Invalid argument. Some argument is invalid and is not identified by a specific error class (e.g.,MPI_ERR_RANK). (mystery argument, rude π)MPI_ERR_BUFFERβ Invalid buffer pointer. Usually a null buffer where one is not valid. (buffer said "i'm not here" π)MPI_ERR_COUNTβ Invalid count argument. Count arguments must be non-negative; a count of zero is often valid. (negative count = not the move π€)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, periodt! π)MPI_ERR_OTHERβ Other error; useMPI_Error_stringto get more information about this error code. (the catch-all, go askMPI_Error_stringfor the details π₯)
okay that's the whole page, you ate that π«Ά this was the MPI_File_iread_at_all(3) manpage from the MPI manual, dated 4/10/2026, and that's the footer, so consider yourself signed off on with a little kiss πβ¨π§πβπ
π¦ 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