Edit

Share via


MPI_Grequest_start function

Creates and returns a user-defined request.

Syntax

int MPIAPI MPI_Grequest_start(
  _In_     MPI_Grequest_query_function  *query_fn,
  _In_     MPI_Grequest_free_function   *free_fn,
  _In_     MPI_Grequest_cancel_function *cancel_fn,
  _In_opt_ void                         *extra_state,
  _Out_    MPI_Request                  *request
);

Parameters

  • query_fn [in]
    Callback function invoked when request status is queried.

  • free_fn [in]
    Callback function invoked when request is freed.

  • cancel_fn [in]
    Callback function invoked when request is cancelled.

  • extra_state [in, optional]
    Extra state passed to the above functions.

  • request [out]
    Generalized request.

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_GREQUEST_START(QUERY_FN, FREE_FN, CANCEL_FN, EXTRA_STATE, REQUEST, IERROR)
        INTEGER REQUEST, IERROR
        EXTERNAL QUERY_FN, FREE_FN, CANCEL_FN
        INTEGER (KIND=MPI_ADDRESS_KIND) EXTRA_STATE

Remarks

The return values from the callback functions must be a valid MPI error code or class. This value may either be the return value from any MPI routine (with one exception noted below) or any of the MPI error classes. For portable programs, MPI_ERR_OTHER may be used; to provide more specific information, create a new MPI error class or code with MPI_Add_error_class or MPI_Add_error_code and return that value.

The MPI standard is not clear on the return values from the callback routines. However, there are notes in the standard that imply that these are MPI error codes. For example, pages 169 line 46 through page 170, line 1 require that the free_fn return an MPI error code that may be used in the MPI completion functions when they return MPI_ERR_IN_STATUS.

The one special case is the error value returned by MPI_Comm_dup when the attribute callback routine returns a failure. The MPI standard is not clear on what values may be used to indicate an error return. Further, the Intel MPI test suite made use of non-zero values to indicate failure, and expected these values to be returned by the MPI_Comm_dup when the attribute routines encountered an error. Such error values may not be valid MPI error codes or classes. Because of this, it is the user's responsibility to either use valid MPI error codes in return from the attribute callbacks, if those error codes are to be returned by a generalized request callback, or to detect and convert those error codes to valid MPI error codes (recall that MPI error classes are valid error codes).

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 External Functions

MPI_Grequest_query_function

MPI_Grequest_free_function

MPI_Grequest_cancel_function