MPI_FILE_IREAD_AT(3)
π MPI_FILE_IREAD_AT β Open MPI
Okay bestie, gather round, because this one's a nonblocking read and it's lowkey iconic. MPI_File_iread_at β reads a file at an explicitly specified offset (nonblocking, noncollective). Yes, that's the whole vibe of the page. This is the Open MPI version, from the Open MPI manual, and we're getting into it. π¦
β¨ 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
πΈ INPUT PARAMETERS πΈ
fhβ the file handle, bestie. It's a handle.offsetβ where in the file we're reading from. It's an integer.countβ how many elements are in the buffer. Integer, periodt.datatypeβ the data type of each element in the buffer. Handle.
π OUTPUT PARAMETERS π
bufβ the initial address of the buffer. It's a choice.requestβ the request object you get back. Handle.ierrorβ Fortran only, gorl: the error status. Integer.
π§ DESCRIPTION π§
So MPI_File_iread_at is literally the nonblocking version of MPI_File_read_at. That's the whole relationship. π«
It's 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 your buffer buf. π«Ά
The offset is measured in etype units relative to the current view. Translation: holes are not counted when locating an offset. So don't come for her about gaps in the file, she's not counting them. π
The data is taken out of those parts of the file specified by the current view. Then MPI_File_iread_at stores the number of datatype elements actually read in status. Every other field of status is undefined β so do not go poking around in there expecting lore, it's giving "nothing to see here". π
π ERRORS π
Almost all MPI routines return an error value, bestie. In C routines it's the return result of the function, and in Fortran routines it's in the last argument. β¨
Before that error value comes back, the current MPI error handler associated with the communication object (like a communicator, window, or file) is called. And if no communication object is associated with the MPI call? Then the call is considered attached to MPI_COMM_SELF, and it'll call the associated MPI error handler. When MPI_COMM_SELF isn't initialized (i.e., before MPI_Init/MPI_Init_thread, after MPI_Finalize, or when you're using the Sessions Model exclusively), the error raises the initial error handler. You can change that initial error handler by calling MPI_Comm_set_errhandler on MPI_COMM_SELF when using the World model, or with the mpi_initial_errhandler CLI argument to mpiexec, or the info key to MPI_Comm_spawn/MPI_Comm_spawn_multiple. And 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. π
Open MPI ships three predefined error handlers you can use, and they are:
MPI_ERRORS_ARE_FATALβ causes the program to abort all connected MPI processes. Not a drill. πMPI_ERRORS_ABORTβ an error handler that can be invoked on a communicator, window, file, or session. When it's called on a communicator, it acts as ifMPI_Abortwas called on that communicator. If it's 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 it's called on a session, it aborts only the local process. Very "this is between me and my process" energy. πMPI_ERRORS_RETURNβ returns an error code to the application. Chill of it. π
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
β οΈ Heads up: note that MPI does not guarantee that an MPI program can continue past an error. So like, don't just assume you can walk it off. π
See the MPI man page for a full list of MPI error codes. And see the Error Handling section of the MPI-3.1 standard for more information. π
π COPYRIGHT π
2003-2026, The Open MPI Community β that's the whole copyright situation, no cap. π«‘
And that's the page, bestie! β¨πβ¨ This icon of a man page dropped on Sep 11, 2026, in the Open MPI edition, filed under MPI_FILE_IREAD_AT(3) β go forth and read nonblockingly, you absolute main character. ππ¦π
π¦ where this page comes from
- arch rolling: openmpi 5.0.11-1 Β· BSD-3-Clause AND LicenseRef-MPICH
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms