From 0561d6474879d4fd49ec95cf13c7abdfb10c0862 Mon Sep 17 00:00:00 2001 From: Ralph Castain Date: Wed, 23 Aug 2017 09:38:27 -0700 Subject: [PATCH] Continue tracking PMIx v2.1.0 Signed-off-by: Ralph Castain --- opal/mca/pmix/pmix2x/pmix/VERSION | 4 ++-- .../pmix/pmix2x/pmix/include/pmix_common.h | 1 - .../pmix2x/pmix/src/client/pmix_client_get.c | 23 ++++++++++++++++--- .../pmix/pmix2x/pmix/test/simple/simptest.c | 1 + 4 files changed, 23 insertions(+), 6 deletions(-) diff --git a/opal/mca/pmix/pmix2x/pmix/VERSION b/opal/mca/pmix/pmix2x/pmix/VERSION index 163d7aaa18..036f6f6d91 100644 --- a/opal/mca/pmix/pmix2x/pmix/VERSION +++ b/opal/mca/pmix/pmix2x/pmix/VERSION @@ -30,7 +30,7 @@ greek= # command, or with the date (if "git describe" fails) in the form of # "date". -repo_rev=git439c171 +repo_rev=git19a63db # If tarball_version is not empty, it is used as the version string in # the tarball filename, regardless of all other versions listed in @@ -44,7 +44,7 @@ tarball_version= # The date when this release was created -date="Aug 22, 2017" +date="Aug 23, 2017" # The shared library version of each of PMIx's public libraries. # These versions are maintained in accordance with the "Library diff --git a/opal/mca/pmix/pmix2x/pmix/include/pmix_common.h b/opal/mca/pmix/pmix2x/pmix/include/pmix_common.h index 3d872edfda..b082931bf4 100644 --- a/opal/mca/pmix/pmix2x/pmix/include/pmix_common.h +++ b/opal/mca/pmix/pmix2x/pmix/include/pmix_common.h @@ -349,7 +349,6 @@ typedef uint32_t pmix_rank_t; #define PMIX_TIME_REMAINING "pmix.time.remaining" // (char*) query number of seconds (uint32_t) remaining in allocation // for the specified nspace - /* log attributes */ #define PMIX_LOG_STDERR "pmix.log.stderr" // (char*) log string to stderr #define PMIX_LOG_STDOUT "pmix.log.stdout" // (char*) log string to stdout diff --git a/opal/mca/pmix/pmix2x/pmix/src/client/pmix_client_get.c b/opal/mca/pmix/pmix2x/pmix/src/client/pmix_client_get.c index e48e4ac8e9..d9fdc08213 100644 --- a/opal/mca/pmix/pmix2x/pmix/src/client/pmix_client_get.c +++ b/opal/mca/pmix/pmix2x/pmix/src/client/pmix_client_get.c @@ -418,7 +418,19 @@ static void infocb(pmix_status_t status, if (NULL == kv) { rc = PMIX_ERR_NOMEM; } else { - rc = pmix_value_xfer(kv, &info[0].value); + /* if this is a compressed string, then uncompress it */ + if (PMIX_COMPRESSED_STRING == info[0].value.type) { + kv->type = PMIX_STRING; + pmix_util_uncompress_string(&kv->data.string, (uint8_t*)info[0].value.data.bo.bytes, info[0].value.data.bo.size); + if (NULL == kv->data.string) { + PMIX_ERROR_LOG(PMIX_ERR_NOMEM); + rc = PMIX_ERR_NOMEM; + PMIX_VALUE_FREE(kv, 1); + kv = NULL; + } + } else { + rc = pmix_value_xfer(kv, &info[0].value); + } } } } else { @@ -431,7 +443,9 @@ static void infocb(pmix_status_t status, cd->valcbfunc(rc, kv, cd->cbdata); } PMIX_RELEASE(cd); - PMIX_VALUE_FREE(kv, 1); + if (NULL != kv) { + PMIX_VALUE_FREE(kv, 1); + } if (NULL != release_fn) { release_fn(release_cbdata); } @@ -534,7 +548,10 @@ static void _getnbfn(int fd, short flags, void *cbdata) PMIX_QUERY_CREATE(cd->queries, 1); cd->nqueries = 1; pmix_argv_append_nosize(&cd->queries[0].keys, cb->key); - PMIx_Query_info_nb(cd->queries, 1, infocb, cd); + if (PMIX_SUCCESS != (rc = PMIx_Query_info_nb(cd->queries, 1, infocb, cd))) { + PMIX_RELEASE(cd); + goto respond; + } PMIX_RELEASE(cb); return; } diff --git a/opal/mca/pmix/pmix2x/pmix/test/simple/simptest.c b/opal/mca/pmix/pmix2x/pmix/test/simple/simptest.c index 8982b805ac..1503413841 100644 --- a/opal/mca/pmix/pmix2x/pmix/test/simple/simptest.c +++ b/opal/mca/pmix/pmix2x/pmix/test/simple/simptest.c @@ -863,6 +863,7 @@ static pmix_status_t query_fn(pmix_proc_t *proct, /* keep this simple */ PMIX_INFO_CREATE(info, nqueries); for (n=0; n < nqueries; n++) { + pmix_output(0, "\tKey: %s", queries[n].keys[0]); (void)strncpy(info[n].key, queries[n].keys[0], PMIX_MAX_KEYLEN); info[n].value.type = PMIX_STRING; if (0 > asprintf(&info[n].value.data.string, "%d", (int)n)) {