MPI_FILE_WRITE_ORDERED_END(3)
β¨ MPI_FILE_WRITE_ORDERED_END β¨
okay bestie, so this is the Open MPI manual page for MPI_File_write_ordered_end β yes the whole entire name, we're not abbreviating, we're not being cute about it (well, we ARE being cute, but the name stays). It's a file-writing thing. It's a collective thing. And it's the second half of a split routine, so buckle up π
πΈ NAME πΈ
MPI_File_write_ordered_end β writes to a file at a location given by a shared file pointer, and it's the ending part of a split collective routine. Also: it's blocking. no cap.
β¨ SYNTAX β¨
C Syntax
#include <mpi.h>
int MPI_File_write_ordered_end(MPI_File fh, const void *buf,
MPI_Status *status)
Fortran Syntax
USE MPI
! or the older form: INCLUDE 'mpif.h'
MPI_FILE_WRITE_ORDERED_END(FH, BUF, STATUS, IERROR)
<type> BUF(*)
INTEGER FH, STATUS(MPI_STATUS_SIZE), IERROR
Fortran 2008 Syntax
USE mpi_f08
MPI_File_write_ordered_end(fh, buf, status, ierror)
TYPE(MPI_File), INTENT(IN) :: fh
TYPE(*), DIMENSION(..), INTENT(IN), ASYNCHRONOUS :: buf
TYPE(MPI_Status) :: status
INTEGER, OPTIONAL, INTENT(OUT) :: ierror
π« INPUT/OUTPUT PARAMETER π«
fhβ the file handle (a handle). it's giving "which file tho" and this is the answer π
π¦ INPUT PARAMETER π¦
bufβ initial address of the buffer (a choice). your data lives here, bestie.
π OUTPUT PARAMETERS π
statusβ the status object (a status). it catches the tea after the call β¨ierrorβ Fortran only: the error status (an integer).
π DESCRIPTION π
So MPI_File_write_ordered_end is the ending part of a split collective routine. It must be called by all processes in the communicator group that's associated with the file handle fh. Not some of them. Not most of them. All of them. teamwork makes the dream work fr fr π«Ά
And here's the lil bonus: MPI_File_write_ordered_end returns the number of elements written into the file associated with fh β and it hands you that number inside status. slay.
π NOTES π
Every single nonblocking collective routine for data access is "split" into two routines, each one rocking a _begin or _end suffix. Iconic structure, honestly. These split collective routines follow the semantic rules spelled out in Section 9.4.5 of the MPI-2 standard β so if you wanna go deeper, that's where the lore lives π
π ERRORS π
okay so almost every MPI routine returns an error value: C routines hand it back as the return result of the function, and Fortran routines put it in the last argument. classic.
Before that error value comes back to you, the current MPI error handler associated with the communication object (think: communicator, window, file) gets called. And if no communication object is associated with the MPI call? Then the call counts as attached to MPI_COMM_SELF and it'll call the MPI error handler associated with that. When MPI_COMM_SELF isn't 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 that initial error handler by calling MPI_Comm_set_errhandler on MPI_COMM_SELF when you're in the World model, or via the mpi_initial_errhandler CLI argument to mpiexec, or via 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 the other MPI functions. periodt.
Open MPI ships three predefined error handlers you can use:
MPI_ERRORS_ARE_FATALβ causes the program to abort all connected MPI processes. dramatic but that's the job πMPI_ERRORS_ABORTβ an error handler you can invoke on a communicator, window, file, or session. Called on a communicator? It acts as ifMPI_Abortwas called on that communicator. 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. Called on a session? It aborts only the local process.MPI_ERRORS_RETURNβ returns an error code to the application. simple, honest, does what it says π
You can also build your own error handlers, bestie, 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: MPI does not guarantee that an MPI program can continue past an error. so likeβ¦ don't count on it π«£
For the full list of MPI error codes, go see the MPI man page. And for more info, check out the Error Handling section of the MPI-3.1 standard.
π Copyright π
2003-2026, The Open MPI Community
and that's the whole page, no crumbs left π thanks for reading all the way to the bottom, you're literally the main character. this lil drop of wisdom is from the Open MPI crew, stamped Sep 10, 2026 β go write to some files, ordered-ly π β¨
π¦ 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