Key values for attributes are system-allocated, by MPI_{ XXX}_CREATE_KEYVAL. Only such values can be passed to the functions that use key values as input arguments. In order to signal that an erroneous key value has been passed to one of these functions, there is a new MPI error class: MPI_ERR_KEYVAL. It can be returned by MPI_ATTR_PUT, MPI_ATTR_GET, MPI_ATTR_DELETE, MPI_KEYVAL_FREE, MPI_{ XXX}_DELETE_ATTR, MPI_{ XXX}_SET_ATTR, MPI_{ XXX}_GET_ATTR, MPI_{ XXX}_FREE_KEYVAL, MPI_COMM_DUP, MPI_COMM_IDUP, MPI_COMM_DUP_WITH_INFO, MPI_COMM_IDUP_WITH_INFO, MPI_COMM_DISCONNECT, and MPI_COMM_FREE. The last six are included because keyval is an argument to the copy and delete functions for attributes.