Edit

Share via


MPI_Comm_set_attr function

Stores attribute value associated with a key.

Syntax

int MPIAPI MPI_Comm_set_attr(
       MPI_Comm comm,
       int      comm_keyval,
  _In_ void     *attribute_val
);

Parameters

  • comm
    Communicator to which attribute will be attached.

  • comm_keyval
    Key value, as returned by MPI_Comm_create_keyval.

  • attribute_val [in]
    Attribute value.

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_COMM_SET_ATTR(COMM, COMM_KEYVAL, ATTRIBUTE_VAL, IERROR)
        INTEGER COMM, COMM_KEYVAL, IERROR
        INTEGER(KIND=MPI_ADDRESS_KIND) ATTRIBUTE_VAL

Remarks

Values of the permanent attributes MPI_TAG_UB, MPI_HOST, MPI_IO, MPI_WTIME_IS_GLOBAL, MPI_UNIVERSE_SIZE, MPI_LASTUSEDCODE, and MPI_APPNUM may not be changed.

The datatype of the attribute value depends on whether C, C++, or Fortran is being used. In C and C++, an attribute value is a void pointer; in Fortran, it is an address-sized integer.

If an attribute is already present, the delete function (specified when the corresponding keyval was created) will be called.

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