Skip to content

Commit 84b6d72

Browse files
Ralph Castainhjelmn
authored andcommitted
Fix external PMIx v1.2.5 support
As @hjelmn and I discussed, this is a little hacky. However, it is the only solution that can be done solely from the OMPI side. Signed-off-by: Ralph Castain <[email protected]> (cherry picked from commit f424aa3) Signed-off-by: Nathan Hjelm <[email protected]>
1 parent 5e894c4 commit 84b6d72

File tree

3 files changed

+25
-2
lines changed

3 files changed

+25
-2
lines changed

opal/mca/pmix/ext1x/pmix1x.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ BEGIN_C_DECLS
3636
typedef struct {
3737
opal_pmix_base_component_t super;
3838
opal_list_t jobids;
39+
opal_list_t values;
3940
bool native_launch;
4041
} mca_pmix_ext1x_component_t;
4142

opal/mca/pmix/ext1x/pmix1x_client.c

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,7 @@ int pmix1_store_local(const opal_process_name_t *proc, opal_value_t *val)
220220
pmix_status_t rc;
221221
pmix_proc_t p;
222222
opal_pmix1_jobid_trkr_t *job, *jptr;
223+
opal_value_t *hack;
223224

224225
if (NULL != proc) {
225226
/* look thru our list of jobids and find the
@@ -232,8 +233,15 @@ int pmix1_store_local(const opal_process_name_t *proc, opal_value_t *val)
232233
}
233234
}
234235
if (NULL == job) {
235-
OPAL_ERROR_LOG(OPAL_ERR_NOT_FOUND);
236-
return OPAL_ERR_NOT_FOUND;
236+
/* if we don't know about the job, then neither will the internal
237+
* storage routine in PMIx. In this older version of PMIx, there
238+
* is no way to insert an nspace into the client, and so we cannot
239+
* get around the problem there. Instead, we need to hold such
240+
* values locally in the component. Sadly, we cannot just use
241+
* the input val param as it might not be dynamic, so copy it here */
242+
opal_dss.copy((void**)&hack, val, OPAL_VALUE);
243+
opal_list_append(&mca_pmix_ext1x_component.values, &hack->super);
244+
return OPAL_SUCCESS;
237245
}
238246
(void)strncpy(p.nspace, job->nspace, PMIX_MAX_NSLEN);
239247
p.rank = proc->vpid;
@@ -445,6 +453,15 @@ int pmix1_get(const opal_process_name_t *proc, const char *key,
445453
}
446454
}
447455
if (NULL == job) {
456+
/* see if we have this key on our local value list */
457+
OPAL_LIST_FOREACH(ival, &mca_pmix_ext1x_component.values, opal_value_t) {
458+
if (0 == strcmp(key, ival->key)) {
459+
/* got it */
460+
opal_dss.copy((void**)val, ival, OPAL_VALUE);
461+
return OPAL_SUCCESS;
462+
}
463+
}
464+
/* otherwise, we can't find it */
448465
return OPAL_ERR_NOT_FOUND;
449466
}
450467
(void)strncpy(p.nspace, job->nspace, PMIX_MAX_NSLEN);
@@ -495,6 +512,9 @@ int pmix1_get(const opal_process_name_t *proc, const char *key,
495512
ret = OPAL_SUCCESS;
496513
} else {
497514
*val = OBJ_NEW(opal_value_t);
515+
if (NULL != key) {
516+
(*val)->key = strdup(key);
517+
}
498518
ret = pmix1_value_unload(*val, kv);
499519
PMIX_VALUE_FREE(kv, 1);
500520
}

opal/mca/pmix/ext1x/pmix1x_component.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,12 +78,14 @@ mca_pmix_ext1x_component_t mca_pmix_ext1x_component = {
7878
static int external_open(void)
7979
{
8080
OBJ_CONSTRUCT(&mca_pmix_ext1x_component.jobids, opal_list_t);
81+
OBJ_CONSTRUCT(&mca_pmix_ext1x_component.values, opal_list_t);
8182
return OPAL_SUCCESS;
8283
}
8384

8485
static int external_close(void)
8586
{
8687
OPAL_LIST_DESTRUCT(&mca_pmix_ext1x_component.jobids);
88+
OPAL_LIST_DESTRUCT(&mca_pmix_ext1x_component.values);
8789
return OPAL_SUCCESS;
8890
}
8991

0 commit comments

Comments
 (0)