From 2929f52ffc753f88ceaad583102a810834b73c1f Mon Sep 17 00:00:00 2001 From: Boris Karasev Date: Fri, 15 Sep 2017 12:29:51 +0300 Subject: [PATCH] pmix1: fixed immediate request This fixes a hang of immediate PMIx request. PMIx v1.2 does not support the info key `PMIX_IMMEDIATE` that leads to hanging. For that request the fix uses the key `PMIX_OPTIONAL` for not go to the server. Signed-off-by: Boris Karasev --- opal/mca/pmix/ext1x/pmix1x_client.c | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/opal/mca/pmix/ext1x/pmix1x_client.c b/opal/mca/pmix/ext1x/pmix1x_client.c index 76c44b349c..3d45d354f4 100644 --- a/opal/mca/pmix/ext1x/pmix1x_client.c +++ b/opal/mca/pmix/ext1x/pmix1x_client.c @@ -474,8 +474,14 @@ int pmix1_get(const opal_process_name_t *proc, const char *key, PMIX_INFO_CREATE(pinfo, ninfo); n=0; OPAL_LIST_FOREACH(ival, info, opal_value_t) { - (void)strncpy(pinfo[n].key, ival->key, PMIX_MAX_KEYLEN); - pmix1_value_load(&pinfo[n].value, ival); + if (0 == strcmp(ival->key, OPAL_PMIX_IMMEDIATE)) { + (void)strncpy(pinfo[n].key, OPAL_PMIX_OPTIONAL, PMIX_MAX_KEYLEN); + pmix1_value_load(&pinfo[n].value, ival); + } else { + (void)strncpy(pinfo[n].key, ival->key, PMIX_MAX_KEYLEN); + pmix1_value_load(&pinfo[n].value, ival); + } + ++n; } } else { pinfo = NULL; @@ -562,8 +568,14 @@ int pmix1_getnb(const opal_process_name_t *proc, const char *key, PMIX_INFO_CREATE(op->info, op->sz); n=0; OPAL_LIST_FOREACH(ival, info, opal_value_t) { - (void)strncpy(op->info[n].key, ival->key, PMIX_MAX_KEYLEN); - pmix1_value_load(&op->info[n].value, ival); + if (0 == strcmp(ival->key, OPAL_PMIX_IMMEDIATE)) { + (void)strncpy(op->info[n].key, OPAL_PMIX_OPTIONAL, PMIX_MAX_KEYLEN); + pmix1_value_load(&op->info[n].value, ival); + } else { + (void)strncpy(op->info[n].key, ival->key, PMIX_MAX_KEYLEN); + pmix1_value_load(&op->info[n].value, ival); + } + ++n; } }