MPI_File_read_at_all(3)
π MPI_File_read_at_all(3) π
okay bestie, buckle up, because this is one of those MPI file routines that's lowkey iconic once you get it. it lives in the MPI manual, section 3, and it's the collective read with an explicit offset. yes, both things. she's doing the most and she's serving. π¦
β¨ NAME β¨
MPI_File_read_at_all β collective read using explicit offset π
πΈ SYNOPSIS πΈ
int MPI_File_read_at_all(MPI_File fh, MPI_Offset offset, void *buf, int count,
MPI_Datatype datatype, MPI_Status *status)
int MPI_File_read_at_all_c(MPI_File fh, MPI_Offset offset, void *buf,
MPI_Count count, MPI_Datatype datatype,
MPI_Status *status)
not one but TWO flavours, periodt. pick your fighter. β¨
π INPUT PARAMETERS π
fhβ the file handle, bestie. it's a handle type. she's your entry pass to the file.offsetβ the file offset. an integer. you're telling it exactly where to look, no guessing games, no shared file pointer drama, iykyk.countβ how many elements are chillin' in your buffer. integer vibes.datatypeβ the datatype of each buffer element. a handle. say it with me: each element. π
π«Ά OUTPUT PARAMETERS π«Ά
bufβ initial address of the buffer. it's typed as choice, which is manpage-speak for "this depends on you, girl." πstatusβ the status object. aStatus. she reports back. π
π₯ THREAD AND INTERRUPT SAFETY π₯
okay so this one is thread-safe, and that's not a vibe check, that's a promise. it means multiple threads can call this routine at the same time and you do NOT need to bring your own thread locks. she handles herself. no cap. π
BUT. and it's a big but. this routine 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... thread-safe yes, interrupt-safe no. balance. β¨
π NOTES FOR FORTRAN π
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. yes, even the fancy ones. INTEGER. periodt. β
π 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. π like, whole job. gone. so maybe peek at your error handling before you yolo it.
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 β so, like, don't. π
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.
the error codes, in all their glory:
MPI_SUCCESSβ no error; the MPI routine completed successfully. the dream. the icon. the moment. πMPI_ERR_ARGβ invalid argument. some argument is invalid and is not identified by a specific error class (e.g.,MPI_ERR_RANK). she's vague about it, sorry.MPI_ERR_BUFFERβ invalid buffer pointer. usually a null buffer where one is not valid. bestie you forgot to give her something. π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.MPI_ERR_OTHERβ other error; useMPI_Error_stringto get more information about this error code.
π§ SEE ALSO π§
she didn't list any SEE ALSO cross-references on this page, bestie. she's confident enough to stand alone. π
okay that's the whole thing, every flag, every error code, every Fortran note, nothing skipped, nothing invented. that's the standard. π
and that's a wrap on this one, babe. this page comes to you from the MPI manual, dated 4/10/2026, and it's filed under MPI_File_read_at_all(3) β go read something at an explicit offset, you absolute main character. slay. β¨ππ¦
π¦ 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