Skip to content

Commit c5c93e3

Browse files
committed
Update to PMIx master
Signed-off-by: Ralph Castain <[email protected]>
1 parent 3c45542 commit c5c93e3

File tree

28 files changed

+676
-571
lines changed

28 files changed

+676
-571
lines changed

opal/mca/pmix/pmix4x/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=git628a724c
33+
repo_rev=git7e40284d
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="Jul 21, 2019"
47+
date="Jul 26, 2019"
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/pmix4x/pmix/config/pmix.m4

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1212,23 +1212,33 @@ fi
12121212
AM_CONDITIONAL([WANT_PYTHON_BINDINGS], [test $WANT_PYTHON_BINDINGS -eq 1])
12131213

12141214
if test "$WANT_PYTHON_BINDINGS" = "1"; then
1215-
AM_PATH_PYTHON([3.4], [python_happy=1], [python_happy=0])
1216-
if test "$python_happy" = "0"; then
1215+
AM_PATH_PYTHON([3.4])
1216+
AC_SUBST([PMIX_PYTHON_PATH], [#!"$PYTHON"], "Full Python executable path")
1217+
pyvers=`python --version`
1218+
python_version=${pyvers#"Python"}
1219+
major=$(echo $python_version | cut -d. -f1)
1220+
minor=$(echo $python_version | cut -d. -f2)
1221+
if test "$major" -lt "3"; then
1222+
AC_MSG_WARN([Python bindings were enabled, but no suitable])
1223+
AC_MSG_WARN([interpreter was found. PMIx requires at least])
1224+
AC_MSG_WARN([Python v3.4 to provide Python bindings])
1225+
AC_MSG_ERROR([Cannot continue])
1226+
fi
1227+
if test "$major" -eq "3" && test "$minor" -lt "4"; then
12171228
AC_MSG_WARN([Python bindings were enabled, but no suitable])
12181229
AC_MSG_WARN([interpreter was found. PMIx requires at least])
12191230
AC_MSG_WARN([Python v3.4 to provide Python bindings])
12201231
AC_MSG_ERROR([Cannot continue])
12211232
fi
1222-
python_version=`python --version 2>&1`
1233+
12231234
PMIX_SUMMARY_ADD([[Bindings]],[[Python]], [pmix_python], [yes ($python_version)])
1224-
AC_SUBST([PMIX_PYTHON_PATH], [#!"$PYTHON"], "Full Python executable path")
12251235

12261236
AC_MSG_CHECKING([if Cython package installed])
12271237
have_cython=`$srcdir/config/pmix_check_cython.py 2> /dev/null`
12281238
if test "$have_cython" = "0"; then
12291239
AC_MSG_RESULT([yes])
12301240
AC_MSG_CHECKING([Cython version])
1231-
cython_version=`cython --version 2>&1`
1241+
cython_version=`python -c "from Cython.Compiler.Version import version; print(version)"`
12321242
AC_MSG_RESULT([$cython_version])
12331243
PMIX_SUMMARY_ADD([[Bindings]],[[Cython]], [pmix_cython], [yes ($cython_version)])
12341244
else

opal/mca/pmix/pmix4x/pmix/examples/client.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,9 @@ int main(int argc, char **argv)
254254
fprintf(stderr, "Client ns %s rank %d: PMIx_Commit failed: %d\n", myproc.nspace, myproc.rank, rc);
255255
goto done;
256256
}
257+
if (0 == myproc.rank) {
258+
sleep(2);
259+
}
257260

258261
/* call fence to synchronize with our peers - instruct
259262
* the fence operation to collect and return all "put"

opal/mca/pmix/pmix4x/pmix/examples/dynamic.c

Lines changed: 18 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,7 @@ int main(int argc, char **argv)
4949
char nsp2[PMIX_MAX_NSLEN+1];
5050
pmix_app_t *app;
5151
char hostname[1024], dir[1024];
52-
pmix_proc_t *peers;
53-
size_t npeers, ntmp=0;
54-
char *nodelist;
52+
size_t ntmp=0;
5553

5654
if (0 > gethostname(hostname, sizeof(hostname))) {
5755
exit(1);
@@ -71,14 +69,14 @@ int main(int argc, char **argv)
7169
(void)strncpy(proc.nspace, myproc.nspace, PMIX_MAX_NSLEN);
7270
proc.rank = PMIX_RANK_WILDCARD;
7371

74-
/* get our universe size */
75-
if (PMIX_SUCCESS != (rc = PMIx_Get(&proc, PMIX_UNIV_SIZE, NULL, 0, &val))) {
76-
fprintf(stderr, "Client ns %s rank %d: PMIx_Get universe size failed: %d\n", myproc.nspace, myproc.rank, rc);
72+
/* get our job size */
73+
if (PMIX_SUCCESS != (rc = PMIx_Get(&proc, PMIX_JOB_SIZE, NULL, 0, &val))) {
74+
fprintf(stderr, "Client ns %s rank %d: PMIx_Get job size failed: %d\n", myproc.nspace, myproc.rank, rc);
7775
goto done;
7876
}
7977
nprocs = val->data.uint32;
8078
PMIX_VALUE_RELEASE(val);
81-
fprintf(stderr, "Client %s:%d universe size %d\n", myproc.nspace, myproc.rank, nprocs);
79+
fprintf(stderr, "Client %s:%d job size %d\n", myproc.nspace, myproc.rank, nprocs);
8280

8381
/* call fence to sync */
8482
(void)strncpy(proc.nspace, myproc.nspace, PMIX_MAX_NSLEN);
@@ -103,13 +101,6 @@ int main(int argc, char **argv)
103101
app->env = (char**)malloc(2 * sizeof(char*));
104102
app->env[0] = strdup("PMIX_ENV_VALUE=3");
105103
app->env[1] = NULL;
106-
PMIX_INFO_CREATE(app->info, 2);
107-
(void)strncpy(app->info[0].key, "DARTH", PMIX_MAX_KEYLEN);
108-
app->info[0].value.type = PMIX_INT8;
109-
app->info[0].value.data.int8 = 12;
110-
(void)strncpy(app->info[1].key, "VADER", PMIX_MAX_KEYLEN);
111-
app->info[1].value.type = PMIX_DOUBLE;
112-
app->info[1].value.data.dval = 12.34;
113104

114105
fprintf(stderr, "Client ns %s rank %d: calling PMIx_Spawn\n", myproc.nspace, myproc.rank);
115106
if (PMIX_SUCCESS != (rc = PMIx_Spawn(NULL, 0, app, 1, nsp2))) {
@@ -122,65 +113,28 @@ int main(int argc, char **argv)
122113
val = NULL;
123114
(void)strncpy(proc.nspace, nsp2, PMIX_MAX_NSLEN);
124115
proc.rank = PMIX_RANK_WILDCARD;
125-
if (PMIX_SUCCESS != (rc = PMIx_Get(&proc, PMIX_UNIV_SIZE, NULL, 0, &val)) ||
116+
if (PMIX_SUCCESS != (rc = PMIx_Get(&proc, PMIX_JOB_SIZE, NULL, 0, &val)) ||
126117
NULL == val) {
127-
fprintf(stderr, "Client ns %s rank %d: PMIx_Get universe size failed: %d\n", myproc.nspace, myproc.rank, rc);
118+
fprintf(stderr, "Client ns %s rank %d: PMIx_Get job size failed: %d\n", myproc.nspace, myproc.rank, rc);
128119
goto done;
129120
}
130121
ntmp = val->data.uint32;
131122
PMIX_VALUE_RELEASE(val);
132-
fprintf(stderr, "Client %s:%d universe %s size %d\n", myproc.nspace, myproc.rank, nsp2, (int)ntmp);
133-
}
134-
135-
/* just cycle the connect/disconnect functions */
136-
(void)strncpy(proc.nspace, myproc.nspace, PMIX_MAX_NSLEN);
137-
proc.rank = PMIX_RANK_WILDCARD;
138-
if (PMIX_SUCCESS != (rc = PMIx_Connect(&proc, 1, NULL, 0))) {
139-
fprintf(stderr, "Client ns %s rank %d: PMIx_Connect failed: %d\n", myproc.nspace, myproc.rank, rc);
140-
goto done;
141-
}
142-
fprintf(stderr, "Client ns %s rank %d: PMIx_Connect succeeded\n",
143-
myproc.nspace, myproc.rank);
144-
if (PMIX_SUCCESS != (rc = PMIx_Disconnect(&proc, 1, NULL, 0))) {
145-
fprintf(stderr, "Client ns %s rank %d: PMIx_Disonnect failed: %d\n", myproc.nspace, myproc.rank, rc);
146-
goto done;
147-
}
148-
fprintf(stderr, "Client ns %s rank %d: PMIx_Disconnect succeeded\n", myproc.nspace, myproc.rank);
123+
fprintf(stderr, "Client %s:%d job %s size %d\n", myproc.nspace, myproc.rank, nsp2, (int)ntmp);
149124

150-
/* finally, test the resolve functions */
151-
if (0 == myproc.rank) {
152-
if (PMIX_SUCCESS != (rc = PMIx_Resolve_peers(hostname, NULL, &peers, &npeers))) {
153-
fprintf(stderr, "Client ns %s rank %d: PMIx_Resolve_peers failed for nspace %s: %d\n", myproc.nspace, myproc.rank, nsp2, rc);
154-
goto done;
155-
}
156-
if ((nprocs+ntmp) != npeers) {
157-
fprintf(stderr, "Client ns %s rank %d: PMIx_Resolve_peers returned incorrect npeers: %d vs %d\n", myproc.nspace, myproc.rank, (int)(nprocs+ntmp), (int)npeers);
158-
goto done;
159-
}
160-
fprintf(stderr, "Client ns %s rank %d: PMIx_Resolve_peers returned %d npeers\n", myproc.nspace, myproc.rank, (int)npeers);
161-
if (PMIX_SUCCESS != (rc = PMIx_Resolve_nodes(nsp2, &nodelist))) {
162-
fprintf(stderr, "Client ns %s rank %d: PMIx_Resolve_nodes failed for nspace %s: %d\n", myproc.nspace, myproc.rank, nsp2, rc);
163-
goto done;
164-
}
165-
fprintf(stderr, "Client ns %s rank %d: PMIx_Resolve_nodes %s", myproc.nspace, myproc.rank, nodelist);
166-
} else {
167-
if (PMIX_SUCCESS != (rc = PMIx_Resolve_peers(hostname, myproc.nspace, &peers, &npeers))) {
168-
fprintf(stderr, "Client ns %s rank %d: PMIx_Resolve_peers failed for nspace %s: %d\n", myproc.nspace, myproc.rank, myproc.nspace, rc);
169-
goto done;
170-
}
171-
if (nprocs != npeers) {
172-
fprintf(stderr, "Client ns %s rank %d: PMIx_Resolve_peers returned incorrect npeers: %d vs %d\n", myproc.nspace, myproc.rank, nprocs, (int)npeers);
173-
goto done;
174-
}
175-
fprintf(stderr, "Client ns %s rank %d: PMIx_Resolve_peers returned %d npeers\n", myproc.nspace, myproc.rank, (int)npeers);
176-
if (PMIX_SUCCESS != (rc = PMIx_Resolve_nodes(myproc.nspace, &nodelist))) {
177-
fprintf(stderr, "Client ns %s rank %d: PMIx_Resolve_nodes failed: %d\n", myproc.nspace, myproc.rank, rc);
125+
/* get a proc-specific value */
126+
val = NULL;
127+
(void)strncpy(proc.nspace, nsp2, PMIX_MAX_NSLEN);
128+
proc.rank = 1;
129+
if (PMIX_SUCCESS != (rc = PMIx_Get(&proc, PMIX_LOCAL_RANK, NULL, 0, &val)) ||
130+
NULL == val) {
131+
fprintf(stderr, "Client ns %s rank %d: PMIx_Get local rank failed: %d\n", myproc.nspace, myproc.rank, rc);
178132
goto done;
179133
}
180-
fprintf(stderr, "Client ns %s rank %d: PMIx_Resolve_nodes %s\n", myproc.nspace, myproc.rank, nodelist);
134+
ntmp = (int)val->data.uint16;
135+
PMIX_VALUE_RELEASE(val);
136+
fprintf(stderr, "Client %s:%d job %s local rank %d\n", myproc.nspace, myproc.rank, nsp2, (int)ntmp);
181137
}
182-
PMIX_PROC_FREE(peers, npeers);
183-
free(nodelist);
184138

185139
done:
186140
/* call fence to sync */

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ PMIX_EXPORT pmix_status_t PMIx_Get(const pmix_proc_t *proc,
101101
(NULL == key) ? "NULL" : key);
102102

103103
/* try to get data directly, without threadshift */
104-
if (PMIX_RANK_UNDEF != proc->rank) {
104+
if (PMIX_RANK_UNDEF != proc->rank && NULL != key) {
105105
if (PMIX_SUCCESS == (rc = _getfn_fastpath(proc, key, info, ninfo, val))) {
106106
goto done;
107107
}
@@ -327,7 +327,6 @@ static void _getnb_cbfunc(struct pmix_peer_t *pr,
327327
}
328328

329329
if (PMIX_SUCCESS != ret) {
330-
PMIX_ERROR_LOG(ret);
331330
goto done;
332331
}
333332
if (PMIX_RANK_UNDEF == proc.rank) {

opal/mca/pmix/pmix4x/pmix/src/common/pmix_log.c

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
22
/*
3-
* Copyright (c) 2014-2018 Intel, Inc. All rights reserved.
3+
* Copyright (c) 2014-2019 Intel, Inc. All rights reserved.
44
* Copyright (c) 2016 Mellanox Technologies, Inc.
55
* All rights reserved.
66
* Copyright (c) 2016 IBM Corporation. All rights reserved.
@@ -83,14 +83,18 @@ PMIX_EXPORT pmix_status_t PMIx_Log(const pmix_info_t data[], size_t ndata,
8383
* recv routine so we know which callback to use when
8484
* the return message is recvd */
8585
PMIX_CONSTRUCT(&cb, pmix_cb_t);
86-
if (PMIX_SUCCESS != (rc = PMIx_Log_nb(data, ndata, directives,
87-
ndirs, opcbfunc, &cb))) {
86+
rc = PMIx_Log_nb(data, ndata, directives, ndirs, opcbfunc, &cb);
87+
if (PMIX_SUCCESS == rc) {
88+
/* wait for the operation to complete */
89+
PMIX_WAIT_THREAD(&cb.lock);
90+
} else {
8891
PMIX_DESTRUCT(&cb);
92+
if (PMIX_OPERATION_SUCCEEDED == rc) {
93+
rc = PMIX_SUCCESS;
94+
}
8995
return rc;
9096
}
9197

92-
/* wait for the operation to complete */
93-
PMIX_WAIT_THREAD(&cb.lock);
9498
rc = cb.status;
9599
PMIX_DESTRUCT(&cb);
96100

opal/mca/pmix/pmix4x/pmix/src/mca/pif/bsdx_ipv4/pif_bsdx.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* Copyright (c) 2010 Cisco Systems, Inc. All rights reserved.
33
* Copyright (c) 2010 Oracle and/or its affiliates. All rights reserved.
4-
* Copyright (c) 2018 Intel, Inc. All rights reserved.
4+
* Copyright (c) 2018-2019 Intel, Inc. All rights reserved.
55
* $COPYRIGHT$
66
*
77
* Additional copyrights may follow
@@ -158,7 +158,7 @@ static int if_bsdx_open(void)
158158
/* fill values into the pmix_pif_t */
159159
memcpy(&a4, &(sin_addr->sin_addr), sizeof(struct in_addr));
160160

161-
pmix_strncpy(intf->if_name, cur_ifaddrs->ifa_name, IF_NAMESIZE-1);
161+
pmix_strncpy(intf->if_name, cur_ifaddrs->ifa_name, PMIX_IF_NAMESIZE-1);
162162
intf->if_index = pmix_list_get_size(&pmix_if_list) + 1;
163163
((struct sockaddr_in*) &intf->if_addr)->sin_addr = a4;
164164
((struct sockaddr_in*) &intf->if_addr)->sin_family = AF_INET;

opal/mca/pmix/pmix4x/pmix/src/mca/pif/bsdx_ipv6/pif_bsdx_ipv6.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* Copyright (c) 2010 Cisco Systems, Inc. All rights reserved.
33
* Copyright (c) 2010 Oracle and/or its affiliates. All rights reserved.
4-
* Copyright (c) 2018 Intel, Inc. All rights reserved.
4+
* Copyright (c) 2018-2019 Intel, Inc. All rights reserved.
55
* $COPYRIGHT$
66
*
77
* Additional copyrights may follow
@@ -183,7 +183,7 @@ static int if_bsdx_ipv6_open(void)
183183
return PMIX_ERR_OUT_OF_RESOURCE;
184184
}
185185
intf->af_family = AF_INET6;
186-
pmix_strncpy(intf->if_name, cur_ifaddrs->ifa_name, IF_NAMESIZE-1);
186+
pmix_strncpy(intf->if_name, cur_ifaddrs->ifa_name, PMIX_IF_NAMESIZE-1);
187187
intf->if_index = pmix_list_get_size(&pmix_if_list) + 1;
188188
((struct sockaddr_in6*) &intf->if_addr)->sin6_addr = a6;
189189
((struct sockaddr_in6*) &intf->if_addr)->sin6_family = AF_INET6;

opal/mca/pmix/pmix4x/pmix/src/mca/pif/linux_ipv6/pif_linux_ipv6.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* Copyright (c) 2010 Cisco Systems, Inc. All rights reserved.
33
* Copyright (c) 2010 Oracle and/or its affiliates. All rights reserved.
4-
* Copyright (c) 2018 Intel, Inc. All rights reserved.
4+
* Copyright (c) 2018-2019 Intel, Inc. All rights reserved.
55
* $COPYRIGHT$
66
*
77
* Additional copyrights may follow
@@ -82,12 +82,15 @@ static int if_linux_ipv6_open(void)
8282
if ((f = fopen("/proc/net/if_inet6", "r"))) {
8383
/* IF_NAMESIZE is normally 16 on Linux,
8484
but the next scanf allows up to 21 bytes */
85-
char ifname[21];
85+
char ifname[PMIX_IF_NAMESIZE];
8686
unsigned int idx, pfxlen, scope, dadstat;
8787
struct in6_addr a6;
8888
int iter;
8989
uint32_t flag;
90-
unsigned int addrbyte[16];
90+
unsigned int addrbyte[PMIX_IF_NAMESIZE];
91+
92+
memset(addrbyte, 0, PMIX_IF_NAMESIZE*sizeof(unsigned int));
93+
memset(ifname, 0, PMIX_IF_NAMESIZE*sizeof(char));
9194

9295
while (fscanf(f, "%2x%2x%2x%2x%2x%2x%2x%2x%2x%2x%2x%2x%2x%2x%2x%2x %x %x %x %x %20s\n",
9396
&addrbyte[0], &addrbyte[1], &addrbyte[2], &addrbyte[3],
@@ -129,7 +132,7 @@ static int if_linux_ipv6_open(void)
129132
}
130133

131134
/* now construct the pmix_pif_t */
132-
pmix_strncpy(intf->if_name, ifname, IF_NAMESIZE-1);
135+
pmix_strncpy(intf->if_name, ifname, PMIX_IF_NAMESIZE-1);
133136
intf->if_index = pmix_list_get_size(&pmix_if_list)+1;
134137
intf->if_kernel_index = (uint16_t) idx;
135138
((struct sockaddr_in6*) &intf->if_addr)->sin6_addr = a6;

opal/mca/pmix/pmix4x/pmix/src/mca/pif/pif.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Copyright (c) 2010-2013 Cisco Systems, Inc. All rights reserved.
44
* Copyright (c) 2015 Los Alamos National Security, LLC. All rights
55
* reserved.
6-
* Copyright (c) 2016-2018 Intel, Inc. All rights reserved.
6+
* Copyright (c) 2016-2019 Intel, Inc. All rights reserved.
77
* $COPYRIGHT$
88
*
99
* Additional copyrights may follow
@@ -73,7 +73,7 @@ BEGIN_C_DECLS
7373

7474
typedef struct pmix_pif_t {
7575
pmix_list_item_t super;
76-
char if_name[IF_NAMESIZE+1];
76+
char if_name[PMIX_IF_NAMESIZE+1];
7777
int if_index;
7878
uint16_t if_kernel_index;
7979
uint16_t af_family;

0 commit comments

Comments
 (0)