diff --git a/opal/mca/pmix/pmix3x/pmix/NEWS b/opal/mca/pmix/pmix3x/pmix/NEWS index 34f837bf1bb..c65753a231d 100644 --- a/opal/mca/pmix/pmix3x/pmix/NEWS +++ b/opal/mca/pmix/pmix3x/pmix/NEWS @@ -1,5 +1,6 @@ Copyright (c) 2015-2020 Intel, Inc. All rights reserved. Copyright (c) 2017-2020 IBM Corporation. All rights reserved. +Copyright (c) 2021 Nanook Consulting. All rights reserved. $COPYRIGHT$ Additional copyrights may follow @@ -20,11 +21,16 @@ other, a single NEWS-worthy item might apply to different series. For example, a bug might be fixed in the master, and then moved to multiple release branches. -Master (not on release branches yet) ------------------------------------- + +3.2.3 -- 12 Feb 2021 +---------------------- + - PR #1967: Fix thread conflict in event notification + - PR #2001: Finalize: set hostname in global to NULL to avoid segfault + in apps that call init/finalize multiple times + - PR #2045: Have developer builds use -O3 by default -3.2.2 -- TBD +3.2.2 -- 7 Dec 2020 ---------------------- - PR #1930: Remove man page setup as there are no manpages in v3.2 - PR #1933: Remove stale config command @@ -66,12 +72,13 @@ Master (not on release branches yet) - PR #1885: Fix immediate flag behavior at the server -3.1.6 -- 20 Aug 2020 +3.1.6 -- 04 Jan 2021 ---------------------- - PR #1669: Silence unnecessary error log message - PR #1776: Fixed crash of dstore locks destructor - PR #1825: Add option to bypass local-only fence optimization - PR #1830: Increase timeout in test case + - PR #1990: Fix server/get for gds=hash 3.1.5 -- 14 Feb 2020 diff --git a/opal/mca/pmix/pmix3x/pmix/VERSION b/opal/mca/pmix/pmix3x/pmix/VERSION index 75e56d37538..9cdc381eb2c 100644 --- a/opal/mca/pmix/pmix3x/pmix/VERSION +++ b/opal/mca/pmix/pmix3x/pmix/VERSION @@ -16,7 +16,7 @@ major=3 minor=2 -release=2 +release=3 # greek is used for alpha or beta release tags. If it is non-empty, # it will be appended to the version number. It does not have to be @@ -31,7 +31,7 @@ greek= # command, or with the date (if "git describe" fails) in the form of # "date". -repo_rev=git1703e6fb +repo_rev=gitad8d1f3 # If tarball_version is not empty, it is used as the version string in # the tarball filename, regardless of all other versions listed in @@ -45,7 +45,7 @@ tarball_version= # The date when this release was created -date="Dec 01, 2020" +date="Feb 11, 2021" # The shared library version of each of PMIx's public libraries. # These versions are maintained in accordance with the "Library @@ -76,7 +76,7 @@ date="Dec 01, 2020" # Version numbers are described in the Libtool current:revision:age # format. -libpmix_so_version=4:32:2 +libpmix_so_version=4:33:2 libpmi_so_version=1:1:0 libpmi2_so_version=1:0:0 diff --git a/opal/mca/pmix/pmix3x/pmix/config/pmix.m4 b/opal/mca/pmix/pmix3x/pmix/config/pmix.m4 index cfc6b251272..3e576970991 100644 --- a/opal/mca/pmix/pmix3x/pmix/config/pmix.m4 +++ b/opal/mca/pmix/pmix3x/pmix/config/pmix.m4 @@ -23,6 +23,7 @@ dnl and Technology (RIST). All rights reserved. dnl Copyright (c) 2016 Mellanox Technologies, Inc. dnl All rights reserved. dnl +dnl Copyright (c) 2021 Nanook Consulting. All rights reserved. dnl $COPYRIGHT$ dnl dnl Additional copyrights may follow @@ -1018,15 +1019,11 @@ else AC_MSG_RESULT([no]) WANT_DEBUG=0 fi -#################### Early development override #################### -if test "$WANT_DEBUG" = "0" && test -z "$enable_debug" && test "$PMIX_DEVEL" = "1"; then - WANT_DEBUG=1 - echo "--> developer override: enable debugging code by default" -fi -#################### Early development override #################### + if test "$WANT_DEBUG" = "0"; then CFLAGS="-DNDEBUG $CFLAGS" fi + AC_DEFINE_UNQUOTED(PMIX_ENABLE_DEBUG, $WANT_DEBUG, [Whether we want developer-level debugging code or not]) diff --git a/opal/mca/pmix/pmix3x/pmix/contrib/pmix.spec b/opal/mca/pmix/pmix3x/pmix/contrib/pmix.spec index c9a9e988d26..52b3016d97f 100644 --- a/opal/mca/pmix/pmix3x/pmix/contrib/pmix.spec +++ b/opal/mca/pmix/pmix3x/pmix/contrib/pmix.spec @@ -12,9 +12,10 @@ # Copyright (c) 2006-2016 Cisco Systems, Inc. All rights reserved. # Copyright (c) 2013 Mellanox Technologies, Inc. # All rights reserved. -# Copyright (c) 2015-2020 Intel, Inc. All rights reserved. +# Copyright (c) 2015-2018 Intel, Inc. All rights reserved. # Copyright (c) 2015 Research Organization for Information Science # and Technology (RIST). All rights reserved. +# Copyright (c) 2021 Nanook Consulting. All rights reserved. # $COPYRIGHT$ # # Additional copyrights may follow @@ -192,7 +193,7 @@ Summary: An extended/exascale implementation of PMI Name: %{?_name:%{_name}}%{!?_name:pmix} -Version: 3.2.2 +Version: 3.2.3 Release: 1%{?dist} License: BSD Group: Development/Libraries diff --git a/opal/mca/pmix/pmix3x/pmix/src/event/pmix_event.h b/opal/mca/pmix/pmix3x/pmix/src/event/pmix_event.h index 20a75b88ffc..5c523be1844 100644 --- a/opal/mca/pmix/pmix3x/pmix/src/event/pmix_event.h +++ b/opal/mca/pmix/pmix3x/pmix/src/event/pmix_event.h @@ -12,6 +12,7 @@ * All rights reserved. * Copyright (c) 2015-2020 Intel, Inc. All rights reserved. * Copyright (c) 2020 IBM Corporation. All rights reserved. + * Copyright (c) 2021 Nanook Consulting. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -140,7 +141,11 @@ typedef struct pmix_event_chain_t { size_t nallocated; pmix_info_t *results; size_t nresults; + pmix_info_t *interim; + size_t ninterim; pmix_event_hdlr_t *evhdlr; + pmix_op_cbfunc_t opcbfunc; + void *cbdata; pmix_op_cbfunc_t final_cbfunc; void *final_cbdata; } pmix_event_chain_t; diff --git a/opal/mca/pmix/pmix3x/pmix/src/event/pmix_event_notification.c b/opal/mca/pmix/pmix3x/pmix/src/event/pmix_event_notification.c index 04c96478093..df8e4059b94 100644 --- a/opal/mca/pmix/pmix3x/pmix/src/event/pmix_event_notification.c +++ b/opal/mca/pmix/pmix3x/pmix/src/event/pmix_event_notification.c @@ -5,6 +5,7 @@ * and Technology (RIST). All rights reserved. * Copyright (c) 2017 IBM Corporation. All rights reserved. * + * Copyright (c) 2021 Nanook Consulting. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -32,6 +33,10 @@ static pmix_status_t notify_server_of_event(pmix_status_t status, pmix_data_range_t range, const pmix_info_t info[], size_t ninfo, pmix_op_cbfunc_t cbfunc, void *cbdata); +static void progress_local_event_hdlr(pmix_status_t status, + pmix_info_t *results, size_t nresults, + pmix_op_cbfunc_t cbfunc, void *thiscbdata, + void *notification_cbdata); /* if we are a client, we call this function to notify the server of * an event. If we are a server, our host RM will call this function @@ -313,19 +318,13 @@ static pmix_status_t notify_server_of_event(pmix_status_t status, } -static void progress_local_event_hdlr(pmix_status_t status, - pmix_info_t *results, size_t nresults, - pmix_op_cbfunc_t cbfunc, void *thiscbdata, - void *notification_cbdata) +static void cycle_events(int sd, short args, void *cbdata) { - /* this may be in the host's thread, so we need to threadshift it - * before accessing our internal data */ - - pmix_event_chain_t *chain = (pmix_event_chain_t*)notification_cbdata; + pmix_event_chain_t *chain = (pmix_event_chain_t*)cbdata; size_t n, nsave, cnt; - pmix_info_t *newinfo; pmix_list_item_t *item; pmix_event_hdlr_t *nxt; + pmix_info_t *newinfo; pmix_output_verbose(2, pmix_client_globals.event_output, "%s progressing local event", @@ -345,7 +344,7 @@ static void progress_local_event_hdlr(pmix_status_t status, * the array to make space */ /* add in any new results plus space for the returned status */ - nsave += nresults + 1; + nsave += chain->ninterim + 1; /* create the new space */ PMIX_INFO_CREATE(newinfo, nsave); /* transfer over the prior data */ @@ -364,11 +363,11 @@ static void progress_local_event_hdlr(pmix_status_t status, pmix_strncpy(newinfo[cnt].key, "UNKNOWN", PMIX_MAX_KEYLEN); } newinfo[cnt].value.type = PMIX_STATUS; - newinfo[cnt].value.data.status = status; + newinfo[cnt].value.data.status = chain->status; ++cnt; /* transfer across the new results */ - for (n=0; n < nresults; n++) { - PMIX_INFO_XFER(&newinfo[cnt], &results[n]); + for (n=0; n < chain->ninterim; n++) { + PMIX_INFO_XFER(&newinfo[cnt], &chain->interim[n]); ++cnt; } /* release the prior results */ @@ -382,14 +381,27 @@ static void progress_local_event_hdlr(pmix_status_t status, chain->ninfo = chain->nallocated - 2; PMIX_INFO_DESTRUCT(&chain->info[chain->nallocated-2]); PMIX_INFO_DESTRUCT(&chain->info[chain->nallocated-1]); - + // call their interim cbfunc + if (NULL != chain->opcbfunc) { + chain->opcbfunc(PMIX_SUCCESS, chain->cbdata); + } + /* if the caller indicates that the chain is completed, * or we completed the "last" event */ - if (PMIX_EVENT_ACTION_COMPLETE == status || chain->endchain) { - goto complete; + if (PMIX_EVENT_ACTION_COMPLETE == chain->status || chain->endchain) { + if (PMIX_EVENT_ACTION_COMPLETE == chain->status) { + chain->status = PMIX_SUCCESS; + } + /* we still have to call their final callback */ + if (NULL != chain->final_cbfunc) { + chain->final_cbfunc(chain->status, chain->final_cbdata); + } + /* maintain acctng */ + PMIX_RELEASE(chain); + return; } - item = NULL; + item = NULL; /* see if we need to continue, starting with the single code events */ if (1 == chain->evhdlr->ncodes) { /* the last handler was for a single code - see if there are @@ -591,18 +603,31 @@ static void progress_local_event_hdlr(pmix_status_t status, } } - complete: - /* we still have to call their final callback */ + /* if we get here, there was nothing more to do, but + * we still have to call their final callback */ if (NULL != chain->final_cbfunc) { - chain->final_cbfunc(PMIX_SUCCESS, chain->final_cbdata); + chain->final_cbfunc(chain->status, chain->final_cbdata); return; } /* maintain acctng */ PMIX_RELEASE(chain); - /* let the caller know that we are done with their callback */ - if (NULL != cbfunc) { - cbfunc(PMIX_SUCCESS, thiscbdata); - } +} + +static void progress_local_event_hdlr(pmix_status_t status, + pmix_info_t *results, size_t nresults, + pmix_op_cbfunc_t cbfunc, void *thiscbdata, + void *notification_cbdata) +{ + /* this may be in the host's thread, so we need to threadshift it + * before accessing our internal data */ + + pmix_event_chain_t *chain = (pmix_event_chain_t*)notification_cbdata; + + chain->interim = results; + chain->ninterim = nresults; + chain->opcbfunc = cbfunc; + chain->cbdata = thiscbdata; + PMIX_THREADSHIFT(chain, cycle_events); } /* given notification of an event, cycle thru our list of @@ -1277,6 +1302,9 @@ void pmix_event_timeout_cb(int fd, short flags, void *arg) /* remove it from the list */ pmix_list_remove_item(&pmix_globals.cached_events, &ch->super); + /* protect the chain */ + PMIX_RETAIN(ch); + /* process this event thru the regular channels */ if (PMIX_PEER_IS_SERVER(pmix_globals.mypeer) && !PMIX_PEER_IS_LAUNCHER(pmix_globals.mypeer)) { @@ -1440,7 +1468,11 @@ static void chcon(pmix_event_chain_t *p) p->nallocated = 0; p->results = NULL; p->nresults = 0; + p->interim = NULL; + p->ninterim = 0; p->evhdlr = NULL; + p->opcbfunc = NULL; + p->cbdata = NULL; p->final_cbfunc = NULL; p->final_cbdata = NULL; } diff --git a/opal/mca/pmix/pmix3x/pmix/src/event/pmix_event_registration.c b/opal/mca/pmix/pmix3x/pmix/src/event/pmix_event_registration.c index 092eefca480..6a8735f02d6 100644 --- a/opal/mca/pmix/pmix3x/pmix/src/event/pmix_event_registration.c +++ b/opal/mca/pmix/pmix3x/pmix/src/event/pmix_event_registration.c @@ -3,6 +3,7 @@ * Copyright (c) 2014-2020 Intel, Inc. All rights reserved. * Copyright (c) 2017-2018 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2021 Nanook Consulting. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -413,7 +414,7 @@ static void check_cached_events(pmix_rshift_caddy_t *cd) /* we always leave space for event hdlr name and a callback object */ chain->nallocated = ncd->ninfo + 2; PMIX_INFO_CREATE(chain->info, chain->nallocated); - if (0 < cd->ninfo) { + if (0 < ncd->ninfo) { chain->ninfo = ncd->ninfo; /* need to copy the info */ for (n=0; n < ncd->ninfo; n++) { @@ -871,7 +872,6 @@ PMIX_EXPORT void PMIx_Register_event_handler(pmix_status_t codes[], size_t ncode void *cbdata) { pmix_rshift_caddy_t *cd; - size_t n; PMIX_ACQUIRE_THREAD(&pmix_global_lock); @@ -900,9 +900,7 @@ PMIX_EXPORT void PMIx_Register_event_handler(pmix_status_t codes[], size_t ncode } return; } - for (n=0; n < ncodes; n++) { - cd->codes[n] = codes[n]; - } + memcpy(cd->codes, codes, ncodes * sizeof(pmix_status_t)); } cd->ncodes = ncodes; cd->info = info; diff --git a/opal/mca/pmix/pmix3x/pmix/src/runtime/pmix_finalize.c b/opal/mca/pmix/pmix3x/pmix/src/runtime/pmix_finalize.c index 45a9fb48ca9..d53c8e23b39 100644 --- a/opal/mca/pmix/pmix3x/pmix/src/runtime/pmix_finalize.c +++ b/opal/mca/pmix/pmix3x/pmix/src/runtime/pmix_finalize.c @@ -15,6 +15,8 @@ * Copyright (c) 2013-2020 Intel, Inc. All rights reserved. * Copyright (c) 2016-2019 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2021 Triad National Security, LLC. All rights reserved. + * Copyright (c) 2021 Nanook Consulting. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -134,6 +136,7 @@ void pmix_rte_finalize(void) PMIX_LIST_DESTRUCT(&pmix_globals.stdin_targets); if (NULL != pmix_globals.hostname) { free(pmix_globals.hostname); + pmix_globals.hostname = NULL; } PMIX_LIST_DESTRUCT(&pmix_globals.nspaces);