Skip to content

Commit d1e4a0f

Browse files
authored
Merge pull request #4831 from rhc54/cmr31/pmixup
v3.1.x: Sync to PMIx v2.1.1
2 parents f80e0b7 + 3f536cb commit d1e4a0f

File tree

18 files changed

+231
-131
lines changed

18 files changed

+231
-131
lines changed

opal/mca/pmix/pmix2x/pmix/NEWS

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,18 @@ 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.1 -- 23 Feb 2018
25+
----------------------
26+
- Fix direct modex when receiving new nspace
27+
- Resolve direct modex of job-level info
28+
- Fix a bug in attribute configuration checks
29+
- Fix a couple of bugs in unpacking of direct modex job-level data
30+
- Correcly handle application setup data during "instant on" launch
31+
- add a PMIX_BYTE_OBJECT_LOAD convenience macro
32+
- Fix two early "free" bugs
33+
- Add an example PMI-1 client program
34+
35+
2436
2.1.0 -- 1 Feb 2018
2537
----------------------
2638
**** NOTE: This release contains the first implementation of cross-version

opal/mca/pmix/pmix2x/pmix/VERSION

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
major=2
1717
minor=1
18-
release=0
18+
release=1
1919

2020
# greek is used for alpha or beta release tags. If it is non-empty,
2121
# it will be appended to the version number. It does not have to be
@@ -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=git79b2db3
33+
repo_rev=git30cbf9f
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="Feb 01, 2018"
47+
date="Feb 18, 2018"
4848

4949
# The shared library version of each of PMIx's public libraries.
5050
# These versions are maintained in accordance with the "Library
@@ -75,6 +75,6 @@ date="Feb 01, 2018"
7575
# Version numbers are described in the Libtool current:revision:age
7676
# format.
7777

78-
libpmix_so_version=3:10:1
78+
libpmix_so_version=3:11:1
7979
libpmi_so_version=1:0:0
8080
libpmi2_so_version=1:0:0

opal/mca/pmix/pmix2x/pmix/config/pmix_check_attributes.m4

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# -*- shell-script -*-
22
# PMIx copyrights:
3-
# Copyright (c) 2013 Intel, Inc. All rights reserved
3+
# Copyright (c) 2013-2018 Intel, Inc. All rights reserved.
44
#
55
#########################
66
#
@@ -15,7 +15,7 @@
1515
# Copyright (c) 2004-2005 The Regents of the University of California.
1616
# All rights reserved.
1717
# Copyright (c) 2009 Oak Ridge National Labs. All rights reserved.
18-
# Copyright (c) 2010-2015 Cisco Systems, Inc. All rights reserved.
18+
# Copyright (c) 2010-2018 Cisco Systems, Inc. All rights reserved.
1919
# Copyright (c) 2013 Mellanox Technologies, Inc.
2020
# All rights reserved.
2121
# Copyright (c) 2015 Intel, Inc. All rights reserved.
@@ -170,6 +170,8 @@ AC_DEFUN([PMIX_CHECK_ATTRIBUTES], [
170170
pmix_cv___attribute__visibility=0
171171
pmix_cv___attribute__warn_unused_result=0
172172
pmix_cv___attribute__destructor=0
173+
pmix_cv___attribute__optnone=0
174+
pmix_cv___attribute__extension=0
173175
else
174176
AC_MSG_RESULT([yes])
175177

@@ -486,6 +488,21 @@ AC_DEFUN([PMIX_CHECK_ATTRIBUTES], [
486488
],
487489
[],
488490
[])
491+
492+
_PMIX_CHECK_SPECIFIC_ATTRIBUTE([optnone],
493+
[
494+
void __attribute__ ((__optnone__)) foo(void);
495+
void foo(void) { return ; }
496+
],
497+
[],
498+
[])
499+
500+
_PMIX_CHECK_SPECIFIC_ATTRIBUTE([extension],
501+
[
502+
int i = __extension__ 3;
503+
],
504+
[],
505+
[])
489506
fi
490507

491508
# Now that all the values are set, define them
@@ -536,4 +553,8 @@ AC_DEFUN([PMIX_CHECK_ATTRIBUTES], [
536553
[Whether your compiler has __attribute__ weak alias or not])
537554
AC_DEFINE_UNQUOTED(PMIX_HAVE_ATTRIBUTE_DESTRUCTOR, [$pmix_cv___attribute__destructor],
538555
[Whether your compiler has __attribute__ destructor or not])
556+
AC_DEFINE_UNQUOTED(PMIX_HAVE_ATTRIBUTE_OPTNONE, [$pmix_cv___attribute__optnone],
557+
[Whether your compiler has __attribute__ optnone or not])
558+
AC_DEFINE_UNQUOTED(PMIX_HAVE_ATTRIBUTE_EXTENSION, [$pmix_cv___attribute__extension],
559+
[Whether your compiler has __attribute__ extension or not])
539560
])

opal/mca/pmix/pmix2x/pmix/contrib/pmix.spec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@
192192

193193
Summary: An extended/exascale implementation of PMI
194194
Name: %{?_name:%{_name}}%{!?_name:pmix}
195-
Version: 2.1.0
195+
Version: 2.1.1
196196
Release: 1%{?dist}
197197
License: BSD
198198
Group: Development/Libraries

opal/mca/pmix/pmix2x/pmix/contrib/pmix_jenkins.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -395,4 +395,3 @@ if [ -n "$JENKINS_RUN_TESTS" -a "$JENKINS_RUN_TESTS" -ne "0" ]; then
395395
set -e
396396
fi
397397
fi
398-

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

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -755,6 +755,20 @@ typedef struct pmix_byte_object {
755755
char *bytes;
756756
size_t size;
757757
} pmix_byte_object_t;
758+
#define PMIX_BYTE_OBJECT_CREATE(m, n) \
759+
do { \
760+
(m) = (pmix_byte_object_t*)malloc((n) * sizeof(pmix_byte_object_t)); \
761+
if (NULL != (m)) { \
762+
memset((m), 0, (n)*sizeof(pmix_byte_object_t)); \
763+
} \
764+
} while(0)
765+
766+
#define PMIX_BYTE_OBJECT_CONSTRUCT(m) \
767+
do { \
768+
(m)->bytes = NULL; \
769+
(m)->size = 0; \
770+
} while(0)
771+
758772
#define PMIX_BYTE_OBJECT_DESTRUCT(m) \
759773
do { \
760774
if (NULL != (m)->bytes) { \
@@ -773,6 +787,14 @@ typedef struct pmix_byte_object {
773787
free((m)); \
774788
} while(0)
775789

790+
#define PMIX_BYTE_OBJECT_LOAD(b, d, s) \
791+
do { \
792+
(b)->bytes = (d); \
793+
(d) = NULL; \
794+
(b)->size = (s); \
795+
(s) = 0; \
796+
} while(0)
797+
776798

777799
/**** PMIX DATA BUFFER ****/
778800
typedef struct pmix_data_buffer {

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

Lines changed: 7 additions & 7 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-2017 Intel, Inc. All rights reserved.
3+
* Copyright (c) 2014-2018 Intel, Inc. All rights reserved.
44
* Copyright (c) 2014-2015 Research Organization for Information Science
55
* and Technology (RIST). All rights reserved.
66
* Copyright (c) 2014 Artem Y. Polyakov <[email protected]>.
@@ -564,15 +564,19 @@ static void wait_lookup_cbfunc(struct pmix_peer_t *pr,
564564
pmix_cb_t *cb = (pmix_cb_t*)cbdata;
565565
pmix_status_t rc, ret;
566566
int32_t cnt;
567-
pmix_pdata_t *pdata = NULL;
568-
size_t ndata = 0;
567+
pmix_pdata_t *pdata;
568+
size_t ndata;
569569

570570
PMIX_ACQUIRE_OBJECT(cb);
571571

572572
pmix_output_verbose(2, pmix_globals.debug_output,
573573
"pmix:client recv callback activated with %d bytes",
574574
(NULL == buf) ? -1 : (int)buf->bytes_used);
575575

576+
/* set the defaults */
577+
pdata = NULL;
578+
ndata = 0;
579+
576580
if (NULL == cb->cbfunc.lookupfn) {
577581
/* nothing we can do with this */
578582
PMIX_RELEASE(cb);
@@ -589,10 +593,6 @@ static void wait_lookup_cbfunc(struct pmix_peer_t *pr,
589593
goto report;
590594
}
591595

592-
/* set the defaults */
593-
pdata = NULL;
594-
ndata = 0;
595-
596596
/* unpack the returned status */
597597
cnt = 1;
598598
PMIX_BFROPS_UNPACK(rc, pmix_client_globals.myserver,

opal/mca/pmix/pmix2x/pmix/src/include/pmix_globals.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ BEGIN_C_DECLS
5252

5353
/* internal-only attributes */
5454
#define PMIX_BFROPS_MODULE "pmix.bfrops.mod" // (char*) name of bfrops plugin in-use by a given nspace
55+
#define PMIX_PNET_SETUP_APP "pmix.pnet.setapp" // (pmix_byte_object_t) blob containing info to be given to
56+
// pnet framework on remote nodes
5557

5658
/* define an internal-only process name that has
5759
* a dynamically-sized nspace field to save memory */

opal/mca/pmix/pmix2x/pmix/src/mca/base/pmix_mca_base_var_group.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* Copyright (c) 2008-2013 Cisco Systems, Inc. All rights reserved.
1414
* Copyright (c) 2012-2015 Los Alamos National Security, LLC. All rights
1515
* reserved.
16-
* Copyright (c) 2016 Intel, Inc. All rights reserved
16+
* Copyright (c) 2016-2018 Intel, Inc. All rights reserved.
1717
* $COPYRIGHT$
1818
*
1919
* Additional copyrights may follow
@@ -315,7 +315,7 @@ int pmix_mca_base_var_group_component_register (const pmix_mca_base_component_t
315315
const char *description)
316316
{
317317
/* 1.7 components do not store the project */
318-
return group_register (NULL, component->pmix_mca_type_name,
318+
return group_register (component->pmix_mca_project_name, component->pmix_mca_type_name,
319319
component->pmix_mca_component_name, description);
320320
}
321321

opal/mca/pmix/pmix2x/pmix/src/mca/gds/ds12/gds_dstore.c

Lines changed: 9 additions & 18 deletions
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 (c) 2016 IBM Corporation. All rights reserved.
44
* Copyright (c) 2016-2017 Mellanox Technologies, Inc.
55
* All rights reserved.
@@ -2995,44 +2995,35 @@ static pmix_status_t dstore_store_modex(struct pmix_nspace_t *nspace,
29952995
pmix_byte_object_t *bo)
29962996
{
29972997
pmix_nspace_t *ns = (pmix_nspace_t*)nspace;
2998-
pmix_server_caddy_t *scd;
29992998
pmix_status_t rc = PMIX_SUCCESS;
30002999
int32_t cnt;
30013000
pmix_buffer_t pbkt;
30023001
pmix_proc_t proc;
30033002
pmix_kval_t *kv;
3004-
pmix_peer_t *peer;
30053003

30063004
pmix_output_verbose(2, pmix_gds_base_framework.framework_output,
30073005
"[%s:%d] gds:dstore:store_modex for nspace %s",
30083006
pmix_globals.myid.nspace, pmix_globals.myid.rank,
30093007
ns->nspace);
30103008

3009+
/* NOTE: THE BYTE OBJECT DELIVERED HERE WAS CONSTRUCTED
3010+
* BY A SERVER, AND IS THEREFORE PACKED USING THE SERVER'S
3011+
* PEER OBJECT (WHICH IS REQUIRED TO BE THE SAME AS OUR OWN) */
3012+
30113013
/* this is data returned via the PMIx_Fence call when
30123014
* data collection was requested, so it only contains
30133015
* REMOTE/GLOBAL data. The byte object contains
30143016
* the rank followed by pmix_kval_t's. The list of callbacks
30153017
* contains all local participants. */
3016-
peer = NULL;
3017-
PMIX_LIST_FOREACH(scd, cbs, pmix_server_caddy_t) {
3018-
if (scd->peer->nptr == ns) {
3019-
peer = scd->peer;
3020-
break;
3021-
}
3022-
}
3023-
if (NULL == peer) {
3024-
/* we can ignore this one */
3025-
return PMIX_SUCCESS;
3026-
}
30273018

30283019
/* setup the byte object for unpacking */
30293020
PMIX_CONSTRUCT(&pbkt, pmix_buffer_t);
30303021
/* the next step unfortunately NULLs the byte object's
30313022
* entries, so we need to ensure we restore them! */
3032-
PMIX_LOAD_BUFFER(peer, &pbkt, bo->bytes, bo->size);
3023+
PMIX_LOAD_BUFFER(pmix_globals.mypeer, &pbkt, bo->bytes, bo->size);
30333024
/* unload the proc that provided this data */
30343025
cnt = 1;
3035-
PMIX_BFROPS_UNPACK(rc, peer, &pbkt, &proc, &cnt, PMIX_PROC);
3026+
PMIX_BFROPS_UNPACK(rc, pmix_globals.mypeer, &pbkt, &proc, &cnt, PMIX_PROC);
30363027
if (PMIX_SUCCESS != rc) {
30373028
PMIX_ERROR_LOG(rc);
30383029
bo->bytes = pbkt.base_ptr;
@@ -3052,7 +3043,7 @@ static pmix_status_t dstore_store_modex(struct pmix_nspace_t *nspace,
30523043
/* unpack the remaining values until we hit the end of the buffer */
30533044
cnt = 1;
30543045
kv = PMIX_NEW(pmix_kval_t);
3055-
PMIX_BFROPS_UNPACK(rc, peer, &pbkt, kv, &cnt, PMIX_KVAL);
3046+
PMIX_BFROPS_UNPACK(rc, pmix_globals.mypeer, &pbkt, kv, &cnt, PMIX_KVAL);
30563047
while (PMIX_SUCCESS == rc) {
30573048
/* store this in the hash table */
30583049
PMIX_GDS_STORE_KV(rc, pmix_globals.mypeer, &proc, PMIX_REMOTE, kv);
@@ -3071,7 +3062,7 @@ static pmix_status_t dstore_store_modex(struct pmix_nspace_t *nspace,
30713062
/* continue along */
30723063
kv = PMIX_NEW(pmix_kval_t);
30733064
cnt = 1;
3074-
PMIX_BFROPS_UNPACK(rc, peer, &pbkt, kv, &cnt, PMIX_KVAL);
3065+
PMIX_BFROPS_UNPACK(rc, pmix_globals.mypeer, &pbkt, kv, &cnt, PMIX_KVAL);
30753066
}
30763067
PMIX_RELEASE(kv); // maintain accounting
30773068
if (PMIX_ERR_UNPACK_READ_PAST_END_OF_BUFFER != rc) {

opal/mca/pmix/pmix2x/pmix/src/mca/preg/native/preg_native.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -699,7 +699,7 @@ static pmix_status_t resolve_nodes(const char *nspace,
699699
pmix_proc_t proc;
700700

701701
cb = PMIX_NEW(pmix_cb_t);
702-
cb->pname.nspace = (char*)nspace;
702+
cb->pname.nspace = strdup(nspace);
703703

704704
PMIX_THREADSHIFT(cb, _resolve_nodes);
705705

opal/mca/pmix/pmix2x/pmix/src/mca/ptl/base/ptl_base_sendrecv.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,7 @@ void pmix_ptl_base_lost_connection(pmix_peer_t *peer, pmix_status_t err)
122122
}
123123
/* reduce the number of local procs */
124124
--peer->nptr->nlocalprocs;
125-
/* now decrease the refcount - might actually free the object */
126-
PMIX_RELEASE(peer->info);
125+
127126
/* remove this client from our array */
128127
pmix_pointer_array_set_item(&pmix_server_globals.clients,
129128
peer->index, NULL);
@@ -148,6 +147,10 @@ void pmix_ptl_base_lost_connection(pmix_peer_t *peer, pmix_status_t err)
148147
* an event. If not, then we do */
149148
PMIX_REPORT_EVENT(err, peer, PMIX_RANGE_NAMESPACE, _notify_complete);
150149
}
150+
/* now decrease the refcount - might actually free the object */
151+
PMIX_RELEASE(peer->info);
152+
153+
/* Release peer info */
151154
PMIX_RELEASE(peer);
152155
} else {
153156
/* if I am a client, there is only

opal/mca/pmix/pmix2x/pmix/src/server/pmix_server.c

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1256,11 +1256,12 @@ static void _setup_op(pmix_status_t rc, void *cbdata)
12561256
static void _setup_app(int sd, short args, void *cbdata)
12571257
{
12581258
pmix_setup_caddy_t *cd = (pmix_setup_caddy_t*)cbdata;
1259+
pmix_buffer_t buffer;
1260+
pmix_byte_object_t blob;
12591261
pmix_setup_caddy_t *fcd = NULL;
12601262
pmix_status_t rc;
12611263
pmix_list_t ilist;
12621264
pmix_kval_t *kv;
1263-
size_t n;
12641265

12651266
PMIX_ACQUIRE_OBJECT(cd);
12661267

@@ -1279,21 +1280,31 @@ static void _setup_app(int sd, short args, void *cbdata)
12791280
goto depart;
12801281
}
12811282

1282-
/* if anything came back, construct the info array */
1283-
if (0 < (fcd->ninfo = pmix_list_get_size(&ilist))) {
1284-
PMIX_INFO_CREATE(fcd->info, fcd->ninfo);
1285-
n = 0;
1283+
/* if anything came back, construct the blob */
1284+
if (0 < pmix_list_get_size(&ilist)) {
1285+
PMIX_CONSTRUCT(&buffer, pmix_buffer_t);
12861286
PMIX_LIST_FOREACH(kv, &ilist, pmix_kval_t) {
1287-
(void)strncpy(fcd->info[n].key, kv->key, PMIX_MAX_KEYLEN);
1288-
PMIX_BFROPS_VALUE_XFER(rc, pmix_globals.mypeer,
1289-
&fcd->info[n].value, kv->value);
1287+
PMIX_BFROPS_PACK(rc, pmix_globals.mypeer, &buffer, kv, 1, PMIX_KVAL);
12901288
if (PMIX_SUCCESS != rc) {
1291-
PMIX_INFO_FREE(fcd->info, fcd->ninfo);
1289+
PMIX_DESTRUCT(&blob);
12921290
PMIX_RELEASE(fcd);
12931291
fcd = NULL;
12941292
goto depart;
12951293
}
12961294
}
1295+
PMIX_INFO_CREATE(fcd->info, 1);
1296+
if (NULL == fcd->info) {
1297+
PMIX_DESTRUCT(&blob);
1298+
PMIX_RELEASE(fcd);
1299+
fcd = NULL;
1300+
goto depart;
1301+
}
1302+
fcd->ninfo = 1;
1303+
PMIX_BYTE_OBJECT_CONSTRUCT(&blob);
1304+
PMIX_BYTE_OBJECT_LOAD(&blob, buffer.base_ptr, buffer.bytes_used);
1305+
PMIX_DESTRUCT(&buffer);
1306+
PMIX_INFO_LOAD(&fcd->info[0], PMIX_PNET_SETUP_APP, &blob, PMIX_BYTE_OBJECT);
1307+
PMIX_BYTE_OBJECT_DESTRUCT(&blob);
12971308
}
12981309

12991310
depart:

0 commit comments

Comments
 (0)