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 uncommittedMPI_Datatype(seeMPI_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; useMPI_Error_stringto get more information about this error code. the catch-all bin. go askMPI_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
- nixos 26.05: mpich 5.0.1
- ubuntu stonking: mpich-doc 5.0.1-9 Β· other
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms