332. Prototype definitions


Up: Defined Values and Handles Next: Deprecated prototype definitions Previous: Types

The following are defined C typedefs for user-defined functions, also included in the file mpi.h.

For Fortran, here are examples of how each of the user-defined subroutines should be declared.

The user-function argument to MPI_OP_CREATE should be declared like this:

SUBROUTINE USER_FUNCTION(INVEC, INOUTVEC, LEN, TYPE) 
   <type> INVEC(LEN), INOUTVEC(LEN) 
   INTEGER LEN, TYPE 
The copy and delete function arguments to MPI_COMM_CREATE_KEYVAL should be declared like these:


SUBROUTINE COMM_COPY_ATTR_FN(OLDCOMM, COMM_KEYVAL, EXTRA_STATE, 
             ATTRIBUTE_VAL_IN, ATTRIBUTE_VAL_OUT, FLAG, IERROR) 
   INTEGER OLDCOMM, COMM_KEYVAL, IERROR 
   INTEGER(KIND=MPI_ADDRESS_KIND) EXTRA_STATE, ATTRIBUTE_VAL_IN, 
             ATTRIBUTE_VAL_OUT 
   LOGICAL FLAG 
 
SUBROUTINE COMM_DELETE_ATTR_FN(COMM, COMM_KEYVAL, ATTRIBUTE_VAL, 
             EXTRA_STATE, IERROR) 
   INTEGER COMM, COMM_KEYVAL, IERROR 
   INTEGER(KIND=MPI_ADDRESS_KIND) ATTRIBUTE_VAL, EXTRA_STATE 
The copy and delete function arguments to MPI_WIN_CREATE_KEYVAL should be declared like these:


SUBROUTINE WIN_COPY_ATTR_FN(OLDWIN, WIN_KEYVAL, EXTRA_STATE, 
             ATTRIBUTE_VAL_IN, ATTRIBUTE_VAL_OUT, FLAG, IERROR) 
   INTEGER OLDWIN, WIN_KEYVAL, IERROR 
   INTEGER(KIND=MPI_ADDRESS_KIND) EXTRA_STATE, ATTRIBUTE_VAL_IN, 
             ATTRIBUTE_VAL_OUT 
   LOGICAL FLAG 
 
SUBROUTINE WIN_DELETE_ATTR_FN(WIN, WIN_KEYVAL, ATTRIBUTE_VAL, 
             EXTRA_STATE, IERROR) 
   INTEGER WIN, WIN_KEYVAL, IERROR 
   INTEGER(KIND=MPI_ADDRESS_KIND) ATTRIBUTE_VAL, EXTRA_STATE 
The copy and delete function arguments to MPI_TYPE_CREATE_KEYVAL should be declared like these:


SUBROUTINE TYPE_COPY_ATTR_FN(OLDTYPE, TYPE_KEYVAL, EXTRA_STATE, 
              ATTRIBUTE_VAL_IN, ATTRIBUTE_VAL_OUT, FLAG, IERROR) 
   INTEGER OLDTYPE, TYPE_KEYVAL, IERROR 
   INTEGER(KIND=MPI_ADDRESS_KIND) EXTRA_STATE, 
              ATTRIBUTE_VAL_IN, ATTRIBUTE_VAL_OUT 
   LOGICAL FLAG 
 
SUBROUTINE TYPE_DELETE_ATTR_FN(TYPE, TYPE_KEYVAL, ATTRIBUTE_VAL, 
              EXTRA_STATE, IERROR) 
   INTEGER TYPE, TYPE_KEYVAL, IERROR 
   INTEGER(KIND=MPI_ADDRESS_KIND) ATTRIBUTE_VAL, EXTRA_STATE 
The handler-function argument to MPI_COMM_CREATE_ERRHANDLER should be declared like this:

The handler-function argument to MPI_WIN_CREATE_ERRHANDLER should be declared like this:

The handler-function argument to MPI_FILE_CREATE_ERRHANDLER should be declared like this:

The query, free, and cancel function arguments to MPI_GREQUEST_START should be declared like these:


SUBROUTINE GREQUEST_QUERY_FUNCTION(EXTRA_STATE, STATUS, IERROR) 
   INTEGER STATUS(MPI_STATUS_SIZE), IERROR 
   INTEGER(KIND=MPI_ADDRESS_KIND) EXTRA_STATE 
  
SUBROUTINE GREQUEST_FREE_FUNCTION(EXTRA_STATE, IERROR) 
   INTEGER IERROR 
   INTEGER(KIND=MPI_ADDRESS_KIND) EXTRA_STATE 
  
SUBROUTINE GREQUEST_CANCEL_FUNCTION(EXTRA_STATE, COMPLETE, IERROR) 
   INTEGER IERROR 
   INTEGER(KIND=MPI_ADDRESS_KIND) EXTRA_STATE 
   LOGICAL COMPLETE 
The extend and conversion function arguments to MPI_REGISTER_DATAREP should be declared like these:


SUBROUTINE DATAREP_EXTENT_FUNCTION(DATATYPE, EXTENT, EXTRA_STATE, IERROR) 
    INTEGER DATATYPE, IERROR  
    INTEGER(KIND=MPI_ADDRESS_KIND) EXTENT, EXTRA_STATE 
  
SUBROUTINE DATAREP_CONVERSION_FUNCTION(USERBUF, DATATYPE, COUNT, FILEBUF,  
             POSITION, EXTRA_STATE, IERROR) 
    <TYPE> USERBUF(*), FILEBUF(*)  
    INTEGER COUNT, DATATYPE, IERROR  
    INTEGER(KIND=MPI_OFFSET_KIND) POSITION  
    INTEGER(KIND=MPI_ADDRESS_KIND) EXTRA_STATE 
The following are defined C++ typedefs, also included in the file mpi.h.



Up: Defined Values and Handles Next: Deprecated prototype definitions Previous: Types


Return to MPI-2.2 Standard Index
Return to MPI Forum Home Page

(Unofficial) MPI-2.2 of September 4, 2009
HTML Generated on September 10, 2009