Skip to content

Commit ee69984

Browse files
committed
Fixes the pmix1x external component
The server side of PMIx v1 component didn't register own nspace, that didn't allow the use of the PMIx functions. Signed-off-by: Boris Karasev <[email protected]>
1 parent d5200ea commit ee69984

File tree

1 file changed

+24
-1
lines changed

1 file changed

+24
-1
lines changed

opal/mca/pmix/ext1x/pmix1x_server_south.c

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* Copyright (c) 2014-2017 Research Organization for Information Science
55
* and Technology (RIST). All rights reserved.
66
* Copyright (c) 2014-2015 Intel, Inc. All rights reserved.
7-
* Copyright (c) 2014 Mellanox Technologies, Inc.
7+
* Copyright (c) 2014-2017 Mellanox Technologies, Inc.
88
* All rights reserved.
99
* Copyright (c) 2016 Cisco Systems, Inc. All rights reserved.
1010
* $COPYRIGHT$
@@ -115,6 +115,13 @@ static void errreg_cbfunc(pmix_status_t status,
115115
status, errhandler_ref);
116116
}
117117

118+
static void op2cbfunc(pmix_status_t status, void *cbdata)
119+
{
120+
volatile bool *active = (volatile bool*)cbdata;
121+
if (active)
122+
*active = false;
123+
}
124+
118125
int pmix1_server_init(opal_pmix_server_module_t *module,
119126
opal_list_t *info)
120127
{
@@ -123,6 +130,8 @@ int pmix1_server_init(opal_pmix_server_module_t *module,
123130
opal_value_t *kv;
124131
pmix_info_t *pinfo;
125132
size_t sz, n;
133+
opal_pmix1_jobid_trkr_t *job;
134+
volatile bool active;
126135

127136
if (0 < (dbg = opal_output_get_verbosity(opal_pmix_base_framework.framework_output))) {
128137
asprintf(&dbgvalue, "PMIX_DEBUG=%d", dbg);
@@ -144,6 +153,13 @@ int pmix1_server_init(opal_pmix_server_module_t *module,
144153
pinfo = NULL;
145154
}
146155

156+
/* insert this into our list of jobids - it will be the
157+
* first, and so we'll check it first */
158+
job = OBJ_NEW(opal_pmix1_jobid_trkr_t);
159+
(void)opal_snprintf_jobid(job->nspace, PMIX_MAX_NSLEN, OPAL_PROC_MY_NAME.jobid);
160+
job->jobid = OPAL_PROC_MY_NAME.jobid;
161+
opal_list_append(&mca_pmix_ext1x_component.jobids, &job->super);
162+
147163
if (PMIX_SUCCESS != (rc = PMIx_server_init(&mymodule, pinfo, sz))) {
148164
PMIX_INFO_FREE(pinfo, sz);
149165
return pmix1_convert_rc(rc);
@@ -155,6 +171,13 @@ int pmix1_server_init(opal_pmix_server_module_t *module,
155171

156172
/* register the errhandler */
157173
PMIx_Register_errhandler(NULL, 0, myerr, errreg_cbfunc, NULL);
174+
175+
/* as we might want to use some client-side functions, be sure
176+
* to register our own nspace */
177+
active = true;
178+
PMIx_server_register_nspace(job->nspace, 1, NULL, 0, op2cbfunc, (void*)&active);
179+
PMIX_WAIT_FOR_COMPLETION(active);
180+
158181
return OPAL_SUCCESS;
159182
}
160183

0 commit comments

Comments
 (0)