diff --git a/.gitignore b/.gitignore index fc76a3db59..8a7161cd70 100644 --- a/.gitignore +++ b/.gitignore @@ -382,6 +382,8 @@ opal/mca/pmix/pmix*/pmix/src/include/private/autogen/config.h opal/mca/pmix/pmix*/pmix/src/include/frameworks.h opal/mca/pmix/pmix*/pmix/src/mca/pinstalldirs/config/pinstall_dirs.h opal/mca/pmix/pmix*/pmix/config/autogen_found_items.m4 +opal/mca/pmix/pmix*/pmix/config/mca_library_paths.txt +opal/mca/pmix/pmix*/pmix/config/test-driver opal/mca/pmix/pmix*/pmix/src/include/pmix_config.h opal/mca/pmix/pmix*/pmix/src/include/pmix_config.h.in opal/mca/pmix/pmix*/pmix/include/pmix_common.h @@ -400,6 +402,23 @@ opal/mca/pmix/pmix*/pmix/examples/jctrl opal/mca/pmix/pmix*/pmix/examples/pub opal/mca/pmix/pmix*/pmix/examples/server opal/mca/pmix/pmix*/pmix/examples/tool +opal/mca/pmix/pmix*/pmix/test/run_tests00.pl +opal/mca/pmix/pmix*/pmix/test/run_tests01.pl +opal/mca/pmix/pmix*/pmix/test/run_tests02.pl +opal/mca/pmix/pmix*/pmix/test/run_tests03.pl +opal/mca/pmix/pmix*/pmix/test/run_tests04.pl +opal/mca/pmix/pmix*/pmix/test/run_tests05.pl +opal/mca/pmix/pmix*/pmix/test/run_tests06.pl +opal/mca/pmix/pmix*/pmix/test/run_tests07.pl +opal/mca/pmix/pmix*/pmix/test/run_tests08.pl +opal/mca/pmix/pmix*/pmix/test/run_tests09.pl +opal/mca/pmix/pmix*/pmix/test/run_tests10.pl +opal/mca/pmix/pmix*/pmix/test/run_tests11.pl +opal/mca/pmix/pmix*/pmix/test/run_tests12.pl +opal/mca/pmix/pmix*/pmix/test/run_tests13.pl +opal/mca/pmix/pmix*/pmix/test/run_tests14.pl +opal/mca/pmix/pmix*/pmix/test/run_tests15.pl + opal/mca/pmix/ext4x/ext4x.c opal/mca/pmix/ext4x/ext4x.h diff --git a/opal/mca/pmix/pmix4x/pmix/LICENSE b/opal/mca/pmix/pmix4x/pmix/LICENSE index 3eb0a094e0..9f9a1b943b 100644 --- a/opal/mca/pmix/pmix4x/pmix/LICENSE +++ b/opal/mca/pmix/pmix4x/pmix/LICENSE @@ -47,6 +47,8 @@ Copyright (c) 2012 The University of Wisconsin-La Crosse. All rights reserved. Copyright (c) 2013-2019 Intel, Inc. All rights reserved. Copyright (c) 2011-2014 NVIDIA Corporation. All rights reserved. +Copyright (c) 2019 Amazon.com, Inc. or its affiliates. All Rights + reserved. $COPYRIGHT$ diff --git a/opal/mca/pmix/pmix4x/pmix/Makefile.am b/opal/mca/pmix/pmix4x/pmix/Makefile.am index a48fc73e6e..13d1c300b3 100644 --- a/opal/mca/pmix/pmix4x/pmix/Makefile.am +++ b/opal/mca/pmix/pmix4x/pmix/Makefile.am @@ -12,6 +12,8 @@ # Copyright (c) 2006-2016 Cisco Systems, Inc. All rights reserved. # Copyright (c) 2012-2013 Los Alamos National Security, Inc. All rights reserved. # Copyright (c) 2013-2018 Intel, Inc. All rights reserved. +# Copyright (c) 2019 Amazon.com, Inc. or its affiliates. All Rights +# reserved. # $COPYRIGHT$ # # Additional copyrights may follow @@ -25,6 +27,7 @@ ACLOCAL_AMFLAGS = -I ./config SUBDIRS = config contrib include src etc bindings +AM_DISTCHECK_CONFIGURE_FLAGS = --disable-dlopen headers = sources = diff --git a/opal/mca/pmix/pmix4x/pmix/VERSION b/opal/mca/pmix/pmix4x/pmix/VERSION index f791c866ad..863b4fed9c 100644 --- a/opal/mca/pmix/pmix4x/pmix/VERSION +++ b/opal/mca/pmix/pmix4x/pmix/VERSION @@ -30,7 +30,7 @@ greek=a1 # command, or with the date (if "git describe" fails) in the form of # "date". -repo_rev=git2531c0c3 +repo_rev=gitbde4a8a5 # 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 09, 2019" +date="Apr 23, 2019" # 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/pmix4x/pmix/autogen.pl b/opal/mca/pmix/pmix4x/pmix/autogen.pl index 40b533d214..9d365783c8 100755 --- a/opal/mca/pmix/pmix4x/pmix/autogen.pl +++ b/opal/mca/pmix/pmix4x/pmix/autogen.pl @@ -4,7 +4,7 @@ # Copyright (c) 2010 Oracle and/or its affiliates. All rights reserved. # Copyright (c) 2013 Mellanox Technologies, Inc. # All rights reserved. -# Copyright (c) 2013-2017 Intel, Inc. All rights reserved. +# Copyright (c) 2013-2019 Intel, Inc. All rights reserved. # Copyright (c) 2015 Research Organization for Information Science # and Technology (RIST). All rights reserved. # Copyright (c) 2015 IBM Corporation. All rights reserved. @@ -37,6 +37,9 @@ my $m4; # Sanity check file my $topdir_file = "include/pmix.h"; my $dnl_line = "dnl ---------------------------------------------------------------------------"; +# The text file we'll write at the end that will contain +# all the mca component directory paths +my $mca_library_paths_file = "config/mca_library_paths.txt"; # Data structures to fill up with all the stuff we find my $mca_found; @@ -137,6 +140,9 @@ sub mca_process_component { push(@{$mca_found->{$framework}->{"components"}}, $found_component); + # save the directory for later to create the paths + # to all the component libraries + push(@subdirs, $cdir); } ############################################################################## @@ -723,6 +729,15 @@ open(M4, ">$m4_output_file") || print M4 $m4; close(M4); +# Remove the old library path file and write the new one +verbose "==> Writing txt file with all the mca component paths\n"; +unlink($mca_library_paths_file); +open(M4, ">$mca_library_paths_file") || + my_die "Cannot open $mca_library_paths_file"; +my $paths = join(":", @subdirs); +print M4 $paths; +close(M4); + # Run autoreconf verbose "==> Running autoreconf\n"; my $cmd = "autoreconf -ivf --warnings=all,no-obsolete,no-override -I config"; diff --git a/opal/mca/pmix/pmix4x/pmix/config/Makefile.am b/opal/mca/pmix/pmix4x/pmix/config/Makefile.am index 075f5b859e..6e3961dfaf 100644 --- a/opal/mca/pmix/pmix4x/pmix/config/Makefile.am +++ b/opal/mca/pmix/pmix4x/pmix/config/Makefile.am @@ -43,7 +43,8 @@ EXTRA_DIST = \ pmix_search_libs.m4 \ pmix_setup_cc.m4 \ pmix_setup_libevent.m4 \ - pmix_mca_priority_sort.pl + pmix_mca_priority_sort.pl \ + mca_library_paths.txt maintainer-clean-local: diff --git a/opal/mca/pmix/pmix4x/pmix/config/pmix.m4 b/opal/mca/pmix/pmix4x/pmix/config/pmix.m4 index 1c1ba094f5..9f9f382000 100644 --- a/opal/mca/pmix/pmix4x/pmix/config/pmix.m4 +++ b/opal/mca/pmix/pmix4x/pmix/config/pmix.m4 @@ -859,6 +859,32 @@ AC_DEFUN([PMIX_SETUP_CORE],[ AC_SUBST(pmixlibdir) AC_SUBST(pmixincludedir) + ############################################################################ + # setup "make check" + ############################################################################ + PMIX_BUILT_TEST_PREFIX=$PMIX_top_builddir + AC_SUBST(PMIX_BUILT_TEST_PREFIX) + # expose the mca component library paths in the build system + pathfile=$PMIX_top_srcdir/config/mca_library_paths.txt + PMIX_COMPONENT_LIBRARY_PATHS=`cat $pathfile` + AC_SUBST(PMIX_COMPONENT_LIBRARY_PATHS) + AC_CONFIG_FILES(pmix_config_prefix[test/run_tests00.pl], [chmod +x test/run_tests00.pl]) + AC_CONFIG_FILES(pmix_config_prefix[test/run_tests01.pl], [chmod +x test/run_tests01.pl]) + AC_CONFIG_FILES(pmix_config_prefix[test/run_tests02.pl], [chmod +x test/run_tests02.pl]) + AC_CONFIG_FILES(pmix_config_prefix[test/run_tests03.pl], [chmod +x test/run_tests03.pl]) + AC_CONFIG_FILES(pmix_config_prefix[test/run_tests04.pl], [chmod +x test/run_tests04.pl]) + AC_CONFIG_FILES(pmix_config_prefix[test/run_tests05.pl], [chmod +x test/run_tests05.pl]) + AC_CONFIG_FILES(pmix_config_prefix[test/run_tests06.pl], [chmod +x test/run_tests06.pl]) + AC_CONFIG_FILES(pmix_config_prefix[test/run_tests07.pl], [chmod +x test/run_tests07.pl]) + AC_CONFIG_FILES(pmix_config_prefix[test/run_tests08.pl], [chmod +x test/run_tests08.pl]) + AC_CONFIG_FILES(pmix_config_prefix[test/run_tests09.pl], [chmod +x test/run_tests09.pl]) + AC_CONFIG_FILES(pmix_config_prefix[test/run_tests10.pl], [chmod +x test/run_tests10.pl]) + AC_CONFIG_FILES(pmix_config_prefix[test/run_tests11.pl], [chmod +x test/run_tests11.pl]) + AC_CONFIG_FILES(pmix_config_prefix[test/run_tests12.pl], [chmod +x test/run_tests12.pl]) + AC_CONFIG_FILES(pmix_config_prefix[test/run_tests13.pl], [chmod +x test/run_tests13.pl]) + AC_CONFIG_FILES(pmix_config_prefix[test/run_tests14.pl], [chmod +x test/run_tests14.pl]) + AC_CONFIG_FILES(pmix_config_prefix[test/run_tests15.pl], [chmod +x test/run_tests15.pl]) + ############################################################################ # final output ############################################################################ @@ -920,7 +946,7 @@ AC_DEFUN([PMIX_DEFINE_ARGS],[ AC_ARG_ENABLE([embedded-mode], [AC_HELP_STRING([--enable-embedded-mode], [Using --enable-embedded-mode causes PMIx to skip a few configure checks and install nothing. It should only be used when building PMIx within the scope of a larger package.])]) - AS_IF([test ! -z "$enable_embedded_mode" && test "$enable_embedded_mode" = "yes"], + AS_IF([test "$enable_embedded_mode" = "yes"], [pmix_mode=embedded pmix_install_primary_headers=no AC_MSG_RESULT([yes])], @@ -1207,6 +1233,24 @@ if test "$WANT_PYTHON_BINDINGS" = "1"; then fi fi +# see if they want to disable non-RTLD_GLOBAL dlopen +AC_MSG_CHECKING([if want to support dlopen of non-global namespaces]) +AC_ARG_ENABLE([nonglobal-dlopen], + AC_HELP_STRING([--enable-nonglobal-dlopen], + [enable non-global dlopen (default: enabled)])) +if test "$enable_nonglobal_dlopen" == "no"; then + AC_MSG_RESULT([no]) + pmix_need_libpmix=0 +else + AC_MSG_RESULT([yes]) + pmix_need_libpmix=1 +fi + +# if someone enables embedded mode but doesn't want to install the +# devel headers, then default nonglobal-dlopen to false +AS_IF([test -z "$enable_nonglobal_dlopen" && test "x$pmix_mode" = "xembedded" && test $WANT_INSTALL_HEADERS -eq 0 && test $pmix_need_libpmix -eq 1], + [pmix_need_libpmix=0]) + ])dnl # This must be a standalone routine so that it can be called both by @@ -1222,6 +1266,7 @@ AC_DEFUN([PMIX_DO_AM_CONDITIONALS],[ 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_PMI_BACKWARD, test "$WANT_PMI_BACKWARD" = 1) + AM_CONDITIONAL(NEED_LIBPMIX, [test "$pmix_need_libpmix" = "1"]) ]) pmix_did_am_conditionals=yes ])dnl diff --git a/opal/mca/pmix/pmix4x/pmix/contrib/make_dist_tarball b/opal/mca/pmix/pmix4x/pmix/contrib/make_dist_tarball index e9276cc886..3fb951bf96 100755 --- a/opal/mca/pmix/pmix4x/pmix/contrib/make_dist_tarball +++ b/opal/mca/pmix/pmix4x/pmix/contrib/make_dist_tarball @@ -11,7 +11,9 @@ # Copyright (c) 2004-2005 The Regents of the University of California. # All rights reserved. # Copyright (c) 2008-2018 Cisco Systems, Inc. All rights reserved -# Copyright (c) 2015 Intel, Inc. All rights reserved. +# Copyright (c) 2015-2019 Intel, Inc. All rights reserved. +# Copyright (c) 2019 Amazon.com, Inc. or its affiliates. All Rights +# reserved. # $COPYRIGHT$ # # Additional copyrights may follow @@ -108,14 +110,6 @@ if test "$LIBEVENT" != ""; then config_args="--with-libevent=$LIBEVENT $config_args" fi -# if config_args isn't empty, then add that to the distcheck_flags -# (because we'll assumedly need those to run configure under "make -# distcheck"). -if test "$config_args" != ""; then - echo "*** Adding to distcheck_flags: $config_args" - distcheck_flags="$distcheck_flags AM_DISTCHECK_CONFIGURE_FLAGS=\"$config_args\"" -fi - export DISTCHECK_CONFIGURE_FLAGS=$config_args # diff --git a/opal/mca/pmix/pmix4x/pmix/src/include/pmix_globals.h b/opal/mca/pmix/pmix4x/pmix/src/include/pmix_globals.h index 36d67f79dc..39d641a4e4 100644 --- a/opal/mca/pmix/pmix4x/pmix/src/include/pmix_globals.h +++ b/opal/mca/pmix/pmix4x/pmix/src/include/pmix_globals.h @@ -121,6 +121,9 @@ typedef uint8_t pmix_cmd_t; /* provide a "pretty-print" function for cmds */ const char* pmix_command_string(pmix_cmd_t cmd); +/* provide a hook to init tool data */ +PMIX_EXPORT extern pmix_status_t pmix_tool_init_info(void); + /* define a set of flags to direct collection * of data during operations */ typedef enum { diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/base/help-pmix-mca-base.txt b/opal/mca/pmix/pmix4x/pmix/src/mca/base/help-pmix-mca-base.txt index 7a96e7ace8..16b8b86ada 100644 --- a/opal/mca/pmix/pmix4x/pmix/src/mca/base/help-pmix-mca-base.txt +++ b/opal/mca/pmix/pmix4x/pmix/src/mca/base/help-pmix-mca-base.txt @@ -10,7 +10,7 @@ # University of Stuttgart. All rights reserved. # Copyright (c) 2004-2005 The Regents of the University of California. # All rights reserved. -# Copyright (c) 2008-2014 Cisco Systems, Inc. All rights reserved. +# Copyright (c) 2008-2019 Cisco Systems, Inc. All rights reserved # Copyright (c) 2018 Intel, Inc. All rights reserved. # $COPYRIGHT$ # @@ -60,3 +60,12 @@ all components *except* a and b", while "c,d" specifies the inclusive behavior and means "use *only* components c and d." You cannot mix inclusive and exclusive behavior. +# +[failed to add component dir] +The pmix_mca_base_component_path MCA variable was used to add paths to +search for PMIX components. At least one directory failed to add +properly: + + %s + +Check to make sure that this directory exists, is readable, etc. diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/base/pmix_mca_base_component_repository.c b/opal/mca/pmix/pmix4x/pmix/src/mca/base/pmix_mca_base_component_repository.c index eb7dda21b5..062b1cb75d 100644 --- a/opal/mca/pmix/pmix4x/pmix/src/mca/base/pmix_mca_base_component_repository.c +++ b/opal/mca/pmix/pmix4x/pmix/src/mca/base/pmix_mca_base_component_repository.c @@ -10,12 +10,12 @@ * University of Stuttgart. All rights reserved. * Copyright (c) 2004-2005 The Regents of the University of California. * All rights reserved. - * Copyright (c) 2008-2015 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2008-2019 Cisco Systems, Inc. All rights reserved * Copyright (c) 2015 Los Alamos National Security, LLC. All rights * reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. - * Copyright (c) 2016-2018 Intel, Inc. All rights reserved. + * Copyright (c) 2016-2019 Intel, Inc. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -43,6 +43,7 @@ #include "pmix_common.h" #include "src/class/pmix_hash_table.h" #include "src/util/basename.h" +#include "src/util/show_help.h" #if PMIX_HAVE_PDL_SUPPORT @@ -220,8 +221,13 @@ int pmix_mca_base_component_repository_add (const char *path) dir = pmix_mca_base_system_default_path; } - if (0 != pmix_pdl_foreachfile(dir, process_repository_item, NULL)) { - break; + if (0 != pmix_pdl_foreachfile(dir, process_repository_item, NULL) && + !(0 == strcmp(dir, pmix_mca_base_system_default_path) || 0 == strcmp(dir, pmix_mca_base_user_default_path))) { + // It is not an error if a directory fails to add (e.g., + // if it doesn't exist). But we should warn about it as + // it is something related to "show_load_errors" + pmix_show_help("help-pmix-mca-base.txt", + "failed to add component dir", true, dir); } } while (NULL != (dir = strtok_r (NULL, sep, &ctx))); diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/bfrops/v12/Makefile.am b/opal/mca/pmix/pmix4x/pmix/src/mca/bfrops/v12/Makefile.am index c4bab250f0..5855a6aeae 100644 --- a/opal/mca/pmix/pmix4x/pmix/src/mca/bfrops/v12/Makefile.am +++ b/opal/mca/pmix/pmix4x/pmix/src/mca/bfrops/v12/Makefile.am @@ -51,6 +51,9 @@ mcacomponentdir = $(pmixlibdir) mcacomponent_LTLIBRARIES = $(component) mca_bfrops_v12_la_SOURCES = $(component_sources) mca_bfrops_v12_la_LDFLAGS = -module -avoid-version +if NEED_LIBPMIX +mca_bfrops_v12_la_LIBADD = $(top_builddir)/src/libpmix.la +endif noinst_LTLIBRARIES = $(lib) libmca_bfrops_v12_la_SOURCES = $(lib_sources) diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/bfrops/v20/Makefile.am b/opal/mca/pmix/pmix4x/pmix/src/mca/bfrops/v20/Makefile.am index cad58de0d8..42eb14940a 100644 --- a/opal/mca/pmix/pmix4x/pmix/src/mca/bfrops/v20/Makefile.am +++ b/opal/mca/pmix/pmix4x/pmix/src/mca/bfrops/v20/Makefile.am @@ -51,6 +51,9 @@ mcacomponentdir = $(pmixlibdir) mcacomponent_LTLIBRARIES = $(component) mca_bfrops_v20_la_SOURCES = $(component_sources) mca_bfrops_v20_la_LDFLAGS = -module -avoid-version +if NEED_LIBPMIX +mca_bfrops_v20_la_LIBADD = $(top_builddir)/src/libpmix.la +endif noinst_LTLIBRARIES = $(lib) libmca_bfrops_v20_la_SOURCES = $(lib_sources) diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/bfrops/v21/Makefile.am b/opal/mca/pmix/pmix4x/pmix/src/mca/bfrops/v21/Makefile.am index 4514cc1e3e..1658de9d1d 100644 --- a/opal/mca/pmix/pmix4x/pmix/src/mca/bfrops/v21/Makefile.am +++ b/opal/mca/pmix/pmix4x/pmix/src/mca/bfrops/v21/Makefile.am @@ -44,6 +44,9 @@ mcacomponentdir = $(pmixlibdir) mcacomponent_LTLIBRARIES = $(component) mca_bfrops_v21_la_SOURCES = $(component_sources) mca_bfrops_v21_la_LDFLAGS = -module -avoid-version +if NEED_LIBPMIX +mca_bfrops_v21_la_LIBADD = $(top_builddir)/src/libpmix.la +endif noinst_LTLIBRARIES = $(lib) libmca_bfrops_v21_la_SOURCES = $(lib_sources) diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/bfrops/v3/Makefile.am b/opal/mca/pmix/pmix4x/pmix/src/mca/bfrops/v3/Makefile.am index 3b7ea38cde..d14a13258f 100644 --- a/opal/mca/pmix/pmix4x/pmix/src/mca/bfrops/v3/Makefile.am +++ b/opal/mca/pmix/pmix4x/pmix/src/mca/bfrops/v3/Makefile.am @@ -44,6 +44,9 @@ mcacomponentdir = $(pmixlibdir) mcacomponent_LTLIBRARIES = $(component) mca_bfrops_v3_la_SOURCES = $(component_sources) mca_bfrops_v3_la_LDFLAGS = -module -avoid-version +if NEED_LIBPMIX +mca_bfrops_v3_la_LIBADD = $(top_builddir)/src/libpmix.la +endif noinst_LTLIBRARIES = $(lib) libmca_bfrops_v3_la_SOURCES = $(lib_sources) diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/bfrops/v4/Makefile.am b/opal/mca/pmix/pmix4x/pmix/src/mca/bfrops/v4/Makefile.am index 997fd20dd5..8239aa5589 100644 --- a/opal/mca/pmix/pmix4x/pmix/src/mca/bfrops/v4/Makefile.am +++ b/opal/mca/pmix/pmix4x/pmix/src/mca/bfrops/v4/Makefile.am @@ -44,6 +44,9 @@ mcacomponentdir = $(pmixlibdir) mcacomponent_LTLIBRARIES = $(component) mca_bfrops_v4_la_SOURCES = $(component_sources) mca_bfrops_v4_la_LDFLAGS = -module -avoid-version +if NEED_LIBPMIX +mca_bfrops_v4_la_LIBADD = $(top_builddir)/src/libpmix.la +endif noinst_LTLIBRARIES = $(lib) libmca_bfrops_v4_la_SOURCES = $(lib_sources) diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/gds/ds12/Makefile.am b/opal/mca/pmix/pmix4x/pmix/src/mca/gds/ds12/Makefile.am index ba785f73fb..eae7ef34ab 100644 --- a/opal/mca/pmix/pmix4x/pmix/src/mca/gds/ds12/Makefile.am +++ b/opal/mca/pmix/pmix4x/pmix/src/mca/gds/ds12/Makefile.am @@ -64,6 +64,9 @@ mcacomponent_LTLIBRARIES = $(component) mca_gds_ds12_la_SOURCES = $(component_sources) mca_gds_ds12_la_LDFLAGS = -module -avoid-version \ $(PMIX_TOP_BUILDDIR)/src/mca/common/dstore/libmca_common_dstore.la +if NEED_LIBPMIX +mca_gds_ds12_la_LIBADD = $(top_builddir)/src/libpmix.la +endif noinst_LTLIBRARIES = $(lib) libmca_gds_ds12_la_SOURCES = $(lib_sources) diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/gds/ds21/Makefile.am b/opal/mca/pmix/pmix4x/pmix/src/mca/gds/ds21/Makefile.am index 906a39c5ef..06e1dd13a9 100644 --- a/opal/mca/pmix/pmix4x/pmix/src/mca/gds/ds21/Makefile.am +++ b/opal/mca/pmix/pmix4x/pmix/src/mca/gds/ds21/Makefile.am @@ -56,6 +56,9 @@ mcacomponent_LTLIBRARIES = $(component) mca_gds_ds21_la_SOURCES = $(component_sources) mca_gds_ds21_la_LDFLAGS = -module -avoid-version \ $(PMIX_TOP_BUILDDIR)/src/mca/common/dstore/libmca_common_dstore.la +if NEED_LIBPMIX +mca_gds_ds21_la_LIBADD = $(top_builddir)/src/libpmix.la +endif noinst_LTLIBRARIES = $(lib) libmca_gds_ds21_la_SOURCES = $(lib_sources) diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/gds/hash/Makefile.am b/opal/mca/pmix/pmix4x/pmix/src/mca/gds/hash/Makefile.am index a4086fbb82..4067145ff2 100644 --- a/opal/mca/pmix/pmix4x/pmix/src/mca/gds/hash/Makefile.am +++ b/opal/mca/pmix/pmix4x/pmix/src/mca/gds/hash/Makefile.am @@ -49,6 +49,9 @@ mcacomponent_LTLIBRARIES = $(component) mca_gds_hash_la_SOURCES = $(component_sources) mca_gds_hash_la_LIBADD = $(gds_hash_LIBS) mca_gds_hash_la_LDFLAGS = -module -avoid-version $(gds_hash_LDFLAGS) +if NEED_LIBPMIX +mca_gds_hash_la_LIBADD += $(top_builddir)/src/libpmix.la +endif noinst_LTLIBRARIES = $(lib) libmca_gds_hash_la_SOURCES = $(lib_sources) diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/gds/hash/gds_hash.c b/opal/mca/pmix/pmix4x/pmix/src/mca/gds/hash/gds_hash.c index 349fedcc1c..1f3c1d0d69 100644 --- a/opal/mca/pmix/pmix4x/pmix/src/mca/gds/hash/gds_hash.c +++ b/opal/mca/pmix/pmix4x/pmix/src/mca/gds/hash/gds_hash.c @@ -1301,7 +1301,6 @@ static pmix_status_t hash_fetch(const pmix_proc_t *proc, val = NULL; rc = pmix_hash_fetch(ht, PMIX_RANK_WILDCARD, NULL, &val); if (PMIX_SUCCESS != rc) { - PMIX_ERROR_LOG(rc); if (NULL != val) { PMIX_VALUE_RELEASE(val); } @@ -1315,7 +1314,6 @@ static pmix_status_t hash_fetch(const pmix_proc_t *proc, if (PMIX_DATA_ARRAY != val->type || NULL == val->data.darray || PMIX_INFO != val->data.darray->type) { - PMIX_ERROR_LOG(PMIX_ERR_INVALID_VAL); PMIX_VALUE_RELEASE(val); return PMIX_ERR_INVALID_VAL; } diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/pcompress/zlib/Makefile.am b/opal/mca/pmix/pmix4x/pmix/src/mca/pcompress/zlib/Makefile.am index 2fda76a39e..c54a393aba 100644 --- a/opal/mca/pmix/pmix4x/pmix/src/mca/pcompress/zlib/Makefile.am +++ b/opal/mca/pmix/pmix4x/pmix/src/mca/pcompress/zlib/Makefile.am @@ -35,6 +35,9 @@ mcacomponent_LTLIBRARIES = $(component_install) mca_pcompress_zlib_la_SOURCES = $(sources) mca_pcompress_zlib_la_LDFLAGS = -module -avoid-version $(pcompress_zlib_LDFLAGS) mca_pcompress_zlib_la_LIBADD = $(pcompress_zlib_LIBS) +if NEED_LIBPMIX +mca_pcompress_zlib_la_LIBADD += $(top_builddir)/src/libpmix.la +endif noinst_LTLIBRARIES = $(component_noinst) libmca_pcompress_zlib_la_SOURCES = $(sources) diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/plog/default/Makefile.am b/opal/mca/pmix/pmix4x/pmix/src/mca/plog/default/Makefile.am index c2343f7f16..369a06269f 100644 --- a/opal/mca/pmix/pmix4x/pmix/src/mca/plog/default/Makefile.am +++ b/opal/mca/pmix/pmix4x/pmix/src/mca/plog/default/Makefile.am @@ -40,6 +40,9 @@ mcacomponentdir = $(pmixlibdir) mcacomponent_LTLIBRARIES = $(component_install) mca_plog_default_la_SOURCES = $(sources) mca_plog_default_la_LDFLAGS = -module -avoid-version +if NEED_LIBPMIX +mca_plog_default_la_LIBADD = $(top_builddir)/src/libpmix.la +endif noinst_LTLIBRARIES = $(component_noinst) libmca_plog_default_la_SOURCES =$(sources) diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/plog/stdfd/Makefile.am b/opal/mca/pmix/pmix4x/pmix/src/mca/plog/stdfd/Makefile.am index 5be11f336a..0cdd43d60c 100644 --- a/opal/mca/pmix/pmix4x/pmix/src/mca/plog/stdfd/Makefile.am +++ b/opal/mca/pmix/pmix4x/pmix/src/mca/plog/stdfd/Makefile.am @@ -40,6 +40,9 @@ mcacomponentdir = $(pmixlibdir) mcacomponent_LTLIBRARIES = $(component_install) mca_plog_stdfd_la_SOURCES = $(sources) mca_plog_stdfd_la_LDFLAGS = -module -avoid-version +if NEED_LIBPMIX +mca_plog_stdfd_la_LIBADD = $(top_builddir)/src/libpmix.la +endif noinst_LTLIBRARIES = $(component_noinst) libmca_plog_stdfd_la_SOURCES =$(sources) diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/plog/syslog/Makefile.am b/opal/mca/pmix/pmix4x/pmix/src/mca/plog/syslog/Makefile.am index a8fe06d582..ba79c07fe7 100644 --- a/opal/mca/pmix/pmix4x/pmix/src/mca/plog/syslog/Makefile.am +++ b/opal/mca/pmix/pmix4x/pmix/src/mca/plog/syslog/Makefile.am @@ -40,6 +40,9 @@ mcacomponentdir = $(pmixlibdir) mcacomponent_LTLIBRARIES = $(component_install) mca_plog_syslog_la_SOURCES = $(sources) mca_plog_syslog_la_LDFLAGS = -module -avoid-version +if NEED_LIBPMIX +mca_plog_syslog_la_LIBADD = $(top_builddir)/src/libpmix.la +endif noinst_LTLIBRARIES = $(component_noinst) libmca_plog_syslog_la_SOURCES =$(sources) diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/pnet/opa/Makefile.am b/opal/mca/pmix/pmix4x/pmix/src/mca/pnet/opa/Makefile.am index d22f69af9f..fe01cde836 100644 --- a/opal/mca/pmix/pmix4x/pmix/src/mca/pnet/opa/Makefile.am +++ b/opal/mca/pmix/pmix4x/pmix/src/mca/pnet/opa/Makefile.am @@ -49,6 +49,9 @@ mcacomponent_LTLIBRARIES = $(component) mca_pnet_opa_la_SOURCES = $(component_sources) mca_pnet_opa_la_LIBADD = $(pnet_opa_LIBS) mca_pnet_opa_la_LDFLAGS = -module -avoid-version $(pnet_opa_LDFLAGS) +if NEED_LIBPMIX +mca_pnet_opa_la_LIBADD += $(top_builddir)/src/libpmix.la +endif noinst_LTLIBRARIES = $(lib) libmca_pnet_opa_la_SOURCES = $(lib_sources) diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/pnet/tcp/Makefile.am b/opal/mca/pmix/pmix4x/pmix/src/mca/pnet/tcp/Makefile.am index c1a3c75766..048f34b0b6 100644 --- a/opal/mca/pmix/pmix4x/pmix/src/mca/pnet/tcp/Makefile.am +++ b/opal/mca/pmix/pmix4x/pmix/src/mca/pnet/tcp/Makefile.am @@ -49,6 +49,9 @@ mcacomponent_LTLIBRARIES = $(component) mca_pnet_tcp_la_SOURCES = $(component_sources) mca_pnet_tcp_la_LIBADD = $(pnet_tcp_LIBS) mca_pnet_tcp_la_LDFLAGS = -module -avoid-version $(pnet_tcp_LDFLAGS) +if NEED_LIBPMIX +mca_pnet_tcp_la_LIBADD += $(top_builddir)/src/libpmix.la +endif noinst_LTLIBRARIES = $(lib) libmca_pnet_tcp_la_SOURCES = $(lib_sources) diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/pnet/test/Makefile.am b/opal/mca/pmix/pmix4x/pmix/src/mca/pnet/test/Makefile.am index b61a8ddb5f..b71000ef55 100644 --- a/opal/mca/pmix/pmix4x/pmix/src/mca/pnet/test/Makefile.am +++ b/opal/mca/pmix/pmix4x/pmix/src/mca/pnet/test/Makefile.am @@ -46,6 +46,9 @@ mcacomponentdir = $(pmixlibdir) mcacomponent_LTLIBRARIES = $(component) mca_pnet_test_la_SOURCES = $(component_sources) mca_pnet_test_la_LDFLAGS = -module -avoid-version +if NEED_LIBPMIX +mca_pnet_test_la_LIBADD = $(top_builddir)/src/libpmix.la +endif noinst_LTLIBRARIES = $(lib) libmca_pnet_test_la_SOURCES = $(lib_sources) diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/preg/native/Makefile.am b/opal/mca/pmix/pmix4x/pmix/src/mca/preg/native/Makefile.am index 0f0c65c538..607dcdb0c9 100644 --- a/opal/mca/pmix/pmix4x/pmix/src/mca/preg/native/Makefile.am +++ b/opal/mca/pmix/pmix4x/pmix/src/mca/preg/native/Makefile.am @@ -44,6 +44,9 @@ mcacomponentdir = $(pmixlibdir) mcacomponent_LTLIBRARIES = $(component) mca_preg_native_la_SOURCES = $(component_sources) mca_preg_native_la_LDFLAGS = -module -avoid-version +if NEED_LIBPMIX +mca_preg_native_la_LIBADD = $(top_builddir)/src/libpmix.la +endif noinst_LTLIBRARIES = $(lib) libmca_preg_native_la_SOURCES = $(lib_sources) diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/psec/munge/Makefile.am b/opal/mca/pmix/pmix4x/pmix/src/mca/psec/munge/Makefile.am index 50a16f7c14..79756320d6 100644 --- a/opal/mca/pmix/pmix4x/pmix/src/mca/psec/munge/Makefile.am +++ b/opal/mca/pmix/pmix4x/pmix/src/mca/psec/munge/Makefile.am @@ -47,6 +47,9 @@ mcacomponent_LTLIBRARIES = $(component) mca_psec_munge_la_SOURCES = $(component_sources) mca_psec_munge_la_LDFLAGS = -module -avoid-version $(psec_munge_LDFLAGS) mca_psec_munge_la_LIBADD = $(psec_munge_LIBS) +if NEED_LIBPMIX +mca_psec_munge_la_LIBADD += $(top_builddir)/src/libpmix.la +endif noinst_LTLIBRARIES = $(lib) libmca_psec_munge_la_SOURCES = $(lib_sources) diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/psec/native/Makefile.am b/opal/mca/pmix/pmix4x/pmix/src/mca/psec/native/Makefile.am index ca6e39f39f..b1086a2aac 100644 --- a/opal/mca/pmix/pmix4x/pmix/src/mca/psec/native/Makefile.am +++ b/opal/mca/pmix/pmix4x/pmix/src/mca/psec/native/Makefile.am @@ -44,6 +44,9 @@ mcacomponentdir = $(pmixlibdir) mcacomponent_LTLIBRARIES = $(component) mca_psec_native_la_SOURCES = $(component_sources) mca_psec_native_la_LDFLAGS = -module -avoid-version +if NEED_LIBPMIX +mca_psec_native_la_LIBADD = $(top_builddir)/src/libpmix.la +endif noinst_LTLIBRARIES = $(lib) libmca_psec_native_la_SOURCES = $(lib_sources) diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/psec/native/psec_native.c b/opal/mca/pmix/pmix4x/pmix/src/mca/psec/native/psec_native.c index 1af787399a..60af0f7af1 100644 --- a/opal/mca/pmix/pmix4x/pmix/src/mca/psec/native/psec_native.c +++ b/opal/mca/pmix/pmix4x/pmix/src/mca/psec/native/psec_native.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015-2018 Intel, Inc. All rights reserved. + * Copyright (c) 2015-2019 Intel, Inc. All rights reserved. * Copyright (c) 2016 IBM Corporation. All rights reserved. * Copyright (c) 2017 Research Organization for Information Science * and Technology (RIST). All rights reserved. @@ -25,7 +25,7 @@ #include "src/util/error.h" #include "src/util/output.h" -#include "src/mca/psec/psec.h" +#include "src/mca/psec/base/base.h" #include "psec_native.h" static pmix_status_t native_init(void); @@ -49,14 +49,14 @@ pmix_psec_module_t pmix_native_module = { static pmix_status_t native_init(void) { - pmix_output_verbose(2, pmix_globals.debug_output, + pmix_output_verbose(2, pmix_psec_base_framework.framework_output, "psec: native init"); return PMIX_SUCCESS; } static void native_finalize(void) { - pmix_output_verbose(2, pmix_globals.debug_output, + pmix_output_verbose(2, pmix_psec_base_framework.framework_output, "psec: native finalize"); } @@ -167,7 +167,7 @@ static pmix_status_t validate_cred(struct pmix_peer_t *peer, size_t n, m; uint32_t u32; - pmix_output_verbose(2, pmix_globals.debug_output, + pmix_output_verbose(2, pmix_psec_base_framework.framework_output, "psec: native validate_cred %s", (NULL == cred) ? "NULL" : "NON-NULL"); @@ -175,10 +175,10 @@ static pmix_status_t validate_cred(struct pmix_peer_t *peer, /* usock protocol - get the remote side's uid/gid */ #if defined(SO_PEERCRED) && (defined(HAVE_STRUCT_UCRED_UID) || defined(HAVE_STRUCT_UCRED_CR_UID)) /* Ignore received 'cred' and validate ucred for socket instead. */ - pmix_output_verbose(2, pmix_globals.debug_output, + pmix_output_verbose(2, pmix_psec_base_framework.framework_output, "psec:native checking getsockopt on socket %d for peer credentials", pr->sd); if (getsockopt(pr->sd, SOL_SOCKET, SO_PEERCRED, &ucred, &crlen) < 0) { - pmix_output_verbose(2, pmix_globals.debug_output, + pmix_output_verbose(2, pmix_psec_base_framework.framework_output, "psec: getsockopt SO_PEERCRED failed: %s", strerror (pmix_socket_errno)); return PMIX_ERR_INVALID_CRED; @@ -192,10 +192,10 @@ static pmix_status_t validate_cred(struct pmix_peer_t *peer, #endif #elif defined(HAVE_GETPEEREID) - pmix_output_verbose(2, pmix_globals.debug_output, + pmix_output_verbose(2, pmix_psec_base_framework.framework_output, "psec:native checking getpeereid on socket %d for peer credentials", pr->sd); if (0 != getpeereid(pr->sd, &euid, &egid)) { - pmix_output_verbose(2, pmix_globals.debug_output, + pmix_output_verbose(2, pmix_psec_base_framework.framework_output, "psec: getsockopt getpeereid failed: %s", strerror (pmix_socket_errno)); return PMIX_ERR_INVALID_CRED; @@ -255,14 +255,14 @@ static pmix_status_t validate_cred(struct pmix_peer_t *peer, /* check uid */ if (euid != pr->info->uid) { - pmix_output_verbose(2, pmix_globals.debug_output, + pmix_output_verbose(2, pmix_psec_base_framework.framework_output, "psec: socket cred contains invalid uid %u", euid); return PMIX_ERR_INVALID_CRED; } /* check gid */ if (egid != pr->info->gid) { - pmix_output_verbose(2, pmix_globals.debug_output, + pmix_output_verbose(2, pmix_psec_base_framework.framework_output, "psec: socket cred contains invalid gid %u", egid); return PMIX_ERR_INVALID_CRED; } diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/psec/none/Makefile.am b/opal/mca/pmix/pmix4x/pmix/src/mca/psec/none/Makefile.am index aa7408b297..cde03ba502 100644 --- a/opal/mca/pmix/pmix4x/pmix/src/mca/psec/none/Makefile.am +++ b/opal/mca/pmix/pmix4x/pmix/src/mca/psec/none/Makefile.am @@ -44,6 +44,9 @@ mcacomponentdir = $(pmixlibdir) mcacomponent_LTLIBRARIES = $(component) mca_psec_none_la_SOURCES = $(component_sources) mca_psec_none_la_LDFLAGS = -module -avoid-version +if NEED_LIBPMIX +mca_psec_none_la_LIBADD = $(top_builddir)/src/libpmix.la +endif noinst_LTLIBRARIES = $(lib) libmca_psec_none_la_SOURCES = $(lib_sources) diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/psensor/file/Makefile.am b/opal/mca/pmix/pmix4x/pmix/src/mca/psensor/file/Makefile.am index 79d648d978..638fcd6a32 100644 --- a/opal/mca/pmix/pmix4x/pmix/src/mca/psensor/file/Makefile.am +++ b/opal/mca/pmix/pmix4x/pmix/src/mca/psensor/file/Makefile.am @@ -31,6 +31,9 @@ mcacomponentdir = $(pmixlibdir) mcacomponent_LTLIBRARIES = $(component_install) mca_psensor_file_la_SOURCES = $(sources) mca_psensor_file_la_LDFLAGS = -module -avoid-version +if NEED_LIBPMIX +mca_psensor_file_la_LIBADD = $(top_builddir)/src/libpmix.la +endif noinst_LTLIBRARIES = $(component_noinst) libmca_psensor_file_la_SOURCES =$(sources) diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/psensor/heartbeat/Makefile.am b/opal/mca/pmix/pmix4x/pmix/src/mca/psensor/heartbeat/Makefile.am index 65d85addb2..95b978415d 100644 --- a/opal/mca/pmix/pmix4x/pmix/src/mca/psensor/heartbeat/Makefile.am +++ b/opal/mca/pmix/pmix4x/pmix/src/mca/psensor/heartbeat/Makefile.am @@ -32,6 +32,9 @@ mcacomponentdir = $(pmixlibdir) mcacomponent_LTLIBRARIES = $(component_install) mca_psensor_heartbeat_la_SOURCES = $(sources) mca_psensor_heartbeat_la_LDFLAGS = -module -avoid-version +if NEED_LIBPMIX +mca_psensor_heartbeat_la_LIBADD = $(top_builddir)/src/libpmix.la +endif noinst_LTLIBRARIES = $(component_noinst) libmca_psensor_heartbeat_la_SOURCES =$(sources) diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/pshmem/mmap/Makefile.am b/opal/mca/pmix/pmix4x/pmix/src/mca/pshmem/mmap/Makefile.am index 3beef0862b..1483ae5de0 100644 --- a/opal/mca/pmix/pmix4x/pmix/src/mca/pshmem/mmap/Makefile.am +++ b/opal/mca/pmix/pmix4x/pmix/src/mca/pshmem/mmap/Makefile.am @@ -37,6 +37,9 @@ mcacomponentdir = $(pmixlibdir) mcacomponent_LTLIBRARIES = $(component) mca_pshmem_mmap_la_SOURCES = $(component_sources) mca_pshmem_mmap_la_LDFLAGS = -module -avoid-version +if NEED_LIBPMIX +mca_pshmem_mmap_la_LIBADD = $(top_builddir)/src/libpmix.la +endif noinst_LTLIBRARIES = $(lib) libmca_pshmem_mmap_la_SOURCES = $(lib_sources) diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/psquash/flex128/Makefile.am b/opal/mca/pmix/pmix4x/pmix/src/mca/psquash/flex128/Makefile.am index fc014a73ad..367f739c87 100644 --- a/opal/mca/pmix/pmix4x/pmix/src/mca/psquash/flex128/Makefile.am +++ b/opal/mca/pmix/pmix4x/pmix/src/mca/psquash/flex128/Makefile.am @@ -34,6 +34,9 @@ mcacomponentdir = $(pmixlibdir) mcacomponent_LTLIBRARIES = $(component) mca_psquash_flex128_la_SOURCES = $(component_sources) mca_psquash_flex128_la_LDFLAGS = -module -avoid-version +if NEED_LIBPMIX +mca_psquash_flex128_la_LIBADD = $(top_builddir)/src/libpmix.la +endif noinst_LTLIBRARIES = $(lib) libmca_psquash_flex128_la_SOURCES = $(lib_sources) diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/psquash/native/Makefile.am b/opal/mca/pmix/pmix4x/pmix/src/mca/psquash/native/Makefile.am index 17d2178304..01a401ae64 100644 --- a/opal/mca/pmix/pmix4x/pmix/src/mca/psquash/native/Makefile.am +++ b/opal/mca/pmix/pmix4x/pmix/src/mca/psquash/native/Makefile.am @@ -37,6 +37,9 @@ mcacomponentdir = $(pmixlibdir) mcacomponent_LTLIBRARIES = $(component) mca_psquash_native_la_SOURCES = $(component_sources) mca_psquash_native_la_LDFLAGS = -module -avoid-version +if NEED_LIBPMIX +mca_psquash_native_la_LIBADD = $(top_builddir)/src/libpmix.la +endif noinst_LTLIBRARIES = $(lib) libmca_psquash_native_la_SOURCES = $(lib_sources) diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/ptl/tcp/Makefile.am b/opal/mca/pmix/pmix4x/pmix/src/mca/ptl/tcp/Makefile.am index 7959643bfb..0a5b86bfda 100644 --- a/opal/mca/pmix/pmix4x/pmix/src/mca/ptl/tcp/Makefile.am +++ b/opal/mca/pmix/pmix4x/pmix/src/mca/ptl/tcp/Makefile.am @@ -44,6 +44,9 @@ mcacomponentdir = $(pmixlibdir) mcacomponent_LTLIBRARIES = $(component) mca_ptl_tcp_la_SOURCES = $(component_sources) mca_ptl_tcp_la_LDFLAGS = -module -avoid-version +if NEED_LIBPMIX +mca_ptl_tcp_la_LIBADD = $(top_builddir)/src/libpmix.la +endif noinst_LTLIBRARIES = $(lib) libmca_ptl_tcp_la_SOURCES = $(lib_sources) diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/ptl/tcp/ptl_tcp_component.c b/opal/mca/pmix/pmix4x/pmix/src/mca/ptl/tcp/ptl_tcp_component.c index 27313f6099..56a683703f 100644 --- a/opal/mca/pmix/pmix4x/pmix/src/mca/ptl/tcp/ptl_tcp_component.c +++ b/opal/mca/pmix/pmix4x/pmix/src/mca/ptl/tcp/ptl_tcp_component.c @@ -1351,11 +1351,21 @@ static void connection_handler(int sd, short args, void *cbdata) } } if (NULL == nptr) { - /* we don't know this namespace, reject it */ - free(msg); - /* send an error reply to the client */ - rc = PMIX_ERR_NOT_FOUND; - goto error; + /* it is possible that this is a tool inside of + * a job-script as part of a multi-spawn operation. + * Since each tool invocation may have finalized and + * terminated, the tool will appear to "terminate", thus + * causing us to cleanup all references to it, and then + * reappear. So we don't reject this connection request. + * Instead, we create the nspace and rank objects for + * it and let the RM/host decide if this behavior + * is allowed */ + nptr = PMIX_NEW(pmix_namespace_t); + if (NULL == nptr) { + rc = PMIX_ERR_NOMEM; + goto error; + } + nptr->nspace = strdup(nspace); } /* now look for the rank */ info = NULL; @@ -1367,11 +1377,13 @@ static void connection_handler(int sd, short args, void *cbdata) } } if (!found) { - /* rank unknown, reject it */ - free(msg); - /* send an error reply to the client */ - rc = PMIX_ERR_NOT_FOUND; - goto error; + /* see above note about not finding nspace */ + info = PMIX_NEW(pmix_rank_info_t); + info->pname.nspace = strdup(nspace); + info->pname.rank = rank; + info->uid = pnd->uid; + info->gid = pnd->gid; + pmix_list_append(&nptr->ranks, &info->super); } PMIX_RETAIN(info); peer->info = info; @@ -1906,8 +1918,8 @@ static void cnct_cbfunc(pmix_status_t status, pmix_setup_caddy_t *cd; pmix_output_verbose(2, pmix_ptl_base_framework.framework_output, - "pmix:tcp:cnct_cbfunc returning %s:%d", - proc->nspace, proc->rank); + "pmix:tcp:cnct_cbfunc returning %s:%d %s", + proc->nspace, proc->rank, PMIx_Error_string(status)); /* need to thread-shift this into our context */ cd = PMIX_NEW(pmix_setup_caddy_t); diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/ptl/usock/Makefile.am b/opal/mca/pmix/pmix4x/pmix/src/mca/ptl/usock/Makefile.am index 3d015399be..2c91ac37c8 100644 --- a/opal/mca/pmix/pmix4x/pmix/src/mca/ptl/usock/Makefile.am +++ b/opal/mca/pmix/pmix4x/pmix/src/mca/ptl/usock/Makefile.am @@ -44,6 +44,9 @@ mcacomponentdir = $(pmixlibdir) mcacomponent_LTLIBRARIES = $(component) mca_ptl_usock_la_SOURCES = $(component_sources) mca_ptl_usock_la_LDFLAGS = -module -avoid-version +if NEED_LIBPMIX +mca_ptl_usock_la_LIBADD = $(top_builddir)/src/libpmix.la +endif noinst_LTLIBRARIES = $(lib) libmca_ptl_usock_la_SOURCES = $(lib_sources) diff --git a/opal/mca/pmix/pmix4x/pmix/src/tool/pmix_tool.c b/opal/mca/pmix/pmix4x/pmix/src/tool/pmix_tool.c index 238cbbdab7..62978fb6f3 100644 --- a/opal/mca/pmix/pmix4x/pmix/src/tool/pmix_tool.c +++ b/opal/mca/pmix/pmix4x/pmix/src/tool/pmix_tool.c @@ -257,9 +257,7 @@ static void job_data(struct pmix_peer_t *pr, PMIX_EXPORT int PMIx_tool_init(pmix_proc_t *proc, pmix_info_t info[], size_t ninfo) { - pmix_kval_t *kptr; pmix_status_t rc; - char hostname[PMIX_MAX_NSLEN]; char *evar, *nspace = NULL; pmix_rank_t rank = PMIX_RANK_UNDEF; bool gdsfound, do_not_connect = false; @@ -735,318 +733,38 @@ PMIX_EXPORT int PMIx_tool_init(pmix_proc_t *proc, PMIX_RELEASE_THREAD(&pmix_global_lock); return rc; } + /* quick check to see if we got something back. If this + * is a launcher that is being executed multiple times + * in a job-script, then the original registration data + * will have been deleted after the first invocation. In + * such a case, we simply regenerate it locally as it is + * well-known */ + pmix_cb_t cb; + PMIX_CONSTRUCT(&cb, pmix_cb_t); + pmix_strncpy(wildcard.nspace, pmix_globals.myid.nspace, PMIX_MAX_NSLEN); + wildcard.rank = PMIX_RANK_WILDCARD; + cb.proc = &wildcard; + cb.copy = true; + PMIX_GDS_FETCH_KV(rc, pmix_globals.mypeer, &cb); + if (PMIX_SUCCESS != rc) { + pmix_output_verbose(5, pmix_client_globals.get_output, + "pmix:tool:client data not found in internal storage"); + rc = pmix_tool_init_info(); + if (PMIX_SUCCESS != rc) { + PMIX_RELEASE_THREAD(&pmix_global_lock); + return rc; + } + } } else { /* now finish the initialization by filling our local * datastore with typical job-related info. No point * in having the server generate these as we are * obviously a singleton, and so the values are well-known */ - pmix_strncpy(wildcard.nspace, pmix_globals.myid.nspace, PMIX_MAX_NSLEN); - wildcard.rank = pmix_globals.myid.rank; - - /* the jobid is just our nspace */ - kptr = PMIX_NEW(pmix_kval_t); - kptr->key = strdup(PMIX_JOBID); - PMIX_VALUE_CREATE(kptr->value, 1); - kptr->value->type = PMIX_STRING; - kptr->value->data.string = strdup(pmix_globals.myid.nspace); - PMIX_GDS_STORE_KV(rc, pmix_globals.mypeer, - &wildcard, - PMIX_INTERNAL, kptr); + rc = pmix_tool_init_info(); if (PMIX_SUCCESS != rc) { - PMIX_ERROR_LOG(rc); PMIX_RELEASE_THREAD(&pmix_global_lock); return rc; } - PMIX_RELEASE(kptr); // maintain accounting - - /* our rank */ - kptr = PMIX_NEW(pmix_kval_t); - kptr->key = strdup(PMIX_RANK); - PMIX_VALUE_CREATE(kptr->value, 1); - kptr->value->type = PMIX_INT; - kptr->value->data.integer = 0; - PMIX_GDS_STORE_KV(rc, pmix_globals.mypeer, - &pmix_globals.myid, - PMIX_INTERNAL, kptr); - if (PMIX_SUCCESS != rc) { - PMIX_ERROR_LOG(rc); - PMIX_RELEASE_THREAD(&pmix_global_lock); - return rc; - } - PMIX_RELEASE(kptr); // maintain accounting - - /* nproc offset */ - kptr = PMIX_NEW(pmix_kval_t); - kptr->key = strdup(PMIX_NPROC_OFFSET); - PMIX_VALUE_CREATE(kptr->value, 1); - kptr->value->type = PMIX_UINT32; - kptr->value->data.uint32 = 0; - PMIX_GDS_STORE_KV(rc, pmix_globals.mypeer, - &wildcard, - PMIX_INTERNAL, kptr); - if (PMIX_SUCCESS != rc) { - PMIX_ERROR_LOG(rc); - PMIX_RELEASE_THREAD(&pmix_global_lock); - return rc; - } - PMIX_RELEASE(kptr); // maintain accounting - - /* node size */ - kptr = PMIX_NEW(pmix_kval_t); - kptr->key = strdup(PMIX_NODE_SIZE); - PMIX_VALUE_CREATE(kptr->value, 1); - kptr->value->type = PMIX_UINT32; - kptr->value->data.uint32 = 1; - PMIX_GDS_STORE_KV(rc, pmix_globals.mypeer, - &wildcard, - PMIX_INTERNAL, kptr); - if (PMIX_SUCCESS != rc) { - PMIX_ERROR_LOG(rc); - PMIX_RELEASE_THREAD(&pmix_global_lock); - return rc; - } - PMIX_RELEASE(kptr); // maintain accounting - - /* local peers */ - kptr = PMIX_NEW(pmix_kval_t); - kptr->key = strdup(PMIX_LOCAL_PEERS); - PMIX_VALUE_CREATE(kptr->value, 1); - kptr->value->type = PMIX_STRING; - kptr->value->data.string = strdup("0"); - PMIX_GDS_STORE_KV(rc, pmix_globals.mypeer, - &wildcard, - PMIX_INTERNAL, kptr); - if (PMIX_SUCCESS != rc) { - PMIX_ERROR_LOG(rc); - PMIX_RELEASE_THREAD(&pmix_global_lock); - return rc; - } - PMIX_RELEASE(kptr); // maintain accounting - - /* local leader */ - kptr = PMIX_NEW(pmix_kval_t); - kptr->key = strdup(PMIX_LOCALLDR); - PMIX_VALUE_CREATE(kptr->value, 1); - kptr->value->type = PMIX_UINT32; - kptr->value->data.uint32 = 0; - PMIX_GDS_STORE_KV(rc, pmix_globals.mypeer, - &wildcard, - PMIX_INTERNAL, kptr); - if (PMIX_SUCCESS != rc) { - PMIX_ERROR_LOG(rc); - PMIX_RELEASE_THREAD(&pmix_global_lock); - return rc; - } - PMIX_RELEASE(kptr); // maintain accounting - - /* universe size */ - kptr = PMIX_NEW(pmix_kval_t); - kptr->key = strdup(PMIX_UNIV_SIZE); - PMIX_VALUE_CREATE(kptr->value, 1); - kptr->value->type = PMIX_UINT32; - kptr->value->data.uint32 = 1; - PMIX_GDS_STORE_KV(rc, pmix_globals.mypeer, - &wildcard, - PMIX_INTERNAL, kptr); - if (PMIX_SUCCESS != rc) { - PMIX_ERROR_LOG(rc); - PMIX_RELEASE_THREAD(&pmix_global_lock); - return rc; - } - PMIX_RELEASE(kptr); // maintain accounting - - /* job size - we are our very own job, so we have no peers */ - kptr = PMIX_NEW(pmix_kval_t); - kptr->key = strdup(PMIX_JOB_SIZE); - PMIX_VALUE_CREATE(kptr->value, 1); - kptr->value->type = PMIX_UINT32; - kptr->value->data.uint32 = 1; - PMIX_GDS_STORE_KV(rc, pmix_globals.mypeer, - &wildcard, - PMIX_INTERNAL, kptr); - if (PMIX_SUCCESS != rc) { - PMIX_ERROR_LOG(rc); - PMIX_RELEASE_THREAD(&pmix_global_lock); - return rc; - } - PMIX_RELEASE(kptr); // maintain accounting - - /* local size - only us in our job */ - kptr = PMIX_NEW(pmix_kval_t); - kptr->key = strdup(PMIX_LOCAL_SIZE); - PMIX_VALUE_CREATE(kptr->value, 1); - kptr->value->type = PMIX_UINT32; - kptr->value->data.uint32 = 1; - PMIX_GDS_STORE_KV(rc, pmix_globals.mypeer, - &wildcard, - PMIX_INTERNAL, kptr); - if (PMIX_SUCCESS != rc) { - PMIX_ERROR_LOG(rc); - PMIX_RELEASE_THREAD(&pmix_global_lock); - return rc; - } - PMIX_RELEASE(kptr); // maintain accounting - - /* max procs - since we are a self-started tool, there is no - * allocation within which we can grow ourselves */ - kptr = PMIX_NEW(pmix_kval_t); - kptr->key = strdup(PMIX_MAX_PROCS); - PMIX_VALUE_CREATE(kptr->value, 1); - kptr->value->type = PMIX_UINT32; - kptr->value->data.uint32 = 1; - PMIX_GDS_STORE_KV(rc, pmix_globals.mypeer, - &wildcard, - PMIX_INTERNAL, kptr); - if (PMIX_SUCCESS != rc) { - PMIX_ERROR_LOG(rc); - PMIX_RELEASE_THREAD(&pmix_global_lock); - return rc; - } - PMIX_RELEASE(kptr); // maintain accounting - - /* app number */ - kptr = PMIX_NEW(pmix_kval_t); - kptr->key = strdup(PMIX_APPNUM); - PMIX_VALUE_CREATE(kptr->value, 1); - kptr->value->type = PMIX_UINT32; - kptr->value->data.uint32 = 0; - PMIX_GDS_STORE_KV(rc, pmix_globals.mypeer, - &pmix_globals.myid, - PMIX_INTERNAL, kptr); - if (PMIX_SUCCESS != rc) { - PMIX_ERROR_LOG(rc); - PMIX_RELEASE_THREAD(&pmix_global_lock); - return rc; - } - PMIX_RELEASE(kptr); // maintain accounting - - /* app leader */ - kptr = PMIX_NEW(pmix_kval_t); - kptr->key = strdup(PMIX_APPLDR); - PMIX_VALUE_CREATE(kptr->value, 1); - kptr->value->type = PMIX_UINT32; - kptr->value->data.uint32 = 0; - PMIX_GDS_STORE_KV(rc, pmix_globals.mypeer, - &pmix_globals.myid, - PMIX_INTERNAL, kptr); - if (PMIX_SUCCESS != rc) { - PMIX_ERROR_LOG(rc); - PMIX_RELEASE_THREAD(&pmix_global_lock); - return rc; - } - PMIX_RELEASE(kptr); // maintain accounting - - /* app rank */ - kptr = PMIX_NEW(pmix_kval_t); - kptr->key = strdup(PMIX_APP_RANK); - PMIX_VALUE_CREATE(kptr->value, 1); - kptr->value->type = PMIX_UINT32; - kptr->value->data.uint32 = 0; - PMIX_GDS_STORE_KV(rc, pmix_globals.mypeer, - &pmix_globals.myid, - PMIX_INTERNAL, kptr); - if (PMIX_SUCCESS != rc) { - PMIX_ERROR_LOG(rc); - PMIX_RELEASE_THREAD(&pmix_global_lock); - return rc; - } - PMIX_RELEASE(kptr); // maintain accounting - - /* global rank */ - kptr = PMIX_NEW(pmix_kval_t); - kptr->key = strdup(PMIX_GLOBAL_RANK); - PMIX_VALUE_CREATE(kptr->value, 1); - kptr->value->type = PMIX_UINT32; - kptr->value->data.uint32 = 0; - PMIX_GDS_STORE_KV(rc, pmix_globals.mypeer, - &pmix_globals.myid, - PMIX_INTERNAL, kptr); - if (PMIX_SUCCESS != rc) { - PMIX_ERROR_LOG(rc); - PMIX_RELEASE_THREAD(&pmix_global_lock); - return rc; - } - PMIX_RELEASE(kptr); // maintain accounting - - /* local rank - we are alone in our job */ - kptr = PMIX_NEW(pmix_kval_t); - kptr->key = strdup(PMIX_LOCAL_RANK); - PMIX_VALUE_CREATE(kptr->value, 1); - kptr->value->type = PMIX_UINT16; - kptr->value->data.uint32 = 0; - PMIX_GDS_STORE_KV(rc, pmix_globals.mypeer, - &pmix_globals.myid, - PMIX_INTERNAL, kptr); - if (PMIX_SUCCESS != rc) { - PMIX_ERROR_LOG(rc); - PMIX_RELEASE_THREAD(&pmix_global_lock); - return rc; - } - PMIX_RELEASE(kptr); // maintain accounting - - /* we cannot know the node rank as we don't know what - * other processes are executing on this node - so - * we'll add that info to the server-tool handshake - * and load it from there */ - - /* hostname */ - if (NULL != pmix_globals.hostname) { - pmix_strncpy(hostname, pmix_globals.hostname, PMIX_MAX_NSLEN); - } else { - gethostname(hostname, PMIX_MAX_NSLEN); - } - kptr = PMIX_NEW(pmix_kval_t); - kptr->key = strdup(PMIX_HOSTNAME); - PMIX_VALUE_CREATE(kptr->value, 1); - kptr->value->type = PMIX_STRING; - kptr->value->data.string = strdup(hostname); - PMIX_GDS_STORE_KV(rc, pmix_globals.mypeer, - &pmix_globals.myid, - PMIX_INTERNAL, kptr); - if (PMIX_SUCCESS != rc) { - PMIX_ERROR_LOG(rc); - PMIX_RELEASE_THREAD(&pmix_global_lock); - return rc; - } - PMIX_RELEASE(kptr); // maintain accounting - - /* we cannot know the RM's nodeid for this host, so - * we'll add that info to the server-tool handshake - * and load it from there */ - - /* the nodemap is simply our hostname as there is no - * regex to generate */ - kptr = PMIX_NEW(pmix_kval_t); - kptr->key = strdup(PMIX_NODE_MAP); - PMIX_VALUE_CREATE(kptr->value, 1); - kptr->value->type = PMIX_STRING; - kptr->value->data.string = strdup(hostname); - PMIX_GDS_STORE_KV(rc, pmix_globals.mypeer, - &wildcard, - PMIX_INTERNAL, kptr); - if (PMIX_SUCCESS != rc) { - PMIX_ERROR_LOG(rc); - PMIX_RELEASE_THREAD(&pmix_global_lock); - return rc; - } - PMIX_RELEASE(kptr); // maintain accounting - - /* likewise, the proc map is just our rank as we are - * the only proc in this job */ - kptr = PMIX_NEW(pmix_kval_t); - kptr->key = strdup(PMIX_PROC_MAP); - PMIX_VALUE_CREATE(kptr->value, 1); - kptr->value->type = PMIX_STRING; - kptr->value->data.string = strdup("0"); - PMIX_GDS_STORE_KV(rc, pmix_globals.mypeer, - &wildcard, - PMIX_INTERNAL, kptr); - if (PMIX_SUCCESS != rc) { - PMIX_ERROR_LOG(rc); - PMIX_RELEASE_THREAD(&pmix_global_lock); - return rc; - } - PMIX_RELEASE(kptr); // maintain accounting } PMIX_RELEASE_THREAD(&pmix_global_lock); @@ -1064,6 +782,307 @@ PMIX_EXPORT int PMIx_tool_init(pmix_proc_t *proc, return rc; } +pmix_status_t pmix_tool_init_info(void) +{ + pmix_kval_t *kptr; + pmix_status_t rc; + pmix_proc_t wildcard; + char hostname[PMIX_MAX_NSLEN]; + + pmix_strncpy(wildcard.nspace, pmix_globals.myid.nspace, PMIX_MAX_NSLEN); + wildcard.rank = pmix_globals.myid.rank; + + /* the jobid is just our nspace */ + kptr = PMIX_NEW(pmix_kval_t); + kptr->key = strdup(PMIX_JOBID); + PMIX_VALUE_CREATE(kptr->value, 1); + kptr->value->type = PMIX_STRING; + kptr->value->data.string = strdup(pmix_globals.myid.nspace); + PMIX_GDS_STORE_KV(rc, pmix_globals.mypeer, + &wildcard, + PMIX_INTERNAL, kptr); + if (PMIX_SUCCESS != rc) { + PMIX_ERROR_LOG(rc); + return rc; + } + PMIX_RELEASE(kptr); // maintain accounting + + /* our rank */ + kptr = PMIX_NEW(pmix_kval_t); + kptr->key = strdup(PMIX_RANK); + PMIX_VALUE_CREATE(kptr->value, 1); + kptr->value->type = PMIX_INT; + kptr->value->data.integer = 0; + PMIX_GDS_STORE_KV(rc, pmix_globals.mypeer, + &pmix_globals.myid, + PMIX_INTERNAL, kptr); + if (PMIX_SUCCESS != rc) { + PMIX_ERROR_LOG(rc); + return rc; + } + PMIX_RELEASE(kptr); // maintain accounting + + /* nproc offset */ + kptr = PMIX_NEW(pmix_kval_t); + kptr->key = strdup(PMIX_NPROC_OFFSET); + PMIX_VALUE_CREATE(kptr->value, 1); + kptr->value->type = PMIX_UINT32; + kptr->value->data.uint32 = 0; + PMIX_GDS_STORE_KV(rc, pmix_globals.mypeer, + &wildcard, + PMIX_INTERNAL, kptr); + if (PMIX_SUCCESS != rc) { + PMIX_ERROR_LOG(rc); + return rc; + } + PMIX_RELEASE(kptr); // maintain accounting + + /* node size */ + kptr = PMIX_NEW(pmix_kval_t); + kptr->key = strdup(PMIX_NODE_SIZE); + PMIX_VALUE_CREATE(kptr->value, 1); + kptr->value->type = PMIX_UINT32; + kptr->value->data.uint32 = 1; + PMIX_GDS_STORE_KV(rc, pmix_globals.mypeer, + &wildcard, + PMIX_INTERNAL, kptr); + if (PMIX_SUCCESS != rc) { + PMIX_ERROR_LOG(rc); + return rc; + } + PMIX_RELEASE(kptr); // maintain accounting + + /* local peers */ + kptr = PMIX_NEW(pmix_kval_t); + kptr->key = strdup(PMIX_LOCAL_PEERS); + PMIX_VALUE_CREATE(kptr->value, 1); + kptr->value->type = PMIX_STRING; + kptr->value->data.string = strdup("0"); + PMIX_GDS_STORE_KV(rc, pmix_globals.mypeer, + &wildcard, + PMIX_INTERNAL, kptr); + if (PMIX_SUCCESS != rc) { + PMIX_ERROR_LOG(rc); + return rc; + } + PMIX_RELEASE(kptr); // maintain accounting + + /* local leader */ + kptr = PMIX_NEW(pmix_kval_t); + kptr->key = strdup(PMIX_LOCALLDR); + PMIX_VALUE_CREATE(kptr->value, 1); + kptr->value->type = PMIX_UINT32; + kptr->value->data.uint32 = 0; + PMIX_GDS_STORE_KV(rc, pmix_globals.mypeer, + &wildcard, + PMIX_INTERNAL, kptr); + if (PMIX_SUCCESS != rc) { + PMIX_ERROR_LOG(rc); + return rc; + } + PMIX_RELEASE(kptr); // maintain accounting + + /* universe size */ + kptr = PMIX_NEW(pmix_kval_t); + kptr->key = strdup(PMIX_UNIV_SIZE); + PMIX_VALUE_CREATE(kptr->value, 1); + kptr->value->type = PMIX_UINT32; + kptr->value->data.uint32 = 1; + PMIX_GDS_STORE_KV(rc, pmix_globals.mypeer, + &wildcard, + PMIX_INTERNAL, kptr); + if (PMIX_SUCCESS != rc) { + PMIX_ERROR_LOG(rc); + return rc; + } + PMIX_RELEASE(kptr); // maintain accounting + + /* job size - we are our very own job, so we have no peers */ + kptr = PMIX_NEW(pmix_kval_t); + kptr->key = strdup(PMIX_JOB_SIZE); + PMIX_VALUE_CREATE(kptr->value, 1); + kptr->value->type = PMIX_UINT32; + kptr->value->data.uint32 = 1; + PMIX_GDS_STORE_KV(rc, pmix_globals.mypeer, + &wildcard, + PMIX_INTERNAL, kptr); + if (PMIX_SUCCESS != rc) { + PMIX_ERROR_LOG(rc); + return rc; + } + PMIX_RELEASE(kptr); // maintain accounting + + /* local size - only us in our job */ + kptr = PMIX_NEW(pmix_kval_t); + kptr->key = strdup(PMIX_LOCAL_SIZE); + PMIX_VALUE_CREATE(kptr->value, 1); + kptr->value->type = PMIX_UINT32; + kptr->value->data.uint32 = 1; + PMIX_GDS_STORE_KV(rc, pmix_globals.mypeer, + &wildcard, + PMIX_INTERNAL, kptr); + if (PMIX_SUCCESS != rc) { + PMIX_ERROR_LOG(rc); + return rc; + } + PMIX_RELEASE(kptr); // maintain accounting + + /* max procs - since we are a self-started tool, there is no + * allocation within which we can grow ourselves */ + kptr = PMIX_NEW(pmix_kval_t); + kptr->key = strdup(PMIX_MAX_PROCS); + PMIX_VALUE_CREATE(kptr->value, 1); + kptr->value->type = PMIX_UINT32; + kptr->value->data.uint32 = 1; + PMIX_GDS_STORE_KV(rc, pmix_globals.mypeer, + &wildcard, + PMIX_INTERNAL, kptr); + if (PMIX_SUCCESS != rc) { + PMIX_ERROR_LOG(rc); + return rc; + } + PMIX_RELEASE(kptr); // maintain accounting + + /* app number */ + kptr = PMIX_NEW(pmix_kval_t); + kptr->key = strdup(PMIX_APPNUM); + PMIX_VALUE_CREATE(kptr->value, 1); + kptr->value->type = PMIX_UINT32; + kptr->value->data.uint32 = 0; + PMIX_GDS_STORE_KV(rc, pmix_globals.mypeer, + &pmix_globals.myid, + PMIX_INTERNAL, kptr); + if (PMIX_SUCCESS != rc) { + PMIX_ERROR_LOG(rc); + return rc; + } + PMIX_RELEASE(kptr); // maintain accounting + + /* app leader */ + kptr = PMIX_NEW(pmix_kval_t); + kptr->key = strdup(PMIX_APPLDR); + PMIX_VALUE_CREATE(kptr->value, 1); + kptr->value->type = PMIX_UINT32; + kptr->value->data.uint32 = 0; + PMIX_GDS_STORE_KV(rc, pmix_globals.mypeer, + &pmix_globals.myid, + PMIX_INTERNAL, kptr); + if (PMIX_SUCCESS != rc) { + PMIX_ERROR_LOG(rc); + return rc; + } + PMIX_RELEASE(kptr); // maintain accounting + + /* app rank */ + kptr = PMIX_NEW(pmix_kval_t); + kptr->key = strdup(PMIX_APP_RANK); + PMIX_VALUE_CREATE(kptr->value, 1); + kptr->value->type = PMIX_UINT32; + kptr->value->data.uint32 = 0; + PMIX_GDS_STORE_KV(rc, pmix_globals.mypeer, + &pmix_globals.myid, + PMIX_INTERNAL, kptr); + if (PMIX_SUCCESS != rc) { + PMIX_ERROR_LOG(rc); + return rc; + } + PMIX_RELEASE(kptr); // maintain accounting + + /* global rank */ + kptr = PMIX_NEW(pmix_kval_t); + kptr->key = strdup(PMIX_GLOBAL_RANK); + PMIX_VALUE_CREATE(kptr->value, 1); + kptr->value->type = PMIX_UINT32; + kptr->value->data.uint32 = 0; + PMIX_GDS_STORE_KV(rc, pmix_globals.mypeer, + &pmix_globals.myid, + PMIX_INTERNAL, kptr); + if (PMIX_SUCCESS != rc) { + PMIX_ERROR_LOG(rc); + return rc; + } + PMIX_RELEASE(kptr); // maintain accounting + + /* local rank - we are alone in our job */ + kptr = PMIX_NEW(pmix_kval_t); + kptr->key = strdup(PMIX_LOCAL_RANK); + PMIX_VALUE_CREATE(kptr->value, 1); + kptr->value->type = PMIX_UINT16; + kptr->value->data.uint32 = 0; + PMIX_GDS_STORE_KV(rc, pmix_globals.mypeer, + &pmix_globals.myid, + PMIX_INTERNAL, kptr); + if (PMIX_SUCCESS != rc) { + PMIX_ERROR_LOG(rc); + return rc; + } + PMIX_RELEASE(kptr); // maintain accounting + + /* we cannot know the node rank as we don't know what + * other processes are executing on this node - so + * we'll add that info to the server-tool handshake + * and load it from there */ + + /* hostname */ + if (NULL != pmix_globals.hostname) { + pmix_strncpy(hostname, pmix_globals.hostname, PMIX_MAX_NSLEN); + } else { + gethostname(hostname, PMIX_MAX_NSLEN); + } + kptr = PMIX_NEW(pmix_kval_t); + kptr->key = strdup(PMIX_HOSTNAME); + PMIX_VALUE_CREATE(kptr->value, 1); + kptr->value->type = PMIX_STRING; + kptr->value->data.string = strdup(hostname); + PMIX_GDS_STORE_KV(rc, pmix_globals.mypeer, + &pmix_globals.myid, + PMIX_INTERNAL, kptr); + if (PMIX_SUCCESS != rc) { + PMIX_ERROR_LOG(rc); + return rc; + } + PMIX_RELEASE(kptr); // maintain accounting + + /* we cannot know the RM's nodeid for this host, so + * we'll add that info to the server-tool handshake + * and load it from there */ + + /* the nodemap is simply our hostname as there is no + * regex to generate */ + kptr = PMIX_NEW(pmix_kval_t); + kptr->key = strdup(PMIX_NODE_MAP); + PMIX_VALUE_CREATE(kptr->value, 1); + kptr->value->type = PMIX_STRING; + kptr->value->data.string = strdup(hostname); + PMIX_GDS_STORE_KV(rc, pmix_globals.mypeer, + &wildcard, + PMIX_INTERNAL, kptr); + if (PMIX_SUCCESS != rc) { + PMIX_ERROR_LOG(rc); + return rc; + } + PMIX_RELEASE(kptr); // maintain accounting + + /* likewise, the proc map is just our rank as we are + * the only proc in this job */ + kptr = PMIX_NEW(pmix_kval_t); + kptr->key = strdup(PMIX_PROC_MAP); + PMIX_VALUE_CREATE(kptr->value, 1); + kptr->value->type = PMIX_STRING; + kptr->value->data.string = strdup("0"); + PMIX_GDS_STORE_KV(rc, pmix_globals.mypeer, + &wildcard, + PMIX_INTERNAL, kptr); + if (PMIX_SUCCESS != rc) { + PMIX_ERROR_LOG(rc); + return rc; + } + PMIX_RELEASE(kptr); // maintain accounting + + return PMIX_SUCCESS; +} + + typedef struct { pmix_lock_t lock; pmix_event_t ev; diff --git a/opal/mca/pmix/pmix4x/pmix/test/Makefile.am b/opal/mca/pmix/pmix4x/pmix/test/Makefile.am index 36f2684eb8..c886e3b1fb 100644 --- a/opal/mca/pmix/pmix4x/pmix/test/Makefile.am +++ b/opal/mca/pmix/pmix4x/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-2017 Intel, Inc. All rights reserved. +# Copyright (c) 2013-2019 Intel, Inc. All rights reserved. # Copyright (c) 2018 Research Organization for Information Science # and Technology (RIST). All rights reserved. # $COPYRIGHT$ @@ -33,9 +33,61 @@ 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_SCRIPTS = pmix_client_otheruser.sh \ + run_tests00.pl \ + run_tests01.pl \ + run_tests02.pl \ + run_tests03.pl \ + run_tests04.pl \ + run_tests05.pl \ + run_tests06.pl \ + run_tests07.pl \ + run_tests08.pl \ + run_tests09.pl \ + run_tests10.pl \ + run_tests11.pl \ + run_tests12.pl \ + run_tests13.pl \ + run_tests14.pl \ + run_tests15.pl + noinst_PROGRAMS = +######################### +# Support for "make check" + +check_PROGRAMS = \ + pmix_test \ + pmix_client \ + pmix_regex + +if WANT_PMI_BACKWARD +check_PROGRAMS += \ + pmi_client \ + pmi2_client +endif + +TESTS = \ + run_tests00.pl \ + run_tests01.pl \ + run_tests02.pl \ + run_tests03.pl \ + run_tests04.pl \ + run_tests05.pl \ + run_tests06.pl \ + run_tests07.pl \ + run_tests08.pl \ + run_tests09.pl \ + run_tests10.pl \ + run_tests11.pl \ + run_tests12.pl \ + run_tests13.pl \ + run_tests14.pl \ + run_tests15.pl + + +########################## + if WANT_PMI_BACKWARD noinst_PROGRAMS += pmi_client pmi2_client endif diff --git a/opal/mca/pmix/pmix4x/pmix/test/run_tests00.pl.in b/opal/mca/pmix/pmix4x/pmix/test/run_tests00.pl.in new file mode 100755 index 0000000000..fb139c9ce7 --- /dev/null +++ b/opal/mca/pmix/pmix4x/pmix/test/run_tests00.pl.in @@ -0,0 +1,73 @@ +#!/usr/bin/env perl +# +# Copyright (c) 2019 Intel, Inc. +# +# Copyright (c) 2019 Cisco Systems, Inc. All rights reserved +# $COPYRIGHT$ +# +# Additional copyrights may follow + +use strict; + +my @tests = ("-n 4 --ns-dist 3:1 --fence \"[db | 0:0-2;1:0]\"", + "-n 4 --ns-dist 3:1 --fence \"[db | 0:;1:0]\"", + "-n 4 --ns-dist 3:1 --fence \"[db | 0:;1:]\"", + "-n 4 --ns-dist 3:1 --fence \"[0:]\"", + "-n 4 --ns-dist 3:1 --fence \"[b | 0:]\"", + "-n 4 --ns-dist 3:1 --fence \"[d | 0:]\" --noise \"[0:0,1]\"", + "-n 4 --job-fence -c", + "-n 4 --job-fence", + "-n 2 --test-publish", + "-n 2 --test-spawn", + "-n 2 --test-connect", + "-n 5 --test-resolve-peers --ns-dist \"1:2:2\"", + "-n 5 --test-replace 100:0,1,10,50,99", + "-n 5 --test-internal 10", + "-s 2 -n 2 --job-fence", + "-s 2 -n 2 --job-fence -c"); + +my $test; +my $cmd; +my $output; +my $status = 0; +my $testnum; + +# We are running tests against the build tree (vs. the installation +# tree). Autogen gives us a full list of all possible component +# directories in PMIX_COMPONENT_LIBRARY_PATHS. Iterate through each +# of those directories: 1) to see if there is actually a component +# built in there, and 2) to turn it into an absolute path name. Then +# put the new list in the "mca_bast_component_path" MCA parameter env +# variable so that the MCA base knows where to find all the +# components. +my @myfullpaths; +my $mybuilddir = "@PMIX_BUILT_TEST_PREFIX@"; +my $mypathstr = "@PMIX_COMPONENT_LIBRARY_PATHS@"; +my @splitstr = split(':', $mypathstr); +foreach my $path (@splitstr) { + # Note that the component is actually built in the ".libs" + # subdirectory. If the component wasn't built, that subdirectory + # will not exist, so don't save it. + my $fullpath = $mybuilddir . "/" . $path . "/.libs"; + push(@myfullpaths, $fullpath) + if (-d $fullpath); +} +my $mymcapaths = join(":", @myfullpaths); +$ENV{'PMIX_MCA_mca_base_component_path'} = $mymcapaths; + +my $wdir = $mybuilddir . "/test"; +chdir $wdir; + +$testnum = $0; +$testnum =~ s/.pl//; +$testnum = substr($testnum, -2); +$test = @tests[$testnum]; + +$cmd = "./pmix_test " . $test . " 2>&1"; +print $cmd . "\n"; +$output = `$cmd`; +print $output . "\n"; +print "CODE $?\n"; +$status = "$?"; + +exit($status >> 8); diff --git a/opal/mca/pmix/pmix4x/pmix/test/run_tests01.pl.in b/opal/mca/pmix/pmix4x/pmix/test/run_tests01.pl.in new file mode 100755 index 0000000000..fb139c9ce7 --- /dev/null +++ b/opal/mca/pmix/pmix4x/pmix/test/run_tests01.pl.in @@ -0,0 +1,73 @@ +#!/usr/bin/env perl +# +# Copyright (c) 2019 Intel, Inc. +# +# Copyright (c) 2019 Cisco Systems, Inc. All rights reserved +# $COPYRIGHT$ +# +# Additional copyrights may follow + +use strict; + +my @tests = ("-n 4 --ns-dist 3:1 --fence \"[db | 0:0-2;1:0]\"", + "-n 4 --ns-dist 3:1 --fence \"[db | 0:;1:0]\"", + "-n 4 --ns-dist 3:1 --fence \"[db | 0:;1:]\"", + "-n 4 --ns-dist 3:1 --fence \"[0:]\"", + "-n 4 --ns-dist 3:1 --fence \"[b | 0:]\"", + "-n 4 --ns-dist 3:1 --fence \"[d | 0:]\" --noise \"[0:0,1]\"", + "-n 4 --job-fence -c", + "-n 4 --job-fence", + "-n 2 --test-publish", + "-n 2 --test-spawn", + "-n 2 --test-connect", + "-n 5 --test-resolve-peers --ns-dist \"1:2:2\"", + "-n 5 --test-replace 100:0,1,10,50,99", + "-n 5 --test-internal 10", + "-s 2 -n 2 --job-fence", + "-s 2 -n 2 --job-fence -c"); + +my $test; +my $cmd; +my $output; +my $status = 0; +my $testnum; + +# We are running tests against the build tree (vs. the installation +# tree). Autogen gives us a full list of all possible component +# directories in PMIX_COMPONENT_LIBRARY_PATHS. Iterate through each +# of those directories: 1) to see if there is actually a component +# built in there, and 2) to turn it into an absolute path name. Then +# put the new list in the "mca_bast_component_path" MCA parameter env +# variable so that the MCA base knows where to find all the +# components. +my @myfullpaths; +my $mybuilddir = "@PMIX_BUILT_TEST_PREFIX@"; +my $mypathstr = "@PMIX_COMPONENT_LIBRARY_PATHS@"; +my @splitstr = split(':', $mypathstr); +foreach my $path (@splitstr) { + # Note that the component is actually built in the ".libs" + # subdirectory. If the component wasn't built, that subdirectory + # will not exist, so don't save it. + my $fullpath = $mybuilddir . "/" . $path . "/.libs"; + push(@myfullpaths, $fullpath) + if (-d $fullpath); +} +my $mymcapaths = join(":", @myfullpaths); +$ENV{'PMIX_MCA_mca_base_component_path'} = $mymcapaths; + +my $wdir = $mybuilddir . "/test"; +chdir $wdir; + +$testnum = $0; +$testnum =~ s/.pl//; +$testnum = substr($testnum, -2); +$test = @tests[$testnum]; + +$cmd = "./pmix_test " . $test . " 2>&1"; +print $cmd . "\n"; +$output = `$cmd`; +print $output . "\n"; +print "CODE $?\n"; +$status = "$?"; + +exit($status >> 8); diff --git a/opal/mca/pmix/pmix4x/pmix/test/run_tests02.pl.in b/opal/mca/pmix/pmix4x/pmix/test/run_tests02.pl.in new file mode 100755 index 0000000000..fb139c9ce7 --- /dev/null +++ b/opal/mca/pmix/pmix4x/pmix/test/run_tests02.pl.in @@ -0,0 +1,73 @@ +#!/usr/bin/env perl +# +# Copyright (c) 2019 Intel, Inc. +# +# Copyright (c) 2019 Cisco Systems, Inc. All rights reserved +# $COPYRIGHT$ +# +# Additional copyrights may follow + +use strict; + +my @tests = ("-n 4 --ns-dist 3:1 --fence \"[db | 0:0-2;1:0]\"", + "-n 4 --ns-dist 3:1 --fence \"[db | 0:;1:0]\"", + "-n 4 --ns-dist 3:1 --fence \"[db | 0:;1:]\"", + "-n 4 --ns-dist 3:1 --fence \"[0:]\"", + "-n 4 --ns-dist 3:1 --fence \"[b | 0:]\"", + "-n 4 --ns-dist 3:1 --fence \"[d | 0:]\" --noise \"[0:0,1]\"", + "-n 4 --job-fence -c", + "-n 4 --job-fence", + "-n 2 --test-publish", + "-n 2 --test-spawn", + "-n 2 --test-connect", + "-n 5 --test-resolve-peers --ns-dist \"1:2:2\"", + "-n 5 --test-replace 100:0,1,10,50,99", + "-n 5 --test-internal 10", + "-s 2 -n 2 --job-fence", + "-s 2 -n 2 --job-fence -c"); + +my $test; +my $cmd; +my $output; +my $status = 0; +my $testnum; + +# We are running tests against the build tree (vs. the installation +# tree). Autogen gives us a full list of all possible component +# directories in PMIX_COMPONENT_LIBRARY_PATHS. Iterate through each +# of those directories: 1) to see if there is actually a component +# built in there, and 2) to turn it into an absolute path name. Then +# put the new list in the "mca_bast_component_path" MCA parameter env +# variable so that the MCA base knows where to find all the +# components. +my @myfullpaths; +my $mybuilddir = "@PMIX_BUILT_TEST_PREFIX@"; +my $mypathstr = "@PMIX_COMPONENT_LIBRARY_PATHS@"; +my @splitstr = split(':', $mypathstr); +foreach my $path (@splitstr) { + # Note that the component is actually built in the ".libs" + # subdirectory. If the component wasn't built, that subdirectory + # will not exist, so don't save it. + my $fullpath = $mybuilddir . "/" . $path . "/.libs"; + push(@myfullpaths, $fullpath) + if (-d $fullpath); +} +my $mymcapaths = join(":", @myfullpaths); +$ENV{'PMIX_MCA_mca_base_component_path'} = $mymcapaths; + +my $wdir = $mybuilddir . "/test"; +chdir $wdir; + +$testnum = $0; +$testnum =~ s/.pl//; +$testnum = substr($testnum, -2); +$test = @tests[$testnum]; + +$cmd = "./pmix_test " . $test . " 2>&1"; +print $cmd . "\n"; +$output = `$cmd`; +print $output . "\n"; +print "CODE $?\n"; +$status = "$?"; + +exit($status >> 8); diff --git a/opal/mca/pmix/pmix4x/pmix/test/run_tests03.pl.in b/opal/mca/pmix/pmix4x/pmix/test/run_tests03.pl.in new file mode 100755 index 0000000000..fb139c9ce7 --- /dev/null +++ b/opal/mca/pmix/pmix4x/pmix/test/run_tests03.pl.in @@ -0,0 +1,73 @@ +#!/usr/bin/env perl +# +# Copyright (c) 2019 Intel, Inc. +# +# Copyright (c) 2019 Cisco Systems, Inc. All rights reserved +# $COPYRIGHT$ +# +# Additional copyrights may follow + +use strict; + +my @tests = ("-n 4 --ns-dist 3:1 --fence \"[db | 0:0-2;1:0]\"", + "-n 4 --ns-dist 3:1 --fence \"[db | 0:;1:0]\"", + "-n 4 --ns-dist 3:1 --fence \"[db | 0:;1:]\"", + "-n 4 --ns-dist 3:1 --fence \"[0:]\"", + "-n 4 --ns-dist 3:1 --fence \"[b | 0:]\"", + "-n 4 --ns-dist 3:1 --fence \"[d | 0:]\" --noise \"[0:0,1]\"", + "-n 4 --job-fence -c", + "-n 4 --job-fence", + "-n 2 --test-publish", + "-n 2 --test-spawn", + "-n 2 --test-connect", + "-n 5 --test-resolve-peers --ns-dist \"1:2:2\"", + "-n 5 --test-replace 100:0,1,10,50,99", + "-n 5 --test-internal 10", + "-s 2 -n 2 --job-fence", + "-s 2 -n 2 --job-fence -c"); + +my $test; +my $cmd; +my $output; +my $status = 0; +my $testnum; + +# We are running tests against the build tree (vs. the installation +# tree). Autogen gives us a full list of all possible component +# directories in PMIX_COMPONENT_LIBRARY_PATHS. Iterate through each +# of those directories: 1) to see if there is actually a component +# built in there, and 2) to turn it into an absolute path name. Then +# put the new list in the "mca_bast_component_path" MCA parameter env +# variable so that the MCA base knows where to find all the +# components. +my @myfullpaths; +my $mybuilddir = "@PMIX_BUILT_TEST_PREFIX@"; +my $mypathstr = "@PMIX_COMPONENT_LIBRARY_PATHS@"; +my @splitstr = split(':', $mypathstr); +foreach my $path (@splitstr) { + # Note that the component is actually built in the ".libs" + # subdirectory. If the component wasn't built, that subdirectory + # will not exist, so don't save it. + my $fullpath = $mybuilddir . "/" . $path . "/.libs"; + push(@myfullpaths, $fullpath) + if (-d $fullpath); +} +my $mymcapaths = join(":", @myfullpaths); +$ENV{'PMIX_MCA_mca_base_component_path'} = $mymcapaths; + +my $wdir = $mybuilddir . "/test"; +chdir $wdir; + +$testnum = $0; +$testnum =~ s/.pl//; +$testnum = substr($testnum, -2); +$test = @tests[$testnum]; + +$cmd = "./pmix_test " . $test . " 2>&1"; +print $cmd . "\n"; +$output = `$cmd`; +print $output . "\n"; +print "CODE $?\n"; +$status = "$?"; + +exit($status >> 8); diff --git a/opal/mca/pmix/pmix4x/pmix/test/run_tests04.pl.in b/opal/mca/pmix/pmix4x/pmix/test/run_tests04.pl.in new file mode 100755 index 0000000000..fb139c9ce7 --- /dev/null +++ b/opal/mca/pmix/pmix4x/pmix/test/run_tests04.pl.in @@ -0,0 +1,73 @@ +#!/usr/bin/env perl +# +# Copyright (c) 2019 Intel, Inc. +# +# Copyright (c) 2019 Cisco Systems, Inc. All rights reserved +# $COPYRIGHT$ +# +# Additional copyrights may follow + +use strict; + +my @tests = ("-n 4 --ns-dist 3:1 --fence \"[db | 0:0-2;1:0]\"", + "-n 4 --ns-dist 3:1 --fence \"[db | 0:;1:0]\"", + "-n 4 --ns-dist 3:1 --fence \"[db | 0:;1:]\"", + "-n 4 --ns-dist 3:1 --fence \"[0:]\"", + "-n 4 --ns-dist 3:1 --fence \"[b | 0:]\"", + "-n 4 --ns-dist 3:1 --fence \"[d | 0:]\" --noise \"[0:0,1]\"", + "-n 4 --job-fence -c", + "-n 4 --job-fence", + "-n 2 --test-publish", + "-n 2 --test-spawn", + "-n 2 --test-connect", + "-n 5 --test-resolve-peers --ns-dist \"1:2:2\"", + "-n 5 --test-replace 100:0,1,10,50,99", + "-n 5 --test-internal 10", + "-s 2 -n 2 --job-fence", + "-s 2 -n 2 --job-fence -c"); + +my $test; +my $cmd; +my $output; +my $status = 0; +my $testnum; + +# We are running tests against the build tree (vs. the installation +# tree). Autogen gives us a full list of all possible component +# directories in PMIX_COMPONENT_LIBRARY_PATHS. Iterate through each +# of those directories: 1) to see if there is actually a component +# built in there, and 2) to turn it into an absolute path name. Then +# put the new list in the "mca_bast_component_path" MCA parameter env +# variable so that the MCA base knows where to find all the +# components. +my @myfullpaths; +my $mybuilddir = "@PMIX_BUILT_TEST_PREFIX@"; +my $mypathstr = "@PMIX_COMPONENT_LIBRARY_PATHS@"; +my @splitstr = split(':', $mypathstr); +foreach my $path (@splitstr) { + # Note that the component is actually built in the ".libs" + # subdirectory. If the component wasn't built, that subdirectory + # will not exist, so don't save it. + my $fullpath = $mybuilddir . "/" . $path . "/.libs"; + push(@myfullpaths, $fullpath) + if (-d $fullpath); +} +my $mymcapaths = join(":", @myfullpaths); +$ENV{'PMIX_MCA_mca_base_component_path'} = $mymcapaths; + +my $wdir = $mybuilddir . "/test"; +chdir $wdir; + +$testnum = $0; +$testnum =~ s/.pl//; +$testnum = substr($testnum, -2); +$test = @tests[$testnum]; + +$cmd = "./pmix_test " . $test . " 2>&1"; +print $cmd . "\n"; +$output = `$cmd`; +print $output . "\n"; +print "CODE $?\n"; +$status = "$?"; + +exit($status >> 8); diff --git a/opal/mca/pmix/pmix4x/pmix/test/run_tests05.pl.in b/opal/mca/pmix/pmix4x/pmix/test/run_tests05.pl.in new file mode 100755 index 0000000000..fb139c9ce7 --- /dev/null +++ b/opal/mca/pmix/pmix4x/pmix/test/run_tests05.pl.in @@ -0,0 +1,73 @@ +#!/usr/bin/env perl +# +# Copyright (c) 2019 Intel, Inc. +# +# Copyright (c) 2019 Cisco Systems, Inc. All rights reserved +# $COPYRIGHT$ +# +# Additional copyrights may follow + +use strict; + +my @tests = ("-n 4 --ns-dist 3:1 --fence \"[db | 0:0-2;1:0]\"", + "-n 4 --ns-dist 3:1 --fence \"[db | 0:;1:0]\"", + "-n 4 --ns-dist 3:1 --fence \"[db | 0:;1:]\"", + "-n 4 --ns-dist 3:1 --fence \"[0:]\"", + "-n 4 --ns-dist 3:1 --fence \"[b | 0:]\"", + "-n 4 --ns-dist 3:1 --fence \"[d | 0:]\" --noise \"[0:0,1]\"", + "-n 4 --job-fence -c", + "-n 4 --job-fence", + "-n 2 --test-publish", + "-n 2 --test-spawn", + "-n 2 --test-connect", + "-n 5 --test-resolve-peers --ns-dist \"1:2:2\"", + "-n 5 --test-replace 100:0,1,10,50,99", + "-n 5 --test-internal 10", + "-s 2 -n 2 --job-fence", + "-s 2 -n 2 --job-fence -c"); + +my $test; +my $cmd; +my $output; +my $status = 0; +my $testnum; + +# We are running tests against the build tree (vs. the installation +# tree). Autogen gives us a full list of all possible component +# directories in PMIX_COMPONENT_LIBRARY_PATHS. Iterate through each +# of those directories: 1) to see if there is actually a component +# built in there, and 2) to turn it into an absolute path name. Then +# put the new list in the "mca_bast_component_path" MCA parameter env +# variable so that the MCA base knows where to find all the +# components. +my @myfullpaths; +my $mybuilddir = "@PMIX_BUILT_TEST_PREFIX@"; +my $mypathstr = "@PMIX_COMPONENT_LIBRARY_PATHS@"; +my @splitstr = split(':', $mypathstr); +foreach my $path (@splitstr) { + # Note that the component is actually built in the ".libs" + # subdirectory. If the component wasn't built, that subdirectory + # will not exist, so don't save it. + my $fullpath = $mybuilddir . "/" . $path . "/.libs"; + push(@myfullpaths, $fullpath) + if (-d $fullpath); +} +my $mymcapaths = join(":", @myfullpaths); +$ENV{'PMIX_MCA_mca_base_component_path'} = $mymcapaths; + +my $wdir = $mybuilddir . "/test"; +chdir $wdir; + +$testnum = $0; +$testnum =~ s/.pl//; +$testnum = substr($testnum, -2); +$test = @tests[$testnum]; + +$cmd = "./pmix_test " . $test . " 2>&1"; +print $cmd . "\n"; +$output = `$cmd`; +print $output . "\n"; +print "CODE $?\n"; +$status = "$?"; + +exit($status >> 8); diff --git a/opal/mca/pmix/pmix4x/pmix/test/run_tests06.pl.in b/opal/mca/pmix/pmix4x/pmix/test/run_tests06.pl.in new file mode 100755 index 0000000000..fb139c9ce7 --- /dev/null +++ b/opal/mca/pmix/pmix4x/pmix/test/run_tests06.pl.in @@ -0,0 +1,73 @@ +#!/usr/bin/env perl +# +# Copyright (c) 2019 Intel, Inc. +# +# Copyright (c) 2019 Cisco Systems, Inc. All rights reserved +# $COPYRIGHT$ +# +# Additional copyrights may follow + +use strict; + +my @tests = ("-n 4 --ns-dist 3:1 --fence \"[db | 0:0-2;1:0]\"", + "-n 4 --ns-dist 3:1 --fence \"[db | 0:;1:0]\"", + "-n 4 --ns-dist 3:1 --fence \"[db | 0:;1:]\"", + "-n 4 --ns-dist 3:1 --fence \"[0:]\"", + "-n 4 --ns-dist 3:1 --fence \"[b | 0:]\"", + "-n 4 --ns-dist 3:1 --fence \"[d | 0:]\" --noise \"[0:0,1]\"", + "-n 4 --job-fence -c", + "-n 4 --job-fence", + "-n 2 --test-publish", + "-n 2 --test-spawn", + "-n 2 --test-connect", + "-n 5 --test-resolve-peers --ns-dist \"1:2:2\"", + "-n 5 --test-replace 100:0,1,10,50,99", + "-n 5 --test-internal 10", + "-s 2 -n 2 --job-fence", + "-s 2 -n 2 --job-fence -c"); + +my $test; +my $cmd; +my $output; +my $status = 0; +my $testnum; + +# We are running tests against the build tree (vs. the installation +# tree). Autogen gives us a full list of all possible component +# directories in PMIX_COMPONENT_LIBRARY_PATHS. Iterate through each +# of those directories: 1) to see if there is actually a component +# built in there, and 2) to turn it into an absolute path name. Then +# put the new list in the "mca_bast_component_path" MCA parameter env +# variable so that the MCA base knows where to find all the +# components. +my @myfullpaths; +my $mybuilddir = "@PMIX_BUILT_TEST_PREFIX@"; +my $mypathstr = "@PMIX_COMPONENT_LIBRARY_PATHS@"; +my @splitstr = split(':', $mypathstr); +foreach my $path (@splitstr) { + # Note that the component is actually built in the ".libs" + # subdirectory. If the component wasn't built, that subdirectory + # will not exist, so don't save it. + my $fullpath = $mybuilddir . "/" . $path . "/.libs"; + push(@myfullpaths, $fullpath) + if (-d $fullpath); +} +my $mymcapaths = join(":", @myfullpaths); +$ENV{'PMIX_MCA_mca_base_component_path'} = $mymcapaths; + +my $wdir = $mybuilddir . "/test"; +chdir $wdir; + +$testnum = $0; +$testnum =~ s/.pl//; +$testnum = substr($testnum, -2); +$test = @tests[$testnum]; + +$cmd = "./pmix_test " . $test . " 2>&1"; +print $cmd . "\n"; +$output = `$cmd`; +print $output . "\n"; +print "CODE $?\n"; +$status = "$?"; + +exit($status >> 8); diff --git a/opal/mca/pmix/pmix4x/pmix/test/run_tests07.pl.in b/opal/mca/pmix/pmix4x/pmix/test/run_tests07.pl.in new file mode 100755 index 0000000000..fb139c9ce7 --- /dev/null +++ b/opal/mca/pmix/pmix4x/pmix/test/run_tests07.pl.in @@ -0,0 +1,73 @@ +#!/usr/bin/env perl +# +# Copyright (c) 2019 Intel, Inc. +# +# Copyright (c) 2019 Cisco Systems, Inc. All rights reserved +# $COPYRIGHT$ +# +# Additional copyrights may follow + +use strict; + +my @tests = ("-n 4 --ns-dist 3:1 --fence \"[db | 0:0-2;1:0]\"", + "-n 4 --ns-dist 3:1 --fence \"[db | 0:;1:0]\"", + "-n 4 --ns-dist 3:1 --fence \"[db | 0:;1:]\"", + "-n 4 --ns-dist 3:1 --fence \"[0:]\"", + "-n 4 --ns-dist 3:1 --fence \"[b | 0:]\"", + "-n 4 --ns-dist 3:1 --fence \"[d | 0:]\" --noise \"[0:0,1]\"", + "-n 4 --job-fence -c", + "-n 4 --job-fence", + "-n 2 --test-publish", + "-n 2 --test-spawn", + "-n 2 --test-connect", + "-n 5 --test-resolve-peers --ns-dist \"1:2:2\"", + "-n 5 --test-replace 100:0,1,10,50,99", + "-n 5 --test-internal 10", + "-s 2 -n 2 --job-fence", + "-s 2 -n 2 --job-fence -c"); + +my $test; +my $cmd; +my $output; +my $status = 0; +my $testnum; + +# We are running tests against the build tree (vs. the installation +# tree). Autogen gives us a full list of all possible component +# directories in PMIX_COMPONENT_LIBRARY_PATHS. Iterate through each +# of those directories: 1) to see if there is actually a component +# built in there, and 2) to turn it into an absolute path name. Then +# put the new list in the "mca_bast_component_path" MCA parameter env +# variable so that the MCA base knows where to find all the +# components. +my @myfullpaths; +my $mybuilddir = "@PMIX_BUILT_TEST_PREFIX@"; +my $mypathstr = "@PMIX_COMPONENT_LIBRARY_PATHS@"; +my @splitstr = split(':', $mypathstr); +foreach my $path (@splitstr) { + # Note that the component is actually built in the ".libs" + # subdirectory. If the component wasn't built, that subdirectory + # will not exist, so don't save it. + my $fullpath = $mybuilddir . "/" . $path . "/.libs"; + push(@myfullpaths, $fullpath) + if (-d $fullpath); +} +my $mymcapaths = join(":", @myfullpaths); +$ENV{'PMIX_MCA_mca_base_component_path'} = $mymcapaths; + +my $wdir = $mybuilddir . "/test"; +chdir $wdir; + +$testnum = $0; +$testnum =~ s/.pl//; +$testnum = substr($testnum, -2); +$test = @tests[$testnum]; + +$cmd = "./pmix_test " . $test . " 2>&1"; +print $cmd . "\n"; +$output = `$cmd`; +print $output . "\n"; +print "CODE $?\n"; +$status = "$?"; + +exit($status >> 8); diff --git a/opal/mca/pmix/pmix4x/pmix/test/run_tests08.pl.in b/opal/mca/pmix/pmix4x/pmix/test/run_tests08.pl.in new file mode 100755 index 0000000000..fb139c9ce7 --- /dev/null +++ b/opal/mca/pmix/pmix4x/pmix/test/run_tests08.pl.in @@ -0,0 +1,73 @@ +#!/usr/bin/env perl +# +# Copyright (c) 2019 Intel, Inc. +# +# Copyright (c) 2019 Cisco Systems, Inc. All rights reserved +# $COPYRIGHT$ +# +# Additional copyrights may follow + +use strict; + +my @tests = ("-n 4 --ns-dist 3:1 --fence \"[db | 0:0-2;1:0]\"", + "-n 4 --ns-dist 3:1 --fence \"[db | 0:;1:0]\"", + "-n 4 --ns-dist 3:1 --fence \"[db | 0:;1:]\"", + "-n 4 --ns-dist 3:1 --fence \"[0:]\"", + "-n 4 --ns-dist 3:1 --fence \"[b | 0:]\"", + "-n 4 --ns-dist 3:1 --fence \"[d | 0:]\" --noise \"[0:0,1]\"", + "-n 4 --job-fence -c", + "-n 4 --job-fence", + "-n 2 --test-publish", + "-n 2 --test-spawn", + "-n 2 --test-connect", + "-n 5 --test-resolve-peers --ns-dist \"1:2:2\"", + "-n 5 --test-replace 100:0,1,10,50,99", + "-n 5 --test-internal 10", + "-s 2 -n 2 --job-fence", + "-s 2 -n 2 --job-fence -c"); + +my $test; +my $cmd; +my $output; +my $status = 0; +my $testnum; + +# We are running tests against the build tree (vs. the installation +# tree). Autogen gives us a full list of all possible component +# directories in PMIX_COMPONENT_LIBRARY_PATHS. Iterate through each +# of those directories: 1) to see if there is actually a component +# built in there, and 2) to turn it into an absolute path name. Then +# put the new list in the "mca_bast_component_path" MCA parameter env +# variable so that the MCA base knows where to find all the +# components. +my @myfullpaths; +my $mybuilddir = "@PMIX_BUILT_TEST_PREFIX@"; +my $mypathstr = "@PMIX_COMPONENT_LIBRARY_PATHS@"; +my @splitstr = split(':', $mypathstr); +foreach my $path (@splitstr) { + # Note that the component is actually built in the ".libs" + # subdirectory. If the component wasn't built, that subdirectory + # will not exist, so don't save it. + my $fullpath = $mybuilddir . "/" . $path . "/.libs"; + push(@myfullpaths, $fullpath) + if (-d $fullpath); +} +my $mymcapaths = join(":", @myfullpaths); +$ENV{'PMIX_MCA_mca_base_component_path'} = $mymcapaths; + +my $wdir = $mybuilddir . "/test"; +chdir $wdir; + +$testnum = $0; +$testnum =~ s/.pl//; +$testnum = substr($testnum, -2); +$test = @tests[$testnum]; + +$cmd = "./pmix_test " . $test . " 2>&1"; +print $cmd . "\n"; +$output = `$cmd`; +print $output . "\n"; +print "CODE $?\n"; +$status = "$?"; + +exit($status >> 8); diff --git a/opal/mca/pmix/pmix4x/pmix/test/run_tests09.pl.in b/opal/mca/pmix/pmix4x/pmix/test/run_tests09.pl.in new file mode 100755 index 0000000000..fb139c9ce7 --- /dev/null +++ b/opal/mca/pmix/pmix4x/pmix/test/run_tests09.pl.in @@ -0,0 +1,73 @@ +#!/usr/bin/env perl +# +# Copyright (c) 2019 Intel, Inc. +# +# Copyright (c) 2019 Cisco Systems, Inc. All rights reserved +# $COPYRIGHT$ +# +# Additional copyrights may follow + +use strict; + +my @tests = ("-n 4 --ns-dist 3:1 --fence \"[db | 0:0-2;1:0]\"", + "-n 4 --ns-dist 3:1 --fence \"[db | 0:;1:0]\"", + "-n 4 --ns-dist 3:1 --fence \"[db | 0:;1:]\"", + "-n 4 --ns-dist 3:1 --fence \"[0:]\"", + "-n 4 --ns-dist 3:1 --fence \"[b | 0:]\"", + "-n 4 --ns-dist 3:1 --fence \"[d | 0:]\" --noise \"[0:0,1]\"", + "-n 4 --job-fence -c", + "-n 4 --job-fence", + "-n 2 --test-publish", + "-n 2 --test-spawn", + "-n 2 --test-connect", + "-n 5 --test-resolve-peers --ns-dist \"1:2:2\"", + "-n 5 --test-replace 100:0,1,10,50,99", + "-n 5 --test-internal 10", + "-s 2 -n 2 --job-fence", + "-s 2 -n 2 --job-fence -c"); + +my $test; +my $cmd; +my $output; +my $status = 0; +my $testnum; + +# We are running tests against the build tree (vs. the installation +# tree). Autogen gives us a full list of all possible component +# directories in PMIX_COMPONENT_LIBRARY_PATHS. Iterate through each +# of those directories: 1) to see if there is actually a component +# built in there, and 2) to turn it into an absolute path name. Then +# put the new list in the "mca_bast_component_path" MCA parameter env +# variable so that the MCA base knows where to find all the +# components. +my @myfullpaths; +my $mybuilddir = "@PMIX_BUILT_TEST_PREFIX@"; +my $mypathstr = "@PMIX_COMPONENT_LIBRARY_PATHS@"; +my @splitstr = split(':', $mypathstr); +foreach my $path (@splitstr) { + # Note that the component is actually built in the ".libs" + # subdirectory. If the component wasn't built, that subdirectory + # will not exist, so don't save it. + my $fullpath = $mybuilddir . "/" . $path . "/.libs"; + push(@myfullpaths, $fullpath) + if (-d $fullpath); +} +my $mymcapaths = join(":", @myfullpaths); +$ENV{'PMIX_MCA_mca_base_component_path'} = $mymcapaths; + +my $wdir = $mybuilddir . "/test"; +chdir $wdir; + +$testnum = $0; +$testnum =~ s/.pl//; +$testnum = substr($testnum, -2); +$test = @tests[$testnum]; + +$cmd = "./pmix_test " . $test . " 2>&1"; +print $cmd . "\n"; +$output = `$cmd`; +print $output . "\n"; +print "CODE $?\n"; +$status = "$?"; + +exit($status >> 8); diff --git a/opal/mca/pmix/pmix4x/pmix/test/run_tests10.pl.in b/opal/mca/pmix/pmix4x/pmix/test/run_tests10.pl.in new file mode 100755 index 0000000000..fb139c9ce7 --- /dev/null +++ b/opal/mca/pmix/pmix4x/pmix/test/run_tests10.pl.in @@ -0,0 +1,73 @@ +#!/usr/bin/env perl +# +# Copyright (c) 2019 Intel, Inc. +# +# Copyright (c) 2019 Cisco Systems, Inc. All rights reserved +# $COPYRIGHT$ +# +# Additional copyrights may follow + +use strict; + +my @tests = ("-n 4 --ns-dist 3:1 --fence \"[db | 0:0-2;1:0]\"", + "-n 4 --ns-dist 3:1 --fence \"[db | 0:;1:0]\"", + "-n 4 --ns-dist 3:1 --fence \"[db | 0:;1:]\"", + "-n 4 --ns-dist 3:1 --fence \"[0:]\"", + "-n 4 --ns-dist 3:1 --fence \"[b | 0:]\"", + "-n 4 --ns-dist 3:1 --fence \"[d | 0:]\" --noise \"[0:0,1]\"", + "-n 4 --job-fence -c", + "-n 4 --job-fence", + "-n 2 --test-publish", + "-n 2 --test-spawn", + "-n 2 --test-connect", + "-n 5 --test-resolve-peers --ns-dist \"1:2:2\"", + "-n 5 --test-replace 100:0,1,10,50,99", + "-n 5 --test-internal 10", + "-s 2 -n 2 --job-fence", + "-s 2 -n 2 --job-fence -c"); + +my $test; +my $cmd; +my $output; +my $status = 0; +my $testnum; + +# We are running tests against the build tree (vs. the installation +# tree). Autogen gives us a full list of all possible component +# directories in PMIX_COMPONENT_LIBRARY_PATHS. Iterate through each +# of those directories: 1) to see if there is actually a component +# built in there, and 2) to turn it into an absolute path name. Then +# put the new list in the "mca_bast_component_path" MCA parameter env +# variable so that the MCA base knows where to find all the +# components. +my @myfullpaths; +my $mybuilddir = "@PMIX_BUILT_TEST_PREFIX@"; +my $mypathstr = "@PMIX_COMPONENT_LIBRARY_PATHS@"; +my @splitstr = split(':', $mypathstr); +foreach my $path (@splitstr) { + # Note that the component is actually built in the ".libs" + # subdirectory. If the component wasn't built, that subdirectory + # will not exist, so don't save it. + my $fullpath = $mybuilddir . "/" . $path . "/.libs"; + push(@myfullpaths, $fullpath) + if (-d $fullpath); +} +my $mymcapaths = join(":", @myfullpaths); +$ENV{'PMIX_MCA_mca_base_component_path'} = $mymcapaths; + +my $wdir = $mybuilddir . "/test"; +chdir $wdir; + +$testnum = $0; +$testnum =~ s/.pl//; +$testnum = substr($testnum, -2); +$test = @tests[$testnum]; + +$cmd = "./pmix_test " . $test . " 2>&1"; +print $cmd . "\n"; +$output = `$cmd`; +print $output . "\n"; +print "CODE $?\n"; +$status = "$?"; + +exit($status >> 8); diff --git a/opal/mca/pmix/pmix4x/pmix/test/run_tests11.pl.in b/opal/mca/pmix/pmix4x/pmix/test/run_tests11.pl.in new file mode 100755 index 0000000000..fb139c9ce7 --- /dev/null +++ b/opal/mca/pmix/pmix4x/pmix/test/run_tests11.pl.in @@ -0,0 +1,73 @@ +#!/usr/bin/env perl +# +# Copyright (c) 2019 Intel, Inc. +# +# Copyright (c) 2019 Cisco Systems, Inc. All rights reserved +# $COPYRIGHT$ +# +# Additional copyrights may follow + +use strict; + +my @tests = ("-n 4 --ns-dist 3:1 --fence \"[db | 0:0-2;1:0]\"", + "-n 4 --ns-dist 3:1 --fence \"[db | 0:;1:0]\"", + "-n 4 --ns-dist 3:1 --fence \"[db | 0:;1:]\"", + "-n 4 --ns-dist 3:1 --fence \"[0:]\"", + "-n 4 --ns-dist 3:1 --fence \"[b | 0:]\"", + "-n 4 --ns-dist 3:1 --fence \"[d | 0:]\" --noise \"[0:0,1]\"", + "-n 4 --job-fence -c", + "-n 4 --job-fence", + "-n 2 --test-publish", + "-n 2 --test-spawn", + "-n 2 --test-connect", + "-n 5 --test-resolve-peers --ns-dist \"1:2:2\"", + "-n 5 --test-replace 100:0,1,10,50,99", + "-n 5 --test-internal 10", + "-s 2 -n 2 --job-fence", + "-s 2 -n 2 --job-fence -c"); + +my $test; +my $cmd; +my $output; +my $status = 0; +my $testnum; + +# We are running tests against the build tree (vs. the installation +# tree). Autogen gives us a full list of all possible component +# directories in PMIX_COMPONENT_LIBRARY_PATHS. Iterate through each +# of those directories: 1) to see if there is actually a component +# built in there, and 2) to turn it into an absolute path name. Then +# put the new list in the "mca_bast_component_path" MCA parameter env +# variable so that the MCA base knows where to find all the +# components. +my @myfullpaths; +my $mybuilddir = "@PMIX_BUILT_TEST_PREFIX@"; +my $mypathstr = "@PMIX_COMPONENT_LIBRARY_PATHS@"; +my @splitstr = split(':', $mypathstr); +foreach my $path (@splitstr) { + # Note that the component is actually built in the ".libs" + # subdirectory. If the component wasn't built, that subdirectory + # will not exist, so don't save it. + my $fullpath = $mybuilddir . "/" . $path . "/.libs"; + push(@myfullpaths, $fullpath) + if (-d $fullpath); +} +my $mymcapaths = join(":", @myfullpaths); +$ENV{'PMIX_MCA_mca_base_component_path'} = $mymcapaths; + +my $wdir = $mybuilddir . "/test"; +chdir $wdir; + +$testnum = $0; +$testnum =~ s/.pl//; +$testnum = substr($testnum, -2); +$test = @tests[$testnum]; + +$cmd = "./pmix_test " . $test . " 2>&1"; +print $cmd . "\n"; +$output = `$cmd`; +print $output . "\n"; +print "CODE $?\n"; +$status = "$?"; + +exit($status >> 8); diff --git a/opal/mca/pmix/pmix4x/pmix/test/run_tests12.pl.in b/opal/mca/pmix/pmix4x/pmix/test/run_tests12.pl.in new file mode 100755 index 0000000000..fb139c9ce7 --- /dev/null +++ b/opal/mca/pmix/pmix4x/pmix/test/run_tests12.pl.in @@ -0,0 +1,73 @@ +#!/usr/bin/env perl +# +# Copyright (c) 2019 Intel, Inc. +# +# Copyright (c) 2019 Cisco Systems, Inc. All rights reserved +# $COPYRIGHT$ +# +# Additional copyrights may follow + +use strict; + +my @tests = ("-n 4 --ns-dist 3:1 --fence \"[db | 0:0-2;1:0]\"", + "-n 4 --ns-dist 3:1 --fence \"[db | 0:;1:0]\"", + "-n 4 --ns-dist 3:1 --fence \"[db | 0:;1:]\"", + "-n 4 --ns-dist 3:1 --fence \"[0:]\"", + "-n 4 --ns-dist 3:1 --fence \"[b | 0:]\"", + "-n 4 --ns-dist 3:1 --fence \"[d | 0:]\" --noise \"[0:0,1]\"", + "-n 4 --job-fence -c", + "-n 4 --job-fence", + "-n 2 --test-publish", + "-n 2 --test-spawn", + "-n 2 --test-connect", + "-n 5 --test-resolve-peers --ns-dist \"1:2:2\"", + "-n 5 --test-replace 100:0,1,10,50,99", + "-n 5 --test-internal 10", + "-s 2 -n 2 --job-fence", + "-s 2 -n 2 --job-fence -c"); + +my $test; +my $cmd; +my $output; +my $status = 0; +my $testnum; + +# We are running tests against the build tree (vs. the installation +# tree). Autogen gives us a full list of all possible component +# directories in PMIX_COMPONENT_LIBRARY_PATHS. Iterate through each +# of those directories: 1) to see if there is actually a component +# built in there, and 2) to turn it into an absolute path name. Then +# put the new list in the "mca_bast_component_path" MCA parameter env +# variable so that the MCA base knows where to find all the +# components. +my @myfullpaths; +my $mybuilddir = "@PMIX_BUILT_TEST_PREFIX@"; +my $mypathstr = "@PMIX_COMPONENT_LIBRARY_PATHS@"; +my @splitstr = split(':', $mypathstr); +foreach my $path (@splitstr) { + # Note that the component is actually built in the ".libs" + # subdirectory. If the component wasn't built, that subdirectory + # will not exist, so don't save it. + my $fullpath = $mybuilddir . "/" . $path . "/.libs"; + push(@myfullpaths, $fullpath) + if (-d $fullpath); +} +my $mymcapaths = join(":", @myfullpaths); +$ENV{'PMIX_MCA_mca_base_component_path'} = $mymcapaths; + +my $wdir = $mybuilddir . "/test"; +chdir $wdir; + +$testnum = $0; +$testnum =~ s/.pl//; +$testnum = substr($testnum, -2); +$test = @tests[$testnum]; + +$cmd = "./pmix_test " . $test . " 2>&1"; +print $cmd . "\n"; +$output = `$cmd`; +print $output . "\n"; +print "CODE $?\n"; +$status = "$?"; + +exit($status >> 8); diff --git a/opal/mca/pmix/pmix4x/pmix/test/run_tests13.pl.in b/opal/mca/pmix/pmix4x/pmix/test/run_tests13.pl.in new file mode 100755 index 0000000000..fb139c9ce7 --- /dev/null +++ b/opal/mca/pmix/pmix4x/pmix/test/run_tests13.pl.in @@ -0,0 +1,73 @@ +#!/usr/bin/env perl +# +# Copyright (c) 2019 Intel, Inc. +# +# Copyright (c) 2019 Cisco Systems, Inc. All rights reserved +# $COPYRIGHT$ +# +# Additional copyrights may follow + +use strict; + +my @tests = ("-n 4 --ns-dist 3:1 --fence \"[db | 0:0-2;1:0]\"", + "-n 4 --ns-dist 3:1 --fence \"[db | 0:;1:0]\"", + "-n 4 --ns-dist 3:1 --fence \"[db | 0:;1:]\"", + "-n 4 --ns-dist 3:1 --fence \"[0:]\"", + "-n 4 --ns-dist 3:1 --fence \"[b | 0:]\"", + "-n 4 --ns-dist 3:1 --fence \"[d | 0:]\" --noise \"[0:0,1]\"", + "-n 4 --job-fence -c", + "-n 4 --job-fence", + "-n 2 --test-publish", + "-n 2 --test-spawn", + "-n 2 --test-connect", + "-n 5 --test-resolve-peers --ns-dist \"1:2:2\"", + "-n 5 --test-replace 100:0,1,10,50,99", + "-n 5 --test-internal 10", + "-s 2 -n 2 --job-fence", + "-s 2 -n 2 --job-fence -c"); + +my $test; +my $cmd; +my $output; +my $status = 0; +my $testnum; + +# We are running tests against the build tree (vs. the installation +# tree). Autogen gives us a full list of all possible component +# directories in PMIX_COMPONENT_LIBRARY_PATHS. Iterate through each +# of those directories: 1) to see if there is actually a component +# built in there, and 2) to turn it into an absolute path name. Then +# put the new list in the "mca_bast_component_path" MCA parameter env +# variable so that the MCA base knows where to find all the +# components. +my @myfullpaths; +my $mybuilddir = "@PMIX_BUILT_TEST_PREFIX@"; +my $mypathstr = "@PMIX_COMPONENT_LIBRARY_PATHS@"; +my @splitstr = split(':', $mypathstr); +foreach my $path (@splitstr) { + # Note that the component is actually built in the ".libs" + # subdirectory. If the component wasn't built, that subdirectory + # will not exist, so don't save it. + my $fullpath = $mybuilddir . "/" . $path . "/.libs"; + push(@myfullpaths, $fullpath) + if (-d $fullpath); +} +my $mymcapaths = join(":", @myfullpaths); +$ENV{'PMIX_MCA_mca_base_component_path'} = $mymcapaths; + +my $wdir = $mybuilddir . "/test"; +chdir $wdir; + +$testnum = $0; +$testnum =~ s/.pl//; +$testnum = substr($testnum, -2); +$test = @tests[$testnum]; + +$cmd = "./pmix_test " . $test . " 2>&1"; +print $cmd . "\n"; +$output = `$cmd`; +print $output . "\n"; +print "CODE $?\n"; +$status = "$?"; + +exit($status >> 8); diff --git a/opal/mca/pmix/pmix4x/pmix/test/run_tests14.pl.in b/opal/mca/pmix/pmix4x/pmix/test/run_tests14.pl.in new file mode 100755 index 0000000000..fb139c9ce7 --- /dev/null +++ b/opal/mca/pmix/pmix4x/pmix/test/run_tests14.pl.in @@ -0,0 +1,73 @@ +#!/usr/bin/env perl +# +# Copyright (c) 2019 Intel, Inc. +# +# Copyright (c) 2019 Cisco Systems, Inc. All rights reserved +# $COPYRIGHT$ +# +# Additional copyrights may follow + +use strict; + +my @tests = ("-n 4 --ns-dist 3:1 --fence \"[db | 0:0-2;1:0]\"", + "-n 4 --ns-dist 3:1 --fence \"[db | 0:;1:0]\"", + "-n 4 --ns-dist 3:1 --fence \"[db | 0:;1:]\"", + "-n 4 --ns-dist 3:1 --fence \"[0:]\"", + "-n 4 --ns-dist 3:1 --fence \"[b | 0:]\"", + "-n 4 --ns-dist 3:1 --fence \"[d | 0:]\" --noise \"[0:0,1]\"", + "-n 4 --job-fence -c", + "-n 4 --job-fence", + "-n 2 --test-publish", + "-n 2 --test-spawn", + "-n 2 --test-connect", + "-n 5 --test-resolve-peers --ns-dist \"1:2:2\"", + "-n 5 --test-replace 100:0,1,10,50,99", + "-n 5 --test-internal 10", + "-s 2 -n 2 --job-fence", + "-s 2 -n 2 --job-fence -c"); + +my $test; +my $cmd; +my $output; +my $status = 0; +my $testnum; + +# We are running tests against the build tree (vs. the installation +# tree). Autogen gives us a full list of all possible component +# directories in PMIX_COMPONENT_LIBRARY_PATHS. Iterate through each +# of those directories: 1) to see if there is actually a component +# built in there, and 2) to turn it into an absolute path name. Then +# put the new list in the "mca_bast_component_path" MCA parameter env +# variable so that the MCA base knows where to find all the +# components. +my @myfullpaths; +my $mybuilddir = "@PMIX_BUILT_TEST_PREFIX@"; +my $mypathstr = "@PMIX_COMPONENT_LIBRARY_PATHS@"; +my @splitstr = split(':', $mypathstr); +foreach my $path (@splitstr) { + # Note that the component is actually built in the ".libs" + # subdirectory. If the component wasn't built, that subdirectory + # will not exist, so don't save it. + my $fullpath = $mybuilddir . "/" . $path . "/.libs"; + push(@myfullpaths, $fullpath) + if (-d $fullpath); +} +my $mymcapaths = join(":", @myfullpaths); +$ENV{'PMIX_MCA_mca_base_component_path'} = $mymcapaths; + +my $wdir = $mybuilddir . "/test"; +chdir $wdir; + +$testnum = $0; +$testnum =~ s/.pl//; +$testnum = substr($testnum, -2); +$test = @tests[$testnum]; + +$cmd = "./pmix_test " . $test . " 2>&1"; +print $cmd . "\n"; +$output = `$cmd`; +print $output . "\n"; +print "CODE $?\n"; +$status = "$?"; + +exit($status >> 8); diff --git a/opal/mca/pmix/pmix4x/pmix/test/run_tests15.pl.in b/opal/mca/pmix/pmix4x/pmix/test/run_tests15.pl.in new file mode 100755 index 0000000000..fb139c9ce7 --- /dev/null +++ b/opal/mca/pmix/pmix4x/pmix/test/run_tests15.pl.in @@ -0,0 +1,73 @@ +#!/usr/bin/env perl +# +# Copyright (c) 2019 Intel, Inc. +# +# Copyright (c) 2019 Cisco Systems, Inc. All rights reserved +# $COPYRIGHT$ +# +# Additional copyrights may follow + +use strict; + +my @tests = ("-n 4 --ns-dist 3:1 --fence \"[db | 0:0-2;1:0]\"", + "-n 4 --ns-dist 3:1 --fence \"[db | 0:;1:0]\"", + "-n 4 --ns-dist 3:1 --fence \"[db | 0:;1:]\"", + "-n 4 --ns-dist 3:1 --fence \"[0:]\"", + "-n 4 --ns-dist 3:1 --fence \"[b | 0:]\"", + "-n 4 --ns-dist 3:1 --fence \"[d | 0:]\" --noise \"[0:0,1]\"", + "-n 4 --job-fence -c", + "-n 4 --job-fence", + "-n 2 --test-publish", + "-n 2 --test-spawn", + "-n 2 --test-connect", + "-n 5 --test-resolve-peers --ns-dist \"1:2:2\"", + "-n 5 --test-replace 100:0,1,10,50,99", + "-n 5 --test-internal 10", + "-s 2 -n 2 --job-fence", + "-s 2 -n 2 --job-fence -c"); + +my $test; +my $cmd; +my $output; +my $status = 0; +my $testnum; + +# We are running tests against the build tree (vs. the installation +# tree). Autogen gives us a full list of all possible component +# directories in PMIX_COMPONENT_LIBRARY_PATHS. Iterate through each +# of those directories: 1) to see if there is actually a component +# built in there, and 2) to turn it into an absolute path name. Then +# put the new list in the "mca_bast_component_path" MCA parameter env +# variable so that the MCA base knows where to find all the +# components. +my @myfullpaths; +my $mybuilddir = "@PMIX_BUILT_TEST_PREFIX@"; +my $mypathstr = "@PMIX_COMPONENT_LIBRARY_PATHS@"; +my @splitstr = split(':', $mypathstr); +foreach my $path (@splitstr) { + # Note that the component is actually built in the ".libs" + # subdirectory. If the component wasn't built, that subdirectory + # will not exist, so don't save it. + my $fullpath = $mybuilddir . "/" . $path . "/.libs"; + push(@myfullpaths, $fullpath) + if (-d $fullpath); +} +my $mymcapaths = join(":", @myfullpaths); +$ENV{'PMIX_MCA_mca_base_component_path'} = $mymcapaths; + +my $wdir = $mybuilddir . "/test"; +chdir $wdir; + +$testnum = $0; +$testnum =~ s/.pl//; +$testnum = substr($testnum, -2); +$test = @tests[$testnum]; + +$cmd = "./pmix_test " . $test . " 2>&1"; +print $cmd . "\n"; +$output = `$cmd`; +print $output . "\n"; +print "CODE $?\n"; +$status = "$?"; + +exit($status >> 8); diff --git a/opal/mca/pmix/pmix4x/pmix/test/test_common.h b/opal/mca/pmix/pmix4x/pmix/test/test_common.h index 88c7d327c7..15426dc535 100644 --- a/opal/mca/pmix/pmix4x/pmix/test/test_common.h +++ b/opal/mca/pmix/pmix4x/pmix/test/test_common.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013-2018 Intel, Inc. All rights reserved. + * Copyright (c) 2013-2019 Intel, Inc. All rights reserved. * Copyright (c) 2015 Artem Y. Polyakov . * All rights reserved. * Copyright (c) 2015 Research Organization for Information Science @@ -262,7 +262,7 @@ typedef struct { TEST_VERBOSE(("%s:%d want to get from %s:%d key %s", my_nspace, my_rank, ns, r, key)); \ if (blocking) { \ if (PMIX_SUCCESS != (rc = PMIx_Get(&foobar, key, NULL, 0, &val))) { \ - if( !( rc == PMIX_ERR_NOT_FOUND && ok_notfnd ) ){ \ + if( !( (rc == PMIX_ERR_NOT_FOUND || rc == PMIX_ERR_PROC_ENTRY_NOT_FOUND) && ok_notfnd ) ){ \ TEST_ERROR(("%s:%d: PMIx_Get failed: %d from %s:%d, key %s", my_nspace, my_rank, rc, ns, r, key)); \ } \ rc = PMIX_ERROR; \ @@ -289,7 +289,7 @@ typedef struct { } \ if (PMIX_SUCCESS == rc) { \ if( PMIX_SUCCESS != cbdata.status ){ \ - if( !( cbdata.status == PMIX_ERR_NOT_FOUND && ok_notfnd ) ){ \ + if( !( (cbdata.status == PMIX_ERR_NOT_FOUND || cbdata.status == PMIX_ERR_PROC_ENTRY_NOT_FOUND) && ok_notfnd ) ){ \ TEST_ERROR(("%s:%d: PMIx_Get_nb failed: %d from %s:%d, key=%s", \ my_nspace, my_rank, rc, my_nspace, r)); \ } \ diff --git a/opal/mca/pmix/pmix4x/pmix/test/test_fence.c b/opal/mca/pmix/pmix4x/pmix/test/test_fence.c index 9ad4cf786d..a33d9618b7 100644 --- a/opal/mca/pmix/pmix4x/pmix/test/test_fence.c +++ b/opal/mca/pmix/pmix4x/pmix/test/test_fence.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016-2018 Intel, Inc. All rights reserved. + * Copyright (c) 2016-2019 Intel, Inc. All rights reserved. * Copyright (c) 2015-2017 Mellanox Technologies, Inc. * All rights reserved. * $COPYRIGHT$ @@ -384,7 +384,7 @@ int test_job_fence(test_params params, char *my_nspace, pmix_rank_t my_rank) if( local ){ GET(int, (12340+j), my_nspace, i+params.base_rank, 100, j, 0, 0, 0); if (PMIX_SUCCESS != rc) { - TEST_ERROR(("%s:%d: PMIx_Get failed: %d", my_nspace, my_rank, rc)); + TEST_ERROR(("%s:%d: PMIx_Get failed: %s", my_nspace, my_rank, PMIx_Error_string(rc))); return PMIX_ERROR; } @@ -423,9 +423,10 @@ int test_job_fence(test_params params, char *my_nspace, pmix_rank_t my_rank) my_nspace, my_rank)); return PMIX_ERROR; } - if (PMIX_ERR_NOT_FOUND != rc) { - TEST_ERROR(("%s:%d [ERROR]: PMIx_Get returned %d instead of not_found", - my_nspace, my_rank, rc)); + if (PMIX_ERR_NOT_FOUND != rc && PMIX_ERR_PROC_ENTRY_NOT_FOUND != rc) { + TEST_ERROR(("%s:%d [ERROR]: PMIx_Get returned %s instead of not_found", + my_nspace, my_rank, PMIx_Error_string(rc))); + return PMIX_ERROR; } if (NULL != val) { TEST_ERROR(("%s:%d [ERROR]: PMIx_Get did not return NULL value", my_nspace, my_rank)); diff --git a/opal/mca/pmix/pmix4x/pmix/test/test_server.c b/opal/mca/pmix/pmix4x/pmix/test/test_server.c index f99df44c5b..04f79089d8 100644 --- a/opal/mca/pmix/pmix4x/pmix/test/test_server.c +++ b/opal/mca/pmix/pmix4x/pmix/test/test_server.c @@ -93,56 +93,6 @@ static void release_cb(pmix_status_t status, void *cbdata) *ptr = 0; } -static void set_namespace(int local_size, int univ_size, char *ranks, char *name) -{ - size_t ninfo; - pmix_info_t *info; - ninfo = 8; - char *regex, *ppn; - - PMIX_INFO_CREATE(info, ninfo); - pmix_strncpy(info[0].key, PMIX_UNIV_SIZE, PMIX_MAX_KEYLEN); - info[0].value.type = PMIX_UINT32; - info[0].value.data.uint32 = univ_size; - - pmix_strncpy(info[1].key, PMIX_SPAWNED, PMIX_MAX_KEYLEN); - info[1].value.type = PMIX_UINT32; - info[1].value.data.uint32 = 0; - - pmix_strncpy(info[2].key, PMIX_LOCAL_SIZE, PMIX_MAX_KEYLEN); - info[2].value.type = PMIX_UINT32; - info[2].value.data.uint32 = local_size; - - pmix_strncpy(info[3].key, PMIX_LOCAL_PEERS, PMIX_MAX_KEYLEN); - info[3].value.type = PMIX_STRING; - info[3].value.data.string = strdup(ranks); - - PMIx_generate_regex(NODE_NAME, ®ex); - pmix_strncpy(info[4].key, PMIX_NODE_MAP, PMIX_MAX_KEYLEN); - info[4].value.type = PMIX_STRING; - info[4].value.data.string = regex; - - PMIx_generate_ppn(ranks, &ppn); - pmix_strncpy(info[5].key, PMIX_PROC_MAP, PMIX_MAX_KEYLEN); - info[5].value.type = PMIX_STRING; - info[5].value.data.string = ppn; - - pmix_strncpy(info[6].key, PMIX_JOB_SIZE, PMIX_MAX_KEYLEN); - info[6].value.type = PMIX_UINT32; - info[6].value.data.uint32 = univ_size; - - pmix_strncpy(info[7].key, PMIX_APPNUM, PMIX_MAX_KEYLEN); - info[7].value.type = PMIX_UINT32; - info[7].value.data.uint32 = getpid (); - - int in_progress = 1, rc; - if (PMIX_SUCCESS == (rc = PMIx_server_register_nspace(name, local_size, - info, ninfo, release_cb, &in_progress))) { - PMIX_WAIT_FOR_COMPLETION(in_progress); - } - PMIX_INFO_FREE(info, ninfo); -} - static void fill_seq_ranks_array(size_t nprocs, int base_rank, char **ranks) { uint32_t i; @@ -165,6 +115,70 @@ static void fill_seq_ranks_array(size_t nprocs, int base_rank, char **ranks) } } +static void set_namespace(int local_size, int univ_size, + int base_rank, char *name) +{ + size_t ninfo; + pmix_info_t *info; + ninfo = 8; + char *regex, *ppn; + char *ranks = NULL; + + PMIX_INFO_CREATE(info, ninfo); + pmix_strncpy(info[0].key, PMIX_UNIV_SIZE, PMIX_MAX_KEYLEN); + info[0].value.type = PMIX_UINT32; + info[0].value.data.uint32 = univ_size; + + pmix_strncpy(info[1].key, PMIX_SPAWNED, PMIX_MAX_KEYLEN); + info[1].value.type = PMIX_UINT32; + info[1].value.data.uint32 = 0; + + pmix_strncpy(info[2].key, PMIX_LOCAL_SIZE, PMIX_MAX_KEYLEN); + info[2].value.type = PMIX_UINT32; + info[2].value.data.uint32 = local_size; + + /* generate the array of local peers */ + fill_seq_ranks_array(local_size, base_rank, &ranks); + if (NULL == ranks) { + return; + } + pmix_strncpy(info[3].key, PMIX_LOCAL_PEERS, PMIX_MAX_KEYLEN); + info[3].value.type = PMIX_STRING; + info[3].value.data.string = strdup(ranks); + free(ranks); + + PMIx_generate_regex(NODE_NAME, ®ex); + pmix_strncpy(info[4].key, PMIX_NODE_MAP, PMIX_MAX_KEYLEN); + info[4].value.type = PMIX_STRING; + info[4].value.data.string = regex; + + /* generate the global proc map */ + fill_seq_ranks_array(univ_size, 0, &ranks); + if (NULL == ranks) { + return; + } + PMIx_generate_ppn(ranks, &ppn); + free(ranks); + pmix_strncpy(info[5].key, PMIX_PROC_MAP, PMIX_MAX_KEYLEN); + info[5].value.type = PMIX_STRING; + info[5].value.data.string = ppn; + + pmix_strncpy(info[6].key, PMIX_JOB_SIZE, PMIX_MAX_KEYLEN); + info[6].value.type = PMIX_UINT32; + info[6].value.data.uint32 = univ_size; + + pmix_strncpy(info[7].key, PMIX_APPNUM, PMIX_MAX_KEYLEN); + info[7].value.type = PMIX_UINT32; + info[7].value.data.uint32 = getpid (); + + int in_progress = 1, rc; + if (PMIX_SUCCESS == (rc = PMIx_server_register_nspace(name, local_size, + info, ninfo, release_cb, &in_progress))) { + PMIX_WAIT_FOR_COMPLETION(in_progress); + } + PMIX_INFO_FREE(info, ninfo); +} + static void server_unpack_procs(char *buf, size_t size) { char *ptr = buf; @@ -878,14 +892,8 @@ int server_launch_clients(int local_size, int univ_size, int base_rank, univ_size)); TEST_VERBOSE(("Setting job info")); - fill_seq_ranks_array(local_size, base_rank, &ranks); - if (NULL == ranks) { - PMIx_server_finalize(); - TEST_ERROR(("fill_seq_ranks_array failed")); - return PMIX_ERROR; - } (void)snprintf(proc.nspace, PMIX_MAX_NSLEN, "%s-%d", TEST_NAMESPACE, num_ns); - set_namespace(local_size, univ_size, ranks, proc.nspace); + set_namespace(local_size, univ_size, base_rank, proc.nspace); if (NULL != ranks) { free(ranks); }