Commit 9a4cc43c authored by William Gropp's avatar William Gropp
Browse files

Fix check for datatype name

The original code here was a bit subtle, so this fix adds a comment
explaining the particular test and provides the fallback message
when a datatype has no name associated with it.
parent e9611808
......@@ -293,8 +293,14 @@ char *mpit_validDtypeStr(MPI_Datatype datatype)
int tlen;
strncpy(typename, "Invalid:", MPI_MAX_OBJECT_NAME);
MPI_Type_get_name(datatype, typename + 8, &tlen);
if (typename[0])
/* We must check location typename[8] to see if
MPI_Type_get_name returned a name (not all datatypes
have names). If it did not, then we indicate that
with a different message */
if (typename[8])
p = typename;
else
p = "Invalid: Unknown datatype name";
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment