MPI_Comm_create_keyval function

Creates a new attribute key.

Syntax

int MPIAPI MPI_Comm_create_keyval(
  _In_opt_ MPI_Comm_copy_attr_function   *comm_copy_attr_fn,
  _In_opt_ MPI_Comm_delete_attr_function *comm_delete_attr_fn,
  _Out_    int                           *comm_keyval,
  _In_opt_ void                          *extra_state
);

Parameters

  • comm_copy_attr_fn [in, optional]
    Copy callback function for keyval.

  • comm_delete_attr_fn [in, optional]
    Delete callback function for keyval.

  • comm_keyval [out]
    Key value for future access.

  • extra_state [in, optional]
    Extra state for callback functions.

Return value

MPI_SUCCESS

Fortran

    MPI_COMM_CREATE_KEYVAL(COMM_COPY_ATTR_FN, COMM_DELETE_ATTR_FN, COMM_KEYVAL,
            EXTRA_STATE, IERROR)
        EXTERNAL COMM_COPY_ATTR_FN, COMM_DELETE_ATTR_FN
        INTEGER COMM_KEYVAL, IERROR
        INTEGER(KIND=MPI_ADDRESS_KIND) EXTRA_STATE

Remarks

Key values are global (available for any and all communicators).

Default copy and delete functions are available. These are MPI_COMM_NULL_COPY_FN - empty copy function MPI_COMM_NULL_DELETE_FN - empty delete function MPI_COMM_DUP_FN - simple dup function

There are subtle differences between C and Fortran that require that the copy_fn be written in the same language from which MPI_Comm_create_keyval is called. This should not be a problem for most users; only programers using both Fortran and C in the same program need to be sure that they follow this rule.

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

MPI_Comm_copy_attr_function

MPI_Comm_delete_attr_function