Skip to content

Commit f298f29

Browse files
author
Ralph Castain
committed
Update PMIx to latest master tarball. Ensure we set the HNP name for orted's so that PMIx_Lookup can find the server
Signed-off-by: Ralph Castain <[email protected]>
1 parent 8cc3f28 commit f298f29

File tree

10 files changed

+129
-59
lines changed

10 files changed

+129
-59
lines changed

opal/mca/pmix/pmix3x/pmix/VERSION

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ greek=
3030
# command, or with the date (if "git describe" fails) in the form of
3131
# "date<date>".
3232

33-
repo_rev=git967f3e3
33+
repo_rev=git38811ec
3434

3535
# If tarball_version is not empty, it is used as the version string in
3636
# the tarball filename, regardless of all other versions listed in
@@ -44,7 +44,7 @@ tarball_version=
4444

4545
# The date when this release was created
4646

47-
date="Oct 20, 2016"
47+
date="Oct 26, 2016"
4848

4949
# The shared library version of each of PMIx's public libraries.
5050
# These versions are maintained in accordance with the "Library

opal/mca/pmix/pmix3x/pmix/src/client/pmi1.c

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -247,19 +247,17 @@ PMIX_EXPORT int PMI_Get_size(int *size)
247247
{
248248
pmix_status_t rc = PMIX_SUCCESS;
249249
pmix_value_t *val;
250-
pmix_proc_t proc;
251250
pmix_info_t info[1];
252251
bool val_optinal = 1;
252+
pmix_proc_t proc = myproc;
253+
proc.rank = PMIX_RANK_WILDCARD;
253254

254255
PMI_CHECK();
255256

256257
if (NULL == size) {
257258
return PMI_ERR_INVALID_ARG;
258259
}
259260

260-
(void)strncpy(proc.nspace, myproc.nspace, PMIX_MAX_NSLEN);
261-
proc.rank = PMIX_RANK_UNDEF;
262-
263261
/* set controlling parameters
264262
* PMIX_OPTIONAL - expect that these keys should be available on startup
265263
*/
@@ -293,19 +291,17 @@ PMIX_EXPORT int PMI_Get_universe_size(int *size)
293291
{
294292
pmix_status_t rc = PMIX_SUCCESS;
295293
pmix_value_t *val;
296-
pmix_proc_t proc;
297294
pmix_info_t info[1];
298295
bool val_optinal = 1;
296+
pmix_proc_t proc = myproc;
297+
proc.rank = PMIX_RANK_WILDCARD;
299298

300299
PMI_CHECK();
301300

302301
if (NULL == size) {
303302
return PMI_ERR_INVALID_ARG;
304303
}
305304

306-
(void)strncpy(proc.nspace, myproc.nspace, PMIX_MAX_NSLEN);
307-
proc.rank = PMIX_RANK_UNDEF;
308-
309305
/* set controlling parameters
310306
* PMIX_OPTIONAL - expect that these keys should be available on startup
311307
*/
@@ -327,19 +323,17 @@ PMIX_EXPORT int PMI_Get_appnum(int *appnum)
327323
{
328324
pmix_status_t rc = PMIX_SUCCESS;
329325
pmix_value_t *val;
330-
pmix_proc_t proc;
331326
pmix_info_t info[1];
332327
bool val_optinal = 1;
328+
pmix_proc_t proc = myproc;
329+
proc.rank = PMIX_RANK_WILDCARD;
333330

334331
PMI_CHECK();
335332

336333
if (NULL == appnum) {
337334
return PMI_ERR_INVALID_ARG;
338335
}
339336

340-
(void)strncpy(proc.nspace, myproc.nspace, PMIX_MAX_NSLEN);
341-
proc.rank = PMIX_RANK_UNDEF;
342-
343337
/* set controlling parameters
344338
* PMIX_OPTIONAL - expect that these keys should be available on startup
345339
*/
@@ -481,6 +475,8 @@ PMIX_EXPORT int PMI_Get_clique_size(int *size)
481475
pmix_value_t *val;
482476
pmix_info_t info[1];
483477
bool val_optinal = 1;
478+
pmix_proc_t proc = myproc;
479+
proc.rank = PMIX_RANK_WILDCARD;
484480

485481
PMI_CHECK();
486482

@@ -494,7 +490,7 @@ PMIX_EXPORT int PMI_Get_clique_size(int *size)
494490
PMIX_INFO_CONSTRUCT(&info[0]);
495491
PMIX_INFO_LOAD(&info[0], PMIX_OPTIONAL, &val_optinal, PMIX_BOOL);
496492

497-
rc = PMIx_Get(&myproc, PMIX_LOCAL_SIZE, info, 1, &val);
493+
rc = PMIx_Get(&proc, PMIX_LOCAL_SIZE, info, 1, &val);
498494
if (PMIX_SUCCESS == rc) {
499495
rc = convert_int(size, val);
500496
PMIX_VALUE_RELEASE(val);
@@ -511,14 +507,16 @@ PMIX_EXPORT int PMI_Get_clique_ranks(int ranks[], int length)
511507
pmix_value_t *val;
512508
char **rks;
513509
int i;
510+
pmix_proc_t proc = myproc;
511+
proc.rank = PMIX_RANK_WILDCARD;
514512

515513
PMI_CHECK();
516514

517515
if (NULL == ranks) {
518516
return PMI_ERR_INVALID_ARGS;
519517
}
520518

521-
rc = PMIx_Get(&myproc, PMIX_LOCAL_PEERS, NULL, 0, &val);
519+
rc = PMIx_Get(&proc, PMIX_LOCAL_PEERS, NULL, 0, &val);
522520
if (PMIX_SUCCESS == rc) {
523521
/* kv will contain a string of comma-separated
524522
* ranks on my node */

opal/mca/pmix/pmix3x/pmix/src/client/pmi2.c

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,10 @@ PMIX_EXPORT int PMI2_Init(int *spawned, int *size, int *rank, int *appnum)
5555
{
5656
pmix_status_t rc = PMIX_SUCCESS;
5757
pmix_value_t *val;
58-
pmix_proc_t proc;
5958
pmix_info_t info[1];
6059
bool val_optinal = 1;
60+
pmix_proc_t proc = myproc;
61+
proc.rank = PMIX_RANK_WILDCARD;
6162

6263
if (PMIX_SUCCESS != PMIx_Init(&myproc, NULL, 0)) {
6364
return PMI2_ERR_INIT;
@@ -66,10 +67,6 @@ PMIX_EXPORT int PMI2_Init(int *spawned, int *size, int *rank, int *appnum)
6667
/* get the rank */
6768
*rank = myproc.rank;
6869

69-
/* getting internal key requires special rank value */
70-
memcpy(&proc, &myproc, sizeof(myproc));
71-
proc.rank = PMIX_RANK_UNDEF;
72-
7370
/* set controlling parameters
7471
* PMIX_OPTIONAL - expect that these keys should be available on startup
7572
*/
@@ -257,6 +254,9 @@ PMIX_EXPORT int PMI2_Info_GetSize(int *size)
257254
pmix_value_t *val;
258255
pmix_info_t info[1];
259256
bool val_optinal = 1;
257+
pmix_proc_t proc = myproc;
258+
proc.rank = PMIX_RANK_WILDCARD;
259+
260260

261261
PMI2_CHECK();
262262

@@ -270,7 +270,7 @@ PMIX_EXPORT int PMI2_Info_GetSize(int *size)
270270
PMIX_INFO_CONSTRUCT(&info[0]);
271271
PMIX_INFO_LOAD(&info[0], PMIX_OPTIONAL, &val_optinal, PMIX_BOOL);
272272

273-
if (PMIX_SUCCESS == PMIx_Get(&myproc, PMIX_LOCAL_SIZE, info, 1, &val)) {
273+
if (PMIX_SUCCESS == PMIx_Get(&proc, PMIX_LOCAL_SIZE, info, 1, &val)) {
274274
rc = convert_int(size, val);
275275
PMIX_VALUE_RELEASE(val);
276276
}
@@ -426,6 +426,8 @@ PMIX_EXPORT int PMI2_Info_GetNodeAttr(const char name[],
426426
pmix_value_t *val;
427427
pmix_info_t info[1];
428428
bool val_optinal = 1;
429+
pmix_proc_t proc = myproc;
430+
proc.rank = PMIX_RANK_UNDEF;
429431

430432
PMI2_CHECK();
431433

@@ -440,7 +442,8 @@ PMIX_EXPORT int PMI2_Info_GetNodeAttr(const char name[],
440442
PMIX_INFO_LOAD(&info[0], PMIX_OPTIONAL, &val_optinal, PMIX_BOOL);
441443

442444
*found = 0;
443-
rc = PMIx_Get(&myproc, name, info, 1, &val);
445+
/* TODO: does PMI2's "name" makes sense to PMIx? */
446+
rc = PMIx_Get(&proc, name, info, 1, &val);
444447
if (PMIX_SUCCESS == rc && NULL != val) {
445448
if (PMIX_STRING != val->type) {
446449
rc = PMIX_ERROR;
@@ -486,20 +489,17 @@ PMIX_EXPORT int PMI2_Info_GetJobAttr(const char name[], char value[], int valuel
486489
{
487490
pmix_status_t rc = PMIX_SUCCESS;
488491
pmix_value_t *val;
489-
pmix_proc_t proc;
490492
pmix_info_t info[1];
491493
bool val_optinal = 1;
494+
pmix_proc_t proc = myproc;
495+
proc.rank = PMIX_RANK_UNDEF;
492496

493497
PMI2_CHECK();
494498

495499
if ((NULL == name) || (NULL == value) || (NULL == found)) {
496500
return PMI2_ERR_INVALID_ARG;
497501
}
498502

499-
/* getting internal key requires special rank value */
500-
memcpy(&proc, &myproc, sizeof(myproc));
501-
proc.rank = PMIX_RANK_UNDEF;
502-
503503
/* set controlling parameters
504504
* PMIX_OPTIONAL - expect that these keys should be available on startup
505505
*/

opal/mca/pmix/pmix3x/pmix/src/client/pmix_client.c

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -445,17 +445,19 @@ PMIX_EXPORT pmix_status_t PMIx_Finalize(const pmix_info_t info[], size_t ninfo)
445445
"pmix:client finalize sync received");
446446
}
447447

448+
PMIX_DESTRUCT(&pmix_client_globals.myserver);
448449
pmix_rte_finalize();
449450

450-
PMIX_DESTRUCT(&pmix_client_globals.myserver);
451-
PMIX_LIST_DESTRUCT(&pmix_client_globals.pending_requests);
451+
PMIX_LIST_DESTRUCT(&pmix_client_globals.pending_requests);
452452

453-
if (0 <= pmix_client_globals.myserver.sd) {
453+
if (0 <= pmix_client_globals.myserver.sd) {
454454
CLOSE_THE_SOCKET(pmix_client_globals.myserver.sd);
455455
}
456456

457457
pmix_bfrop_close();
458458

459+
pmix_class_finalize();
460+
459461
return PMIX_SUCCESS;
460462
}
461463

@@ -529,8 +531,8 @@ PMIX_EXPORT pmix_status_t PMIx_Abort(int flag, const char msg[],
529531
return PMIX_SUCCESS;
530532
}
531533

532-
static void _putfn(int sd, short args, void *cbdata)
533-
{
534+
static void _putfn(int sd, short args, void *cbdata)
535+
{
534536
pmix_cb_t *cb = (pmix_cb_t*)cbdata;
535537
pmix_status_t rc;
536538
pmix_kval_t *kv;
@@ -552,21 +554,10 @@ PMIX_EXPORT pmix_status_t PMIx_Abort(int flag, const char msg[],
552554
/* shouldn't be possible */
553555
goto done;
554556
}
555-
#if defined(PMIX_ENABLE_DSTORE) && (PMIX_ENABLE_DSTORE == 1)
556-
/* TODO: It is not safe to store data on a client side
557-
* There is a possibility to get server/client conflict.
558-
* Do nothing here misses PMIx_Get/PMIx_Put flow (w/o PMIx_Commit)
559-
*/
560-
/*
561-
if (PMIX_SUCCESS != (rc = pmix_dstore_store(ns->nspace, pmix_globals.myid.rank, kv))) {
562-
PMIX_ERROR_LOG(rc);
563-
}
564-
*/
565-
#else
557+
566558
if (PMIX_SUCCESS != (rc = pmix_hash_store(&ns->modex, pmix_globals.myid.rank, kv))) {
567559
PMIX_ERROR_LOG(rc);
568560
}
569-
#endif /* PMIX_ENABLE_DSTORE */
570561

571562
/* pack the cache that matches the scope - global scope needs
572563
* to go into both local and remote caches */

opal/mca/pmix/pmix3x/pmix/src/client/pmix_client_get.c

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -571,7 +571,32 @@ static void _getnbfn(int fd, short flags, void *cbdata)
571571

572572
/* otherwise, the data must be something they "put" */
573573
#if defined(PMIX_ENABLE_DSTORE) && (PMIX_ENABLE_DSTORE == 1)
574-
rc = pmix_dstore_fetch(nptr->nspace, cb->rank, cb->key, &val);
574+
rc = PMIX_ERR_PROC_ENTRY_NOT_FOUND;
575+
if ((0 == strncmp(pmix_globals.myid.nspace, nptr->nspace, PMIX_MAX_NSLEN + 1)) &&
576+
((pmix_globals.myid.rank == cb->rank) || (PMIX_RANK_UNDEF == cb->rank))){
577+
/* if we asking the data about this or undefined process -
578+
check local hash table first. All the data passed through
579+
PMIx_Put settle down there */
580+
rc = pmix_hash_fetch(&nptr->modex, pmix_globals.myid.rank, cb->key, &val);
581+
assert( (PMIX_SUCCESS == rc) || (PMIX_ERR_PROC_ENTRY_NOT_FOUND == rc) ||
582+
(PMIX_ERR_NOT_FOUND == rc) );
583+
if( PMIX_SUCCESS != rc ){
584+
if(pmix_globals.myid.rank == cb->rank){
585+
rc = PMIX_ERR_NOT_FOUND;
586+
}
587+
}
588+
/* in else case we supposed to get PMIX_ERR_PROC_ENTRY_NOT_FOUND because
589+
we don't push data from the remote processes into the dstore */
590+
}
591+
/* try to take it from dstore */
592+
if( PMIX_ERR_PROC_ENTRY_NOT_FOUND == rc ){
593+
/* Two option possible here:
594+
- we asking the key from UNDEF process and local proc
595+
haven't pushed this data
596+
- we askin the key from the particular process which is not us.
597+
*/
598+
rc = pmix_dstore_fetch(nptr->nspace, cb->rank, cb->key, &val);
599+
}
575600
#else
576601
rc = pmix_hash_fetch(&nptr->modex, cb->rank, cb->key, &val);
577602
#endif /* PMIX_ENABLE_DSTORE */

opal/mca/pmix/pmix3x/pmix/src/mca/psec/base/psec_base_frame.c

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
* All rights reserved.
1313
* Copyright (c) 2012-2013 Los Alamos National Security, Inc. All rights reserved.
1414
* Copyright (c) 2014-2016 Intel, Inc. All rights reserved.
15-
* Copyright (c) 2015 Research Organization for Information Science
15+
* Copyright (c) 2015-2016 Research Organization for Information Science
1616
* and Technology (RIST). All rights reserved.
1717
* $COPYRIGHT$
1818
*
@@ -32,6 +32,7 @@
3232
#endif
3333

3434
#include "src/class/pmix_list.h"
35+
#include "src/mca/base/base.h"
3536
#include "src/mca/psec/base/base.h"
3637

3738
/*
@@ -43,33 +44,37 @@
4344
#include "src/mca/psec/base/static-components.h"
4445

4546
/* Instantiate the global vars */
46-
pmix_psec_globals_t pmix_psec_globals = {0};
47+
pmix_psec_globals_t pmix_psec_globals = {{{0}}};
4748

4849
static pmix_status_t pmix_psec_close(void)
4950
{
50-
pmix_psec_base_active_module_t *active;
51+
pmix_psec_base_active_module_t *active, *prev;
5152

5253
if (!pmix_psec_globals.initialized) {
5354
return PMIX_SUCCESS;
5455
}
5556
pmix_psec_globals.initialized = false;
5657

57-
PMIX_LIST_FOREACH(active, &pmix_psec_globals.actives, pmix_psec_base_active_module_t) {
58+
PMIX_LIST_FOREACH_SAFE(active, prev, &pmix_psec_globals.actives, pmix_psec_base_active_module_t) {
59+
pmix_list_remove_item(&pmix_psec_globals.actives, &active->super);
5860
if (NULL != active->component->finalize) {
5961
active->component->finalize();
6062
}
63+
PMIX_RELEASE(active);
6164
}
6265
PMIX_DESTRUCT(&pmix_psec_globals.actives);
6366

64-
return PMIX_SUCCESS;
67+
return pmix_mca_base_framework_components_close(&pmix_psec_base_framework, NULL);
6568
}
6669

6770
static pmix_status_t pmix_psec_open(pmix_mca_base_open_flag_t flags)
6871
{
69-
/* initialize globals */
70-
pmix_psec_globals.initialized = true;
71-
PMIX_CONSTRUCT(&pmix_psec_globals.actives, pmix_list_t);
72-
return PMIX_SUCCESS;
72+
/* initialize globals */
73+
pmix_psec_globals.initialized = true;
74+
PMIX_CONSTRUCT(&pmix_psec_globals.actives, pmix_list_t);
75+
76+
/* Open up all available components */
77+
return pmix_mca_base_framework_components_open(&pmix_psec_base_framework, flags);
7378
}
7479

7580
PMIX_MCA_BASE_FRAMEWORK_DECLARE(pmix, psec, "PMIx Security Operations",

opal/mca/pmix/pmix3x/pmix/src/runtime/pmix_finalize.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,17 @@ void pmix_rte_finalize(void)
6666

6767
if (!pmix_globals.external_evbase) {
6868
/* stop the progress thread */
69-
(void)pmix_progress_thread_finalize(NULL);
69+
(void)pmix_progress_thread_stop(NULL);
7070
}
7171

7272
/* cleanup communications */
7373
pmix_usock_finalize();
74+
75+
if (!pmix_globals.external_evbase) {
76+
/* finalize the progress thread */
77+
(void)pmix_progress_thread_finalize(NULL);
78+
}
79+
7480
if (PMIX_PROC_SERVER != pmix_globals.proc_type &&
7581
0 <= pmix_client_globals.myserver.sd) {
7682
CLOSE_THE_SOCKET(pmix_client_globals.myserver.sd);
@@ -82,6 +88,8 @@ void pmix_rte_finalize(void)
8288
/* close the security framework */
8389
(void)pmix_mca_base_framework_close(&pmix_psec_base_framework);
8490

91+
/* finalize the mca */
92+
(void)pmix_mca_base_close();
8593
/* Clear out all the registered MCA params */
8694
pmix_deregister_params();
8795
pmix_mca_base_var_finalize();

0 commit comments

Comments
 (0)