NAME
MMPPIIBBuuffffeerraattttaacchh - Attaches a user-defined buffer for sending.
SSYYNNTTAAXX CC SSyynnttaaxx#include
int MPIBufferattach(void *buf, int size) FFoorrttrraann SSyynnttaaxx INCLUDE 'mpif.h'MPIBUFFERATTACH(BUF, SIZE, IERROR)
BUF(*) INTEGER SIZE, IERROR
CC++++ SSyynnttaaxx#include
void Attachbuffer(void* buffer, int size) IINNPPUUTT PPAARRAAMMEETTEERRSS buf Initial buffer address (choice). size Buffer size, in bytes (integer). OOUUTTPPUUTT PPAARRAAMMEETTEERRIERROR Fortran only: Error status (integer).
DESCRIPTION
Provides to MPI a buffer in the user's memory to be used for buffering outgoing messages. The buffer is used only by messages sent in buffered mode. Only one buffer can be attached to a process at a time. NNOOTTEESS The size given should be the sum of the sizes of all outstanding Bsends that you intend to have, plus MPIBSENDOVERHEAD bytes for each Bsend that you do. For the purposes of calculating size, you should use MPIPacksize. In other words, in the code MPIBufferattach( buf, size ); MPIBsend( ..., count=20, datatype=type1, ... ); ... MPIBsend( ..., count=40, datatype=type2, ... ); the value of size in the MPIBufferattach call should be greater than the value computed by MPIPacksize( 20, type1, comm, &s1 ); MPIPacksize( 40, type2, comm, &s2 ); size = s1 + s2 + 2 * MPIBSENDOVERHEAD; MPIBSENDOVERHEAD gives the maximum amount of buffer space that may be used by the Bsend routines. This value is in mpi.h for C and mpif.h for Fortran. EERRRROORRSS Almost all MPI routines return an error value; C routines as the valueof the function and Fortran routines in the last argument. C++ func-
tions do not return errors. If the default error handler is set toMPI::ERRORSTHROWEXCEPTIONS, then on error the C++ exception mechanism
will be used to throw an MPI:Exception object. Before the error value is returned, the current MPI error handler is called. By default, this error handler aborts the MPI job, except for I/O function errors. The error handler may be changed withMPICommseterrhandler; the predefined error handler MPIERRORSRETURN
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.SEE ALSO
MPIBufferdetach Open MPI 1.2 September 2006 MPIBufferattach(3OpenMPI)