MPI_FILE_IREAD_AT(3)
π MPI_FILE_IREAD_AT π
okay so bestie, this is a page from the Open MPI manual, and we're talking about MPI_FILE_IREAD_AT(3) β like, the whole squad of MPI file-reading routines but make it async. sit down, grab a strawberry, we're doing this. π
β¨ NAME β¨
MPI_File_iread_at β reads a file at an explicitly specified offset, nonblocking, noncollective. that's it, that's the whole name, and honestly it ate. π
π SYNTAX π
C Syntax
#include <mpi.h>
int MPI_File_iread_at(MPI_File fh, MPI_Offset offset,
void *buf, int count, MPI_Datatype datatype,
MPI_Request *request)
Fortran Syntax
USE MPI
! or the older form: INCLUDE 'mpif.h'
MPI_FILE_IREAD_AT(FH, OFFSET, BUF, COUNT, DATATYPE, REQUEST, IERROR)
<type> BUF(*)
INTEGER FH, COUNT, DATATYPE, REQUEST, IERROR
INTEGER(KIND=MPI_OFFSET_KIND) OFFSET
Fortran 2008 Syntax
USE mpi_f08
MPI_File_iread_at(fh, offset, buf, count, datatype, request, ierror)
TYPE(MPI_File), INTENT(IN) :: fh
INTEGER(KIND=MPI_OFFSET_KIND), INTENT(IN) :: offset
TYPE(*), DIMENSION(..), ASYNCHRONOUS :: buf
INTEGER, INTENT(IN) :: count
TYPE(MPI_Datatype), INTENT(IN) :: datatype
TYPE(MPI_Request), INTENT(OUT) :: request
INTEGER, OPTIONAL, INTENT(OUT) :: ierror
three whole flavours, no cap. pick your language, we move. π
π₯ INPUT PARAMETERS π₯
fhβ file handle, it's a handle. your little passport to the file, basically. πoffsetβ file offset, an integer. where in the file we're looking, bestie.countβ number of elements in the buffer, an integer. how many lil things we're grabbing.datatypeβ data type of each buffer element, a handle. yes, every single element, no shortcuts.
π€ OUTPUT PARAMETERS π€
bufβ initial address of the buffer (choice). this is where the reading lands, bestie, it's the whole point. π«Άrequestβ request object, a handle. you hold onto this, it's literally the main character of the next chapter (spoiler: you'll be waiting on it). πierrorβ Fortran only: error status, an integer. Fortran girlies, this one's for you. β¨
π DESCRIPTION π
MPI_File_iread_at is the nonblocking version of MPI_File_read_at. so like, same energy, but it does not make you stand there waiting. iconic behaviour honestly.
MPI_File_iread_at is a nonblocking routine that attempts to read from the file associated with fh at the offset position, a total number of count data items having datatype type, into the user's buffer buf. read that again if you need to, it's giving very precise. π
the offset is in etype units relative to the current view. that is, holes are not counted when locating an offset β okay so the file is like a group chat with deleted messages, and this offset ignores the gaps, it only counts the actual stuff. the data is taken out of those parts of the file specified by the current view.
MPI_File_iread_at stores the number of datatype elements actually read in status. all other fields of status are undefined. so like, do not go poking at the other fields expecting lore, they are truly not giving anything. π
π ERRORS π
almost every MPI routine returns an error value, fr fr β C routines as the return result of the function, and Fortran routines in the last argument.
before the error value is returned, the current MPI error handler associated with the communication object (like, a communicator, window, or file) gets called. if no communication object is associated with the MPI call, then the call is considered attached to MPI_COMM_SELF and will call the associated MPI error handler.
when MPI_COMM_SELF is not initialized (i.e., before MPI_Init / MPI_Init_thread, after MPI_Finalize, or when using the Sessions Model exclusively), the error raises the initial error handler. and you can change that initial error handler:
- by calling
MPI_Comm_set_errhandleronMPI_COMM_SELFwhen using the World model, or - the
mpi_initial_errhandlerCLI argument tompiexec, or - the info key to
MPI_Comm_spawn/MPI_Comm_spawn_multiple.
if no other appropriate error handler has been set, then the MPI_ERRORS_RETURN error handler is called for MPI I/O functions, and the MPI_ERRORS_ABORT error handler is called for all other MPI functions. noted. periodt.
Open MPI includes three predefined error handlers you can use:
MPI_ERRORS_ARE_FATALβ causes the program to abort all connected MPI processes. yeah. everyone. the whole group chat is going down. πMPI_ERRORS_ABORTβ an error handler that can be invoked on a communicator, window, file, or session. when called on a communicator, it acts as ifMPI_Abortwas called on that communicator. if called on a window or file, it acts as ifMPI_Abortwas called on a communicator containing the group of processes in the corresponding window or file. if called on a session, it aborts only the local process.MPI_ERRORS_RETURNβ returns an error code to the application. the chill one, lowkey. πΈ
MPI applications can also implement their own error handlers by calling:
MPI_Comm_create_errhandlerthenMPI_Comm_set_errhandlerMPI_File_create_errhandlerthenMPI_File_set_errhandlerMPI_Session_create_errhandlerthenMPI_Session_set_errhandleror atMPI_Session_initMPI_Win_create_errhandlerthenMPI_Win_set_errhandler
note that MPI does not guarantee that an MPI program can continue past an error. like, this is not a "it'll be fine" situation, bestie. it might genuinely not be fine. π
see the MPI man page for a full list of MPI error codes.
see the Error Handling section of the MPI-3.1 standard for more information. iykyk. π
π«Ά Copyright π«Ά
2003-2026, The Open MPI Community
and that's the whole page, you're so welcome. this was rendered on Sep 10, 2026, straight from the Open MPI docs, and yes the page header and footer both say MPI_FILE_IREAD_AT(3) because we stay consistent in this house. go read your files nonblockingly, queen. β¨ππ¦
π¦ where this page comes from
- ubuntu stonking: openmpi-doc 5.0.10-6 Β· other
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms