What is MPI_Comm_copy_attr_function?
MPI library
MPI (Message Passing Interface) is a library that allows you to write parallel programs in C or Fortran77. The library uses commonly available operating system services to create parallel processes and exchange information among these processes.
MPI_Comm_copy_attr_function
This method is a callback function for caching on communicators. It is invoked when a communicator is duplicated by MPI_COMM_DUP or MPI_COMM_IDUP.
Syntax
int MPI_Comm_copy_attr_function( MPI_Comm oldcomm,int comm_keyval, void *extra_state, void *attribute_val_in, void *attribute_val_out, int *flag
);
Parameters
The copy callback function is called for each key value in oldcomm in an arbitrary order. Each call to the copy callback is made with a key value and its associated attribute.
-
oldcommis the original communicator object describing a group of processes. In many applications, various processes work together and a communicator describes the processes that a routine initiates. -
comm_keyvalis the key value returned by theMPI_Comm_create_keyvalmethod. -
extra_stateis an optional argument to duplicate the extra state. -
attribute_val_inis the source attribute value. -
attribute_val_outis an output parameter representing the destination attribute value. -
flagis an indicator. If the returned value offlagis0, the attribute is deleted in the duplicated communicator. If the value returned is1, the new attribute value is set to the value returned inattribute_val_out.
Return value
The function returns an error if it is unsuccessful. By default, the error aborts the MPI job.
In case of success, it returns MPI_SUCCESS - the value returned upon successful termination of any MPI routine.
Free Resources