MPI_Rsend function

Performs a ready mode send operation and returns when the send buffer can be safely reused.

Syntax

int MPIAPI MPI_Rsend(
  _In_opt_ void         *buf,
           int          count,
           MPI_Datatype datatype,
           int          dest,
           int          tag,
           MPI_Comm     comm
);

Parameters

  • buf [in, optional]
    A pointer to the buffer that contains the data to be sent.

  • count
    The number of elements in the buffer. If the data part of the message is empty, set the count parameter to 0.

  • datatype
    The data type of the elements in the buffer.

  • dest
    The rank of the destination process within the communicator that is specified by the comm parameter.

  • tag
    The message tag that can be used to distinguish different types of messages.

  • comm
    The handle to the communicator.

Return value

Returns MPI_SUCCESS on success. Otherwise, the return value is an error code.

In Fortran, the return value is stored in the IERROR parameter.

Fortran

    MPI_RSEND(BUF, COUNT, DATATYPE, DEST, TAG, COMM, IERROR)
        <type> BUF(*)
        INTEGER COUNT, DATATYPE, DEST, TAG, COMM, IERROR

Remarks

This function is non-local. This function returns as soon as the send buffer can be reused and does not depend on the status of a matching receive operation. However, the successful completion of the overall send operation depends on the existence of a matching receive operation.

This function can only be called if the matching receive operation is already posted. Otherwise, the function returns an error and its result is undefined. On some systems, this requirement eliminates some of the handshaking that is used in other modes, and can improve performance compared to the standard or synchronous send operations.

The MPI_Rsend function has the same semantics as the MPI_Send and MPI_Ssend functions, but it notifies the system that a matching receive is already posted. That information can save some overhead. Therefore, in a correct program, a ready send could be replaced by a standard send with no effect on the behavior of the program other than performance.

Requirements

Product

HPC Pack 2012 MS-MPI Redistributable Package, HPC Pack 2008 R2 MS-MPI Redistributable Package, HPC Pack 2008 MS-MPI Redistributable Package or HPC Pack 2008 Client Utilities

Header

Mpi.h; Mpif.h

Library

Msmpi.lib

DLL

Msmpi.dll

See also

MPI Point to Point Functions

MPI_Send

MPI_Bsend

MPI_Ssend

MPI_Recv