IBM Books

MPI Subroutine Reference

MPI_BSEND, MPI_Bsend

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

buf
is the initial address of the send buffer (choice) (IN)

count
is the number of elements in the send buffer (integer) (IN)

datatype
is the datatype of each send buffer element (handle) (IN)

dest
is the rank of destination (integer) (IN)

tag
is the message tag (integer) (IN)

comm
is the communicator (handle) (IN)

IERROR
is the FORTRAN return code. It is always the last argument.

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

Invalid count
count < 0

Invalid datatype

Type not committed

Invalid destination
dest < 0 or dest > = groupsize

Invalid tag
tag < 0

Invalid comm

Insufficient buffer space

MPI not initialized

MPI already finalized

Related information

MPI_BUFFER_ATTACH
MPI_BUFFER_DETACH
MPI_IBSEND
MPI_SEND


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]