MPI_KEYVAL_CREATE(copy_fn, delete_fn, keyval, extra_state) | |
IN copy_fn | Copy callback function for keyval |
IN delete_fn | Delete callback function for keyval |
OUT keyval | key value for future access (integer) |
IN extra_state | Extra state for callback functions |
The copy_fn function is invoked when a communicator is duplicated by MPI_COMM_DUP. copy_fn should be of type MPI_Copy_function, which is defined as follows:
typedef int MPI_Copy_function(MPI_Comm oldcomm, int keyval, void *extra_state, void *attribute_val_in, void *attribute_val_out, int *flag);
A Fortran declaration for such a function is as follows:
For this routine, an interface within the mpi_f08 module was never defined.
SUBROUTINE COPY_FUNCTION(OLDCOMM, KEYVAL, EXTRA_STATE, ATTRIBUTE_VAL_IN, ATTRIBUTE_VAL_OUT, FLAG, IERR)
INTEGER OLDCOMM, KEYVAL, EXTRA_STATE, ATTRIBUTE_VAL_IN, ATTRIBUTE_VAL_OUT, IERR
LOGICAL FLAG
copy_fn may be specified as MPI_NULL_COPY_FN or MPI_DUP_FN from either C or Fortran; MPI_NULL_COPY_FN is a function that does nothing other than return flag = 0 and MPI_SUCCESS. MPI_DUP_FN is a simple-minded copy function that sets flag = 1, returns the value of attribute_val_in in attribute_val_out, and returns MPI_SUCCESS. Note that MPI_NULL_COPY_FN and MPI_DUP_FN are also deprecated.
Analogous to copy_fn is a callback deletion function, defined as follows. The delete_fn function is invoked when a communicator is deleted by MPI_COMM_FREE or when a call is made explicitly to MPI_ATTR_DELETE. delete_fn should be of type MPI_Delete_function, which is defined as follows:
typedef int MPI_Delete_function(MPI_Comm comm, int keyval, void *attribute_val, void *extra_state);
A Fortran declaration for such a function is as follows:
For this routine, an interface within the mpi_f08 module was never defined.
SUBROUTINE DELETE_FUNCTION(COMM, KEYVAL, ATTRIBUTE_VAL, EXTRA_STATE, IERR)
INTEGER COMM, KEYVAL, ATTRIBUTE_VAL, EXTRA_STATE, IERR
delete_fn may be specified as MPI_NULL_DELETE_FN from either C or Fortran; MPI_NULL_DELETE_FN is a function that does nothing other than return MPI_SUCCESS. Note that MPI_NULL_DELETE_FN is also deprecated.
MPI_KEYVAL_FREE(keyval) | |
INOUT keyval | Frees the integer key value (integer) |
MPI_ATTR_PUT(comm, keyval, attribute_val) | |
INOUT comm | communicator to which attribute will be attached (handle) |
IN keyval | key value, as returned by MPI_KEYVAL_CREATE (integer) |
IN attribute_val | attribute value |
MPI_ATTR_GET(comm, keyval, attribute_val, flag) | |
IN comm | communicator to which attribute is attached (handle) |
IN keyval | key value (integer) |
OUT attribute_val | attribute value, unless flag = false |
OUT flag | true if an attribute value was extracted; false if no attribute is associated with the key |
MPI_ATTR_DELETE(comm, keyval) | |
INOUT comm | communicator to which attribute is attached (handle) |
IN keyval | The key value of the deleted attribute (integer) |