4
4
* Copyright (c) 2014-2017 Research Organization for Information Science
5
5
* and Technology (RIST). All rights reserved.
6
6
* Copyright (c) 2014-2015 Intel, Inc. All rights reserved.
7
- * Copyright (c) 2014 Mellanox Technologies, Inc.
7
+ * Copyright (c) 2014-2017 Mellanox Technologies, Inc.
8
8
* All rights reserved.
9
9
* Copyright (c) 2016 Cisco Systems, Inc. All rights reserved.
10
10
* $COPYRIGHT$
@@ -115,6 +115,13 @@ static void errreg_cbfunc(pmix_status_t status,
115
115
status , errhandler_ref );
116
116
}
117
117
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
+
118
125
int pmix1_server_init (opal_pmix_server_module_t * module ,
119
126
opal_list_t * info )
120
127
{
@@ -123,6 +130,8 @@ int pmix1_server_init(opal_pmix_server_module_t *module,
123
130
opal_value_t * kv ;
124
131
pmix_info_t * pinfo ;
125
132
size_t sz , n ;
133
+ opal_pmix1_jobid_trkr_t * job ;
134
+ volatile bool active ;
126
135
127
136
if (0 < (dbg = opal_output_get_verbosity (opal_pmix_base_framework .framework_output ))) {
128
137
asprintf (& dbgvalue , "PMIX_DEBUG=%d" , dbg );
@@ -144,6 +153,13 @@ int pmix1_server_init(opal_pmix_server_module_t *module,
144
153
pinfo = NULL ;
145
154
}
146
155
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
+
147
163
if (PMIX_SUCCESS != (rc = PMIx_server_init (& mymodule , pinfo , sz ))) {
148
164
PMIX_INFO_FREE (pinfo , sz );
149
165
return pmix1_convert_rc (rc );
@@ -155,6 +171,13 @@ int pmix1_server_init(opal_pmix_server_module_t *module,
155
171
156
172
/* register the errhandler */
157
173
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
+
158
181
return OPAL_SUCCESS ;
159
182
}
160
183
0 commit comments