Skip to content

Commit 025fb3b

Browse files
authored
Merge pull request #5428 from rhc54/cmr30/px
v3.0.x: Allow support for PMIx versions > 2
2 parents c2373fc + 83912e5 commit 025fb3b

File tree

8 files changed

+77
-45
lines changed

8 files changed

+77
-45
lines changed

config/opal_check_pmi.m4

Lines changed: 32 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# Copyright (c) 2009-2015 Cisco Systems, Inc. All rights reserved.
1414
# Copyright (c) 2011-2014 Los Alamos National Security, LLC. All rights
1515
# reserved.
16-
# Copyright (c) 2014-2016 Intel, Inc. All rights reserved.
16+
# Copyright (c) 2014-2018 Intel, Inc. All rights reserved.
1717
# Copyright (c) 2014-2018 Research Organization for Information Science
1818
# and Technology (RIST). All rights reserved.
1919
# Copyright (c) 2016 IBM Corporation. All rights reserved.
@@ -251,7 +251,8 @@ AC_DEFUN([OPAL_CHECK_PMIX],[
251251
opal_external_have_pmix1=0
252252
AS_IF([test -z "$with_pmix" || test "$with_pmix" = "yes" || test "$with_pmix" = "internal"],
253253
[AC_MSG_RESULT([no])
254-
opal_external_pmix_happy=no],
254+
opal_external_pmix_happy=no
255+
opal_external_pmix_version=internal],
255256
256257
[AC_MSG_RESULT([yes])
257258
# check for external pmix lib */
@@ -266,27 +267,35 @@ AC_DEFUN([OPAL_CHECK_PMIX],[
266267
[AC_MSG_CHECKING([libpmix.* in $with_pmix_libdir])
267268
files=`ls $with_pmix_libdir/libpmix.* 2> /dev/null | wc -l`
268269
AS_IF([test "$files" -gt 0],
269-
[pmix_ext_install_libdir=$with_pmix_libdir],
270-
[AC_MSG_CHECKING([libpmix.* in $with_pmix_libdir/lib64])
270+
[AC_MSG_RESULT([found])
271+
pmix_ext_install_libdir=$with_pmix_libdir],
272+
[AC_MSG_RESULT([not found])
273+
AC_MSG_CHECKING([libpmix.* in $with_pmix_libdir/lib64])
271274
files=`ls $with_pmix_libdir/lib64/libpmix.* 2> /dev/null | wc -l`
272275
AS_IF([test "$files" -gt 0],
273-
[pmix_ext_install_libdir=$with_pmix_libdir/lib64],
274-
[AC_MSG_CHECKING([libpmix.* in $with_pmix_libdir/lib])
276+
[AC_MSG_RESULT([found])
277+
pmix_ext_install_libdir=$with_pmix_libdir/lib64],
278+
[AC_MSG_RESULT([not found])
279+
AC_MSG_CHECKING([libpmix.* in $with_pmix_libdir/lib])
275280
files=`ls $with_pmix_libdir/lib/libpmix.* 2> /dev/null | wc -l`
276281
AS_IF([test "$files" -gt 0],
277-
[pmix_ext_install_libdir=$with_pmix_libdir/lib],
282+
[AC_MSG_RESULT([found])
283+
pmix_ext_install_libdir=$with_pmix_libdir/lib],
278284
[AC_MSG_RESULT([not found])
279285
AC_MSG_ERROR([Cannot continue])])])])],
280286
[# check for presence of lib64 directory - if found, see if the
281287
# desired library is present and matches our build requirements
282288
AC_MSG_CHECKING([libpmix.* in $pmix_ext_install_dir/lib64])
283289
files=`ls $pmix_ext_install_dir/lib64/libpmix.* 2> /dev/null | wc -l`
284290
AS_IF([test "$files" -gt 0],
285-
[pmix_ext_install_libdir=$pmix_ext_install_dir/lib64],
286-
[AC_MSG_CHECKING([libpmix.* in $pmix_ext_install_dir/lib])
291+
[AC_MSG_RESULT([found])
292+
pmix_ext_install_libdir=$pmix_ext_install_dir/lib64],
293+
[AC_MSG_RESULT([not found])
294+
AC_MSG_CHECKING([libpmix.* in $pmix_ext_install_dir/lib])
287295
files=`ls $pmix_ext_install_dir/lib/libpmix.* 2> /dev/null | wc -l`
288296
AS_IF([test "$files" -gt 0],
289-
[pmix_ext_install_libdir=$pmix_ext_install_dir/lib],
297+
[AC_MSG_RESULT([found])
298+
pmix_ext_install_libdir=$pmix_ext_install_dir/lib],
290299
[AC_MSG_RESULT([not found])
291300
AC_MSG_ERROR([Cannot continue])])])])
292301
@@ -301,33 +310,21 @@ AC_DEFUN([OPAL_CHECK_PMIX],[
301310
CPPFLAGS="-I$pmix_ext_install_dir/include $CPPFLAGS"
302311
AS_IF([test "x`ls $pmix_ext_install_dir/include/pmix_version.h 2> /dev/null`" = "x"],
303312
[AC_MSG_RESULT([version file not found - assuming v1.1.4])
304-
opal_external_pmix_version_found=1
305-
opal_external_pmix_version=114
306-
opal_external_have_pmix1=1],
313+
AC_MSG_WARN([External PMIx support requested, but version])
314+
AC_MSG_WARN([of the external lib is less than the minimum])
315+
AC_MSG_WARN([v1.2.x required by Open MPI.])
316+
AC_MSG_ERROR([cannot continue])],
307317
[AC_MSG_RESULT([version file found])
308318
opal_external_pmix_version_found=0])
309319
310320
# if it does exist, then we need to parse it to find
311321
# the actual release series
312322
AS_IF([test "$opal_external_pmix_version_found" = "0"],
313-
[AC_MSG_CHECKING([version 3x])
314-
AC_PREPROC_IFELSE([AC_LANG_PROGRAM([
315-
#include <pmix_version.h>
316-
#if (PMIX_VERSION_MAJOR != 3L)
317-
#error "not version 3"
318-
#endif
319-
], [])],
320-
[AC_MSG_RESULT([found])
321-
opal_external_pmix_version=3x
322-
opal_external_pmix_version_found=1],
323-
[AC_MSG_RESULT([not found])])])
324-
325-
AS_IF([test "$opal_external_pmix_version_found" = "0"],
326-
[AC_MSG_CHECKING([version 2x])
323+
[AC_MSG_CHECKING([version 2x or above])
327324
AC_PREPROC_IFELSE([AC_LANG_PROGRAM([
328325
#include <pmix_version.h>
329-
#if (PMIX_VERSION_MAJOR != 2L)
330-
#error "not version 2"
326+
#if (PMIX_VERSION_MAJOR < 2L)
327+
#error "not version 2 or above"
331328
#endif
332329
], [])],
333330
[AC_MSG_RESULT([found])
@@ -339,7 +336,7 @@ AC_DEFUN([OPAL_CHECK_PMIX],[
339336
[AC_MSG_CHECKING([version 1x])
340337
AC_PREPROC_IFELSE([AC_LANG_PROGRAM([
341338
#include <pmix_version.h>
342-
#if (PMIX_VERSION_MAJOR != 1L)
339+
#if (PMIX_VERSION_MAJOR != 1L && PMIX_VERSION_MINOR != 2L)
343340
#error "not version 1"
344341
#endif
345342
], [])],
@@ -367,5 +364,10 @@ AC_DEFUN([OPAL_CHECK_PMIX],[
367364
368365
AC_DEFINE_UNQUOTED([OPAL_PMIX_V1],[$opal_external_have_pmix1],
369366
[Whether the external PMIx library is v1])
367+
368+
AS_IF([test "$opal_external_pmix_version" = "1x"],
369+
[OPAL_SUMMARY_ADD([[Miscellaneous]],[[PMIx support]], [opal_pmix], [1.2.x: WARNING - DYNAMIC OPS NOT SUPPORTED])],
370+
[OPAL_SUMMARY_ADD([[Miscellaneous]],[[PMIx support]], [opal_pmix], [$opal_external_pmix_version])])
371+
370372
OPAL_VAR_SCOPE_POP
371373
])

opal/mca/pmix/pmix2x/pmix/NEWS

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,14 @@ 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.2 -- TBD
24+
2.1.3 -- TBD
25+
----------------------
26+
- Fixed memory corruption bug in event notification
27+
system due to uninitialized variable
28+
- Add numeric version definition
29+
30+
31+
2.1.2 -- 6 July 2018
2532
----------------------
2633
- Added PMIX_VERSION_RELEASE string to pmix_version.h
2734
- Added PMIX_SPAWNED and PMIX_PARENT_ID keys to all procs

opal/mca/pmix/pmix2x/pmix/VERSION

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

1616
major=2
1717
minor=1
18-
release=2
18+
release=3
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
2222
# numeric. Common examples include a1 (alpha release 1), b1 or (beta release 1).
2323
# The only requirement is that it must be entirely printable ASCII
2424
# characters and have no white space.
2525

26-
greek=
26+
greek=rc1
2727

2828
# If repo_rev is empty, then the repository version number will be
2929
# obtained during "make dist" via the "git describe --tags --always"
@@ -44,7 +44,7 @@ tarball_version=
4444

4545
# The date when this release was created
4646

47-
date="Jul 01, 2018"
47+
date="Jul 19, 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="Jul 01, 2018"
7575
# Version numbers are described in the Libtool current:revision:age
7676
# format.
7777

78-
libpmix_so_version=3:12:1
78+
libpmix_so_version=3:13:1
7979
libpmi_so_version=1:0:0
8080
libpmi2_so_version=1:0:0

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.2
195+
Version: 2.1.3rc1
196196
Release: 1%{?dist}
197197
License: BSD
198198
Group: Development/Libraries

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,7 @@
1818
#define PMIX_VERSION_MAJOR @pmixmajor@
1919
#define PMIX_VERSION_MINOR @pmixminor@
2020
#define PMIX_VERSION_RELEASE @pmixrelease@
21+
22+
#define PMIX_NUMERIC_VERSION 0x00020103
23+
2124
#endif

opal/mca/pmix/pmix2x/pmix/src/event/pmix_event_notification.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -198,8 +198,8 @@ static pmix_status_t notify_server_of_event(pmix_status_t status,
198198
for (n=0; n < cd->ninfo; n++) {
199199
PMIX_INFO_XFER(&cd->info[n], &chain->info[n]);
200200
if (0 == strncmp(cd->info[n].key, PMIX_EVENT_NON_DEFAULT, PMIX_MAX_KEYLEN)) {
201-
cd->nondefault = true;
202-
chain->nondefault = true;
201+
cd->nondefault = PMIX_INFO_TRUE(&info[n]);
202+
chain->nondefault = cd->nondefault;
203203
} else if (0 == strncmp(cd->info[n].key, PMIX_EVENT_CUSTOM_RANGE, PMIX_MAX_KEYLEN)) {
204204
/* provides an array of pmix_proc_t identifying the procs
205205
* that are to receive this notification, or a single pmix_proc_t */
@@ -972,8 +972,8 @@ static void _notify_client_event(int sd, short args, void *cbdata)
972972
for (n=0; n < cd->ninfo; n++) {
973973
PMIX_INFO_XFER(&chain->info[n], &cd->info[n]);
974974
if (0 == strncmp(cd->info[n].key, PMIX_EVENT_NON_DEFAULT, PMIX_MAX_KEYLEN)) {
975-
cd->nondefault = true;
976-
chain->nondefault = true;
975+
cd->nondefault = PMIX_INFO_TRUE(&cd->info[n]);
976+
chain->nondefault = cd->nondefault;
977977
} else if (0 == strncmp(cd->info[n].key, PMIX_EVENT_CUSTOM_RANGE, PMIX_MAX_KEYLEN)) {
978978
/* provides an array of pmix_proc_t identifying the procs
979979
* that are to receive this notification, or a single pmix_proc_t */
@@ -1087,7 +1087,7 @@ pmix_status_t pmix_server_notify_client_of_event(pmix_status_t status,
10871087
if (NULL != info) {
10881088
for (n=0; n < ninfo; n++) {
10891089
if (0 == strncmp(info[n].key, PMIX_EVENT_NON_DEFAULT, PMIX_MAX_KEYLEN)) {
1090-
cd->nondefault = true;
1090+
cd->nondefault = PMIX_INFO_TRUE(&info[n]);
10911091
} else if (0 == strncmp(info[n].key, PMIX_EVENT_CUSTOM_RANGE, PMIX_MAX_KEYLEN)) {
10921092
/* provides an array of pmix_proc_t identifying the procs
10931093
* that are to receive this notification, or a single pmix_proc_t */

opal/mca/pmix/pmix2x/pmix/src/event/pmix_event_registration.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -391,11 +391,11 @@ static void check_cached_events(pmix_rshift_caddy_t *cd)
391391
chain->status = ncd->status;
392392
(void)strncpy(chain->source.nspace, pmix_globals.myid.nspace, PMIX_MAX_NSLEN);
393393
chain->source.rank = pmix_globals.myid.rank;
394-
/* we already left space for evhandler name plus
395-
* a callback object when we cached the notification */
396-
chain->ninfo = ncd->ninfo;
397-
PMIX_INFO_CREATE(chain->info, chain->ninfo);
394+
/* we always leave space for event hdlr name and a callback object */
395+
chain->nallocated = ncd->ninfo + 2;
396+
PMIX_INFO_CREATE(chain->info, chain->nallocated);
398397
if (0 < cd->ninfo) {
398+
chain->ninfo = ncd->ninfo;
399399
/* need to copy the info */
400400
for (n=0; n < ncd->ninfo; n++) {
401401
PMIX_INFO_XFER(&chain->info[n], &ncd->info[n]);

orte/orted/pmix/pmix_server_gen.c

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -355,6 +355,17 @@ void pmix_server_notify(int status, orte_process_name_t* sender,
355355
}
356356
}
357357

358+
/* protect against infinite loops by marking that this notification was
359+
* passed down to the server by me */
360+
if (NULL == cd->info) {
361+
cd->info = OBJ_NEW(opal_list_t);
362+
}
363+
val = OBJ_NEW(opal_value_t);
364+
val->key = strdup("orte.notify.donotloop");
365+
val->type = OPAL_BOOL;
366+
val->data.flag = true;
367+
opal_list_append(cd->info, &val->super);
368+
358369
opal_output_verbose(2, orte_pmix_server_globals.output,
359370
"%s NOTIFYING PMIX SERVER OF STATUS %d",
360371
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME), ret);
@@ -381,6 +392,14 @@ int pmix_server_notify_event(int code, opal_process_name_t *source,
381392
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),
382393
ORTE_NAME_PRINT(source), code);
383394

395+
/* check to see if this is one we sent down */
396+
OPAL_LIST_FOREACH(val, info, opal_value_t) {
397+
if (0 == strcmp(val->key, "orte.notify.donotloop")) {
398+
/* yep - do not process */
399+
goto done;
400+
}
401+
}
402+
384403
/* a local process has generated an event - we need to xcast it
385404
* to all the daemons so it can be passed down to their local
386405
* procs */
@@ -447,6 +466,7 @@ int pmix_server_notify_event(int code, opal_process_name_t *source,
447466
/* maintain accounting */
448467
OBJ_RELEASE(sig);
449468

469+
done:
450470
/* execute the callback */
451471
if (NULL != cbfunc) {
452472
cbfunc(ORTE_SUCCESS, cbdata);

0 commit comments

Comments
 (0)