Skip to content

Commit 1accd06

Browse files
committed
pmix/pmix112: Update to version 1.2.0rc2
Signed-off-by: Joshua Hursey <jhursey@us.ibm.com>
1 parent 9a98131 commit 1accd06

19 files changed

+627
-439
lines changed

Diff for: opal/mca/pmix/pmix112/pmix/NEWS

+5
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@ current release as well as the "stable" bug fix release branch.
2525
-----
2626
- Add shared memory data storage (dstore) option. Default: enabled
2727
Configure option: --disable-dstore
28+
- PMIx_Commit performance improvements
29+
- Disable errhandler support
30+
- Keep job info in the shared memory dstore
31+
- PMIx_Get performance and memory improvements
32+
2833

2934

3035
1.1.5

Diff for: opal/mca/pmix/pmix112/pmix/VERSION

+3-3
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,14 @@ release=0
2424
# The only requirement is that it must be entirely printable ASCII
2525
# characters and have no white space.
2626

27-
greek=rc1
27+
greek=rc2
2828

2929
# If repo_rev is empty, then the repository version number will be
3030
# obtained during "make dist" via the "git describe --tags --always"
3131
# command, or with the date (if "git describe" fails) in the form of
3232
# "date<date>".
3333

34-
repo_rev=git14985d7
34+
repo_rev=git33736edb
3535

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

4646
# The date when this release was created
4747

48-
date="Oct 24, 2016"
48+
date="Dec 14, 2016"
4949

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

Diff for: opal/mca/pmix/pmix112/pmix/src/client/pmix_client.c

+20-158
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ static const char pmix_version_string[] = PMIX_VERSION;
6868
#endif /* PMIX_ENABLE_DSTORE */
6969

7070
#include "pmix_client_ops.h"
71+
#include "src/include/pmix_jobdata.h"
7172

7273
#define PMIX_MAX_RETRIES 10
7374

@@ -186,7 +187,9 @@ static void job_data(struct pmix_peer_t *pr, pmix_usock_hdr_t *hdr,
186187
return;
187188
}
188189
/* decode it */
189-
pmix_client_process_nspace_blob(pmix_globals.myid.nspace, buf);
190+
#if !(defined(PMIX_ENABLE_DSTORE) && (PMIX_ENABLE_DSTORE == 1))
191+
pmix_job_data_htable_store(nspace, buf);
192+
#endif
190193
cb->status = PMIX_SUCCESS;
191194
cb->active = false;
192195
}
@@ -751,12 +754,27 @@ static void _peersfn(int sd, short args, void *cbdata)
751754
pmix_cb_t *cb = (pmix_cb_t*)cbdata;
752755
pmix_status_t rc;
753756
char **nsprocs=NULL, **nsps=NULL, **tmp;
757+
#if !(defined(PMIX_ENABLE_DSTORE) && (PMIX_ENABLE_DSTORE == 1))
754758
pmix_nspace_t *nsptr;
755759
pmix_nrec_t *nptr;
760+
#endif
756761
size_t i;
757762

758763
/* cycle across our known nspaces */
759764
tmp = NULL;
765+
#if defined(PMIX_ENABLE_DSTORE) && (PMIX_ENABLE_DSTORE == 1)
766+
if (PMIX_SUCCESS == (rc = pmix_dstore_fetch(cb->nspace, PMIX_RANK_WILDCARD,
767+
cb->key, &cb->value))) {
768+
769+
tmp = pmix_argv_split(cb->value->data.string, ',');
770+
for (i=0; NULL != tmp[i]; i++) {
771+
pmix_argv_append_nosize(&nsps, cb->nspace);
772+
pmix_argv_append_nosize(&nsprocs, tmp[i]);
773+
}
774+
pmix_argv_free(tmp);
775+
tmp = NULL;
776+
}
777+
#else
760778
PMIX_LIST_FOREACH(nsptr, &pmix_globals.nspaces, pmix_nspace_t) {
761779
if (0 == strncmp(nsptr->nspace, cb->nspace, PMIX_MAX_NSLEN)) {
762780
/* cycle across the nodes in this nspace */
@@ -774,6 +792,7 @@ static void _peersfn(int sd, short args, void *cbdata)
774792
}
775793
}
776794
}
795+
#endif
777796
if (0 == (i = pmix_argv_count(nsps))) {
778797
/* we don't know this nspace */
779798
rc = PMIX_ERR_NOT_FOUND;
@@ -1030,163 +1049,6 @@ static pmix_status_t recv_connect_ack(int sd)
10301049
return PMIX_SUCCESS;
10311050
}
10321051

1033-
void pmix_client_process_nspace_blob(const char *nspace, pmix_buffer_t *bptr)
1034-
{
1035-
pmix_status_t rc;
1036-
int32_t cnt;
1037-
int rank;
1038-
pmix_kval_t *kptr, *kp2, kv;
1039-
pmix_buffer_t buf2;
1040-
pmix_byte_object_t *bo;
1041-
size_t nnodes, i, j;
1042-
pmix_nspace_t *nsptr, *nsptr2;
1043-
pmix_nrec_t *nrec, *nr2;
1044-
char **procs;
1045-
1046-
pmix_output_verbose(2, pmix_globals.debug_output,
1047-
"pmix: PROCESSING BLOB FOR NSPACE %s", nspace);
1048-
1049-
/* cycle across our known nspaces */
1050-
nsptr = NULL;
1051-
PMIX_LIST_FOREACH(nsptr2, &pmix_globals.nspaces, pmix_nspace_t) {
1052-
if (0 == strcmp(nsptr2->nspace, nspace)) {
1053-
nsptr = nsptr2;
1054-
break;
1055-
}
1056-
}
1057-
if (NULL == nsptr) {
1058-
/* we don't know this nspace - add it */
1059-
nsptr = PMIX_NEW(pmix_nspace_t);
1060-
(void)strncpy(nsptr->nspace, nspace, PMIX_MAX_NSLEN);
1061-
pmix_list_append(&pmix_globals.nspaces, &nsptr->super);
1062-
}
1063-
1064-
/* unpack any info structs provided */
1065-
cnt = 1;
1066-
kptr = PMIX_NEW(pmix_kval_t);
1067-
while (PMIX_SUCCESS == (rc = pmix_bfrop.unpack(bptr, kptr, &cnt, PMIX_KVAL))) {
1068-
if (0 == strcmp(kptr->key, PMIX_PROC_BLOB)) {
1069-
/* transfer the byte object for unpacking */
1070-
bo = &(kptr->value->data.bo);
1071-
PMIX_CONSTRUCT(&buf2, pmix_buffer_t);
1072-
PMIX_LOAD_BUFFER(&buf2, bo->bytes, bo->size);
1073-
PMIX_RELEASE(kptr);
1074-
/* start by unpacking the rank */
1075-
cnt = 1;
1076-
if (PMIX_SUCCESS != (rc = pmix_bfrop.unpack(&buf2, &rank, &cnt, PMIX_INT))) {
1077-
PMIX_ERROR_LOG(rc);
1078-
PMIX_DESTRUCT(&buf2);
1079-
return;
1080-
}
1081-
kp2 = PMIX_NEW(pmix_kval_t);
1082-
kp2->key = strdup(PMIX_RANK);
1083-
PMIX_VALUE_CREATE(kp2->value, 1);
1084-
kp2->value->type = PMIX_INT;
1085-
kp2->value->data.integer = rank;
1086-
if (PMIX_SUCCESS != (rc = pmix_hash_store(&nsptr->internal, rank, kp2))) {
1087-
PMIX_ERROR_LOG(rc);
1088-
}
1089-
PMIX_RELEASE(kp2); // maintain accounting
1090-
cnt = 1;
1091-
kp2 = PMIX_NEW(pmix_kval_t);
1092-
while (PMIX_SUCCESS == (rc = pmix_bfrop.unpack(&buf2, kp2, &cnt, PMIX_KVAL))) {
1093-
/* this is data provided by a job-level exchange, so store it
1094-
* in the job-level data hash_table */
1095-
if (PMIX_SUCCESS != (rc = pmix_hash_store(&nsptr->internal, rank, kp2))) {
1096-
PMIX_ERROR_LOG(rc);
1097-
}
1098-
PMIX_RELEASE(kp2); // maintain accounting
1099-
kp2 = PMIX_NEW(pmix_kval_t);
1100-
}
1101-
/* cleanup */
1102-
PMIX_DESTRUCT(&buf2); // releases the original kptr data
1103-
PMIX_RELEASE(kp2);
1104-
} else if (0 == strcmp(kptr->key, PMIX_MAP_BLOB)) {
1105-
/* transfer the byte object for unpacking */
1106-
bo = &(kptr->value->data.bo);
1107-
PMIX_CONSTRUCT(&buf2, pmix_buffer_t);
1108-
PMIX_LOAD_BUFFER(&buf2, bo->bytes, bo->size);
1109-
PMIX_RELEASE(kptr);
1110-
/* start by unpacking the number of nodes */
1111-
cnt = 1;
1112-
if (PMIX_SUCCESS != (rc = pmix_bfrop.unpack(&buf2, &nnodes, &cnt, PMIX_SIZE))) {
1113-
PMIX_ERROR_LOG(rc);
1114-
PMIX_DESTRUCT(&buf2);
1115-
return;
1116-
}
1117-
/* unpack the list of procs on each node */
1118-
for (i=0; i < nnodes; i++) {
1119-
cnt = 1;
1120-
PMIX_CONSTRUCT(&kv, pmix_kval_t);
1121-
if (PMIX_SUCCESS != (rc = pmix_bfrop.unpack(&buf2, &kv, &cnt, PMIX_KVAL))) {
1122-
PMIX_ERROR_LOG(rc);
1123-
PMIX_DESTRUCT(&buf2);
1124-
PMIX_DESTRUCT(&kv);
1125-
return;
1126-
}
1127-
/* the name of the node is in the key, and the value is
1128-
* a comma-delimited list of procs on that node. See if we already
1129-
* have this node */
1130-
nrec = NULL;
1131-
PMIX_LIST_FOREACH(nr2, &nsptr->nodes, pmix_nrec_t) {
1132-
if (0 == strcmp(nr2->name, kv.key)) {
1133-
nrec = nr2;
1134-
break;
1135-
}
1136-
}
1137-
if (NULL == nrec) {
1138-
/* Create a node record and store that list */
1139-
nrec = PMIX_NEW(pmix_nrec_t);
1140-
nrec->name = strdup(kv.key);
1141-
pmix_list_append(&nsptr->nodes, &nrec->super);
1142-
} else {
1143-
/* refresh the list */
1144-
if (NULL != nrec->procs) {
1145-
free(nrec->procs);
1146-
}
1147-
}
1148-
nrec->procs = strdup(kv.value->data.string);
1149-
/* split the list of procs so we can store their
1150-
* individual location data */
1151-
procs = pmix_argv_split(nrec->procs, ',');
1152-
for (j=0; NULL != procs[j]; j++) {
1153-
/* store the hostname for each proc - again, this is
1154-
* data obtained via a job-level exchange, so store it
1155-
* in the job-level data hash_table */
1156-
kp2 = PMIX_NEW(pmix_kval_t);
1157-
kp2->key = strdup(PMIX_HOSTNAME);
1158-
kp2->value = (pmix_value_t*)malloc(sizeof(pmix_value_t));
1159-
kp2->value->type = PMIX_STRING;
1160-
kp2->value->data.string = strdup(nrec->name);
1161-
rank = strtol(procs[j], NULL, 10);
1162-
if (PMIX_SUCCESS != (rc = pmix_hash_store(&nsptr->internal, rank, kp2))) {
1163-
PMIX_ERROR_LOG(rc);
1164-
}
1165-
PMIX_RELEASE(kp2); // maintain accounting
1166-
}
1167-
pmix_argv_free(procs);
1168-
PMIX_DESTRUCT(&kv);
1169-
}
1170-
/* cleanup */
1171-
PMIX_DESTRUCT(&buf2); // releases the original kptr data
1172-
} else {
1173-
/* this is job-level data, so just add it to that hash_table
1174-
* with the wildcard rank */
1175-
if (PMIX_SUCCESS != (rc = pmix_hash_store(&nsptr->internal, PMIX_RANK_WILDCARD, kptr))) {
1176-
PMIX_ERROR_LOG(rc);
1177-
}
1178-
/* maintain accounting - but note that the kptr remains
1179-
* alive and stored in the hash table! So we cannot reuse
1180-
* it for some other purpose */
1181-
PMIX_RELEASE(kptr);
1182-
}
1183-
kptr = PMIX_NEW(pmix_kval_t);
1184-
cnt = 1;
1185-
}
1186-
/* need to release the leftover kptr */
1187-
PMIX_RELEASE(kptr);
1188-
}
1189-
11901052
static pmix_status_t usock_connect(struct sockaddr *addr, int *fd)
11911053
{
11921054
int sd=-1;

Diff for: opal/mca/pmix/pmix112/pmix/src/client/pmix_client_connect.c

+4-1
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@
5555
#include "src/sec/pmix_sec.h"
5656

5757
#include "pmix_client_ops.h"
58+
#include "src/include/pmix_jobdata.h"
5859

5960
/* callback for wait completion */
6061
static void wait_cbfunc(struct pmix_peer_t *pr, pmix_usock_hdr_t *hdr,
@@ -314,7 +315,9 @@ static void wait_cbfunc(struct pmix_peer_t *pr, pmix_usock_hdr_t *hdr,
314315
continue;
315316
}
316317
/* extract and process any proc-related info for this nspace */
317-
pmix_client_process_nspace_blob(nspace, bptr);
318+
#if !(defined(PMIX_ENABLE_DSTORE) && (PMIX_ENABLE_DSTORE == 1))
319+
pmix_job_data_htable_store(nspace, bptr);
320+
#endif
318321
PMIX_RELEASE(bptr);
319322
}
320323
if (PMIX_ERR_UNPACK_READ_PAST_END_OF_BUFFER != rc) {

Diff for: opal/mca/pmix/pmix112/pmix/src/client/pmix_client_get.c

+37-8
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@
5959
#endif /* PMIX_ENABLE_DSTORE */
6060

6161
#include "pmix_client_ops.h"
62+
#include "src/include/pmix_jobdata.h"
6263

6364
static pmix_buffer_t* _pack_get(char *nspace, int rank,
6465
const pmix_info_t info[], size_t ninfo,
@@ -484,7 +485,11 @@ static void _getnbfn(int fd, short flags, void *cbdata)
484485
}
485486
}
486487
/* now get any data from the job-level info */
488+
#if defined(PMIX_ENABLE_DSTORE) && (PMIX_ENABLE_DSTORE == 1)
489+
if (PMIX_SUCCESS == (rc = pmix_dstore_fetch(nptr->nspace, PMIX_RANK_WILDCARD, NULL, &val))) {
490+
#else
487491
if (PMIX_SUCCESS == (rc = pmix_hash_fetch(&nptr->internal, PMIX_RANK_WILDCARD, NULL, &val))) {
492+
#endif
488493
/* since we didn't provide them with a key, the hash function
489494
* must return the results in the pmix_info_array field of the
490495
* value */
@@ -530,9 +535,8 @@ static void _getnbfn(int fd, short flags, void *cbdata)
530535
return;
531536
}
532537

533-
/* the requested data could be in the job-data table, so let's
534-
* just check there first. */
535-
if (PMIX_SUCCESS == (rc = pmix_hash_fetch(&nptr->internal, PMIX_RANK_WILDCARD, cb->key, &val))) {
538+
#if defined(PMIX_ENABLE_DSTORE) && (PMIX_ENABLE_DSTORE == 1)
539+
if (PMIX_SUCCESS == (rc = pmix_hash_fetch(&nptr->internal, cb->rank, cb->key, &val))) {
536540
/* found it - we are in an event, so we can
537541
* just execute the callback */
538542
cb->value_cbfunc(rc, val, cb->cbdata);
@@ -543,17 +547,42 @@ static void _getnbfn(int fd, short flags, void *cbdata)
543547
PMIX_RELEASE(cb);
544548
return;
545549
}
546-
if (PMIX_RANK_WILDCARD == cb->rank) {
547-
/* can't be anywhere else */
548-
cb->value_cbfunc(PMIX_ERR_NOT_FOUND, NULL, cb->cbdata);
549-
PMIX_RELEASE(cb);
550-
return;
550+
#endif
551+
552+
/* the requested data could be in the job-data table, so let's
553+
* just check there first. */
554+
if (0 == strncmp(cb->key, "pmix", 4)) {
555+
#if defined(PMIX_ENABLE_DSTORE) && (PMIX_ENABLE_DSTORE == 1)
556+
if (PMIX_SUCCESS == (rc = pmix_dstore_fetch(nptr->nspace, PMIX_RANK_WILDCARD, cb->key, &val))) {
557+
#else
558+
if (PMIX_SUCCESS == (rc = pmix_hash_fetch(&nptr->internal, PMIX_RANK_WILDCARD, cb->key, &val))) {
559+
#endif
560+
/* found it - we are in an event, so we can
561+
* just execute the callback */
562+
cb->value_cbfunc(rc, val, cb->cbdata);
563+
/* cleanup */
564+
if (NULL != val) {
565+
PMIX_VALUE_RELEASE(val);
566+
}
567+
PMIX_RELEASE(cb);
568+
return;
569+
}
570+
if (PMIX_RANK_WILDCARD == cb->rank) {
571+
/* can't be anywhere else */
572+
cb->value_cbfunc(PMIX_ERR_NOT_FOUND, NULL, cb->cbdata);
573+
PMIX_RELEASE(cb);
574+
return;
575+
}
551576
}
552577

553578
/* it could still be in the job-data table, only stored under its own
554579
* rank and not WILDCARD - e.g., this is true of data returned about
555580
* ourselves during startup */
581+
#if defined(PMIX_ENABLE_DSTORE) && (PMIX_ENABLE_DSTORE == 1)
582+
if (PMIX_SUCCESS == (rc = pmix_dstore_fetch(nptr->nspace, cb->rank, cb->key, &val))) {
583+
#else
556584
if (PMIX_SUCCESS == (rc = pmix_hash_fetch(&nptr->internal, cb->rank, cb->key, &val))) {
585+
#endif
557586
/* found it - we are in an event, so we can
558587
* just execute the callback */
559588
cb->value_cbfunc(rc, val, cb->cbdata);

Diff for: opal/mca/pmix/pmix112/pmix/src/client/pmix_client_ops.h

-2
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@ typedef struct {
2626

2727
extern pmix_client_globals_t pmix_client_globals;
2828

29-
void pmix_client_process_nspace_blob(const char *nspace, pmix_buffer_t *bptr);
30-
3129
void pmix_client_register_errhandler(pmix_info_t info[], size_t ninfo,
3230
pmix_notification_fn_t errhandler,
3331
pmix_errhandler_reg_cbfunc_t cbfunc,

Diff for: opal/mca/pmix/pmix112/pmix/src/client/pmix_client_spawn.c

+4-1
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@
5555
#include "src/sec/pmix_sec.h"
5656

5757
#include "pmix_client_ops.h"
58+
#include "src/include/pmix_jobdata.h"
5859

5960
static void wait_cbfunc(struct pmix_peer_t *pr, pmix_usock_hdr_t *hdr,
6061
pmix_buffer_t *buf, void *cbdata);
@@ -207,7 +208,9 @@ static void wait_cbfunc(struct pmix_peer_t *pr, pmix_usock_hdr_t *hdr,
207208
if (NULL != n2) {
208209
(void)strncpy(nspace, n2, PMIX_MAX_NSLEN);
209210
/* extract and process any proc-related info for this nspace */
210-
pmix_client_process_nspace_blob(nspace, buf);
211+
#if !(defined(PMIX_ENABLE_DSTORE) && (PMIX_ENABLE_DSTORE == 1))
212+
pmix_job_data_htable_store(nspace, buf);
213+
#endif
211214
free(n2);
212215
}
213216
}

Diff for: opal/mca/pmix/pmix112/pmix/src/common/Makefile.am

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,5 @@
88
#
99

1010
sources += \
11-
src/common/pmix_common.c
11+
src/common/pmix_common.c \
12+
src/common/pmix_jobdata.c

0 commit comments

Comments
 (0)