The pmix.get functions should not be returning "success" if the requested info isn't found. Fix the macros and the component functions so they correctly return "not found" in that situation, and set the data regions and size to NULL and 0, respectively.
This commit was SVN r32818.
Этот коммит содержится в:
родитель
040a69c38b
Коммит
8d0b4f222a
@ -264,9 +264,11 @@ int opal_pmix_base_cache_keys_locally(const opal_identifier_t* id, const char* k
|
||||
size_t len, offset;
|
||||
int rc, size;
|
||||
opal_value_t *kv, *knew;
|
||||
*out_kv = NULL;
|
||||
opal_list_t values;
|
||||
|
||||
/* set the default */
|
||||
*out_kv = NULL;
|
||||
|
||||
/* first try to fetch data from data storage */
|
||||
OBJ_CONSTRUCT(&values, opal_list_t);
|
||||
rc = opal_dstore.fetch(opal_dstore_internal, id, key, &values);
|
||||
@ -383,6 +385,12 @@ int opal_pmix_base_cache_keys_locally(const opal_identifier_t* id, const char* k
|
||||
}
|
||||
}
|
||||
free (tmp_val);
|
||||
/* if there was no issue with unpacking the message, but
|
||||
* we didn't find the requested info, then indicate that
|
||||
* the info wasn't found */
|
||||
if (OPAL_SUCCESS == rc && NULL == *out_kv) {
|
||||
return OPAL_ERR_NOT_FOUND;
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
@ -841,9 +841,17 @@ static int native_get(const opal_identifier_t *id,
|
||||
if (found) {
|
||||
return OPAL_SUCCESS;
|
||||
}
|
||||
/* we didn't find the requested data - pass back a
|
||||
* status that indicates the source of the problem,
|
||||
* either during the data fetch, message unpacking,
|
||||
* or not found */
|
||||
*kv = NULL;
|
||||
if (OPAL_SUCCESS == rc) {
|
||||
rc = ret;
|
||||
if (OPAL_SUCCESS == ret) {
|
||||
rc = OPAL_ERR_NOT_FOUND;
|
||||
} else {
|
||||
rc = ret;
|
||||
}
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
|
@ -176,7 +176,7 @@ typedef void (*opal_pmix_cbfunc_t)(int status, opal_value_t *kv, void *cbdata);
|
||||
opal_value_t *kv; \
|
||||
if (OPAL_SUCCESS != ((r) = opal_pmix.get(&(p)->proc_name, \
|
||||
(s), &kv))) { \
|
||||
OPAL_ERROR_LOG((r)); \
|
||||
*(d) = NULL; \
|
||||
} else { \
|
||||
(r) = opal_value_unload(kv, (void**)(d), (t)); \
|
||||
OBJ_RELEASE(kv); \
|
||||
@ -206,6 +206,9 @@ typedef void (*opal_pmix_cbfunc_t)(int status, opal_value_t *kv, void *cbdata);
|
||||
*(sz) = kv->data.bo.size; \
|
||||
kv->data.bo.bytes = NULL; /* protect the data */ \
|
||||
OBJ_RELEASE(kv); \
|
||||
} else { \
|
||||
*(d) = NULL; \
|
||||
*(sz) = 0; \
|
||||
} \
|
||||
} while(0);
|
||||
|
||||
|
@ -505,9 +505,6 @@ static int s1_get(const opal_identifier_t *id,
|
||||
OPAL_NAME_PRINT(OPAL_PROC_MY_NAME), key);
|
||||
|
||||
rc = opal_pmix_base_cache_keys_locally(id, key, kv, pmix_kvs_name, pmix_vallen_max, kvs_get);
|
||||
if (NULL == *kv) {
|
||||
return OPAL_ERROR;
|
||||
}
|
||||
opal_output_verbose(2, opal_pmix_base_framework.framework_output,
|
||||
"%s pmix:s1 got key %s",
|
||||
OPAL_NAME_PRINT(OPAL_PROC_MY_NAME), key);
|
||||
|
@ -480,9 +480,6 @@ static int s2_get(const opal_identifier_t *id,
|
||||
{
|
||||
int rc;
|
||||
rc = opal_pmix_base_cache_keys_locally(id, key, kv, pmix_kvs_name, pmix_vallen_max, kvs_get);
|
||||
if (NULL == *kv) {
|
||||
return OPAL_ERROR;
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user