@@ -122,12 +122,18 @@ static int isolated_init(opal_list_t *ilist)
122
122
{
123
123
int rc ;
124
124
opal_value_t kv ;
125
+ opal_process_name_t wildcard ;
125
126
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 );
127
131
return OPAL_SUCCESS ;
128
132
}
129
133
130
- ++ isolated_init_count ;
134
+
135
+ wildcard .jobid = 1 ;
136
+ wildcard .vpid = OPAL_VPID_WILDCARD ;
131
137
132
138
/* store our name in the opal_proc_t so that
133
139
* debug messages will make sense - an upper
@@ -178,6 +184,17 @@ static int isolated_init(opal_list_t *ilist)
178
184
}
179
185
OBJ_DESTRUCT (& kv );
180
186
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
+
181
198
OBJ_CONSTRUCT (& kv , opal_value_t );
182
199
kv .key = strdup (OPAL_PMIX_JOBID );
183
200
kv .type = OPAL_UINT32 ;
@@ -246,30 +263,35 @@ static int isolated_init(opal_list_t *ilist)
246
263
}
247
264
OBJ_DESTRUCT (& kv );
248
265
266
+ OPAL_PMIX_RELEASE_THREAD (& opal_pmix_base .lock );
249
267
return OPAL_SUCCESS ;
250
268
251
269
err_exit :
270
+ OPAL_PMIX_RELEASE_THREAD (& opal_pmix_base .lock );
252
271
return rc ;
253
272
}
254
273
255
274
static int isolated_fini (void )
256
275
{
276
+ OPAL_PMIX_ACQUIRE_THREAD (& opal_pmix_base .lock );
277
+ -- opal_pmix_base .initialized ;
278
+
257
279
if (0 == isolated_init_count ) {
258
- return OPAL_SUCCESS ;
280
+ opal_pmix_base_hash_finalize () ;
259
281
}
260
282
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 );
265
284
return OPAL_SUCCESS ;
266
285
}
267
286
268
287
static int isolated_initialized (void )
269
288
{
289
+ OPAL_PMIX_ACQUIRE_THREAD (& opal_pmix_base .lock );
270
290
if (0 < isolated_init_count ) {
291
+ OPAL_PMIX_RELEASE_THREAD (& opal_pmix_base .lock );
271
292
return 1 ;
272
293
}
294
+ OPAL_PMIX_RELEASE_THREAD (& opal_pmix_base .lock );
273
295
return 0 ;
274
296
}
275
297
@@ -325,13 +347,16 @@ static int isolated_put(opal_pmix_scope_t scope,
325
347
{
326
348
int rc ;
327
349
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" ,
330
352
OPAL_NAME_PRINT (OPAL_PROC_MY_NAME ), kv -> key , scope );
331
353
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 );
333
357
return OPAL_ERROR ;
334
358
}
359
+ OPAL_PMIX_RELEASE_THREAD (& opal_pmix_base .lock );
335
360
336
361
rc = opal_pmix_base_store (& isolated_pname , kv );
337
362
@@ -340,18 +365,31 @@ static int isolated_put(opal_pmix_scope_t scope,
340
365
341
366
static int isolated_commit (void )
342
367
{
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
+
343
372
return OPAL_SUCCESS ;
344
373
}
345
374
346
375
static int isolated_fence (opal_list_t * procs , int collect_data )
347
376
{
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 ));
348
380
return OPAL_SUCCESS ;
349
381
}
350
382
351
383
static int isolated_fence_nb (opal_list_t * procs , int collect_data ,
352
384
opal_pmix_op_cbfunc_t cbfunc , void * cbdata )
353
385
{
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 ;
355
393
}
356
394
357
395
static int isolated_get (const opal_process_name_t * id ,
@@ -383,39 +421,60 @@ static int isolated_get(const opal_process_name_t *id,
383
421
static int isolated_get_nb (const opal_process_name_t * id , const char * key ,
384
422
opal_list_t * info , opal_pmix_value_cbfunc_t cbfunc , void * cbdata )
385
423
{
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 ));
386
427
return OPAL_ERR_NOT_IMPLEMENTED ;
387
428
}
388
429
389
430
static int isolated_publish (opal_list_t * info )
390
431
{
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 ));
391
435
return OPAL_ERR_NOT_SUPPORTED ;
392
436
}
393
437
394
438
static int isolated_publish_nb (opal_list_t * info ,
395
439
opal_pmix_op_cbfunc_t cbfunc , void * cbdata )
396
440
{
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 ));
397
444
return OPAL_ERR_NOT_SUPPORTED ;
398
445
}
399
446
400
447
static int isolated_lookup (opal_list_t * data , opal_list_t * info )
401
448
{
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 ));
402
452
return OPAL_ERR_NOT_SUPPORTED ;
403
453
}
404
454
405
455
static int isolated_lookup_nb (char * * keys , opal_list_t * info ,
406
456
opal_pmix_lookup_cbfunc_t cbfunc , void * cbdata )
407
457
{
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 ));
408
461
return OPAL_ERR_NOT_SUPPORTED ;
409
462
}
410
463
411
464
static int isolated_unpublish (char * * keys , opal_list_t * info )
412
465
{
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 ));
413
469
return OPAL_ERR_NOT_SUPPORTED ;
414
470
}
415
471
416
472
static int isolated_unpublish_nb (char * * keys , opal_list_t * info ,
417
473
opal_pmix_op_cbfunc_t cbfunc , void * cbdata )
418
474
{
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 ));
419
478
return OPAL_ERR_NOT_SUPPORTED ;
420
479
}
421
480
@@ -427,6 +486,10 @@ static const char *isolated_get_version(void)
427
486
static int isolated_store_local (const opal_process_name_t * proc ,
428
487
opal_value_t * val )
429
488
{
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
+
430
493
opal_pmix_base_store (proc , val );
431
494
432
495
return OPAL_SUCCESS ;
0 commit comments