MPI_Comm_attach_buffer(3)
π MPI_Comm_attach_buffer β bestie edition π
okay so this is a page from the MPI manual, section 3 (that's the library-call girlies, not the shell-command ones), and we're talking about MPI_Comm_attach_buffer(3) β yes the whole thing, no skips, no cap π«Ά
β¨ NAME β¨
MPI_Comm_attach_buffer β attaches a user-provided buffer for buffered send in the communicator πΈ
like, you hand MPI a chunk of memory, and it's now the buffer for buffered sends on that communicator. main character memory arena energy, honestly.
β¨ SYNOPSIS β¨
int MPI_Comm_attach_buffer(MPI_Comm comm, void *buffer, int size)
int MPI_Comm_attach_buffer_c(MPI_Comm comm, void *buffer, MPI_Count size)
two flavors, bestie β the classic int size one and the fancy _c one that takes an MPI_Count size π
β¨ INPUT PARAMETERS β¨
commβ the communicator (a handle) πbufferβ initial buffer address (a choice) πsizeβ buffer size, in bytes (a non-negative integer!) β so like, don't be weird about it, negative is not the vibe π
β¨ NOTES FOR FORTRAN β¨
okay Fortran girlies listen up, this part is for you π¦
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. In Fortran, MPI routines are subroutines, and are invoked with the call statement. periodt.
Also: all MPI objects (e.g., MPI_Datatype, MPI_Comm) are of type INTEGER in Fortran. no cap. π
β¨ 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. π³ yeah, aborts the whole job, dramatic much?
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 (we don't do that anymore, bestie, it's giving legacy π«). 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. trying their best fr fr π₯Ί
MPI_SUCCESS- No error; MPI routine completed successfully. slay β
MPI_ERR_ARG- Invalid argument. Some argument is invalid and is not identified by a specific error class (e.g.,
MPI_ERR_RANK). π
- Invalid argument. Some argument is invalid and is not identified by a specific error class (e.g.,
MPI_ERR_COMM- Invalid communicator. A common error is to use a null communicator in a call (not even allowed in
MPI_Comm_rank). like girl, that's not even legal π¨
- Invalid communicator. A common error is to use a null communicator in a call (not even allowed in
MPI_ERR_OTHER- Other error; use
MPI_Error_stringto get more information about this error code. the catch-all, the "it's giving mystery" one π
- Other error; use
β¨ SEE ALSO β¨
MPI_Buffer_attachMPI_Bsend
go read those next, bestie, they're the whole friend group π«Ά
okay that's the whole page!! every flag, every param, every error code, all of it, nothing skipped π
this was from the MPI manual, version date 4/10/2026 β so like, mark your calendar, that's the page footer, mwah π
ily, go attach that buffer, you're gonna ate β¨π
π¦ 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