MPI_FILE_WRITE_AT_ALL_BEGIN(3)
π MPI_File_write_at_all_begin π
hiii bestie, welcome to another Open MPI man page (section 3, the I/O girlies' section, iykyk). Buckle up because this one is a nonblocking split collective and she's lowkey iconic.
MPI_File_write_at_all_begin β Writes a file at explicitly specified offsets; beginning part of a split collective routine (nonblocking).
β¨ SYNTAX β¨
okay so like, pick your language era:
πΈ C Syntax
#include <mpi.h>
int MPI_File_write_at_all_begin(MPI_File fh, MPI_Offset offset,
const void *buf, int count, MPI_Datatype datatype)
π¦ Fortran Syntax
USE MPI
! or the older form: INCLUDE 'mpif.h'
MPI_FILE_WRITE_AT_ALL_BEGIN(FH, OFFSET, BUF, COUNT, DATATYPE, IERROR)
<type> BUF(*)
INTEGER FH, COUNT, DATATYPE, IERROR
INTEGER(KIND=MPI_OFFSET_KIND) OFFSET
π Fortran 2008 Syntax
USE mpi_f08
MPI_File_write_at_all_begin(fh, offset, buf, count, datatype, ierror)
TYPE(MPI_File), INTENT(IN) :: fh
INTEGER(KIND=MPI_OFFSET_KIND), INTENT(IN) :: offset
TYPE(*), DIMENSION(..), INTENT(IN), ASYNCHRONOUS :: buf
INTEGER, INTENT(IN) :: count
TYPE(MPI_Datatype), INTENT(IN) :: datatype
INTEGER, OPTIONAL, INTENT(OUT) :: ierror
π INPUT/OUTPUT PARAMETER π
fhβ File handle (handle). she's the whole personality, the file you're talking to.
π₯ INPUT PARAMETERS π₯
offsetβ File offset (handle). where in the file you're aiming, bestie. the original really does label it a handle here, so we're keeping that exactly as it is, no notes πbufβ Initial address of buffer (choice). the address where your data starts chilling.countβ Number of elements in buffer (integer). how many of your lil guys are coming along.datatypeβ Data type of each buffer element (handle). the shape/vibe of each element.
π€ OUTPUT PARAMETER π€
ierrorβ Fortran only: Error status (integer). Fortran girlies only, sorry C stans.
π DESCRIPTION π
MPI_File_write_at_all_begin is the beginning part of a split collective β which is just a fancy way of saying it's a nonblocking routine. It attempts to write into the file associated with fh (at the offset position) a total number of count data items, having datatype type, from the user's buffer buf.
The offset is in etype units relative to the current view. So like β holes are not counted when locating an offset. The data gets written into those parts of the file that the current view specifies. periodt.
π NOTES π
All the nonblocking collective routines for data access are "split" into two routines, each with _begin or _end as a suffix. These split collective routines are subject to the semantic rules described in Section 9.4.5 of the MPI-2 standard. yes, the actual standard, go read it, she's worth it π«Ά
π ERRORS π
Almost every MPI routine returns an error value. C routines hand it back as the return result of the function, and Fortran routines stash it in the last argument. (Not all of them β "almost all," okay? read the words.)
Before that error value is returned, the current MPI error handler associated with the communication object (e.g., communicator, window, 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. But when MPI_COMM_SELF is not 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 instead.
The initial error handler can be changed 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. the favoritism is real π
Open MPI ships with three predefined error handlers you can use:
MPI_ERRORS_ARE_FATALβ Causes the program to abort all connected MPI processes.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, acts as ifMPI_Abortwas called on a communicator containing the group of processes in the corresponding window or file. If called on a session, aborts only the local process.MPI_ERRORS_RETURNβ Returns an error code to the application.
You can also implement 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
Real talk: MPI does not guarantee that an MPI program can continue past an error. like, she might just β¨endβ¨. plan accordingly.
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.
π Copyright π
2003-2026, The Open MPI Community
aaaand that's the whole thing, bestie π you just read an entire MPI man page, main character energy fr fr. this was MPI_FILE_WRITE_AT_ALL_BEGIN(3) from the Open MPI girlies, dated Sep 10, 2026 β go forth and write at explicitly specified offsets, no cap πβ¨π¦
π¦ 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