Skip to content

Commit 41b1701

Browse files
author
Ralph Castain
committed
Update to official PMIx v2.1.0 release
Signed-off-by: Ralph Castain <[email protected]>
1 parent cced4fd commit 41b1701

File tree

22 files changed

+421
-109
lines changed

22 files changed

+421
-109
lines changed

opal/mca/pmix/pmix2x/pmix/NEWS

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright (c) 2015-2017 Intel, Inc. All rights reserved.
1+
Copyright (c) 2015-2018 Intel, Inc. All rights reserved.
22
Copyright (c) 2017 IBM Corporation. All rights reserved.
33
$COPYRIGHT$
44

@@ -21,7 +21,7 @@ example, a bug might be fixed in the master, and then moved to the
2121
current release as well as the "stable" bug fix release branch.
2222

2323

24-
2.1.0 -- 26 Oct 2017
24+
2.1.0 -- 1 Feb 2018
2525
----------------------
2626
**** NOTE: This release contains the first implementation of cross-version
2727
**** support. Servers using v2.1.0 are capable of supporting clients using
@@ -32,6 +32,30 @@ current release as well as the "stable" bug fix release branch.
3232
- Enable support for remote tool connections (PR #540, #542)
3333
- Cleanup libevent configure logi to support default install paths (PR #541)
3434
- Debounce "unreachable" notifications for tools when they disconnect (PR #544)
35+
- Enable the regex generator to support node names that include multiple
36+
sets of numbers
37+
38+
39+
2.0.3 -- 1 Feb 2018
40+
----------------------
41+
- Fix event notification so all sides of multi-library get notified
42+
of other library's existence
43+
- Update syslog protection to support Mac High Sierra OS
44+
- Remove usock component - unable to support v1.x clients due
45+
to datatype differences
46+
- Cleanup security handshake
47+
- Cleanup separation of PMI-1/2 libraries and PMIx symbols
48+
- Protect against overly-large messages
49+
- Update data buffer APIs to support cross-version operations
50+
- Protect receive callbacks from NULL and/or empty buffers as this
51+
can occur when the peer on a connection disappears.
52+
- Fix tool connection search so it properly descends into the directory
53+
tree while searching for the server's contact file.
54+
- Fix store_local so it doesn't reject a new nspace as that can happen
55+
when working with tools
56+
- Ensure we always complete PMIx_Finalize - don't return if something
57+
goes wrong in the middle of the procedure
58+
- Fix several tool connection issues
3559

3660

3761
2.0.2 -- 19 Oct 2017
@@ -115,6 +139,14 @@ current release as well as the "stable" bug fix release branch.
115139
and to themselves
116140

117141

142+
1.2.5 -- 1 Feb 2018
143+
----------------------
144+
- Fix cross-version issue when v1.2 client interacts with v2.1 server (PR #564)
145+
- Update client connection for cross-version support (PR #591)
146+
- Fix write memory barrier ASM for PowerPC (PR #606)
147+
- Add protection from overly-large messages
148+
149+
118150
1.2.4 -- 13 Oct. 2017
119151
----------------------
120152
- Silence some unnecessary warning messages (PR #487)

opal/mca/pmix/pmix2x/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=git9212bbc
33+
repo_rev=git79b2db3
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="Jan 16, 2018"
47+
date="Feb 01, 2018"
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/pmix2x/pmix/examples/client.c

Lines changed: 86 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* All rights reserved.
1414
* Copyright (c) 2009-2012 Cisco Systems, Inc. All rights reserved.
1515
* Copyright (c) 2011 Oak Ridge National Labs. All rights reserved.
16-
* Copyright (c) 2013-2017 Intel, Inc. All rights reserved.
16+
* Copyright (c) 2013-2018 Intel, Inc. All rights reserved.
1717
* Copyright (c) 2015 Mellanox Technologies, Inc. All rights reserved.
1818
* $COPYRIGHT$
1919
*
@@ -97,11 +97,11 @@ int main(int argc, char **argv)
9797
int rc;
9898
pmix_value_t value;
9999
pmix_value_t *val = &value;
100-
char *tmp;
100+
char *tmp, *ptr, *p;
101101
pmix_proc_t proc;
102-
uint32_t nprocs, n;
102+
uint32_t nprocs, m, n, local_cnt, *localpeers;
103103
pmix_info_t *info;
104-
bool flag;
104+
bool flag, local;
105105
volatile int active;
106106
pmix_status_t dbg = PMIX_ERR_DEBUGGER_RELEASE;
107107

@@ -196,7 +196,7 @@ int main(int argc, char **argv)
196196
value.type = PMIX_UINT64;
197197
value.data.uint64 = 1234;
198198
if (PMIX_SUCCESS != (rc = PMIx_Put(PMIX_LOCAL, tmp, &value))) {
199-
fprintf(stderr, "Client ns %s rank %d: PMIx_Put internal failed: %d\n", myproc.nspace, myproc.rank, rc);
199+
fprintf(stderr, "Client ns %s rank %d: PMIx_Put local failed: %d\n", myproc.nspace, myproc.rank, rc);
200200
goto done;
201201
}
202202
free(tmp);
@@ -207,7 +207,7 @@ int main(int argc, char **argv)
207207
value.type = PMIX_STRING;
208208
value.data.string = "1234";
209209
if (PMIX_SUCCESS != (rc = PMIx_Put(PMIX_REMOTE, tmp, &value))) {
210-
fprintf(stderr, "Client ns %s rank %d: PMIx_Put internal failed: %d\n", myproc.nspace, myproc.rank, rc);
210+
fprintf(stderr, "Client ns %s rank %d: PMIx_Put remote failed: %d\n", myproc.nspace, myproc.rank, rc);
211211
goto done;
212212
}
213213
free(tmp);
@@ -230,53 +230,96 @@ int main(int argc, char **argv)
230230
}
231231
PMIX_INFO_FREE(info, 1);
232232

233+
/* get the number of local peers */
234+
if (PMIX_SUCCESS != (rc = PMIx_Get(&proc, PMIX_LOCAL_SIZE, NULL, 0, &val))) {
235+
fprintf(stderr, "Client ns %s rank %d: PMIx_Get PMIX_LOCAL_SIZE failed: %d", myproc.nspace, myproc.rank, rc);
236+
goto done;
237+
}
238+
local_cnt = val->data.uint32;
239+
PMIX_VALUE_RELEASE(val);
240+
241+
/* create an array for the peers */
242+
localpeers = (uint32_t*)malloc(local_cnt * sizeof(int));
243+
244+
/* get the list of local peers */
245+
if (PMIX_SUCCESS != (rc = PMIx_Get(&proc, PMIX_LOCAL_PEERS, NULL, 0, &val))) {
246+
fprintf(stderr, "Client ns %s rank %d: PMIx_Get PMIX_LOCAL_PEERS failed: %d", myproc.nspace, myproc.rank, rc);
247+
goto done;
248+
}
249+
ptr = strdup(val->data.string);
250+
PMIX_VALUE_RELEASE(val);
251+
252+
/* populate the peers array */
253+
p = strtok(ptr, ",");
254+
localpeers[0] = strtoul(p, NULL, 10);
255+
for (n=1; n < local_cnt; n++) {
256+
p = strtok(NULL, ",");
257+
localpeers[n] = strtoul(p, NULL, 10);
258+
}
259+
free(ptr);
260+
233261
/* check the returned data */
234262
for (n=0; n < nprocs; n++) {
235-
if (0 > asprintf(&tmp, "%s-%d-local", myproc.nspace, myproc.rank)) {
236-
exit(1);
263+
if (n == myproc.rank) {
264+
continue;
237265
}
238-
if (PMIX_SUCCESS != (rc = PMIx_Get(&myproc, tmp, NULL, 0, &val))) {
239-
fprintf(stderr, "Client ns %s rank %d: PMIx_Get %s failed: %d\n", myproc.nspace, myproc.rank, tmp, rc);
240-
goto done;
241-
}
242-
if (PMIX_UINT64 != val->type) {
243-
fprintf(stderr, "Client ns %s rank %d: PMIx_Get %s returned wrong type: %d\n", myproc.nspace, myproc.rank, tmp, val->type);
244-
PMIX_VALUE_RELEASE(val);
245-
free(tmp);
246-
goto done;
266+
proc.rank = n;
267+
local = false;
268+
for (m=0; m < local_cnt; m++) {
269+
if (localpeers[m] == proc.rank) {
270+
local = true;
271+
break;
272+
}
247273
}
248-
if (1234 != val->data.uint64) {
249-
fprintf(stderr, "Client ns %s rank %d: PMIx_Get %s returned wrong value: %d\n", myproc.nspace, myproc.rank, tmp, (int)val->data.uint64);
274+
if (local) {
275+
if (0 > asprintf(&tmp, "%s-%d-local", proc.nspace, proc.rank)) {
276+
exit(1);
277+
}
278+
if (PMIX_SUCCESS != (rc = PMIx_Get(&proc, tmp, NULL, 0, &val))) {
279+
fprintf(stderr, "Client ns %s rank %d: PMIx_Get %s failed: %d\n", myproc.nspace, myproc.rank, tmp, rc);
280+
goto done;
281+
}
282+
if (PMIX_UINT64 != val->type) {
283+
fprintf(stderr, "Client ns %s rank %d: PMIx_Get %s returned wrong type: %d\n", myproc.nspace, myproc.rank, tmp, val->type);
284+
PMIX_VALUE_RELEASE(val);
285+
free(tmp);
286+
goto done;
287+
}
288+
if (1234 != val->data.uint64) {
289+
fprintf(stderr, "Client ns %s rank %d: PMIx_Get %s returned wrong value: %d\n", myproc.nspace, myproc.rank, tmp, (int)val->data.uint64);
290+
PMIX_VALUE_RELEASE(val);
291+
free(tmp);
292+
goto done;
293+
}
294+
fprintf(stderr, "Client ns %s rank %d: PMIx_Get %s returned correct\n", myproc.nspace, myproc.rank, tmp);
250295
PMIX_VALUE_RELEASE(val);
251296
free(tmp);
252-
goto done;
253-
}
254-
fprintf(stderr, "Client ns %s rank %d: PMIx_Get %s returned correct\n", myproc.nspace, myproc.rank, tmp);
255-
PMIX_VALUE_RELEASE(val);
256-
free(tmp);
257-
if (0 > asprintf(&tmp, "%s-%d-remote", myproc.nspace, myproc.rank)) {
258-
exit(1);
259-
}
260-
if (PMIX_SUCCESS != (rc = PMIx_Get(&myproc, tmp, NULL, 0, &val))) {
261-
fprintf(stderr, "Client ns %s rank %d: PMIx_Get %s failed: %d\n", myproc.nspace, myproc.rank, tmp, rc);
262-
goto done;
263-
}
264-
if (PMIX_STRING != val->type) {
265-
fprintf(stderr, "Client ns %s rank %d: PMIx_Get %s returned wrong type: %d\n", myproc.nspace, myproc.rank, tmp, val->type);
266-
PMIX_VALUE_RELEASE(val);
267-
free(tmp);
268-
goto done;
269-
}
270-
if (0 != strcmp(val->data.string, "1234")) {
271-
fprintf(stderr, "Client ns %s rank %d: PMIx_Get %s returned wrong value: %s\n", myproc.nspace, myproc.rank, tmp, val->data.string);
297+
} else {
298+
if (0 > asprintf(&tmp, "%s-%d-remote", proc.nspace, proc.rank)) {
299+
exit(1);
300+
}
301+
if (PMIX_SUCCESS != (rc = PMIx_Get(&proc, tmp, NULL, 0, &val))) {
302+
fprintf(stderr, "Client ns %s rank %d: PMIx_Get %s failed: %d\n", myproc.nspace, myproc.rank, tmp, rc);
303+
goto done;
304+
}
305+
if (PMIX_STRING != val->type) {
306+
fprintf(stderr, "Client ns %s rank %d: PMIx_Get %s returned wrong type: %d\n", myproc.nspace, myproc.rank, tmp, val->type);
307+
PMIX_VALUE_RELEASE(val);
308+
free(tmp);
309+
goto done;
310+
}
311+
if (0 != strcmp(val->data.string, "1234")) {
312+
fprintf(stderr, "Client ns %s rank %d: PMIx_Get %s returned wrong value: %s\n", myproc.nspace, myproc.rank, tmp, val->data.string);
313+
PMIX_VALUE_RELEASE(val);
314+
free(tmp);
315+
goto done;
316+
}
317+
fprintf(stderr, "Client ns %s rank %d: PMIx_Get %s returned correct\n", myproc.nspace, myproc.rank, tmp);
272318
PMIX_VALUE_RELEASE(val);
273319
free(tmp);
274-
goto done;
275320
}
276-
fprintf(stderr, "Client ns %s rank %d: PMIx_Get %s returned correct\n", myproc.nspace, myproc.rank, tmp);
277-
PMIX_VALUE_RELEASE(val);
278-
free(tmp);
279321
}
322+
free(localpeers);
280323

281324
done:
282325
/* finalize us */

opal/mca/pmix/pmix2x/pmix/include/pmix_common.h.in

Lines changed: 27 additions & 4 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) 2013-2017 Intel, Inc. All rights reserved.
3+
* Copyright (c) 2013-2018 Intel, Inc. All rights reserved.
44
* Copyright (c) 2016-2017 Research Organization for Information Science
55
* and Technology (RIST). All rights reserved.
66
* Copyright (c) 2016 IBM Corporation. All rights reserved.
@@ -1675,7 +1675,6 @@ PMIX_EXPORT const char* PMIx_Get_version(void);
16751675
PMIX_EXPORT pmix_status_t PMIx_Store_internal(const pmix_proc_t *proc,
16761676
const char *key, pmix_value_t *val);
16771677

1678-
16791678
/**
16801679
* Top-level interface function to pack one or more values into a
16811680
* buffer.
@@ -1694,6 +1693,17 @@ PMIX_EXPORT pmix_status_t PMIx_Store_internal(const pmix_proc_t *proc,
16941693
* will return an error code (generated upon unpacking) -
16951694
* the error cannot be detected during packing.
16961695
*
1696+
* The identity of the intended recipient of the packed buffer (i.e., the
1697+
* process that will be unpacking it) is used solely to resolve any data type
1698+
* differences between PMIx versions. The recipient must, therefore, be
1699+
* known to the user prior to calling the pack function so that the
1700+
* PMIx library is aware of the version the recipient is using.
1701+
*
1702+
* @param *target Pointer to a pmix_proc_t structure containing the
1703+
* nspace/rank of the process that will be unpacking the final buffer.
1704+
* A NULL value may be used to indicate that the target is based on
1705+
* the same PMIx version as the caller.
1706+
*
16971707
* @param *buffer A pointer to the buffer into which the value is to
16981708
* be packed.
16991709
*
@@ -1727,7 +1737,8 @@ PMIX_EXPORT pmix_status_t PMIx_Store_internal(const pmix_proc_t *proc,
17271737
* status_code = PMIx_Data_pack(buffer, &src, 1, PMIX_INT32);
17281738
* @endcode
17291739
*/
1730-
PMIX_EXPORT pmix_status_t PMIx_Data_pack(pmix_data_buffer_t *buffer,
1740+
PMIX_EXPORT pmix_status_t PMIx_Data_pack(const pmix_proc_t *target,
1741+
pmix_data_buffer_t *buffer,
17311742
void *src, int32_t num_vals,
17321743
pmix_data_type_t type);
17331744

@@ -1774,6 +1785,17 @@ PMIX_EXPORT pmix_status_t PMIx_Data_pack(pmix_data_buffer_t *buffer,
17741785
* will return an error code generated upon unpacking - these errors
17751786
* cannot be detected during packing.
17761787
*
1788+
* The identity of the source of the packed buffer (i.e., the
1789+
* process that packed it) is used solely to resolve any data type
1790+
* differences between PMIx versions. The source must, therefore, be
1791+
* known to the user prior to calling the unpack function so that the
1792+
* PMIx library is aware of the version the source used.
1793+
*
1794+
* @param *source Pointer to a pmix_proc_t structure containing the
1795+
* nspace/rank of the process that packed the provided buffer.
1796+
* A NULL value may be used to indicate that the source is based on
1797+
* the same PMIx version as the caller.
1798+
*
17771799
* @param *buffer A pointer to the buffer from which the value will be
17781800
* extracted.
17791801
*
@@ -1823,7 +1845,8 @@ PMIX_EXPORT pmix_status_t PMIx_Data_pack(pmix_data_buffer_t *buffer,
18231845
*
18241846
* @endcode
18251847
*/
1826-
PMIX_EXPORT pmix_status_t PMIx_Data_unpack(pmix_data_buffer_t *buffer, void *dest,
1848+
PMIX_EXPORT pmix_status_t PMIx_Data_unpack(const pmix_proc_t *source,
1849+
pmix_data_buffer_t *buffer, void *dest,
18271850
int32_t *max_num_values,
18281851
pmix_data_type_t type);
18291852

opal/mca/pmix/pmix2x/pmix/include/pmix_rename.h.in

100755100644
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2016 Intel, Inc. All rights reserved
2+
* Copyright (c) 2016-2018 Intel, Inc. All rights reserved.
33
* Copyright (c) 2016 Research Organization for Information Science
44
* and Technology (RIST). All rights reserved.
55
* $COPYRIGHT$

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

Lines changed: 10 additions & 1 deletion
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-2017 Intel, Inc. All rights reserved.
3+
* Copyright (c) 2014-2018 Intel, Inc. All rights reserved.
44
* Copyright (c) 2014-2017 Research Organization for Information Science
55
* and Technology (RIST). All rights reserved.
66
* Copyright (c) 2014 Artem Y. Polyakov <[email protected]>.
@@ -397,6 +397,8 @@ PMIX_EXPORT pmix_status_t PMIx_Init(pmix_proc_t *proc,
397397

398398
/* setup the globals */
399399
PMIX_CONSTRUCT(&pmix_client_globals.pending_requests, pmix_list_t);
400+
PMIX_CONSTRUCT(&pmix_client_globals.peers, pmix_pointer_array_t);
401+
pmix_pointer_array_init(&pmix_client_globals.peers, 1, INT_MAX, 1);
400402
pmix_client_globals.myserver = PMIX_NEW(pmix_peer_t);
401403
if (NULL == pmix_client_globals.myserver) {
402404
PMIX_RELEASE_THREAD(&pmix_global_lock);
@@ -649,6 +651,8 @@ PMIX_EXPORT pmix_status_t PMIx_Finalize(const pmix_info_t info[], size_t ninfo)
649651
size_t n;
650652
pmix_client_timeout_t tev;
651653
struct timeval tv = {2, 0};
654+
pmix_peer_t *peer;
655+
int i;
652656

653657
PMIX_ACQUIRE_THREAD(&pmix_global_lock);
654658
if (1 != pmix_globals.init_cntr) {
@@ -737,6 +741,11 @@ PMIX_EXPORT pmix_status_t PMIx_Finalize(const pmix_info_t info[], size_t ninfo)
737741
}
738742

739743
PMIX_LIST_DESTRUCT(&pmix_client_globals.pending_requests);
744+
for (i=0; i < pmix_client_globals.peers.size; i++) {
745+
if (NULL != (peer = (pmix_peer_t*)pmix_pointer_array_get_item(&pmix_client_globals.peers, i))) {
746+
PMIX_RELEASE(peer);
747+
}
748+
}
740749

741750
if (0 <= pmix_client_globals.myserver->sd) {
742751
CLOSE_THE_SOCKET(pmix_client_globals.myserver->sd);

opal/mca/pmix/pmix2x/pmix/src/client/pmix_client_ops.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2015-2017 Intel, Inc. All rights reserved.
2+
* Copyright (c) 2015-2018 Intel, Inc. All rights reserved.
33
* $COPYRIGHT$
44
*
55
* Additional copyrights may follow
@@ -15,13 +15,15 @@
1515

1616
#include "src/threads/threads.h"
1717
#include "src/class/pmix_list.h"
18+
#include "src/class/pmix_pointer_array.h"
1819
#include "src/include/pmix_globals.h"
1920

2021
BEGIN_C_DECLS
2122

2223
typedef struct {
2324
pmix_peer_t *myserver; // messaging support to/from my server
2425
pmix_list_t pending_requests; // list of pmix_cb_t pending data requests
26+
pmix_pointer_array_t peers; // array of pmix_peer_t cached for data ops
2527
} pmix_client_globals_t;
2628

2729
PMIX_EXPORT extern pmix_client_globals_t pmix_client_globals;

0 commit comments

Comments
 (0)