MPI_FILE_READ_ORDERED_END(3)

πŸ’– MPI_FILE_READ_ORDERED_END πŸ’–

okay so bestie, welcome to the man page for MPI_File_read_ordered_end πŸ’… it lives in the Open MPI family, and yeah, the title says MPI_FILE_READ_ORDERED_END(3) but we said it once and that's enough gossip for now. Sit down, hydrate, let's get into it. 🫢


✨ SYNTAX ✨

C Syntax

#include <mpi.h>

int MPI_File_read_ordered_end(MPI_File fh, void *buf,
     MPI_Status *status)

Fortran Syntax

USE MPI
! or the older form: INCLUDE 'mpif.h'
MPI_FILE_READ_ORDERED_END(FH, BUF, STATUS, IERROR)
     <type>  BUF(*)
     INTEGER FH, STATUS(MPI_STATUS_SIZE), IERROR

Fortran 2008 Syntax

USE mpi_f08
MPI_File_read_ordered_end(fh, buf, status, ierror)
     TYPE(MPI_File), INTENT(IN) :: fh
     TYPE(*), DIMENSION(..), ASYNCHRONOUS :: buf
     TYPE(MPI_Status) :: status
     INTEGER, OPTIONAL, INTENT(OUT) :: ierror

πŸŽ€ INPUT/OUTPUT PARAMETER πŸŽ€

  • fh β€” the file handle, aka the little ID badge your file carries around (handle).

🌸 OUTPUT PARAMETERS 🌸

  • buf β€” the initial address of the buffer, where the goodies land (choice).
  • status β€” the status object, receipts for what went down (status).
  • ierror β€” Fortran only bestie: the error status, as an integer (integer).

πŸ¦‹ DESCRIPTION πŸ¦‹

So MPI_File_read_ordered_end is the ending half of a split collective routine. Split collective = one routine got chopped into _begin and _end pieces, and you need the whole set, okay? πŸ‘‘

It must be called by every single process in the communicator group that's chillin' with the file handle fh. No skipping, no lurking, no "I'll sit this one out." All of y'all. 🌈

MPI_File_rad_ordered_end blocks until the operation that MPI_File_read_ordered_begin kicked off actually completes. (And yes, that spelling is exactly what the page says β€” not me, not my fault, I just report the lore. 😭)

It attempts to read the file associated with fh into the user's buffer buf. ✨

The shared file pointer gets updated by the amounts of data requested by all the processes of the group. And here's the part that's giving main-character energy: for each process, the location in the file where data is read is the position the shared file pointer would be at after all the processes whose ranks within the group are less than that process's rank had read their data. Rank order supremacy, periodt. πŸ’…


πŸ’œ NOTES πŸ’œ

All the nonblocking collective routines for data access are "split" into two routines, each with _begin or _end as a suffix. If that sounds like a lot of rules, it is, and these split collective routines are subject to the semantic rules described in Section 9.4.5 of the MPI-2 standard. Go read it, bestie, I believe in you. πŸ“–


πŸ”₯ ERRORS πŸ”₯

Almost all MPI routines return an error value β€” C routines hand it back as the return result of the function, and Fortran routines tuck it into the last argument. πŸ’Œ

Before that error value comes back to you, the current MPI error handler associated with the communication object (like a communicator, window, or file) gets called. If there's no communication object associated with the MPI call, then the call counts as attached to MPI_COMM_SELF and it'll call the associated MPI error handler. And when MPI_COMM_SELF is not initialized β€” meaning 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 swap out that initial error handler by calling MPI_Comm_set_errhandler on MPI_COMM_SELF when you're using the World model, or with the mpi_initial_errhandler CLI argument to mpiexec, or with the info key to MPI_Comm_spawn / MPI_Comm_spawn_multiple. And if no other appropriate error handler has been set? Then MPI_ERRORS_RETURN gets called for MPI I/O functions, and MPI_ERRORS_ABORT gets called for all other MPI functions. No cap. 🫠

Open MPI ships three predefined error handlers you can use:

  • MPI_ERRORS_ARE_FATAL β€” causes the program to abort all connected MPI processes. Dramatic? Yes. Effective? Also yes. πŸ’€
  • 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 if MPI_Abort was called on that communicator. If called on a window or file, it acts as if MPI_Abort was called on a communicator containing the group of processes in the corresponding window or file. And if called on a session, it aborts only the local process. 🎯
  • MPI_ERRORS_RETURN β€” returns an error code to the application. Chill, gentle, hands you the problem and lets you deal with it. πŸ“

MPI applications can also implement their own error handlers by calling:

  • MPI_Comm_create_errhandler then MPI_Comm_set_errhandler
  • MPI_File_create_errhandler then MPI_File_set_errhandler
  • MPI_Session_create_errhandler then MPI_Session_set_errhandler, or at MPI_Session_init
  • MPI_Win_create_errhandler then MPI_Win_set_errhandler
⚠️ Note that MPI does not guarantee that an MPI program can continue past an error. Like, at all. So don't be out here assuming you get a second act. πŸ™ˆ

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.


🌟 a lil sign-off 🌟

Copyright 2003-2026, The Open MPI Community πŸ’– this page was living its best life on Sep 10, 2026, and the whole thing answers to the name MPI_FILE_READ_ORDERED_END(3). mwah, go read your files in order bestie, ily πŸŽ€βœ¨πŸ¦‹

πŸ“¦ where this page comes from