1
1

Fix MPI_T issues identified by friendly users.

Several fixes:

 - I was allowing an MPI_T_cvar_handle to be created for an invalid
   variable. Fixed this by checking if the variable is valid in
   mca_base_var_get.

 - Use a better error code when the caller tries to create an unbound
   pvar handle for a bound variable.

 - Return the verbosity level in MPI_T_cvar_get_info.

cmr=v1.8.2:reviewer=jsquyres

This commit was SVN r31576.
Этот коммит содержится в:
Nathan Hjelm 2014-04-30 22:10:30 +00:00
родитель d80f14eb0f
Коммит a28012b29d
4 изменённых файлов: 19 добавлений и 11 удалений

Просмотреть файл

@ -63,6 +63,10 @@ int MPI_T_cvar_get_info(int cvar_index, char *name, int *name_len, int *verbosit
if (NULL != bind) {
*bind = var->mbv_bind;
}
if (NULL != verbosity) {
*verbosity = var->mbv_info_lvl;
}
} while (0);
mpit_unlock ();

Просмотреть файл

@ -62,14 +62,7 @@ int ompit_var_type_to_datatype (mca_base_var_type_t type, MPI_Datatype *datatype
*datatype = MPI_CHAR;
break;
case MCA_BASE_VAR_TYPE_BOOL:
if (sizeof (bool) == sizeof (char)) {
*datatype = MPI_CHAR;
} else if (sizeof (bool) == sizeof (int)) {
*datatype = MPI_INT;
} else {
/* not supported -- fixme */
assert (0);
}
*datatype = MPI_INT;
break;
case MCA_BASE_VAR_TYPE_DOUBLE:
*datatype = MPI_DOUBLE;

Просмотреть файл

@ -432,7 +432,7 @@ int mca_base_pvar_handle_alloc (mca_base_pvar_session_t *session, int index, voi
obj_handle = NULL;
} else if (0 != pvar->bind && NULL == obj_handle) {
/* this is an application error. what is the correct error code? */
ret = OPAL_ERROR;
ret = OPAL_ERR_BAD_PARAM;
break;
}

Просмотреть файл

@ -423,7 +423,7 @@ int mca_base_var_get_value (int vari, const void *value,
}
if (!VAR_IS_VALID(var[0])) {
return OPAL_ERR_BAD_PARAM;
return OPAL_ERR_VALUE_OUT_OF_BOUNDS;
}
if (NULL != value) {
@ -834,7 +834,18 @@ int mca_base_var_set_flag (int vari, mca_base_var_flag_t flag, bool set)
*/
int mca_base_var_get (int vari, const mca_base_var_t **var)
{
return var_get (vari, (mca_base_var_t **) var, false);
int ret;
ret = var_get (vari, (mca_base_var_t **) var, false);
if (OPAL_SUCCESS != ret) {
return ret;
}
if (!VAR_IS_VALID(*(var[0]))) {
return OPAL_ERR_VALUE_OUT_OF_BOUNDS;
}
return OPAL_SUCCESS;
}
/*