7.3. Attributes for use with mpi_atter_get

There are several predefined attributes in MPI. Their "keys" have been added to the module as constants. These include:

The following shows how these attributes associated with these keys can be found:

#test attributes
print "MPI_WTIME_IS_GLOBAL",mpi.mpi_attr_get(mpi.MPI_COMM_WORLD,mpi.MPI_WTIME_IS_GLOBAL)

print "         MPI_TAG_UB",mpi.mpi_attr_get(mpi.MPI_COMM_WORLD,mpi.MPI_TAG_UB)
print "           MPI_HOST",mpi.mpi_attr_get(mpi.MPI_COMM_WORLD,mpi.MPI_HOST)
print "             MPI_IO",mpi.mpi_attr_get(mpi.MPI_COMM_WORLD,mpi.MPI_IO)

The Python implementation of mpi_attr_get is slightly different that the C or Fortran implementation. The "normal" versions also return a flag that indicates if the attribute about which is being inquiry is made is defined. For the Python version, if you pass an undefined key to mpi_attr_get it will return NULL. (There is a bug in some versions of MPI that will cause this routine to crash if you pass in an undefined key.)