@@ -122,12 +122,18 @@ static int isolated_init(opal_list_t *ilist)
122122{
123123 int rc ;
124124 opal_value_t kv ;
125+ opal_process_name_t wildcard ;
125126
126- if (0 < isolated_init_count ) {
127+ OPAL_PMIX_ACQUIRE_THREAD (& opal_pmix_base .lock );
128+ ++ isolated_init_count ;
129+ if (1 < isolated_init_count ) {
130+ OPAL_PMIX_RELEASE_THREAD (& opal_pmix_base .lock );
127131 return OPAL_SUCCESS ;
128132 }
129133
130- ++ isolated_init_count ;
134+
135+ wildcard .jobid = 1 ;
136+ wildcard .vpid = OPAL_VPID_WILDCARD ;
131137
132138 /* store our name in the opal_proc_t so that
133139 * debug messages will make sense - an upper
@@ -178,6 +184,17 @@ static int isolated_init(opal_list_t *ilist)
178184 }
179185 OBJ_DESTRUCT (& kv );
180186
187+ OBJ_CONSTRUCT (& kv , opal_value_t );
188+ kv .key = strdup (OPAL_PMIX_MAX_PROCS );
189+ kv .type = OPAL_UINT32 ;
190+ kv .data .uint32 = 1 ;
191+ if (OPAL_SUCCESS != (rc = opal_pmix_base_store (& wildcard , & kv ))) {
192+ OPAL_ERROR_LOG (rc );
193+ OBJ_DESTRUCT (& kv );
194+ goto err_exit ;
195+ }
196+ OBJ_DESTRUCT (& kv );
197+
181198 OBJ_CONSTRUCT (& kv , opal_value_t );
182199 kv .key = strdup (OPAL_PMIX_JOBID );
183200 kv .type = OPAL_UINT32 ;
@@ -246,30 +263,35 @@ static int isolated_init(opal_list_t *ilist)
246263 }
247264 OBJ_DESTRUCT (& kv );
248265
266+ OPAL_PMIX_RELEASE_THREAD (& opal_pmix_base .lock );
249267 return OPAL_SUCCESS ;
250268
251269 err_exit :
270+ OPAL_PMIX_RELEASE_THREAD (& opal_pmix_base .lock );
252271 return rc ;
253272}
254273
255274static int isolated_fini (void )
256275{
276+ OPAL_PMIX_ACQUIRE_THREAD (& opal_pmix_base .lock );
277+ -- opal_pmix_base .initialized ;
278+
257279 if (0 == isolated_init_count ) {
258- return OPAL_SUCCESS ;
280+ opal_pmix_base_hash_finalize () ;
259281 }
260282
261- if (0 != -- isolated_init_count ) {
262- return OPAL_SUCCESS ;
263- }
264- opal_pmix_base_hash_finalize ();
283+ OPAL_PMIX_RELEASE_THREAD (& opal_pmix_base .lock );
265284 return OPAL_SUCCESS ;
266285}
267286
268287static int isolated_initialized (void )
269288{
289+ OPAL_PMIX_ACQUIRE_THREAD (& opal_pmix_base .lock );
270290 if (0 < isolated_init_count ) {
291+ OPAL_PMIX_RELEASE_THREAD (& opal_pmix_base .lock );
271292 return 1 ;
272293 }
294+ OPAL_PMIX_RELEASE_THREAD (& opal_pmix_base .lock );
273295 return 0 ;
274296}
275297
@@ -325,13 +347,16 @@ static int isolated_put(opal_pmix_scope_t scope,
325347{
326348 int rc ;
327349
328- opal_output_verbose (10 , opal_pmix_base_framework .framework_output ,
329- "%s pmix:isolated isolated_put key %s scope %d\n " ,
350+ opal_output_verbose (2 , opal_pmix_base_framework .framework_output ,
351+ "%s pmix:isolated isolated_put key %s scope %d" ,
330352 OPAL_NAME_PRINT (OPAL_PROC_MY_NAME ), kv -> key , scope );
331353
332- if (!isolated_init_count ) {
354+ OPAL_PMIX_ACQUIRE_THREAD (& opal_pmix_base .lock );
355+ if (0 == isolated_init_count ) {
356+ OPAL_PMIX_RELEASE_THREAD (& opal_pmix_base .lock );
333357 return OPAL_ERROR ;
334358 }
359+ OPAL_PMIX_RELEASE_THREAD (& opal_pmix_base .lock );
335360
336361 rc = opal_pmix_base_store (& isolated_pname , kv );
337362
@@ -340,18 +365,31 @@ static int isolated_put(opal_pmix_scope_t scope,
340365
341366static int isolated_commit (void )
342367{
368+ opal_output_verbose (2 , opal_pmix_base_framework .framework_output ,
369+ "%s pmix:isolated isolated commit" ,
370+ OPAL_NAME_PRINT (OPAL_PROC_MY_NAME ));
371+
343372 return OPAL_SUCCESS ;
344373}
345374
346375static int isolated_fence (opal_list_t * procs , int collect_data )
347376{
377+ opal_output_verbose (2 , opal_pmix_base_framework .framework_output ,
378+ "%s pmix:isolated isolated fence" ,
379+ OPAL_NAME_PRINT (OPAL_PROC_MY_NAME ));
348380 return OPAL_SUCCESS ;
349381}
350382
351383static int isolated_fence_nb (opal_list_t * procs , int collect_data ,
352384 opal_pmix_op_cbfunc_t cbfunc , void * cbdata )
353385{
354- return OPAL_ERR_NOT_IMPLEMENTED ;
386+ opal_output_verbose (2 , opal_pmix_base_framework .framework_output ,
387+ "%s pmix:isolated isolated fence_nb" ,
388+ OPAL_NAME_PRINT (OPAL_PROC_MY_NAME ));
389+ if (NULL != cbfunc ) {
390+ cbfunc (OPAL_SUCCESS , cbdata );
391+ }
392+ return OPAL_SUCCESS ;
355393}
356394
357395static int isolated_get (const opal_process_name_t * id ,
@@ -383,39 +421,60 @@ static int isolated_get(const opal_process_name_t *id,
383421static int isolated_get_nb (const opal_process_name_t * id , const char * key ,
384422 opal_list_t * info , opal_pmix_value_cbfunc_t cbfunc , void * cbdata )
385423{
424+ opal_output_verbose (2 , opal_pmix_base_framework .framework_output ,
425+ "%s pmix:isolated isolated get_nb" ,
426+ OPAL_NAME_PRINT (OPAL_PROC_MY_NAME ));
386427 return OPAL_ERR_NOT_IMPLEMENTED ;
387428}
388429
389430static int isolated_publish (opal_list_t * info )
390431{
432+ opal_output_verbose (2 , opal_pmix_base_framework .framework_output ,
433+ "%s pmix:isolated isolated publish" ,
434+ OPAL_NAME_PRINT (OPAL_PROC_MY_NAME ));
391435 return OPAL_ERR_NOT_SUPPORTED ;
392436}
393437
394438static int isolated_publish_nb (opal_list_t * info ,
395439 opal_pmix_op_cbfunc_t cbfunc , void * cbdata )
396440{
441+ opal_output_verbose (2 , opal_pmix_base_framework .framework_output ,
442+ "%s pmix:isolated isolated publish_nb" ,
443+ OPAL_NAME_PRINT (OPAL_PROC_MY_NAME ));
397444 return OPAL_ERR_NOT_SUPPORTED ;
398445}
399446
400447static int isolated_lookup (opal_list_t * data , opal_list_t * info )
401448{
449+ opal_output_verbose (2 , opal_pmix_base_framework .framework_output ,
450+ "%s pmix:isolated isolated lookup" ,
451+ OPAL_NAME_PRINT (OPAL_PROC_MY_NAME ));
402452 return OPAL_ERR_NOT_SUPPORTED ;
403453}
404454
405455static int isolated_lookup_nb (char * * keys , opal_list_t * info ,
406456 opal_pmix_lookup_cbfunc_t cbfunc , void * cbdata )
407457{
458+ opal_output_verbose (2 , opal_pmix_base_framework .framework_output ,
459+ "%s pmix:isolated isolated lookup_nb" ,
460+ OPAL_NAME_PRINT (OPAL_PROC_MY_NAME ));
408461 return OPAL_ERR_NOT_SUPPORTED ;
409462}
410463
411464static int isolated_unpublish (char * * keys , opal_list_t * info )
412465{
466+ opal_output_verbose (2 , opal_pmix_base_framework .framework_output ,
467+ "%s pmix:isolated isolated unpublish" ,
468+ OPAL_NAME_PRINT (OPAL_PROC_MY_NAME ));
413469 return OPAL_ERR_NOT_SUPPORTED ;
414470}
415471
416472static int isolated_unpublish_nb (char * * keys , opal_list_t * info ,
417473 opal_pmix_op_cbfunc_t cbfunc , void * cbdata )
418474{
475+ opal_output_verbose (2 , opal_pmix_base_framework .framework_output ,
476+ "%s pmix:isolated isolated unpublish_nb" ,
477+ OPAL_NAME_PRINT (OPAL_PROC_MY_NAME ));
419478 return OPAL_ERR_NOT_SUPPORTED ;
420479}
421480
@@ -427,6 +486,10 @@ static const char *isolated_get_version(void)
427486static int isolated_store_local (const opal_process_name_t * proc ,
428487 opal_value_t * val )
429488{
489+ opal_output_verbose (2 , opal_pmix_base_framework .framework_output ,
490+ "%s pmix:isolated isolated store_local" ,
491+ OPAL_NAME_PRINT (OPAL_PROC_MY_NAME ));
492+
430493 opal_pmix_base_store (proc , val );
431494
432495 return OPAL_SUCCESS ;
0 commit comments