MPI_FILE_SET_ATOMICITY(3)
π MPI_FILE_SET_ATOMICITY π
omg hiii bestie π«Ά you've stumbled into the Open MPI docs, specifically MPI_FILE_SET_ATOMICITY(3), and honestly? iconic. sit down, grab a boba, and let's talk about consistency semantics like the absolute queens we are. π
β¨ NAME β¨
MPI_File_set_atomicity β sets consistency semantics for data-access operations (collective). π
like, it's the collective girlie that decides how your file writes behave. periodt.
π SYNTAX π
πΈ C Syntax
#include <mpi.h>
int MPI_File_set_atomicity(MPI_File fh, int flag)
πΈ Fortran Syntax
USE MPI
! or the older form: INCLUDE 'mpif.h'
MPI_FILE_SET_ATOMICITY(FH, FLAG, IERROR)
INTEGER FH, FLAG, IERROR
πΈ Fortran 2008 Syntax
USE mpi_f08
MPI_File_set_atomicity(fh, flag, ierror)
TYPE(MPI_File), INTENT(IN) :: fh
LOGICAL, INTENT(IN) :: flag
INTEGER, OPTIONAL, INTENT(OUT) :: ierror
π INPUT PARAMETERS π
fhβ the file handle, aka your lil VIP pass to the file (handle).flagβtrueturns atomic mode ON,falseturns nonatomic mode ON (boolean). it's giving light switch energy fr fr. π₯
π OUTPUT PARAMETER π
ierrorβ Fortran only: the error status (integer). classic Fortran always putting the receipts in the last argument. π
π« DESCRIPTION π«
so here's the tea β β the consistency semantics for data-access operations using the set of file handles created by one collective MPI_File_open get set by collectively calling MPI_File_set_atomicity. and when we say collectively, we mean it, bestie: every process in the group must pass identical values for fh and flag. no solo missions allowed. π«
if flag is true, atomic mode is set. if flag is false, nonatomic mode is set. that's it, that's the whole vibe check.
the default value on a call to MPI_File_open in Open MPI is true for jobs running on more than one node, and false for jobs running on a single SMP. π so like, multi-node = atomic by default, single SMP = nonatomic by default. and for more information, see the MPI-2 standard.
π ERRORS π
almost all MPI routines return an error value β C routines as the return result of the function, and Fortran routines in the last argument. (yes, the last argument thing again. Fortran said my house, my rules.)
before that error value comes back to you, the current MPI error handler associated with the communication object (e.g., communicator, window, file) is 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. and listen β 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.
that initial error handler can be changed by calling MPI_Comm_set_errhandler on MPI_COMM_SELF when using the World model, or via the mpi_initial_errhandler CLI argument to mpiexec, 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.
Open MPI includes three predefined error handlers you can use, bestie:
MPI_ERRORS_ARE_FATALβ Causes the program to abort all connected MPI processes. π like, everyone's going down together.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 polite one. π
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. so like, don't just vibe through it and assume everything's 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.
π Copyright π
2003-2026, The Open MPI Community
okay that's the whole page, bestie!! π¦ you just read the entire MPI_FILE_SET_ATOMICITY(3) manual and honestly? you ate. π
the collective atomicity queen behavior is fully understood, no cap. this fine piece of Open MPI documentation is dated Sep 10, 2026, brought to you by the Open MPI crew β slay forever, mwah. πβ¨π
π¦ 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