MPI_File_iwrite_at(3)

πŸ’– MPI_File_iwrite_at(3) πŸ’–

okay so bestie, welcome to the MPI manual page for MPI_File_iwrite_at β€” yes that's the section (3) energy, we're in the library-call girlies now πŸ‘‘


✨ NAME ✨

MPI_File_iwrite_at β€” Nonblocking write using explicit offset πŸ’…

like. it writes. but it does NOT block. and YOU pick the offset. iconic behaviour fr fr.


🌸 SYNOPSIS 🌸

int MPI_File_iwrite_at(MPI_File fh, MPI_Offset offset, const void *buf,
int count, MPI_Datatype datatype, MPI_Request *request)

int MPI_File_iwrite_at_c(MPI_File fh, MPI_Offset offset, const void *buf,
MPI_Count count, MPI_Datatype datatype,
MPI_Request *request)

two versions, bestie β€” the regular one and the _c one, and the _c one takes an MPI_Count instead of an int for count. bigger numbers, same slay πŸ¦‹


πŸŽ€ INPUT PARAMETERS πŸŽ€

  • fh β€” file handle (handle). it's the file babe, hold onto it 🫢
  • offset β€” file offset (integer). you're telling it EXACTLY where to write. no sharing, no "current position" drama, just vibes + a number ✨
  • buf β€” initial address of buffer (choice). where your data is sitting, waiting to be sent out into the world 🌈
  • count β€” number of elements in buffer (integer). how many of them. yes, element count, not byte count, don't come for me πŸ’€
  • datatype β€” datatype of each buffer element (handle). what each lil element IS, type-wise 🧚

πŸ’œ OUTPUT PARAMETERS πŸ’œ

  • request β€” request object (handle). the lil ticket you hold so you can later check on / wait for your write. she's asynchronous, she has her own life, respect it 😭

πŸ”₯ THREAD AND INTERRUPT SAFETY πŸ”₯

This routine is thread-safe. which means: multiple threads can use it at the same time and you do NOT have to bring your own thread locks. go off, no user-provided locks needed, we love a low-maintenance queen πŸ‘‘

BUT β€” and this is the important part so listen up β€” the routine is not interrupt safe. typically this is because of memory allocation routines like malloc or other non-MPICH runtime routines that are themselves not interrupt-safe. so like. thread-safe yes. interrupt-safe no. don't get it twisted πŸ™ˆ


🌟 NOTES FOR FORTRAN 🌟

All MPI routines in Fortran (except for MPI_WTIME and MPI_WTICK) have an additional argument ierr at the end of the argument list. ierr is an integer and has the same meaning as the return value of the routine in C. so C says it with a return value, Fortran says it with a lil extra argument at the end. same energy, different font πŸ’…

In Fortran, MPI routines are subroutines, and they're invoked with the call statement.

All MPI objects (e.g., MPI_Datatype, MPI_Comm) are of type INTEGER in Fortran. yes, everything. even the fancy ones. INTEGER. periodt πŸŽ€


πŸ’€ ERRORS πŸ’€

All MPI routines (except MPI_Wtime and MPI_Wtick) return an error value; C routines as the value of the function and Fortran routines in the last argument. Before the value is returned, the current MPI error handler is called. By default, this error handler aborts the MPI job β€” like, full stop, everybody out 😭

The error handler may be changed with MPI_Comm_set_errhandler (for communicators), MPI_File_set_errhandler (for files), and MPI_Win_set_errhandler (for RMA windows). The MPI-1 routine MPI_Errhandler_set may be used but its use is deprecated β€” she's retired, let her rest πŸͺ¦

The predefined error handler MPI_ERRORS_RETURN may be used to cause error values to be returned. Note that MPI does not guarantee that an MPI program can continue past an error; however, MPI implementations will attempt to continue whenever possible. so like. they'll try. no promises tho 🀷

  • MPI_SUCCESS β€” No error; MPI routine completed successfully. the dream. the goal. we ate πŸ“
  • MPI_ERR_ARG β€” Invalid argument. Some argument is invalid and is not identified by a specific error class (e.g., MPI_ERR_RANK). she's just "wrong" with no further detail, mysterious queen πŸ’…
  • MPI_ERR_BUFFER β€” Invalid buffer pointer. Usually a null buffer where one is not valid. babe you gave it nothing 😭
  • MPI_ERR_COUNT β€” Invalid count argument. Count arguments must be non-negative; a count of zero is often valid. negative counts are NOT the move πŸ™ˆ
  • MPI_ERR_TYPE β€” Invalid datatype argument. Additionally, this error can occur if an uncommitted MPI_Datatype (see MPI_Type_commit) is used in a communication call. commit your types before you use them, bestie, it's the law ⭐
  • MPI_ERR_OTHER β€” Other error; use MPI_Error_string to get more information about this error code. the catch-all bin. go ask MPI_Error_string, she knows πŸ”

πŸ’– SEE ALSO πŸ’–

(ngl there's no SEE ALSO section in this one, so we're just gonna vibe here for a sec) 🌸


and that's the whole page bestie, you're officially fluent in nonblocking explicit-offset writes. go forth and MPI_Wait on your requests, iykyk πŸ’œ

kisses, the MPI manual, dated 4/10/2026, filed under MPI_File_iwrite_at(3) πŸŽ€βœ¨

πŸ“¦ where this page comes from