Skip to content

Commit 2f13feb

Browse files
samuelkgutierrezrhc54
authored andcommitted
Deduplicate key/value storage for qualified values.
Eliminate duplicated key/value storage for a PMIX_QUALIFIED_VALUE() case in hash_cache_job_info(). Signed-off-by: Samuel K. Gutierrez <[email protected]>
1 parent 62d675f commit 2f13feb

File tree

1 file changed

+14
-12
lines changed

1 file changed

+14
-12
lines changed

src/mca/gds/hash/gds_hash.c

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -301,25 +301,27 @@ static pmix_status_t hash_cache_job_info(struct pmix_namespace_t *ns, pmix_info_
301301
/* if the key is PMIX_QUALIFIED_VALUE, then the value
302302
* consists of a data array that starts with the key-value
303303
* itself followed by the qualifiers */
304+
pmix_output_verbose(2, pmix_gds_base_framework.framework_output,
305+
"[%s:%d] gds:hash:cache_job_info proc data for [%s:%u]: key %s",
306+
pmix_globals.myid.nspace, pmix_globals.myid.rank, trk->ns, rank,
307+
iptr[j].key);
304308
if (PMIX_CHECK_KEY(&iptr[j], PMIX_QUALIFIED_VALUE)) {
305309
rc = pmix_gds_hash_store_qualified(ht, rank, &iptr[j].value);
306310
if (PMIX_SUCCESS != rc) {
307311
PMIX_ERROR_LOG(rc);
308312
goto release;
309313
}
310314
}
311-
kv.key = iptr[j].key;
312-
kv.value = &iptr[j].value;
313-
pmix_output_verbose(2, pmix_gds_base_framework.framework_output,
314-
"[%s:%d] gds:hash:cache_job_info proc data for [%s:%u]: key %s",
315-
pmix_globals.myid.nspace, pmix_globals.myid.rank, trk->ns, rank,
316-
kv.key);
317-
/* store it in the hash_table */
318-
rc = pmix_hash_store(ht, rank, &kv, NULL, 0);
319-
if (PMIX_SUCCESS != rc) {
320-
PMIX_ERROR_LOG(rc);
321-
PMIX_RELEASE(kp2);
322-
goto release;
315+
else {
316+
kv.key = iptr[j].key;
317+
kv.value = &iptr[j].value;
318+
/* store it in the hash_table */
319+
rc = pmix_hash_store(ht, rank, &kv, NULL, 0);
320+
if (PMIX_SUCCESS != rc) {
321+
PMIX_ERROR_LOG(rc);
322+
PMIX_RELEASE(kp2);
323+
goto release;
324+
}
323325
}
324326
/* if this is the appnum, pass it to the pmdl framework */
325327
if (PMIX_CHECK_KEY(&iptr[j], PMIX_APPNUM)) {

0 commit comments

Comments
 (0)