From 9f73974fe1cfd616c5f8a9e5a23f33eb14c08414 Mon Sep 17 00:00:00 2001 From: Ralph Castain Date: Wed, 12 Apr 2017 12:34:27 -0700 Subject: [PATCH] Update to latest PMIx master, including disabling the pmi-1 and pmi-2 backward compatibility as these interfere with the s1,s2 components Signed-off-by: Ralph Castain --- opal/mca/pmix/pmix2x/configure.m4 | 2 +- opal/mca/pmix/pmix2x/pmix/VERSION | 6 +- opal/mca/pmix/pmix2x/pmix/config/pmix.m4 | 18 ++- opal/mca/pmix/pmix2x/pmix/examples/debugger.c | 3 +- opal/mca/pmix/pmix2x/pmix/include/Makefile.am | 8 +- .../pmix2x/pmix/src/client/Makefile.include | 4 +- .../pmix2x/pmix/src/client/pmix_client_get.c | 2 +- .../pmix/src/event/pmix_event_notification.c | 4 +- .../pmix/src/event/pmix_event_registration.c | 119 ++++++++++-------- opal/mca/pmix/pmix2x/pmix/src/util/compress.h | 4 +- opal/mca/pmix/pmix2x/pmix/test/Makefile.am | 11 +- 11 files changed, 108 insertions(+), 73 deletions(-) diff --git a/opal/mca/pmix/pmix2x/configure.m4 b/opal/mca/pmix/pmix2x/configure.m4 index 043cf361b0..37c422a963 100644 --- a/opal/mca/pmix/pmix2x/configure.m4 +++ b/opal/mca/pmix/pmix2x/configure.m4 @@ -61,7 +61,7 @@ AC_DEFUN([MCA_opal_pmix_pmix2x_CONFIG],[ opal_pmix_pmix2x_timing_flag=--disable-pmix-timing fi - opal_pmix_pmix2x_args="--with-pmix-symbol-rename=OPAL_MCA_PMIX2X_ $opal_pmix_pmix2x_sm_flag $opal_pmix_pmix2x_timing_flag --without-tests-examples --disable-visibility --enable-embedded-libevent --with-libevent-header=\\\"opal/mca/event/$opal_event_base_include\\\"" + opal_pmix_pmix2x_args="--with-pmix-symbol-rename=OPAL_MCA_PMIX2X_ $opal_pmix_pmix2x_sm_flag $opal_pmix_pmix2x_timing_flag --without-tests-examples --disable-pmix-backward-compatibility --disable-visibility --enable-embedded-libevent --with-libevent-header=\\\"opal/mca/event/$opal_event_base_include\\\"" AS_IF([test "$enable_debug" = "yes"], [opal_pmix_pmix2x_args="--enable-debug $opal_pmix_pmix2x_args" CFLAGS="$OPAL_CFLAGS_BEFORE_PICKY $OPAL_VISIBILITY_CFLAGS -g"], diff --git a/opal/mca/pmix/pmix2x/pmix/VERSION b/opal/mca/pmix/pmix2x/pmix/VERSION index 578c46cfb2..b7a9149522 100644 --- a/opal/mca/pmix/pmix2x/pmix/VERSION +++ b/opal/mca/pmix/pmix2x/pmix/VERSION @@ -23,14 +23,14 @@ release=0 # The only requirement is that it must be entirely printable ASCII # characters and have no white space. -greek=a1 +greek= # If repo_rev is empty, then the repository version number will be # obtained during "make dist" via the "git describe --tags --always" # command, or with the date (if "git describe" fails) in the form of # "date". -repo_rev=gitc442ba8 +repo_rev=git198a2b0 # If tarball_version is not empty, it is used as the version string in # the tarball filename, regardless of all other versions listed in @@ -44,7 +44,7 @@ tarball_version= # The date when this release was created -date="Apr 02, 2017" +date="Apr 12, 2017" # The shared library version of each of PMIx's public libraries. # These versions are maintained in accordance with the "Library diff --git a/opal/mca/pmix/pmix2x/pmix/config/pmix.m4 b/opal/mca/pmix/pmix2x/pmix/config/pmix.m4 index 8a0bc0abad..236a9fd924 100644 --- a/opal/mca/pmix/pmix2x/pmix/config/pmix.m4 +++ b/opal/mca/pmix/pmix2x/pmix/config/pmix.m4 @@ -952,7 +952,7 @@ AC_MSG_RESULT([$with_ident_string]) AC_MSG_CHECKING([if want developer-level timing support]) AC_ARG_ENABLE(pmix-timing, AC_HELP_STRING([--enable-pmix-timing], - [enable developer-level timing code (default: disabled)])) + [enable PMIx developer-level timing code (default: disabled)])) if test "$enable_pmix_timing" = "yes"; then AC_MSG_RESULT([yes]) WANT_PMIX_TIMING=1 @@ -979,6 +979,21 @@ else WANT_INSTALL_HEADERS=0 fi +# +# Install backward compatibility support for PMI-1 and PMI-2 +# +AC_MSG_CHECKING([if want backward compatibility for PMI-1 and PMI-2]) +AC_ARG_ENABLE(pmix-backward-compatibility, + AC_HELP_STRING([--enable-pmix-backward-compatibility], + [enable PMIx support for PMI-1 and PMI-2 (default: enabled)])) +if test "$enable_pmix_backward_compatibility" = "no"; then + AC_MSG_RESULT([no]) + WANT_PMIX_BACKWARD=0 +else + AC_MSG_RESULT([yes]) + WANT_PMIX_BACKWARD=1 +fi + AM_CONDITIONAL([WANT_INSTALL_HEADERS], [test $WANT_INSTALL_HEADERS -eq 1]) ])dnl @@ -994,6 +1009,7 @@ AC_DEFUN([PMIX_DO_AM_CONDITIONALS],[ AM_CONDITIONAL([WANT_DSTORE], [test "x$enable_dstore" != "xno"]) AM_CONDITIONAL([WANT_PRIMARY_HEADERS], [test "x$pmix_install_primary_headers" = "xyes"]) AM_CONDITIONAL(WANT_INSTALL_HEADERS, test "$WANT_INSTALL_HEADERS" = 1) + AM_CONDITIONAL(WANT_PMIX_BACKWARD, test "$WANT_PMIX_BACKWARD" = 1) ]) pmix_did_am_conditionals=yes ])dnl diff --git a/opal/mca/pmix/pmix2x/pmix/examples/debugger.c b/opal/mca/pmix/pmix2x/pmix/examples/debugger.c index 1887c16f22..62bc8e593f 100644 --- a/opal/mca/pmix/pmix2x/pmix/examples/debugger.c +++ b/opal/mca/pmix/pmix2x/pmix/examples/debugger.c @@ -13,7 +13,7 @@ * All rights reserved. * Copyright (c) 2009-2012 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2011 Oak Ridge National Labs. All rights reserved. - * Copyright (c) 2013-2016 Intel, Inc. All rights reserved. + * Copyright (c) 2013-2017 Intel, Inc. All rights reserved. * Copyright (c) 2015 Mellanox Technologies, Inc. All rights reserved. * $COPYRIGHT$ * @@ -430,7 +430,6 @@ static void infocbfunc(pmix_status_t status, static int attach_to_running_job(char *nspace) { pmix_status_t rc; - pmix_proc_t myproc; pmix_query_t *query; size_t nq; mydbug_query_t *q; diff --git a/opal/mca/pmix/pmix2x/pmix/include/Makefile.am b/opal/mca/pmix/pmix2x/pmix/include/Makefile.am index 7a59803e51..52ad624c51 100644 --- a/opal/mca/pmix/pmix2x/pmix/include/Makefile.am +++ b/opal/mca/pmix/pmix2x/pmix/include/Makefile.am @@ -15,10 +15,14 @@ include_HEADERS = \ pmix.h \ pmix_common.h \ pmix_server.h \ - pmi.h \ - pmi2.h \ pmix_tool.h +if WANT_PMIX_BACKWARD +include_HEADERS += \ + pmi.h \ + pmi2.h +endif + nodist_include_HEADERS = \ pmix_version.h \ pmix_rename.h diff --git a/opal/mca/pmix/pmix2x/pmix/src/client/Makefile.include b/opal/mca/pmix/pmix2x/pmix/src/client/Makefile.include index 2f4fd6eeb1..e9abb45ff1 100644 --- a/opal/mca/pmix/pmix2x/pmix/src/client/Makefile.include +++ b/opal/mca/pmix/pmix2x/pmix/src/client/Makefile.include @@ -1,6 +1,6 @@ # -*- makefile -*- # -# Copyright (c) 2014-2015 Intel, Inc. All rights reserved. +# Copyright (c) 2014-2017 Intel, Inc. All rights reserved. # Copyright (c) 2014 Artem Y. Polyakov . # All rights reserved. # Copyright (c) 2016 Cisco Systems, Inc. All rights reserved. @@ -22,7 +22,7 @@ sources += \ client/pmix_client_spawn.c \ client/pmix_client_connect.c -if !PMIX_EMBEDDED_MODE +if WANT_PMIX_BACKWARD sources += \ client/pmi1.c \ client/pmi2.c diff --git a/opal/mca/pmix/pmix2x/pmix/src/client/pmix_client_get.c b/opal/mca/pmix/pmix2x/pmix/src/client/pmix_client_get.c index 034b4813c3..6abfb3fac8 100644 --- a/opal/mca/pmix/pmix2x/pmix/src/client/pmix_client_get.c +++ b/opal/mca/pmix/pmix2x/pmix/src/client/pmix_client_get.c @@ -633,8 +633,8 @@ static void _getnbfn(int fd, short flags, void *cbdata) rc = pmix_hash_fetch(&nptr->modex, pmix_globals.myid.rank, cb->key, &val); if( PMIX_SUCCESS != rc ){ rc = PMIX_ERR_NOT_FOUND; - goto respond; } + goto respond; } /* otherwise, the data must be something they "put" */ diff --git a/opal/mca/pmix/pmix2x/pmix/src/event/pmix_event_notification.c b/opal/mca/pmix/pmix2x/pmix/src/event/pmix_event_notification.c index b5f2617a2b..83474169fd 100644 --- a/opal/mca/pmix/pmix2x/pmix/src/event/pmix_event_notification.c +++ b/opal/mca/pmix/pmix2x/pmix/src/event/pmix_event_notification.c @@ -202,7 +202,7 @@ static void progress_local_event_hdlr(pmix_status_t status, * as this indicates that info struct should be removed */ nsave = 0; for (n=0; n < chain->nresults; n++) { - if (NULL != chain->results[n].key) { + if (0 < strlen(chain->results[n].key)) { ++nsave; } } @@ -217,7 +217,7 @@ static void progress_local_event_hdlr(pmix_status_t status, /* transfer over the prior data */ cnt = 0; for (n=0; n < chain->nresults; n++) { - if (NULL != chain->results[n].key) { + if (0 < strlen(chain->results[n].key)) { PMIX_INFO_XFER(&newinfo[cnt], &chain->results[n]); ++cnt; } diff --git a/opal/mca/pmix/pmix2x/pmix/src/event/pmix_event_registration.c b/opal/mca/pmix/pmix2x/pmix/src/event/pmix_event_registration.c index 9caa6d378b..68e8098e8f 100644 --- a/opal/mca/pmix/pmix2x/pmix/src/event/pmix_event_registration.c +++ b/opal/mca/pmix/pmix2x/pmix/src/event/pmix_event_registration.c @@ -641,10 +641,18 @@ static void reg_event_hdlr(int sd, short args, void *cbdata) break; } } - /* if the handler wasn't found, then it may show up later - so - * for now just prepend it to the list */ + /* if the handler wasn't found, then we return an error. At some + * future time, we may change this behavior and cache this handler + * until the reference one has been registered. However, this could + * turn out to be a laborious search procedure as the reference + * event handler may in turn be dependent on another handler, etc. */ if (!found) { - pmix_list_prepend(cd->list, &evhdlr->super); + /* this is an error */ + --pmix_globals.events.nhdlrs; + rc = PMIX_ERR_EVENT_REGISTRATION; + index = UINT_MAX; + PMIX_RELEASE(evhdlr); + goto ack; } } if (PMIX_ERR_WOULD_BLOCK == rc) { @@ -710,57 +718,54 @@ static void dereg_event_hdlr(int sd, short args, void *cbdata) } /* check the first and last locations */ - if (NULL != pmix_globals.events.first || - NULL != pmix_globals.events.last) { - if (pmix_globals.events.first->index == cd->ref || - pmix_globals.events.last->index == cd->ref) { - /* found it */ - if (pmix_globals.events.first->index == cd->ref) { - ev = pmix_globals.events.first; - } else { - ev = pmix_globals.events.last; - } - if (NULL != msg) { - /* if this is a default handler, see if any other default - * handlers remain */ - if (NULL == ev->codes) { - if (0 == pmix_list_get_size(&pmix_globals.events.default_events)) { - /* tell the server to dereg our default handler */ - if (PMIX_SUCCESS != (rc = pmix_bfrop.pack(msg, &wildcard, 1, PMIX_STATUS))) { - PMIX_RELEASE(msg); - goto cleanup; - } + if ((NULL != pmix_globals.events.first && pmix_globals.events.first->index == cd->ref) || + (NULL != pmix_globals.events.last && pmix_globals.events.last->index == cd->ref)) { + /* found it */ + if (NULL != pmix_globals.events.first && pmix_globals.events.first->index == cd->ref) { + ev = pmix_globals.events.first; + } else { + ev = pmix_globals.events.last; + } + if (NULL != msg) { + /* if this is a default handler, see if any other default + * handlers remain */ + if (NULL == ev->codes) { + if (0 == pmix_list_get_size(&pmix_globals.events.default_events)) { + /* tell the server to dereg our default handler */ + if (PMIX_SUCCESS != (rc = pmix_bfrop.pack(msg, &wildcard, 1, PMIX_STATUS))) { + PMIX_RELEASE(msg); + goto cleanup; } - } else { - for (n=0; n < ev->ncodes; n++) { - /* see if this is the last registration we have for this code */ - PMIX_LIST_FOREACH(active, &pmix_globals.events.actives, pmix_active_code_t) { - if (active->code == ev->codes[n]) { - --active->nregs; - if (0 == active->nregs) { - pmix_list_remove_item(&pmix_globals.events.actives, &active->super); - /* tell the server to dereg this code */ - if (PMIX_SUCCESS != (rc = pmix_bfrop.pack(msg, &active->code, 1, PMIX_STATUS))) { - PMIX_RELEASE(active); - PMIX_RELEASE(msg); - goto cleanup; - } + } + } else { + for (n=0; n < ev->ncodes; n++) { + /* see if this is the last registration we have for this code */ + PMIX_LIST_FOREACH(active, &pmix_globals.events.actives, pmix_active_code_t) { + if (active->code == ev->codes[n]) { + --active->nregs; + if (0 == active->nregs) { + pmix_list_remove_item(&pmix_globals.events.actives, &active->super); + /* tell the server to dereg this code */ + if (PMIX_SUCCESS != (rc = pmix_bfrop.pack(msg, &active->code, 1, PMIX_STATUS))) { PMIX_RELEASE(active); + PMIX_RELEASE(msg); + goto cleanup; } - break; + PMIX_RELEASE(active); } + break; } } } } - if (pmix_globals.events.first->index == cd->ref) { - pmix_globals.events.first = NULL; - } else { - pmix_globals.events.last = NULL; - } - PMIX_RELEASE(ev); - goto cleanup; } + if (ev == pmix_globals.events.first) { + pmix_globals.events.first = NULL; + } else { + pmix_globals.events.last = NULL; + } + PMIX_RELEASE(ev); + goto cleanup; } /* the registration can be in any of three places, so check each of them */ @@ -793,11 +798,13 @@ static void dereg_event_hdlr(int sd, short args, void *cbdata) --active->nregs; if (0 == active->nregs) { pmix_list_remove_item(&pmix_globals.events.actives, &active->super); - /* tell the server to dereg this code */ - if (PMIX_SUCCESS != (rc = pmix_bfrop.pack(msg, &active->code, 1, PMIX_STATUS))) { - PMIX_RELEASE(active); - PMIX_RELEASE(msg); - goto cleanup; + if (NULL != msg) { + /* tell the server to dereg this code */ + if (PMIX_SUCCESS != (rc = pmix_bfrop.pack(msg, &active->code, 1, PMIX_STATUS))) { + PMIX_RELEASE(active); + PMIX_RELEASE(msg); + goto cleanup; + } } PMIX_RELEASE(active); } @@ -820,11 +827,13 @@ static void dereg_event_hdlr(int sd, short args, void *cbdata) --active->nregs; if (0 == active->nregs) { pmix_list_remove_item(&pmix_globals.events.actives, &active->super); - /* tell the server to dereg this code */ - if (PMIX_SUCCESS != (rc = pmix_bfrop.pack(msg, &active->code, 1, PMIX_STATUS))) { - PMIX_RELEASE(active); - PMIX_RELEASE(msg); - goto cleanup; + if (NULL != msg) { + /* tell the server to dereg this code */ + if (PMIX_SUCCESS != (rc = pmix_bfrop.pack(msg, &active->code, 1, PMIX_STATUS))) { + PMIX_RELEASE(active); + PMIX_RELEASE(msg); + goto cleanup; + } } PMIX_RELEASE(active); } diff --git a/opal/mca/pmix/pmix2x/pmix/src/util/compress.h b/opal/mca/pmix/pmix2x/pmix/src/util/compress.h index 630cdc990c..d81cff74eb 100644 --- a/opal/mca/pmix/pmix2x/pmix/src/util/compress.h +++ b/opal/mca/pmix/pmix2x/pmix/src/util/compress.h @@ -31,8 +31,8 @@ BEGIN_C_DECLS -/* define a limit of 128k for raw strings */ -#define PMIX_STRING_LIMIT 131072 +/* define a limit for storing raw strings */ +#define PMIX_STRING_LIMIT 512 /* define a macro for quickly checking if a string exceeds the * compression limit */ diff --git a/opal/mca/pmix/pmix2x/pmix/test/Makefile.am b/opal/mca/pmix/pmix2x/pmix/test/Makefile.am index 71da45a1e1..1d1a0b8f46 100644 --- a/opal/mca/pmix/pmix2x/pmix/test/Makefile.am +++ b/opal/mca/pmix/pmix2x/pmix/test/Makefile.am @@ -11,7 +11,7 @@ # All rights reserved. # Copyright (c) 2006-2010 Cisco Systems, Inc. All rights reserved. # Copyright (c) 2012-2013 Los Alamos National Security, Inc. All rights reserved. -# Copyright (c) 2013-2016 Intel, Inc. All rights reserved +# Copyright (c) 2013-2017 Intel, Inc. All rights reserved. # $COPYRIGHT$ # # Additional copyrights may follow @@ -32,7 +32,12 @@ headers = test_common.h cli_stages.h server_callbacks.h utils.h test_fence.h \ AM_CPPFLAGS = -I$(top_builddir)/src -I$(top_builddir)/src/include -I$(top_builddir)/src/api noinst_SCRIPTS = pmix_client_otheruser.sh -noinst_PROGRAMS = pmi_client pmi2_client +noinst_PROGRAMS = + +if WANT_PMIX_BACKWARD +noinst_PROGRAMS += pmi_client pmi2_client +endif + if !WANT_HIDDEN noinst_PROGRAMS += pmix_test pmix_client pmix_regex endif @@ -43,6 +48,7 @@ pmix_test_LDFLAGS = $(PMIX_PKG_CONFIG_LDFLAGS) pmix_test_LDADD = \ $(top_builddir)/src/libpmix.la +if WANT_PMIX_BACKWARD pmi_client_SOURCES = $(headers) \ pmi_client.c pmi_client_LDFLAGS = $(PMIX_PKG_CONFIG_LDFLAGS) @@ -54,6 +60,7 @@ pmi2_client_SOURCES = $(headers) \ pmi2_client_LDFLAGS = $(PMIX_PKG_CONFIG_LDFLAGS) pmi2_client_LDADD = \ $(top_builddir)/src/libpmix.la +endif pmix_client_SOURCES = $(headers) \ pmix_client.c test_fence.c test_common.c test_publish.c test_spawn.c \