MPI_Buffer_attach - Attaches a user-defined buffer for
sending
SYNOPSIS
C:
#include <mpi.h>
int MPI_Buffer_attach( buffer, size )
void *buffer;
int size;
C++:
#include <mpi.h>
void Attach_buffer(
void* buffer,
int size)
Fortran:
INCLUDE "mpif.h" (or USE MPI)
<type> BUFFER(*)
INTEGER size, ierror
CALL MPI_BUFFER_ATTACH(buffer, size, ierror)
STANDARDS
This release implements the MPI 1.2 standard, as
documented by the MPI Forum in the spring 1997 release of
MPI: A Message Passing Interface Standard.
DESCRIPTION
The MPI_Buffer_attach routine attaches a user-defined
buffer for send operations. This routine accepts the
following parameters:
buffer Specifies the initial buffer address (choice)
size Specifies the buffer size, in bytes (integer)
ierror Specifies the return code value for successful
completion, which is in MPI_SUCCESS.
MPI_SUCCESS is defined in the mpif.h file.
NOTES
The specified size should be the sum of the sizes of all
outstanding MPI_Bsend(3) operations that you intend to
operation that you perform. For the purposes of
calculating size, you should use the MPI_Pack_size(3)
routine for size accuracy. In other words, in the
following code samples, the value of size in the
MPI_Buffer_attach call should be greater than the value of
size computed by MPI_Pack_size.
MPI_Buffer_attach( buffer, size );
MPI_Bsend(, count=20, datatype=type1, );
MPI_Bsend(, count=40, datatype=type2, );
MPI_Pack_size( 20, type1, comm, &s1 );
MPI_Pack_size( 40, type2, comm, &s2 );
size = s1 + s2 + 2 * MPI_BSEND_OVERHEAD;
MPI_BSEND_OVERHEAD is the maximum amount of buffer space
allocated for use by each MPI_Bsend(3) routine. This
value is located in mpi.h (for C) and in mpif.h (for
Fortran).
SEE ALSO
intro_streams(3), MPI_Bsend(3), MPI_Buffer_detach(3),
MPI_Pack_size(3)
Man(1) output converted with
man2html