Purpose
Performs a blocking buffered mode send operation.
C synopsis
#include <mpi.h> int MPI_Bsend(void* buf,int count,MPI_Datatype datatype, int dest,int tag,MPI_Comm comm);
C++ synopsis
#include mpi.h void MPI::Comm::Bsend(const void* buf, int count, const MPI::Datatype& datatype, int dest, int tag) const;
FORTRAN synopsis
include 'mpif.h' or use mpi MPI_BSEND(CHOICE BUF,INTEGER COUNT,INTEGER DATATYPE,INTEGER DEST, INTEGER TAG,INTEGER COMM,INTEGER IERROR)
Parameters
Description
This subroutine is a blocking buffered mode send operation. It is a local operation. It does not depend on the occurrence of a matching receive in order to complete. If a send operation is started and no matching receive is posted, the outgoing message is buffered to allow the send call to complete.
Return from an MPI_BSEND does not guarantee the message was sent. It may remain in the buffer until a matching receive is posted. MPI_BUFFER_DETACH will block until all messages are received.
Notes
Make sure you have enough buffer space available. An error occurs if the message must be buffered and there is there is not enough buffer space. The amount of buffer space needed to be safe depends on the expected peak of pending messages. The sum of the sizes of all of the pending messages at that point plus (MPI_BSEND_OVERHEAD*number_of_messages) should be sufficient.
Avoid using MPI_BSEND if possible. It adds overhead because it requires an extra memory-to-memory copy of the outgoing data. If MPI_BSEND is used, the associated receive operations may perform better with MPI_CSS_INTERRUPT enabled.
Errors
Related information