From 1c4a3598d0c03bebe302ac20d1d86258b3ab4838 Mon Sep 17 00:00:00 2001 From: Gilles Gouaillardet Date: Tue, 1 Oct 2019 13:36:51 +0900 Subject: [PATCH] pmix/pmix4x: refresh to the latest open PMIx master refresh to openpmix/openpmix@ea3b29b1a4d35c63d99a84a09389ddddb2a4b7c6 Signed-off-by: Gilles Gouaillardet --- .gitignore | 90 +- opal/mca/pmix/pmix4x/Makefile.am | 4 +- opal/mca/pmix/pmix4x/autogen.subdirs | 2 +- opal/mca/pmix/pmix4x/configure.m4 | 10 +- .../pmix/pmix4x/{pmix => openpmix}/AUTHORS | 0 .../pmix/pmix4x/{pmix => openpmix}/HACKING | 0 .../pmix/pmix4x/{pmix => openpmix}/INSTALL | 0 .../pmix/pmix4x/{pmix => openpmix}/LICENSE | 0 .../pmix4x/{pmix => openpmix}/Makefile.am | 4 +- .../pmix/pmix4x/openpmix/Makefile.pmix-rules | 37 + opal/mca/pmix/pmix4x/{pmix => openpmix}/NEWS | 134 + .../mca/pmix/pmix4x/{pmix => openpmix}/README | 0 .../pmix/pmix4x/{pmix => openpmix}/VERSION | 6 +- .../pmix/pmix4x/{pmix => openpmix}/autogen.pl | 0 .../{pmix => openpmix}/bindings/Makefile.am | 0 .../pmix4x/{pmix => openpmix}/bindings/README | 0 .../bindings/python/Makefile.am | 2 + .../{pmix => openpmix}/bindings/python/README | 0 .../openpmix/bindings/python/construct.py | 520 ++++ .../pmix4x/openpmix/bindings/python/pmix.pxi | 1018 ++++++++ .../pmix4x/openpmix/bindings/python/pmix.pyx | 2265 +++++++++++++++++ .../pmix4x/openpmix/bindings/python/setup.py | 47 + .../{pmix => openpmix}/config/Makefile.am | 0 .../config/c_get_alignment.m4 | 2 +- .../{pmix => openpmix}/config/distscript.sh | 0 .../pmix4x/{pmix => openpmix}/config/pmix.m4 | 20 +- .../config/pmix_check_attributes.m4 | 0 .../config/pmix_check_broken_qsort.m4 | 0 .../config/pmix_check_compiler_version.m4 | 2 +- .../config/pmix_check_icc.m4 | 2 +- .../config/pmix_check_ident.m4 | 0 .../config/pmix_check_lock.m4 | 0 .../config/pmix_check_os_flavors.m4 | 0 .../config/pmix_check_package.m4 | 0 .../config/pmix_check_pthread_pids.m4 | 0 .../config/pmix_check_vendor.m4 | 0 .../config/pmix_check_visibility.m4 | 0 .../config/pmix_check_withdir.m4 | 0 .../config/pmix_config_asm.m4 | 0 .../config/pmix_config_pthreads.m4 | 0 .../config/pmix_config_subdir.m4 | 0 .../config/pmix_config_subdir_args.m4 | 0 .../config/pmix_config_threads.m4 | 0 .../config/pmix_ensure_contains_optflags.m4 | 0 .../config/pmix_functions.m4 | 0 .../config/pmix_get_version.sh | 0 .../config/pmix_load_platform.m4 | 0 .../{pmix => openpmix}/config/pmix_mca.m4 | 0 .../config/pmix_mca_priority_sort.pl | 0 .../config/pmix_search_libs.m4 | 0 .../config/pmix_set_mca_prefix.m4 | 0 .../config/pmix_setup_cc.m4 | 7 +- .../config/pmix_setup_cli.m4 | 0 .../config/pmix_setup_hwloc.m4 | 7 +- .../config/pmix_setup_libev.m4 | 9 +- .../config/pmix_setup_libevent.m4 | 5 +- .../openpmix/config/pmix_setup_wrappers.m4 | 311 +++ .../{pmix => openpmix}/config/pmix_summary.m4 | 0 .../config/pmix_try_assemble.m4 | 0 .../pmix4x/{pmix => openpmix}/configure.ac | 1 + .../{pmix => openpmix}/contrib/Makefile.am | 5 +- .../{pmix => openpmix}/contrib/buildrpm.sh | 0 .../contrib/make_dist_tarball | 0 .../pmix4x/openpmix/contrib/make_manpage.pl | 56 + .../contrib/perf_tools/Makefile | 0 .../contrib/perf_tools/Makefile.include | 0 .../contrib/perf_tools/README | 0 .../contrib/perf_tools/pmi.h | 0 .../contrib/perf_tools/pmi2.c | 0 .../contrib/perf_tools/pmi2_pmap_parser.c | 0 .../contrib/perf_tools/pmi2_pmap_parser.h | 0 .../contrib/perf_tools/pmi2_utils.c | 0 .../contrib/perf_tools/pmi2_utils.h | 0 .../contrib/perf_tools/pmi_intra_perf.c | 0 .../contrib/perf_tools/pmix.c | 0 .../contrib/perf_tools/run.sh | 0 .../contrib/platform/optimized | 0 .../contrib/pmix-release.sh | 0 .../contrib/pmix-valgrind.supp | 0 .../{pmix => openpmix}/contrib/pmix.spec | 4 +- .../contrib/pmix_jenkins.sh | 0 .../contrib/update-my-copyright.pl | 0 .../contrib/whitespace-purge.sh | 0 .../pmix4x/{pmix => openpmix}/etc/Makefile.am | 0 .../etc/pmix-mca-params.conf | 0 .../{pmix => openpmix}/examples/Makefile.am | 0 .../{pmix => openpmix}/examples/alloc.c | 0 .../{pmix => openpmix}/examples/asyncgroup.c | 0 .../{pmix => openpmix}/examples/client.c | 0 .../{pmix => openpmix}/examples/client2.c | 0 .../{pmix => openpmix}/examples/debugger.c | 0 .../{pmix => openpmix}/examples/debuggerd.c | 0 .../pmix/pmix4x/openpmix/examples/dmodex.c | 215 ++ .../{pmix => openpmix}/examples/dynamic.c | 0 .../{pmix => openpmix}/examples/examples.h | 0 .../{pmix => openpmix}/examples/fault.c | 0 .../{pmix => openpmix}/examples/group.c | 0 .../{pmix => openpmix}/examples/jctrl.c | 0 .../pmix4x/{pmix => openpmix}/examples/pub.c | 0 .../pmix4x/{pmix => openpmix}/examples/pubi.c | 0 .../{pmix => openpmix}/examples/server.c | 0 .../pmix4x/{pmix => openpmix}/examples/tool.c | 0 .../{pmix => openpmix}/include/Makefile.am | 0 .../pmix4x/{pmix => openpmix}/include/pmi.h | 0 .../pmix4x/{pmix => openpmix}/include/pmi2.h | 0 .../pmix4x/{pmix => openpmix}/include/pmix.h | 33 +- .../include/pmix_common.h.in | 96 +- .../{pmix => openpmix}/include/pmix_extend.h | 0 .../include/pmix_rename.h.in | 0 .../{pmix => openpmix}/include/pmix_sched.h | 0 .../{pmix => openpmix}/include/pmix_server.h | 0 .../{pmix => openpmix}/include/pmix_tool.h | 0 .../include/pmix_version.h.in | 0 .../pmix4x/{pmix => openpmix}/src/Makefile.am | 0 .../src/atomics/sys/Makefile.include | 0 .../src/atomics/sys/architecture.h | 0 .../src/atomics/sys/arm/Makefile.include | 0 .../src/atomics/sys/arm/atomic.h | 0 .../src/atomics/sys/arm/timer.h | 0 .../src/atomics/sys/arm64/Makefile.include | 0 .../src/atomics/sys/arm64/atomic.h | 0 .../src/atomics/sys/arm64/timer.h | 0 .../src/atomics/sys/atomic.h | 0 .../src/atomics/sys/atomic_impl.h | 0 .../src/atomics/sys/atomic_stdc.h | 0 .../{pmix => openpmix}/src/atomics/sys/cma.h | 0 .../atomics/sys/gcc_builtin/Makefile.include | 0 .../src/atomics/sys/gcc_builtin/atomic.h | 0 .../src/atomics/sys/ia32/Makefile.include | 0 .../src/atomics/sys/ia32/atomic.h | 0 .../src/atomics/sys/ia32/timer.h | 0 .../src/atomics/sys/powerpc/Makefile.include | 0 .../src/atomics/sys/powerpc/atomic.h | 0 .../src/atomics/sys/powerpc/timer.h | 0 .../src/atomics/sys/sparcv9/Makefile.include | 0 .../src/atomics/sys/sparcv9/atomic.h | 0 .../src/atomics/sys/sparcv9/timer.h | 0 .../atomics/sys/sync_builtin/Makefile.include | 0 .../src/atomics/sys/sync_builtin/atomic.h | 0 .../src/atomics/sys/timer.h | 0 .../src/atomics/sys/x86_64/Makefile.include | 0 .../src/atomics/sys/x86_64/atomic.h | 0 .../src/atomics/sys/x86_64/timer.h | 0 .../src/class/Makefile.include | 0 .../src/class/pmix_bitmap.c | 0 .../src/class/pmix_bitmap.h | 0 .../src/class/pmix_hash_table.c | 0 .../src/class/pmix_hash_table.h | 0 .../{pmix => openpmix}/src/class/pmix_hotel.c | 0 .../{pmix => openpmix}/src/class/pmix_hotel.h | 0 .../{pmix => openpmix}/src/class/pmix_list.c | 0 .../{pmix => openpmix}/src/class/pmix_list.h | 0 .../src/class/pmix_object.c | 0 .../src/class/pmix_object.h | 0 .../src/class/pmix_pointer_array.c | 0 .../src/class/pmix_pointer_array.h | 0 .../src/class/pmix_ring_buffer.c | 0 .../src/class/pmix_ring_buffer.h | 0 .../src/class/pmix_value_array.c | 0 .../src/class/pmix_value_array.h | 0 .../src/client/Makefile.include | 0 .../{pmix => openpmix}/src/client/pmi1.c | 0 .../{pmix => openpmix}/src/client/pmi2.c | 0 .../src/client/pmix_client.c | 296 ++- .../src/client/pmix_client_connect.c | 0 .../src/client/pmix_client_fence.c | 0 .../src/client/pmix_client_get.c | 35 +- .../src/client/pmix_client_group.c | 160 +- .../src/client/pmix_client_ops.h | 0 .../src/client/pmix_client_pub.c | 9 +- .../src/client/pmix_client_spawn.c | 0 .../src/common/Makefile.include | 0 .../src/common/pmix_attributes.c | 0 .../src/common/pmix_attributes.h | 0 .../src/common/pmix_control.c | 29 +- .../{pmix => openpmix}/src/common/pmix_data.c | 0 .../{pmix => openpmix}/src/common/pmix_iof.c | 70 +- .../{pmix => openpmix}/src/common/pmix_iof.h | 0 .../{pmix => openpmix}/src/common/pmix_log.c | 2 +- .../src/common/pmix_query.c | 29 +- .../src/common/pmix_security.c | 87 +- .../src/common/pmix_strings.c | 0 .../src/event/Makefile.include | 0 .../{pmix => openpmix}/src/event/pmix_event.h | 0 .../src/event/pmix_event_notification.c | 0 .../src/event/pmix_event_registration.c | 94 +- .../src/hwloc/Makefile.include | 0 .../src/hwloc/hwloc-internal.h | 0 .../{pmix => openpmix}/src/hwloc/hwloc.c | 0 .../src/include/Makefile.include | 0 .../{pmix => openpmix}/src/include/align.h | 0 .../src/include/hash_string.h | 0 .../src/include/pmix_config_bottom.h | 0 .../src/include/pmix_config_top.h | 0 .../src/include/pmix_globals.c | 4 +- .../src/include/pmix_globals.h | 11 - .../src/include/pmix_portable_platform.h | 0 .../src/include/pmix_socket_errno.h | 0 .../src/include/pmix_stdatomic.h | 0 .../src/include/pmix_stdint.h | 0 .../{pmix => openpmix}/src/include/prefetch.h | 0 .../{pmix => openpmix}/src/include/types.h | 0 .../src/mca/Makefile.include | 0 .../src/mca/base/Makefile.am | 0 .../{pmix => openpmix}/src/mca/base/base.h | 0 .../src/mca/base/help-pmix-mca-base.txt | 0 .../src/mca/base/help-pmix-mca-var.txt | 0 .../src/mca/base/pmix_mca_base_close.c | 0 .../src/mca/base/pmix_mca_base_cmd_line.c | 0 .../base/pmix_mca_base_component_compare.c | 0 .../mca/base/pmix_mca_base_component_find.c | 0 .../base/pmix_mca_base_component_repository.c | 0 .../base/pmix_mca_base_component_repository.h | 0 .../mca/base/pmix_mca_base_components_close.c | 0 .../mca/base/pmix_mca_base_components_open.c | 0 .../base/pmix_mca_base_components_register.c | 0 .../base/pmix_mca_base_components_select.c | 0 .../src/mca/base/pmix_mca_base_framework.c | 0 .../src/mca/base/pmix_mca_base_framework.h | 0 .../src/mca/base/pmix_mca_base_list.c | 0 .../src/mca/base/pmix_mca_base_open.c | 0 .../mca/base/pmix_mca_base_parse_paramfile.c | 0 .../src/mca/base/pmix_mca_base_var.c | 0 .../src/mca/base/pmix_mca_base_var.h | 0 .../src/mca/base/pmix_mca_base_var_enum.c | 0 .../src/mca/base/pmix_mca_base_var_enum.h | 0 .../src/mca/base/pmix_mca_base_var_group.c | 0 .../src/mca/base/pmix_mca_base_var_group.h | 0 .../src/mca/base/pmix_mca_base_vari.h | 0 .../src/mca/bfrops/Makefile.am | 0 .../src/mca/bfrops/base/Makefile.include | 0 .../src/mca/bfrops/base/base.h | 0 .../src/mca/bfrops/base/bfrop_base_copy.c | 0 .../src/mca/bfrops/base/bfrop_base_fns.c | 24 +- .../src/mca/bfrops/base/bfrop_base_frame.c | 0 .../src/mca/bfrops/base/bfrop_base_pack.c | 0 .../src/mca/bfrops/base/bfrop_base_print.c | 0 .../src/mca/bfrops/base/bfrop_base_select.c | 0 .../src/mca/bfrops/base/bfrop_base_stubs.c | 0 .../src/mca/bfrops/base/bfrop_base_unpack.c | 0 .../src/mca/bfrops/bfrops.h | 0 .../src/mca/bfrops/bfrops_types.h | 0 .../src/mca/bfrops/v12/Makefile.am | 0 .../src/mca/bfrops/v12/bfrop_v12.c | 0 .../src/mca/bfrops/v12/bfrop_v12.h | 0 .../src/mca/bfrops/v12/bfrop_v12_component.c | 0 .../src/mca/bfrops/v12/copy.c | 0 .../src/mca/bfrops/v12/internal.h | 0 .../src/mca/bfrops/v12/pack.c | 0 .../src/mca/bfrops/v12/print.c | 0 .../src/mca/bfrops/v12/unpack.c | 0 .../src/mca/bfrops/v20/Makefile.am | 0 .../src/mca/bfrops/v20/bfrop_pmix20.c | 0 .../src/mca/bfrops/v20/bfrop_pmix20.h | 0 .../mca/bfrops/v20/bfrop_pmix20_component.c | 0 .../src/mca/bfrops/v20/copy.c | 0 .../src/mca/bfrops/v20/internal.h | 0 .../src/mca/bfrops/v20/pack.c | 0 .../src/mca/bfrops/v20/print.c | 0 .../src/mca/bfrops/v20/unpack.c | 0 .../src/mca/bfrops/v21/Makefile.am | 0 .../src/mca/bfrops/v21/bfrop_pmix21.c | 0 .../src/mca/bfrops/v21/bfrop_pmix21.h | 0 .../mca/bfrops/v21/bfrop_pmix21_component.c | 0 .../src/mca/bfrops/v3/Makefile.am | 0 .../src/mca/bfrops/v3/bfrop_pmix3.c | 0 .../src/mca/bfrops/v3/bfrop_pmix3.h | 0 .../src/mca/bfrops/v3/bfrop_pmix3_component.c | 0 .../src/mca/bfrops/v4/Makefile.am | 0 .../src/mca/bfrops/v4/bfrop_pmix4.c | 0 .../src/mca/bfrops/v4/bfrop_pmix4.h | 0 .../src/mca/bfrops/v4/bfrop_pmix4_component.c | 0 .../src/mca/common/Makefile.am | 0 .../src/mca/common/dstore/Makefile.am | 0 .../src/mca/common/dstore/configure.m4 | 0 .../src/mca/common/dstore/dstore_base.c | 4 +- .../src/mca/common/dstore/dstore_base.h | 0 .../src/mca/common/dstore/dstore_common.h | 0 .../src/mca/common/dstore/dstore_file.h | 0 .../src/mca/common/dstore/dstore_segment.c | 0 .../src/mca/common/dstore/dstore_segment.h | 0 .../src/mca/gds/Makefile.am | 0 .../src/mca/gds/base/Makefile.include | 0 .../src/mca/gds/base/base.h | 0 .../src/mca/gds/base/gds_base_fns.c | 0 .../src/mca/gds/base/gds_base_frame.c | 0 .../src/mca/gds/base/gds_base_select.c | 0 .../src/mca/gds/ds12/Makefile.am | 0 .../src/mca/gds/ds12/gds_ds12_base.c | 0 .../src/mca/gds/ds12/gds_ds12_base.h | 0 .../src/mca/gds/ds12/gds_ds12_component.c | 0 .../src/mca/gds/ds12/gds_ds12_file.c | 0 .../src/mca/gds/ds12/gds_ds12_file.h | 0 .../src/mca/gds/ds12/gds_ds12_lock.c | 0 .../src/mca/gds/ds12/gds_ds12_lock.h | 0 .../src/mca/gds/ds12/gds_ds12_lock_fcntl.c | 0 .../src/mca/gds/ds12/gds_ds12_lock_pthread.c | 0 .../src/mca/gds/ds12/gds_ds20_file.c | 0 .../src/mca/gds/ds21/Makefile.am | 0 .../src/mca/gds/ds21/gds_ds21_base.c | 0 .../src/mca/gds/ds21/gds_ds21_base.h | 0 .../src/mca/gds/ds21/gds_ds21_component.c | 0 .../src/mca/gds/ds21/gds_ds21_file.c | 0 .../src/mca/gds/ds21/gds_ds21_file.h | 0 .../src/mca/gds/ds21/gds_ds21_lock.c | 0 .../src/mca/gds/ds21/gds_ds21_lock.h | 0 .../src/mca/gds/ds21/gds_ds21_lock_pthread.c | 0 .../{pmix => openpmix}/src/mca/gds/gds.h | 0 .../src/mca/gds/hash/Makefile.am | 0 .../src/mca/gds/hash/gds_hash.c | 666 ++--- .../src/mca/gds/hash/gds_hash.h | 0 .../src/mca/gds/hash/gds_hash_component.c | 0 .../pmix4x/{pmix => openpmix}/src/mca/mca.h | 0 .../src/mca/pcompress/Makefile.am | 0 .../src/mca/pcompress/base/Makefile.am | 0 .../src/mca/pcompress/base/base.h | 0 .../mca/pcompress/base/pcompress_base_frame.c | 0 .../pcompress/base/pcompress_base_select.c | 0 .../src/mca/pcompress/pcompress.h | 0 .../src/mca/pcompress/zlib/Makefile.am | 0 .../src/mca/pcompress/zlib/compress_zlib.c | 10 +- .../src/mca/pcompress/zlib/compress_zlib.h | 0 .../pcompress/zlib/compress_zlib_component.c | 0 .../src/mca/pcompress/zlib/configure.m4 | 0 .../src/mca/pdl/Makefile.am | 0 .../src/mca/pdl/base/Makefile.am | 0 .../src/mca/pdl/base/base.h | 0 .../src/mca/pdl/base/pdl_base_close.c | 0 .../src/mca/pdl/base/pdl_base_fns.c | 0 .../src/mca/pdl/base/pdl_base_open.c | 0 .../src/mca/pdl/base/pdl_base_select.c | 0 .../src/mca/pdl/configure.m4 | 0 .../{pmix => openpmix}/src/mca/pdl/pdl.h | 0 .../src/mca/pdl/pdlopen/Makefile.am | 0 .../src/mca/pdl/pdlopen/configure.m4 | 0 .../src/mca/pdl/pdlopen/pdl_pdlopen.h | 0 .../mca/pdl/pdlopen/pdl_pdlopen_component.c | 0 .../src/mca/pdl/pdlopen/pdl_pdlopen_module.c | 4 +- .../src/mca/pdl/plibltdl/Makefile.am | 0 .../src/mca/pdl/plibltdl/configure.m4 | 0 .../src/mca/pdl/plibltdl/pdl_libltdl.h | 0 .../mca/pdl/plibltdl/pdl_libltdl_component.c | 0 .../src/mca/pdl/plibltdl/pdl_libltdl_module.c | 0 .../src/mca/pfexec/Makefile.am | 0 .../src/mca/pfexec/base/Makefile.am | 0 .../src/mca/pfexec/base/base.h | 0 .../src/mca/pfexec/base/help-pfexec-base.txt | 0 .../mca/pfexec/base/pfexec_base_default_fns.c | 0 .../src/mca/pfexec/base/pfexec_base_frame.c | 0 .../src/mca/pfexec/base/pfexec_base_select.c | 0 .../src/mca/pfexec/linux/Makefile.am | 0 .../src/mca/pfexec/linux/configure.m4 | 0 .../mca/pfexec/linux/help-pfexec-linux.txt | 0 .../src/mca/pfexec/linux/pfexec_linux.c | 0 .../src/mca/pfexec/linux/pfexec_linux.h | 0 .../mca/pfexec/linux/pfexec_linux_component.c | 0 .../src/mca/pfexec/pfexec.h | 0 .../src/mca/pif/Makefile.am | 0 .../src/mca/pif/base/Makefile.am | 0 .../src/mca/pif/base/base.h | 0 .../src/mca/pif/base/pif_base_components.c | 0 .../src/mca/pif/bsdx_ipv4/Makefile.am | 0 .../src/mca/pif/bsdx_ipv4/configure.m4 | 0 .../src/mca/pif/bsdx_ipv4/pif_bsdx.c | 0 .../src/mca/pif/bsdx_ipv6/Makefile.am | 0 .../src/mca/pif/bsdx_ipv6/configure.m4 | 0 .../src/mca/pif/bsdx_ipv6/pif_bsdx_ipv6.c | 0 .../src/mca/pif/linux_ipv6/Makefile.am | 0 .../src/mca/pif/linux_ipv6/configure.m4 | 0 .../src/mca/pif/linux_ipv6/pif_linux_ipv6.c | 0 .../{pmix => openpmix}/src/mca/pif/pif.h | 0 .../src/mca/pif/posix_ipv4/Makefile.am | 0 .../src/mca/pif/posix_ipv4/configure.m4 | 0 .../src/mca/pif/posix_ipv4/pif_posix.c | 0 .../src/mca/pif/solaris_ipv6/Makefile.am | 0 .../src/mca/pif/solaris_ipv6/configure.m4 | 0 .../mca/pif/solaris_ipv6/pif_solaris_ipv6.c | 0 .../src/mca/pinstalldirs/Makefile.am | 0 .../src/mca/pinstalldirs/base/Makefile.am | 0 .../src/mca/pinstalldirs/base/base.h | 0 .../base/pinstalldirs_base_components.c | 0 .../base/pinstalldirs_base_expand.c | 0 .../src/mca/pinstalldirs/config/Makefile.am | 0 .../src/mca/pinstalldirs/config/configure.m4 | 0 .../pinstalldirs/config/pinstall_dirs.h.in | 0 .../config/pmix_pinstalldirs_config.c | 0 .../src/mca/pinstalldirs/configure.m4 | 0 .../src/mca/pinstalldirs/env/Makefile.am | 0 .../src/mca/pinstalldirs/env/configure.m4 | 0 .../pinstalldirs/env/pmix_pinstalldirs_env.c | 0 .../src/mca/pinstalldirs/pinstalldirs.h | 4 +- .../src/mca/plog/Makefile.am | 0 .../src/mca/plog/base/Makefile.include | 0 .../src/mca/plog/base/base.h | 0 .../src/mca/plog/base/help-pmix-plog.txt | 0 .../src/mca/plog/base/plog_base_frame.c | 0 .../src/mca/plog/base/plog_base_select.c | 0 .../src/mca/plog/base/plog_base_stubs.c | 2 +- .../src/mca/plog/default/Makefile.am | 0 .../src/mca/plog/default/plog_default.c | 0 .../src/mca/plog/default/plog_default.h | 0 .../mca/plog/default/plog_default_component.c | 0 .../{pmix => openpmix}/src/mca/plog/plog.h | 0 .../src/mca/plog/stdfd/Makefile.am | 0 .../src/mca/plog/stdfd/plog_stdfd.c | 2 +- .../src/mca/plog/stdfd/plog_stdfd.h | 0 .../src/mca/plog/stdfd/plog_stdfd_component.c | 0 .../src/mca/plog/syslog/Makefile.am | 0 .../src/mca/plog/syslog/configure.m4 | 0 .../src/mca/plog/syslog/plog_syslog.c | 0 .../src/mca/plog/syslog/plog_syslog.h | 0 .../mca/plog/syslog/plog_syslog_component.c | 0 .../pmix4x/openpmix/src/mca/pmdl/Makefile.am | 44 + .../src/mca/pmdl/base/Makefile.include | 32 + .../pmix4x/openpmix/src/mca/pmdl/base/base.h | 98 + .../src/mca/pmdl/base/pmdl_base_frame.c | 97 + .../src/mca/pmdl/base/pmdl_base_select.c | 116 + .../src/mca/pmdl/base/pmdl_base_stubs.c | 219 ++ .../openpmix/src/mca/pmdl/ompi/Makefile.am | 55 + .../openpmix/src/mca/pmdl/ompi/pmdl_ompi.c | 557 ++++ .../openpmix/src/mca/pmdl/ompi/pmdl_ompi.h | 27 + .../src/mca/pmdl/ompi/pmdl_ompi_component.c | 66 + .../pmix/pmix4x/openpmix/src/mca/pmdl/pmdl.h | 143 ++ .../src/mca/pnet/Makefile.am | 0 .../src/mca/pnet/base/Makefile.include | 0 .../src/mca/pnet/base/base.h | 0 .../src/mca/pnet/base/pnet_base_fns.c | 0 .../src/mca/pnet/base/pnet_base_frame.c | 0 .../src/mca/pnet/base/pnet_base_select.c | 0 .../{pmix => openpmix}/src/mca/pnet/pnet.h | 0 .../src/mca/pnet/tcp/Makefile.am | 0 .../src/mca/pnet/tcp/pnet_tcp.c | 0 .../src/mca/pnet/tcp/pnet_tcp.h | 0 .../src/mca/pnet/tcp/pnet_tcp_component.c | 0 .../src/mca/pnet/test/Makefile.am | 0 .../src/mca/pnet/test/pnet_test.c | 0 .../src/mca/pnet/test/pnet_test.h | 0 .../src/mca/pnet/test/pnet_test_component.c | 0 .../src/mca/preg/Makefile.am | 0 .../src/mca/preg/base/Makefile.include | 0 .../src/mca/preg/base/base.h | 13 - .../src/mca/preg/base/preg_base_frame.c | 2 - .../src/mca/preg/base/preg_base_select.c | 0 .../src/mca/preg/base/preg_base_stubs.c | 159 ++ .../src/mca/preg/compress/Makefile.am | 0 .../src/mca/preg/compress/preg_compress.c | 6 - .../src/mca/preg/compress/preg_compress.h | 0 .../preg/compress/preg_compress_component.c | 0 .../src/mca/preg/native/Makefile.am | 0 .../src/mca/preg/native/preg_native.c | 16 +- .../src/mca/preg/native/preg_native.h | 0 .../mca/preg/native/preg_native_component.c | 0 .../{pmix => openpmix}/src/mca/preg/preg.h | 9 - .../src/mca/preg/preg_types.h | 0 .../src/mca/psec/Makefile.am | 0 .../src/mca/psec/base/Makefile.include | 0 .../src/mca/psec/base/base.h | 0 .../src/mca/psec/base/psec_base_fns.c | 0 .../src/mca/psec/base/psec_base_frame.c | 0 .../src/mca/psec/base/psec_base_select.c | 0 .../src/mca/psec/dummy_handshake/Makefile.am | 0 .../dummy_handshake/psec_dummy_handshake.c | 0 .../dummy_handshake/psec_dummy_handshake.h | 0 .../psec_dummy_handshake_component.c | 0 .../src/mca/psec/munge/Makefile.am | 0 .../src/mca/psec/munge/configure.m4 | 0 .../src/mca/psec/munge/psec_munge.c | 0 .../src/mca/psec/munge/psec_munge.h | 0 .../src/mca/psec/munge/psec_munge_component.c | 0 .../src/mca/psec/native/Makefile.am | 0 .../src/mca/psec/native/psec_native.c | 0 .../src/mca/psec/native/psec_native.h | 0 .../mca/psec/native/psec_native_component.c | 0 .../src/mca/psec/none/Makefile.am | 0 .../src/mca/psec/none/psec_none.c | 0 .../src/mca/psec/none/psec_none.h | 0 .../src/mca/psec/none/psec_none_component.c | 0 .../{pmix => openpmix}/src/mca/psec/psec.h | 0 .../src/mca/psensor/Makefile.am | 0 .../src/mca/psensor/base/Makefile.am | 0 .../src/mca/psensor/base/base.h | 0 .../src/mca/psensor/base/psensor_base_frame.c | 0 .../mca/psensor/base/psensor_base_select.c | 0 .../src/mca/psensor/base/psensor_base_stubs.c | 0 .../src/mca/psensor/file/Makefile.am | 0 .../psensor/file/help-pmix-psensor-file.txt | 0 .../src/mca/psensor/file/psensor_file.c | 3 +- .../src/mca/psensor/file/psensor_file.h | 0 .../mca/psensor/file/psensor_file_component.c | 0 .../src/mca/psensor/heartbeat/Makefile.am | 0 .../heartbeat/help-pmix-psensor-heartbeat.txt | 0 .../mca/psensor/heartbeat/psensor_heartbeat.c | 0 .../mca/psensor/heartbeat/psensor_heartbeat.h | 0 .../heartbeat/psensor_heartbeat_component.c | 0 .../src/mca/psensor/psensor.h | 0 .../src/mca/pshmem/Makefile.am | 0 .../src/mca/pshmem/base/Makefile.include | 0 .../src/mca/pshmem/base/base.h | 0 .../src/mca/pshmem/base/pshmem_base_frame.c | 0 .../src/mca/pshmem/base/pshmem_base_select.c | 0 .../src/mca/pshmem/mmap/Makefile.am | 0 .../src/mca/pshmem/mmap/pshmem_mmap.c | 0 .../src/mca/pshmem/mmap/pshmem_mmap.h | 0 .../mca/pshmem/mmap/pshmem_mmap_component.c | 0 .../src/mca/pshmem/pshmem.h | 0 .../src/mca/psquash/Makefile.am | 0 .../src/mca/psquash/base/Makefile.include | 0 .../src/mca/psquash/base/base.h | 0 .../src/mca/psquash/base/psquash_base_frame.c | 0 .../mca/psquash/base/psquash_base_select.c | 0 .../src/mca/psquash/flex128/Makefile.am | 0 .../src/mca/psquash/flex128/psquash_flex128.c | 0 .../src/mca/psquash/flex128/psquash_flex128.h | 0 .../flex128/psquash_flex128_component.c | 0 .../src/mca/psquash/native/Makefile.am | 0 .../src/mca/psquash/native/psquash_native.c | 0 .../src/mca/psquash/native/psquash_native.h | 0 .../psquash/native/psquash_native_component.c | 0 .../src/mca/psquash/psquash.h | 0 .../src/mca/ptl/Makefile.am | 0 .../src/mca/ptl/base/Makefile.include | 0 .../src/mca/ptl/base/base.h | 0 .../src/mca/ptl/base/ptl_base_connect.c | 0 .../src/mca/ptl/base/ptl_base_frame.c | 0 .../src/mca/ptl/base/ptl_base_listener.c | 0 .../src/mca/ptl/base/ptl_base_select.c | 0 .../src/mca/ptl/base/ptl_base_sendrecv.c | 0 .../src/mca/ptl/base/ptl_base_stubs.c | 0 .../{pmix => openpmix}/src/mca/ptl/ptl.h | 0 .../src/mca/ptl/ptl_types.h | 0 .../src/mca/ptl/tcp/Makefile.am | 0 .../src/mca/ptl/tcp/ptl_tcp.c | 1 + .../src/mca/ptl/tcp/ptl_tcp.h | 0 .../src/mca/ptl/tcp/ptl_tcp_component.c | 1 + .../src/mca/ptl/usock/Makefile.am | 0 .../src/mca/ptl/usock/ptl_usock.c | 0 .../src/mca/ptl/usock/ptl_usock.h | 0 .../src/mca/ptl/usock/ptl_usock_component.c | 0 .../src/runtime/Makefile.include | 0 .../src/runtime/help-pmix-runtime.txt | 0 .../src/runtime/pmix_finalize.c | 0 .../src/runtime/pmix_init.c | 0 .../src/runtime/pmix_params.c | 0 .../src/runtime/pmix_progress_threads.c | 0 .../src/runtime/pmix_progress_threads.h | 0 .../{pmix => openpmix}/src/runtime/pmix_rte.h | 0 .../src/server/Makefile.include | 0 .../src/server/help-pmix-server.txt | 0 .../src/server/pmix_sched.c | 0 .../src/server/pmix_server.c | 99 + .../src/server/pmix_server_get.c | 86 +- .../src/server/pmix_server_ops.c | 2 +- .../src/server/pmix_server_ops.h | 0 .../src/threads/Makefile.include | 0 .../{pmix => openpmix}/src/threads/mutex.c | 0 .../{pmix => openpmix}/src/threads/mutex.h | 0 .../src/threads/mutex_unix.h | 0 .../{pmix => openpmix}/src/threads/thread.c | 0 .../src/threads/thread_usage.h | 0 .../{pmix => openpmix}/src/threads/threads.h | 3 +- .../{pmix => openpmix}/src/threads/tsd.h | 0 .../src/threads/wait_sync.c | 0 .../src/threads/wait_sync.h | 0 .../src/tool/Makefile.include | 0 .../{pmix => openpmix}/src/tool/pmix_tool.c | 0 .../src/tools/Makefile.include | 6 +- .../src/tools/pattrs/Makefile.am | 0 .../src/tools/pattrs/help-pattrs.txt | 0 .../src/tools/pattrs/pattrs.c | 0 .../src/tools/pevent/Makefile.am | 0 .../src/tools/pevent/help-pevent.txt | 0 .../src/tools/pevent/pevent.c | 0 .../src/tools/plookup/Makefile.am | 0 .../src/tools/plookup/help-plookup.txt | 0 .../src/tools/plookup/plookup.c | 0 .../src/tools/pmix_info/Makefile.am | 0 .../src/tools/pmix_info/help-pmix-info.txt | 0 .../src/tools/pmix_info/pinfo.h | 0 .../src/tools/pmix_info/pmix_info.c | 0 .../src/tools/pmix_info/support.c | 0 .../src/tools/pmix_info/support.h | 0 .../src/tools/pps/Makefile.am | 0 .../src/tools/pps/help-pps.txt | 0 .../{pmix => openpmix}/src/tools/pps/pps.c | 0 .../openpmix/src/tools/wrapper/Makefile.am | 73 + .../src/tools/wrapper/generic_wrapper.1in | 265 ++ .../src/tools/wrapper/help-pmix-wrapper.txt | 68 + .../openpmix/src/tools/wrapper/pmix.pc.in | 25 + .../src/tools/wrapper/pmix_wrapper.1in | 43 + .../openpmix/src/tools/wrapper/pmix_wrapper.c | 993 ++++++++ .../tools/wrapper/pmixcc-wrapper-data.txt.in | 25 + .../src/util/Makefile.include | 6 +- .../pmix4x/{pmix => openpmix}/src/util/alfg.c | 0 .../pmix4x/{pmix => openpmix}/src/util/alfg.h | 0 .../pmix4x/{pmix => openpmix}/src/util/argv.c | 0 .../pmix4x/{pmix => openpmix}/src/util/argv.h | 0 .../{pmix => openpmix}/src/util/basename.c | 0 .../{pmix => openpmix}/src/util/basename.h | 0 .../{pmix => openpmix}/src/util/cmd_line.c | 0 .../{pmix => openpmix}/src/util/cmd_line.h | 0 .../{pmix => openpmix}/src/util/context_fns.c | 0 .../{pmix => openpmix}/src/util/context_fns.h | 0 .../pmix4x/{pmix => openpmix}/src/util/crc.c | 0 .../pmix4x/{pmix => openpmix}/src/util/crc.h | 0 .../{pmix => openpmix}/src/util/error.c | 0 .../{pmix => openpmix}/src/util/error.h | 0 .../pmix4x/{pmix => openpmix}/src/util/fd.c | 5 +- .../pmix4x/{pmix => openpmix}/src/util/fd.h | 0 opal/mca/pmix/pmix4x/openpmix/src/util/few.c | 84 + opal/mca/pmix/pmix4x/openpmix/src/util/few.h | 62 + .../{pmix => openpmix}/src/util/getid.c | 0 .../{pmix => openpmix}/src/util/getid.h | 0 .../pmix4x/{pmix => openpmix}/src/util/hash.c | 0 .../pmix4x/{pmix => openpmix}/src/util/hash.h | 0 .../src/util/keyval/Makefile.am | 0 .../src/util/keyval/keyval_lex.h | 0 .../src/util/keyval/keyval_lex.l | 0 .../src/util/keyval_parse.c | 0 .../src/util/keyval_parse.h | 0 .../{pmix => openpmix}/src/util/name_fns.c | 0 .../{pmix => openpmix}/src/util/name_fns.h | 0 .../pmix4x/{pmix => openpmix}/src/util/net.c | 0 .../pmix4x/{pmix => openpmix}/src/util/net.h | 0 .../{pmix => openpmix}/src/util/os_dirpath.c | 4 + .../{pmix => openpmix}/src/util/os_dirpath.h | 0 .../{pmix => openpmix}/src/util/os_path.c | 0 .../{pmix => openpmix}/src/util/os_path.h | 0 .../{pmix => openpmix}/src/util/output.c | 0 .../{pmix => openpmix}/src/util/output.h | 0 .../src/util/parse_options.c | 0 .../src/util/parse_options.h | 0 .../pmix4x/{pmix => openpmix}/src/util/path.c | 3 +- .../pmix4x/{pmix => openpmix}/src/util/path.h | 0 .../pmix4x/{pmix => openpmix}/src/util/pif.c | 0 .../pmix4x/{pmix => openpmix}/src/util/pif.h | 0 .../src/util/pmix_environ.c | 0 .../src/util/pmix_environ.h | 0 .../{pmix => openpmix}/src/util/pmix_pty.c | 0 .../{pmix => openpmix}/src/util/pmix_pty.h | 0 .../{pmix => openpmix}/src/util/printf.c | 0 .../{pmix => openpmix}/src/util/printf.h | 0 .../{pmix => openpmix}/src/util/show_help.c | 0 .../{pmix => openpmix}/src/util/show_help.h | 0 .../src/util/show_help_lex.h | 0 .../src/util/show_help_lex.l | 0 .../{pmix => openpmix}/src/util/strnlen.h | 0 .../{pmix => openpmix}/src/util/timings.c | 0 .../{pmix => openpmix}/src/util/timings.h | 0 .../{pmix => openpmix}/test/Makefile.am | 0 .../pmix4x/{pmix => openpmix}/test/README | 0 .../{pmix => openpmix}/test/cli_stages.c | 0 .../{pmix => openpmix}/test/cli_stages.h | 0 .../{pmix => openpmix}/test/pmi2_client.c | 0 .../{pmix => openpmix}/test/pmi_client.c | 0 .../{pmix => openpmix}/test/pmix_client.c | 0 .../test/pmix_client_otheruser.sh | 0 .../{pmix => openpmix}/test/pmix_regex.c | 0 .../{pmix => openpmix}/test/pmix_test.c | 0 .../test/python/Makefile.am | 0 .../test/python/run_sched.sh.in | 0 .../test/python/run_server.sh.in | 0 .../{pmix => openpmix}/test/run_tests00.pl.in | 0 .../{pmix => openpmix}/test/run_tests01.pl.in | 0 .../{pmix => openpmix}/test/run_tests02.pl.in | 0 .../{pmix => openpmix}/test/run_tests03.pl.in | 0 .../{pmix => openpmix}/test/run_tests04.pl.in | 0 .../{pmix => openpmix}/test/run_tests05.pl.in | 0 .../{pmix => openpmix}/test/run_tests06.pl.in | 0 .../{pmix => openpmix}/test/run_tests07.pl.in | 0 .../{pmix => openpmix}/test/run_tests08.pl.in | 0 .../{pmix => openpmix}/test/run_tests09.pl.in | 0 .../{pmix => openpmix}/test/run_tests10.pl.in | 0 .../{pmix => openpmix}/test/run_tests11.pl.in | 0 .../{pmix => openpmix}/test/run_tests12.pl.in | 0 .../{pmix => openpmix}/test/run_tests13.pl.in | 0 .../{pmix => openpmix}/test/run_tests14.pl.in | 0 .../{pmix => openpmix}/test/run_tests15.pl.in | 0 .../test/server_callbacks.c | 0 .../test/server_callbacks.h | 0 .../test/simple/Makefile.am | 0 .../{pmix => openpmix}/test/simple/gwclient.c | 0 .../{pmix => openpmix}/test/simple/gwtest.c | 0 .../test/simple/quietclient.c | 0 .../test/simple/simpclient.c | 0 .../test/simple/simpcoord.c | 4 + .../{pmix => openpmix}/test/simple/simpdie.c | 0 .../test/simple/simpdmodex.c | 0 .../{pmix => openpmix}/test/simple/simpdyn.c | 0 .../{pmix => openpmix}/test/simple/simpft.c | 0 .../{pmix => openpmix}/test/simple/simpio.c | 0 .../test/simple/simpjctrl.c | 0 .../test/simple/simplegacy.c | 0 .../{pmix => openpmix}/test/simple/simppub.c | 0 .../test/simple/simpsched.c | 0 .../{pmix => openpmix}/test/simple/simptest.c | 25 +- .../test/simple/simptimeout.c | 0 .../{pmix => openpmix}/test/simple/simptool.c | 0 .../test/simple/stability.c | 0 .../test/simple/test_pmix.c | 0 .../pmix4x/{pmix => openpmix}/test/test_cd.c | 0 .../pmix4x/{pmix => openpmix}/test/test_cd.h | 0 .../{pmix => openpmix}/test/test_common.c | 0 .../{pmix => openpmix}/test/test_common.h | 0 .../{pmix => openpmix}/test/test_error.c | 0 .../{pmix => openpmix}/test/test_error.h | 0 .../{pmix => openpmix}/test/test_fence.c | 0 .../{pmix => openpmix}/test/test_fence.h | 0 .../{pmix => openpmix}/test/test_internal.c | 0 .../{pmix => openpmix}/test/test_internal.h | 0 .../{pmix => openpmix}/test/test_publish.c | 0 .../{pmix => openpmix}/test/test_publish.h | 0 .../{pmix => openpmix}/test/test_replace.c | 0 .../{pmix => openpmix}/test/test_replace.h | 0 .../test/test_resolve_peers.c | 0 .../test/test_resolve_peers.h | 0 .../{pmix => openpmix}/test/test_server.c | 0 .../{pmix => openpmix}/test/test_server.h | 0 .../{pmix => openpmix}/test/test_spawn.c | 0 .../{pmix => openpmix}/test/test_spawn.h | 0 .../pmix4x/{pmix => openpmix}/test/utils.c | 0 .../pmix4x/{pmix => openpmix}/test/utils.h | 0 opal/mca/pmix/pmix4x/pmix/examples/dmodex.c | 228 -- .../pmix/src/mca/preg/base/preg_base_stubs.c | 329 --- 723 files changed, 9293 insertions(+), 1265 deletions(-) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/AUTHORS (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/HACKING (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/INSTALL (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/LICENSE (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/Makefile.am (95%) create mode 100644 opal/mca/pmix/pmix4x/openpmix/Makefile.pmix-rules rename opal/mca/pmix/pmix4x/{pmix => openpmix}/NEWS (75%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/README (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/VERSION (98%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/autogen.pl (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/bindings/Makefile.am (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/bindings/README (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/bindings/python/Makefile.am (98%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/bindings/python/README (100%) create mode 100755 opal/mca/pmix/pmix4x/openpmix/bindings/python/construct.py create mode 100644 opal/mca/pmix/pmix4x/openpmix/bindings/python/pmix.pxi create mode 100644 opal/mca/pmix/pmix4x/openpmix/bindings/python/pmix.pyx create mode 100755 opal/mca/pmix/pmix4x/openpmix/bindings/python/setup.py rename opal/mca/pmix/pmix4x/{pmix => openpmix}/config/Makefile.am (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/config/c_get_alignment.m4 (98%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/config/distscript.sh (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/config/pmix.m4 (98%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/config/pmix_check_attributes.m4 (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/config/pmix_check_broken_qsort.m4 (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/config/pmix_check_compiler_version.m4 (98%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/config/pmix_check_icc.m4 (96%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/config/pmix_check_ident.m4 (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/config/pmix_check_lock.m4 (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/config/pmix_check_os_flavors.m4 (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/config/pmix_check_package.m4 (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/config/pmix_check_pthread_pids.m4 (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/config/pmix_check_vendor.m4 (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/config/pmix_check_visibility.m4 (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/config/pmix_check_withdir.m4 (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/config/pmix_config_asm.m4 (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/config/pmix_config_pthreads.m4 (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/config/pmix_config_subdir.m4 (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/config/pmix_config_subdir_args.m4 (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/config/pmix_config_threads.m4 (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/config/pmix_ensure_contains_optflags.m4 (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/config/pmix_functions.m4 (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/config/pmix_get_version.sh (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/config/pmix_load_platform.m4 (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/config/pmix_mca.m4 (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/config/pmix_mca_priority_sort.pl (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/config/pmix_search_libs.m4 (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/config/pmix_set_mca_prefix.m4 (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/config/pmix_setup_cc.m4 (98%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/config/pmix_setup_cli.m4 (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/config/pmix_setup_hwloc.m4 (96%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/config/pmix_setup_libev.m4 (90%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/config/pmix_setup_libevent.m4 (97%) create mode 100644 opal/mca/pmix/pmix4x/openpmix/config/pmix_setup_wrappers.m4 rename opal/mca/pmix/pmix4x/{pmix => openpmix}/config/pmix_summary.m4 (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/config/pmix_try_assemble.m4 (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/configure.ac (99%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/contrib/Makefile.am (91%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/contrib/buildrpm.sh (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/contrib/make_dist_tarball (100%) create mode 100755 opal/mca/pmix/pmix4x/openpmix/contrib/make_manpage.pl rename opal/mca/pmix/pmix4x/{pmix => openpmix}/contrib/perf_tools/Makefile (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/contrib/perf_tools/Makefile.include (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/contrib/perf_tools/README (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/contrib/perf_tools/pmi.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/contrib/perf_tools/pmi2.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/contrib/perf_tools/pmi2_pmap_parser.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/contrib/perf_tools/pmi2_pmap_parser.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/contrib/perf_tools/pmi2_utils.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/contrib/perf_tools/pmi2_utils.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/contrib/perf_tools/pmi_intra_perf.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/contrib/perf_tools/pmix.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/contrib/perf_tools/run.sh (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/contrib/platform/optimized (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/contrib/pmix-release.sh (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/contrib/pmix-valgrind.supp (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/contrib/pmix.spec (99%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/contrib/pmix_jenkins.sh (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/contrib/update-my-copyright.pl (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/contrib/whitespace-purge.sh (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/etc/Makefile.am (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/etc/pmix-mca-params.conf (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/examples/Makefile.am (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/examples/alloc.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/examples/asyncgroup.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/examples/client.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/examples/client2.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/examples/debugger.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/examples/debuggerd.c (100%) create mode 100644 opal/mca/pmix/pmix4x/openpmix/examples/dmodex.c rename opal/mca/pmix/pmix4x/{pmix => openpmix}/examples/dynamic.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/examples/examples.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/examples/fault.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/examples/group.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/examples/jctrl.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/examples/pub.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/examples/pubi.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/examples/server.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/examples/tool.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/include/Makefile.am (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/include/pmi.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/include/pmi2.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/include/pmix.h (96%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/include/pmix_common.h.in (98%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/include/pmix_extend.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/include/pmix_rename.h.in (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/include/pmix_sched.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/include/pmix_server.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/include/pmix_tool.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/include/pmix_version.h.in (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/Makefile.am (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/atomics/sys/Makefile.include (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/atomics/sys/architecture.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/atomics/sys/arm/Makefile.include (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/atomics/sys/arm/atomic.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/atomics/sys/arm/timer.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/atomics/sys/arm64/Makefile.include (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/atomics/sys/arm64/atomic.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/atomics/sys/arm64/timer.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/atomics/sys/atomic.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/atomics/sys/atomic_impl.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/atomics/sys/atomic_stdc.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/atomics/sys/cma.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/atomics/sys/gcc_builtin/Makefile.include (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/atomics/sys/gcc_builtin/atomic.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/atomics/sys/ia32/Makefile.include (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/atomics/sys/ia32/atomic.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/atomics/sys/ia32/timer.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/atomics/sys/powerpc/Makefile.include (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/atomics/sys/powerpc/atomic.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/atomics/sys/powerpc/timer.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/atomics/sys/sparcv9/Makefile.include (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/atomics/sys/sparcv9/atomic.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/atomics/sys/sparcv9/timer.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/atomics/sys/sync_builtin/Makefile.include (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/atomics/sys/sync_builtin/atomic.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/atomics/sys/timer.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/atomics/sys/x86_64/Makefile.include (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/atomics/sys/x86_64/atomic.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/atomics/sys/x86_64/timer.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/class/Makefile.include (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/class/pmix_bitmap.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/class/pmix_bitmap.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/class/pmix_hash_table.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/class/pmix_hash_table.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/class/pmix_hotel.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/class/pmix_hotel.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/class/pmix_list.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/class/pmix_list.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/class/pmix_object.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/class/pmix_object.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/class/pmix_pointer_array.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/class/pmix_pointer_array.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/class/pmix_ring_buffer.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/class/pmix_ring_buffer.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/class/pmix_value_array.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/class/pmix_value_array.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/client/Makefile.include (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/client/pmi1.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/client/pmi2.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/client/pmix_client.c (86%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/client/pmix_client_connect.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/client/pmix_client_fence.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/client/pmix_client_get.c (97%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/client/pmix_client_group.c (88%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/client/pmix_client_ops.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/client/pmix_client_pub.c (99%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/client/pmix_client_spawn.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/common/Makefile.include (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/common/pmix_attributes.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/common/pmix_attributes.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/common/pmix_control.c (94%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/common/pmix_data.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/common/pmix_iof.c (95%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/common/pmix_iof.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/common/pmix_log.c (99%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/common/pmix_query.c (96%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/common/pmix_security.c (83%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/common/pmix_strings.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/event/Makefile.include (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/event/pmix_event.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/event/pmix_event_notification.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/event/pmix_event_registration.c (95%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/hwloc/Makefile.include (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/hwloc/hwloc-internal.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/hwloc/hwloc.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/include/Makefile.include (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/include/align.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/include/hash_string.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/include/pmix_config_bottom.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/include/pmix_config_top.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/include/pmix_globals.c (99%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/include/pmix_globals.h (98%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/include/pmix_portable_platform.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/include/pmix_socket_errno.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/include/pmix_stdatomic.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/include/pmix_stdint.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/include/prefetch.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/include/types.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/Makefile.include (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/base/Makefile.am (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/base/base.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/base/help-pmix-mca-base.txt (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/base/help-pmix-mca-var.txt (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/base/pmix_mca_base_close.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/base/pmix_mca_base_cmd_line.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/base/pmix_mca_base_component_compare.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/base/pmix_mca_base_component_find.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/base/pmix_mca_base_component_repository.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/base/pmix_mca_base_component_repository.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/base/pmix_mca_base_components_close.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/base/pmix_mca_base_components_open.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/base/pmix_mca_base_components_register.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/base/pmix_mca_base_components_select.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/base/pmix_mca_base_framework.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/base/pmix_mca_base_framework.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/base/pmix_mca_base_list.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/base/pmix_mca_base_open.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/base/pmix_mca_base_parse_paramfile.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/base/pmix_mca_base_var.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/base/pmix_mca_base_var.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/base/pmix_mca_base_var_enum.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/base/pmix_mca_base_var_enum.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/base/pmix_mca_base_var_group.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/base/pmix_mca_base_var_group.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/base/pmix_mca_base_vari.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/bfrops/Makefile.am (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/bfrops/base/Makefile.include (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/bfrops/base/base.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/bfrops/base/bfrop_base_copy.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/bfrops/base/bfrop_base_fns.c (98%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/bfrops/base/bfrop_base_frame.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/bfrops/base/bfrop_base_pack.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/bfrops/base/bfrop_base_print.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/bfrops/base/bfrop_base_select.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/bfrops/base/bfrop_base_stubs.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/bfrops/base/bfrop_base_unpack.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/bfrops/bfrops.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/bfrops/bfrops_types.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/bfrops/v12/Makefile.am (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/bfrops/v12/bfrop_v12.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/bfrops/v12/bfrop_v12.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/bfrops/v12/bfrop_v12_component.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/bfrops/v12/copy.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/bfrops/v12/internal.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/bfrops/v12/pack.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/bfrops/v12/print.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/bfrops/v12/unpack.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/bfrops/v20/Makefile.am (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/bfrops/v20/bfrop_pmix20.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/bfrops/v20/bfrop_pmix20.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/bfrops/v20/bfrop_pmix20_component.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/bfrops/v20/copy.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/bfrops/v20/internal.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/bfrops/v20/pack.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/bfrops/v20/print.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/bfrops/v20/unpack.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/bfrops/v21/Makefile.am (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/bfrops/v21/bfrop_pmix21.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/bfrops/v21/bfrop_pmix21.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/bfrops/v21/bfrop_pmix21_component.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/bfrops/v3/Makefile.am (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/bfrops/v3/bfrop_pmix3.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/bfrops/v3/bfrop_pmix3.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/bfrops/v3/bfrop_pmix3_component.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/bfrops/v4/Makefile.am (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/bfrops/v4/bfrop_pmix4.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/bfrops/v4/bfrop_pmix4.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/bfrops/v4/bfrop_pmix4_component.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/common/Makefile.am (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/common/dstore/Makefile.am (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/common/dstore/configure.m4 (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/common/dstore/dstore_base.c (99%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/common/dstore/dstore_base.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/common/dstore/dstore_common.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/common/dstore/dstore_file.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/common/dstore/dstore_segment.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/common/dstore/dstore_segment.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/gds/Makefile.am (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/gds/base/Makefile.include (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/gds/base/base.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/gds/base/gds_base_fns.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/gds/base/gds_base_frame.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/gds/base/gds_base_select.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/gds/ds12/Makefile.am (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/gds/ds12/gds_ds12_base.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/gds/ds12/gds_ds12_base.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/gds/ds12/gds_ds12_component.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/gds/ds12/gds_ds12_file.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/gds/ds12/gds_ds12_file.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/gds/ds12/gds_ds12_lock.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/gds/ds12/gds_ds12_lock.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/gds/ds12/gds_ds12_lock_fcntl.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/gds/ds12/gds_ds12_lock_pthread.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/gds/ds12/gds_ds20_file.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/gds/ds21/Makefile.am (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/gds/ds21/gds_ds21_base.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/gds/ds21/gds_ds21_base.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/gds/ds21/gds_ds21_component.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/gds/ds21/gds_ds21_file.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/gds/ds21/gds_ds21_file.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/gds/ds21/gds_ds21_lock.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/gds/ds21/gds_ds21_lock.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/gds/ds21/gds_ds21_lock_pthread.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/gds/gds.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/gds/hash/Makefile.am (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/gds/hash/gds_hash.c (86%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/gds/hash/gds_hash.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/gds/hash/gds_hash_component.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/mca.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/pcompress/Makefile.am (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/pcompress/base/Makefile.am (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/pcompress/base/base.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/pcompress/base/pcompress_base_frame.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/pcompress/base/pcompress_base_select.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/pcompress/pcompress.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/pcompress/zlib/Makefile.am (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/pcompress/zlib/compress_zlib.c (94%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/pcompress/zlib/compress_zlib.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/pcompress/zlib/compress_zlib_component.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/pcompress/zlib/configure.m4 (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/pdl/Makefile.am (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/pdl/base/Makefile.am (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/pdl/base/base.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/pdl/base/pdl_base_close.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/pdl/base/pdl_base_fns.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/pdl/base/pdl_base_open.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/pdl/base/pdl_base_select.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/pdl/configure.m4 (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/pdl/pdl.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/pdl/pdlopen/Makefile.am (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/pdl/pdlopen/configure.m4 (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/pdl/pdlopen/pdl_pdlopen.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/pdl/pdlopen/pdl_pdlopen_component.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/pdl/pdlopen/pdl_pdlopen_module.c (98%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/pdl/plibltdl/Makefile.am (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/pdl/plibltdl/configure.m4 (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/pdl/plibltdl/pdl_libltdl.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/pdl/plibltdl/pdl_libltdl_component.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/pdl/plibltdl/pdl_libltdl_module.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/pfexec/Makefile.am (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/pfexec/base/Makefile.am (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/pfexec/base/base.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/pfexec/base/help-pfexec-base.txt (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/pfexec/base/pfexec_base_default_fns.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/pfexec/base/pfexec_base_frame.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/pfexec/base/pfexec_base_select.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/pfexec/linux/Makefile.am (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/pfexec/linux/configure.m4 (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/pfexec/linux/help-pfexec-linux.txt (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/pfexec/linux/pfexec_linux.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/pfexec/linux/pfexec_linux.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/pfexec/linux/pfexec_linux_component.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/pfexec/pfexec.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/pif/Makefile.am (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/pif/base/Makefile.am (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/pif/base/base.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/pif/base/pif_base_components.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/pif/bsdx_ipv4/Makefile.am (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/pif/bsdx_ipv4/configure.m4 (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/pif/bsdx_ipv4/pif_bsdx.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/pif/bsdx_ipv6/Makefile.am (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/pif/bsdx_ipv6/configure.m4 (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/pif/bsdx_ipv6/pif_bsdx_ipv6.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/pif/linux_ipv6/Makefile.am (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/pif/linux_ipv6/configure.m4 (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/pif/linux_ipv6/pif_linux_ipv6.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/pif/pif.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/pif/posix_ipv4/Makefile.am (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/pif/posix_ipv4/configure.m4 (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/pif/posix_ipv4/pif_posix.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/pif/solaris_ipv6/Makefile.am (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/pif/solaris_ipv6/configure.m4 (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/pif/solaris_ipv6/pif_solaris_ipv6.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/pinstalldirs/Makefile.am (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/pinstalldirs/base/Makefile.am (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/pinstalldirs/base/base.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/pinstalldirs/base/pinstalldirs_base_components.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/pinstalldirs/base/pinstalldirs_base_expand.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/pinstalldirs/config/Makefile.am (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/pinstalldirs/config/configure.m4 (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/pinstalldirs/config/pinstall_dirs.h.in (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/pinstalldirs/config/pmix_pinstalldirs_config.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/pinstalldirs/configure.m4 (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/pinstalldirs/env/Makefile.am (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/pinstalldirs/env/configure.m4 (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/pinstalldirs/env/pmix_pinstalldirs_env.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/pinstalldirs/pinstalldirs.h (95%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/plog/Makefile.am (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/plog/base/Makefile.include (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/plog/base/base.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/plog/base/help-pmix-plog.txt (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/plog/base/plog_base_frame.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/plog/base/plog_base_select.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/plog/base/plog_base_stubs.c (99%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/plog/default/Makefile.am (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/plog/default/plog_default.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/plog/default/plog_default.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/plog/default/plog_default_component.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/plog/plog.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/plog/stdfd/Makefile.am (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/plog/stdfd/plog_stdfd.c (98%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/plog/stdfd/plog_stdfd.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/plog/stdfd/plog_stdfd_component.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/plog/syslog/Makefile.am (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/plog/syslog/configure.m4 (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/plog/syslog/plog_syslog.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/plog/syslog/plog_syslog.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/plog/syslog/plog_syslog_component.c (100%) create mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/pmdl/Makefile.am create mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/pmdl/base/Makefile.include create mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/pmdl/base/base.h create mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/pmdl/base/pmdl_base_frame.c create mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/pmdl/base/pmdl_base_select.c create mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/pmdl/base/pmdl_base_stubs.c create mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/pmdl/ompi/Makefile.am create mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/pmdl/ompi/pmdl_ompi.c create mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/pmdl/ompi/pmdl_ompi.h create mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/pmdl/ompi/pmdl_ompi_component.c create mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/pmdl/pmdl.h rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/pnet/Makefile.am (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/pnet/base/Makefile.include (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/pnet/base/base.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/pnet/base/pnet_base_fns.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/pnet/base/pnet_base_frame.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/pnet/base/pnet_base_select.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/pnet/pnet.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/pnet/tcp/Makefile.am (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/pnet/tcp/pnet_tcp.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/pnet/tcp/pnet_tcp.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/pnet/tcp/pnet_tcp_component.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/pnet/test/Makefile.am (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/pnet/test/pnet_test.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/pnet/test/pnet_test.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/pnet/test/pnet_test_component.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/preg/Makefile.am (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/preg/base/Makefile.include (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/preg/base/base.h (79%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/preg/base/preg_base_frame.c (97%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/preg/base/preg_base_select.c (100%) create mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/preg/base/preg_base_stubs.c rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/preg/compress/Makefile.am (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/preg/compress/preg_compress.c (97%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/preg/compress/preg_compress.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/preg/compress/preg_compress_component.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/preg/native/Makefile.am (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/preg/native/preg_native.c (98%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/preg/native/preg_native.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/preg/native/preg_native_component.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/preg/preg.h (86%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/preg/preg_types.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/psec/Makefile.am (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/psec/base/Makefile.include (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/psec/base/base.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/psec/base/psec_base_fns.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/psec/base/psec_base_frame.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/psec/base/psec_base_select.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/psec/dummy_handshake/Makefile.am (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/psec/dummy_handshake/psec_dummy_handshake.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/psec/dummy_handshake/psec_dummy_handshake.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/psec/dummy_handshake/psec_dummy_handshake_component.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/psec/munge/Makefile.am (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/psec/munge/configure.m4 (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/psec/munge/psec_munge.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/psec/munge/psec_munge.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/psec/munge/psec_munge_component.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/psec/native/Makefile.am (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/psec/native/psec_native.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/psec/native/psec_native.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/psec/native/psec_native_component.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/psec/none/Makefile.am (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/psec/none/psec_none.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/psec/none/psec_none.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/psec/none/psec_none_component.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/psec/psec.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/psensor/Makefile.am (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/psensor/base/Makefile.am (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/psensor/base/base.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/psensor/base/psensor_base_frame.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/psensor/base/psensor_base_select.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/psensor/base/psensor_base_stubs.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/psensor/file/Makefile.am (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/psensor/file/help-pmix-psensor-file.txt (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/psensor/file/psensor_file.c (99%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/psensor/file/psensor_file.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/psensor/file/psensor_file_component.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/psensor/heartbeat/Makefile.am (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/psensor/heartbeat/help-pmix-psensor-heartbeat.txt (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/psensor/heartbeat/psensor_heartbeat.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/psensor/heartbeat/psensor_heartbeat.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/psensor/heartbeat/psensor_heartbeat_component.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/psensor/psensor.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/pshmem/Makefile.am (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/pshmem/base/Makefile.include (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/pshmem/base/base.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/pshmem/base/pshmem_base_frame.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/pshmem/base/pshmem_base_select.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/pshmem/mmap/Makefile.am (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/pshmem/mmap/pshmem_mmap.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/pshmem/mmap/pshmem_mmap.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/pshmem/mmap/pshmem_mmap_component.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/pshmem/pshmem.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/psquash/Makefile.am (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/psquash/base/Makefile.include (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/psquash/base/base.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/psquash/base/psquash_base_frame.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/psquash/base/psquash_base_select.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/psquash/flex128/Makefile.am (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/psquash/flex128/psquash_flex128.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/psquash/flex128/psquash_flex128.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/psquash/flex128/psquash_flex128_component.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/psquash/native/Makefile.am (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/psquash/native/psquash_native.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/psquash/native/psquash_native.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/psquash/native/psquash_native_component.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/psquash/psquash.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/ptl/Makefile.am (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/ptl/base/Makefile.include (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/ptl/base/base.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/ptl/base/ptl_base_connect.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/ptl/base/ptl_base_frame.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/ptl/base/ptl_base_listener.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/ptl/base/ptl_base_select.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/ptl/base/ptl_base_sendrecv.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/ptl/base/ptl_base_stubs.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/ptl/ptl.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/ptl/ptl_types.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/ptl/tcp/Makefile.am (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/ptl/tcp/ptl_tcp.c (99%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/ptl/tcp/ptl_tcp.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/ptl/tcp/ptl_tcp_component.c (99%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/ptl/usock/Makefile.am (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/ptl/usock/ptl_usock.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/ptl/usock/ptl_usock.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/mca/ptl/usock/ptl_usock_component.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/runtime/Makefile.include (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/runtime/help-pmix-runtime.txt (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/runtime/pmix_finalize.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/runtime/pmix_init.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/runtime/pmix_params.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/runtime/pmix_progress_threads.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/runtime/pmix_progress_threads.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/runtime/pmix_rte.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/server/Makefile.include (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/server/help-pmix-server.txt (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/server/pmix_sched.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/server/pmix_server.c (97%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/server/pmix_server_get.c (94%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/server/pmix_server_ops.c (99%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/server/pmix_server_ops.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/threads/Makefile.include (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/threads/mutex.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/threads/mutex.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/threads/mutex_unix.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/threads/thread.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/threads/thread_usage.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/threads/threads.h (98%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/threads/tsd.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/threads/wait_sync.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/threads/wait_sync.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/tool/Makefile.include (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/tool/pmix_tool.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/tools/Makefile.include (94%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/tools/pattrs/Makefile.am (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/tools/pattrs/help-pattrs.txt (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/tools/pattrs/pattrs.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/tools/pevent/Makefile.am (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/tools/pevent/help-pevent.txt (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/tools/pevent/pevent.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/tools/plookup/Makefile.am (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/tools/plookup/help-plookup.txt (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/tools/plookup/plookup.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/tools/pmix_info/Makefile.am (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/tools/pmix_info/help-pmix-info.txt (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/tools/pmix_info/pinfo.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/tools/pmix_info/pmix_info.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/tools/pmix_info/support.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/tools/pmix_info/support.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/tools/pps/Makefile.am (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/tools/pps/help-pps.txt (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/tools/pps/pps.c (100%) create mode 100644 opal/mca/pmix/pmix4x/openpmix/src/tools/wrapper/Makefile.am create mode 100644 opal/mca/pmix/pmix4x/openpmix/src/tools/wrapper/generic_wrapper.1in create mode 100644 opal/mca/pmix/pmix4x/openpmix/src/tools/wrapper/help-pmix-wrapper.txt create mode 100644 opal/mca/pmix/pmix4x/openpmix/src/tools/wrapper/pmix.pc.in create mode 100644 opal/mca/pmix/pmix4x/openpmix/src/tools/wrapper/pmix_wrapper.1in create mode 100644 opal/mca/pmix/pmix4x/openpmix/src/tools/wrapper/pmix_wrapper.c create mode 100644 opal/mca/pmix/pmix4x/openpmix/src/tools/wrapper/pmixcc-wrapper-data.txt.in rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/util/Makefile.include (96%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/util/alfg.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/util/alfg.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/util/argv.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/util/argv.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/util/basename.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/util/basename.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/util/cmd_line.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/util/cmd_line.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/util/context_fns.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/util/context_fns.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/util/crc.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/util/crc.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/util/error.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/util/error.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/util/fd.c (94%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/util/fd.h (100%) create mode 100644 opal/mca/pmix/pmix4x/openpmix/src/util/few.c create mode 100644 opal/mca/pmix/pmix4x/openpmix/src/util/few.h rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/util/getid.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/util/getid.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/util/hash.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/util/hash.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/util/keyval/Makefile.am (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/util/keyval/keyval_lex.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/util/keyval/keyval_lex.l (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/util/keyval_parse.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/util/keyval_parse.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/util/name_fns.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/util/name_fns.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/util/net.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/util/net.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/util/os_dirpath.c (98%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/util/os_dirpath.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/util/os_path.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/util/os_path.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/util/output.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/util/output.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/util/parse_options.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/util/parse_options.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/util/path.c (99%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/util/path.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/util/pif.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/util/pif.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/util/pmix_environ.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/util/pmix_environ.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/util/pmix_pty.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/util/pmix_pty.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/util/printf.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/util/printf.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/util/show_help.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/util/show_help.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/util/show_help_lex.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/util/show_help_lex.l (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/util/strnlen.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/util/timings.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/src/util/timings.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/test/Makefile.am (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/test/README (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/test/cli_stages.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/test/cli_stages.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/test/pmi2_client.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/test/pmi_client.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/test/pmix_client.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/test/pmix_client_otheruser.sh (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/test/pmix_regex.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/test/pmix_test.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/test/python/Makefile.am (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/test/python/run_sched.sh.in (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/test/python/run_server.sh.in (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/test/run_tests00.pl.in (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/test/run_tests01.pl.in (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/test/run_tests02.pl.in (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/test/run_tests03.pl.in (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/test/run_tests04.pl.in (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/test/run_tests05.pl.in (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/test/run_tests06.pl.in (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/test/run_tests07.pl.in (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/test/run_tests08.pl.in (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/test/run_tests09.pl.in (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/test/run_tests10.pl.in (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/test/run_tests11.pl.in (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/test/run_tests12.pl.in (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/test/run_tests13.pl.in (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/test/run_tests14.pl.in (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/test/run_tests15.pl.in (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/test/server_callbacks.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/test/server_callbacks.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/test/simple/Makefile.am (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/test/simple/gwclient.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/test/simple/gwtest.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/test/simple/quietclient.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/test/simple/simpclient.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/test/simple/simpcoord.c (96%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/test/simple/simpdie.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/test/simple/simpdmodex.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/test/simple/simpdyn.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/test/simple/simpft.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/test/simple/simpio.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/test/simple/simpjctrl.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/test/simple/simplegacy.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/test/simple/simppub.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/test/simple/simpsched.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/test/simple/simptest.c (99%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/test/simple/simptimeout.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/test/simple/simptool.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/test/simple/stability.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/test/simple/test_pmix.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/test/test_cd.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/test/test_cd.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/test/test_common.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/test/test_common.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/test/test_error.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/test/test_error.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/test/test_fence.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/test/test_fence.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/test/test_internal.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/test/test_internal.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/test/test_publish.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/test/test_publish.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/test/test_replace.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/test/test_replace.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/test/test_resolve_peers.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/test/test_resolve_peers.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/test/test_server.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/test/test_server.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/test/test_spawn.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/test/test_spawn.h (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/test/utils.c (100%) rename opal/mca/pmix/pmix4x/{pmix => openpmix}/test/utils.h (100%) delete mode 100644 opal/mca/pmix/pmix4x/pmix/examples/dmodex.c delete mode 100644 opal/mca/pmix/pmix4x/pmix/src/mca/preg/base/preg_base_stubs.c diff --git a/.gitignore b/.gitignore index 8a7161cd70..65b92e43b7 100644 --- a/.gitignore +++ b/.gitignore @@ -373,51 +373,51 @@ opal/mca/hwloc/base/static-components.h.new.struct opal/mca/installdirs/config/install_dirs.h -!opal/mca/pmix/pmix*/pmix/AUTHORS -!opal/mca/pmix/pmix*/pmix/contrib/perf_tools/Makefile -opal/mca/pmix/pmix*/pmix/include/pmix/autogen/config.h -opal/mca/pmix/pmix*/pmix/include/pmix/autogen/config.h.in -opal/mca/pmix/pmix*/pmix/src/include/private/autogen/config.h.in -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 -opal/mca/pmix/pmix*/pmix/include/pmix_rename.h -opal/mca/pmix/pmix*/pmix/include/pmix_version.h -opal/mca/pmix/pmix*/pmix/src/util/keyval/keyval_lex.c -opal/mca/pmix/pmix*/pmix/src/util/show_help_lex.c -opal/mca/pmix/pmix*/pmix/examples/alloc -opal/mca/pmix/pmix*/pmix/examples/client -opal/mca/pmix/pmix*/pmix/examples/debugger -opal/mca/pmix/pmix*/pmix/examples/debuggerd -opal/mca/pmix/pmix*/pmix/examples/dmodex -opal/mca/pmix/pmix*/pmix/examples/dynamic -opal/mca/pmix/pmix*/pmix/examples/fault -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/pmix*/openpmix/AUTHORS +!opal/mca/pmix/pmix*/openpmix/contrib/perf_tools/Makefile +opal/mca/pmix/pmix*/openpmix/include/pmix/autogen/config.h +opal/mca/pmix/pmix*/openpmix/include/pmix/autogen/config.h.in +opal/mca/pmix/pmix*/openpmix/src/include/private/autogen/config.h.in +opal/mca/pmix/pmix*/openpmix/src/include/private/autogen/config.h +opal/mca/pmix/pmix*/openpmix/src/include/frameworks.h +opal/mca/pmix/pmix*/openpmix/src/mca/pinstalldirs/config/pinstall_dirs.h +opal/mca/pmix/pmix*/openpmix/config/autogen_found_items.m4 +opal/mca/pmix/pmix*/openpmix/config/mca_library_paths.txt +opal/mca/pmix/pmix*/openpmix/config/test-driver +opal/mca/pmix/pmix*/openpmix/src/include/pmix_config.h +opal/mca/pmix/pmix*/openpmix/src/include/pmix_config.h.in +opal/mca/pmix/pmix*/openpmix/include/pmix_common.h +opal/mca/pmix/pmix*/openpmix/include/pmix_rename.h +opal/mca/pmix/pmix*/openpmix/include/pmix_version.h +opal/mca/pmix/pmix*/openpmix/src/util/keyval/keyval_lex.c +opal/mca/pmix/pmix*/openpmix/src/util/show_help_lex.c +opal/mca/pmix/pmix*/openpmix/examples/alloc +opal/mca/pmix/pmix*/openpmix/examples/client +opal/mca/pmix/pmix*/openpmix/examples/debugger +opal/mca/pmix/pmix*/openpmix/examples/debuggerd +opal/mca/pmix/pmix*/openpmix/examples/dmodex +opal/mca/pmix/pmix*/openpmix/examples/dynamic +opal/mca/pmix/pmix*/openpmix/examples/fault +opal/mca/pmix/pmix*/openpmix/examples/jctrl +opal/mca/pmix/pmix*/openpmix/examples/pub +opal/mca/pmix/pmix*/openpmix/examples/server +opal/mca/pmix/pmix*/openpmix/examples/tool +opal/mca/pmix/pmix*/openpmix/test/run_tests00.pl +opal/mca/pmix/pmix*/openpmix/test/run_tests01.pl +opal/mca/pmix/pmix*/openpmix/test/run_tests02.pl +opal/mca/pmix/pmix*/openpmix/test/run_tests03.pl +opal/mca/pmix/pmix*/openpmix/test/run_tests04.pl +opal/mca/pmix/pmix*/openpmix/test/run_tests05.pl +opal/mca/pmix/pmix*/openpmix/test/run_tests06.pl +opal/mca/pmix/pmix*/openpmix/test/run_tests07.pl +opal/mca/pmix/pmix*/openpmix/test/run_tests08.pl +opal/mca/pmix/pmix*/openpmix/test/run_tests09.pl +opal/mca/pmix/pmix*/openpmix/test/run_tests10.pl +opal/mca/pmix/pmix*/openpmix/test/run_tests11.pl +opal/mca/pmix/pmix*/openpmix/test/run_tests12.pl +opal/mca/pmix/pmix*/openpmix/test/run_tests13.pl +opal/mca/pmix/pmix*/openpmix/test/run_tests14.pl +opal/mca/pmix/pmix*/openpmix/test/run_tests15.pl opal/mca/pmix/ext4x/ext4x.c diff --git a/opal/mca/pmix/pmix4x/Makefile.am b/opal/mca/pmix/pmix4x/Makefile.am index b63f2fd372..d108c5dc88 100644 --- a/opal/mca/pmix/pmix4x/Makefile.am +++ b/opal/mca/pmix/pmix4x/Makefile.am @@ -15,7 +15,7 @@ EXTRA_DIST = autogen.subdirs dist_opaldata_DATA = help-pmix-pmix4x.txt -SUBDIRS = pmix +SUBDIRS = openpmix sources = \ pmix4x.h \ @@ -43,7 +43,7 @@ mcacomponent_LTLIBRARIES = $(component_install) mca_pmix_pmix4x_la_SOURCES = $(sources) mca_pmix_pmix4x_la_CFLAGS = $(opal_pmix_pmix4x_CFLAGS) mca_pmix_pmix4x_la_CPPFLAGS = \ - -I$(srcdir)/pmix/include $(opal_pmix_pmix4x_CPPFLAGS) + -I$(srcdir)/openpmix/include $(opal_pmix_pmix4x_CPPFLAGS) mca_pmix_pmix4x_la_LDFLAGS = -module -avoid-version $(opal_pmix_pmix4x_LDFLAGS) mca_pmix_pmix4x_la_LIBADD = $(top_builddir)/opal/lib@OPAL_LIB_PREFIX@open-pal.la \ $(opal_pmix_pmix4x_LIBS) diff --git a/opal/mca/pmix/pmix4x/autogen.subdirs b/opal/mca/pmix/pmix4x/autogen.subdirs index f4fd6e846e..651a781023 100644 --- a/opal/mca/pmix/pmix4x/autogen.subdirs +++ b/opal/mca/pmix/pmix4x/autogen.subdirs @@ -1 +1 @@ -pmix +openpmix diff --git a/opal/mca/pmix/pmix4x/configure.m4 b/opal/mca/pmix/pmix4x/configure.m4 index 60de20e9b0..d97f812888 100644 --- a/opal/mca/pmix/pmix4x/configure.m4 +++ b/opal/mca/pmix/pmix4x/configure.m4 @@ -59,7 +59,7 @@ AC_DEFUN([MCA_opal_pmix_pmix4x_CONFIG],[ [opal_pmix_pmix4x_args="--with-devel-headers $opal_pmix_pmix4x_args"]) CPPFLAGS="-I$OPAL_TOP_SRCDIR -I$OPAL_TOP_BUILDDIR -I$OPAL_TOP_SRCDIR/opal/include -I$OPAL_TOP_BUILDDIR/opal/include $CPPFLAGS" - OPAL_CONFIG_SUBDIR([$opal_pmix_pmix4x_basedir/pmix], + OPAL_CONFIG_SUBDIR([$opal_pmix_pmix4x_basedir/openpmix], [$opal_pmix_pmix4x_args $opal_subdir_args 'CFLAGS=$CFLAGS' 'CPPFLAGS=$CPPFLAGS'], [opal_pmix_pmix4x_happy=1], [opal_pmix_pmix4x_happy=0]) @@ -83,9 +83,9 @@ AC_DEFUN([MCA_opal_pmix_pmix4x_CONFIG],[ AC_MSG_ERROR([CANNOT CONTINUE])]) # Build flags for our Makefile.am opal_pmix_pmix4x_LDFLAGS= - opal_pmix_pmix4x_LIBS="$OPAL_TOP_BUILDDIR/$opal_pmix_pmix4x_basedir/pmix/src/libpmix.la" - opal_pmix_pmix4x_CPPFLAGS="-I$OPAL_TOP_BUILDDIR/$opal_pmix_pmix4x_basedir/pmix/include -I$OPAL_TOP_BUILDDIR/$opal_pmix_pmix4x_basedir/pmix -I$OPAL_TOP_SRCDIR/$opal_pmix_pmix4x_basedir/pmix/include -I$OPAL_TOP_SRCDIR/$opal_pmix_pmix4x_basedir/pmix" - opal_pmix_pmix4x_DEPENDENCIES="$OPAL_TOP_BUILDDIR/$opal_pmix_pmix4x_basedir/pmix/src/libpmix.la"]) + opal_pmix_pmix4x_LIBS="$OPAL_TOP_BUILDDIR/$opal_pmix_pmix4x_basedir/openpmix/src/libpmix.la" + opal_pmix_pmix4x_CPPFLAGS="-I$OPAL_TOP_BUILDDIR/$opal_pmix_pmix4x_basedir/openpmix/include -I$OPAL_TOP_BUILDDIR/$opal_pmix_pmix4x_basedir/openpmix -I$OPAL_TOP_SRCDIR/$opal_pmix_pmix4x_basedir/openpmix/include -I$OPAL_TOP_SRCDIR/$opal_pmix_pmix4x_basedir/openpmix" + opal_pmix_pmix4x_DEPENDENCIES="$OPAL_TOP_BUILDDIR/$opal_pmix_pmix4x_basedir/openpmix/src/libpmix.la"]) AC_SUBST([opal_pmix_pmix4x_LIBS]) AC_SUBST([opal_pmix_pmix4x_CPPFLAGS]) @@ -94,7 +94,7 @@ AC_DEFUN([MCA_opal_pmix_pmix4x_CONFIG],[ # Finally, add some flags to the wrapper compiler so that our # headers can be found. - pmix_pmix4x_status_filename="$OPAL_TOP_BUILDDIR/$opal_pmix_pmix4x_basedir/pmix/config.status" + pmix_pmix4x_status_filename="$OPAL_TOP_BUILDDIR/$opal_pmix_pmix4x_basedir/openpmix/config.status" pmix_pmix4x_WRAPPER_EXTRA_CPPFLAGS=`egrep PMIX_EMBEDDED_CPPFLAGS $pmix_pmix4x_status_filename | cut -d\" -f4` pmix_pmix4x_WRAPPER_EXTRA_LDFLAGS=`egrep PMIX_EMBEDDED_LDFLAGS $pmix_pmix4x_status_filename | cut -d\" -f4` pmix_pmix4x_WRAPPER_EXTRA_LIBS=`egrep PMIX_EMBEDDED_LIBS $pmix_pmix4x_status_filename | cut -d\" -f4` diff --git a/opal/mca/pmix/pmix4x/pmix/AUTHORS b/opal/mca/pmix/pmix4x/openpmix/AUTHORS similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/AUTHORS rename to opal/mca/pmix/pmix4x/openpmix/AUTHORS diff --git a/opal/mca/pmix/pmix4x/pmix/HACKING b/opal/mca/pmix/pmix4x/openpmix/HACKING similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/HACKING rename to opal/mca/pmix/pmix4x/openpmix/HACKING diff --git a/opal/mca/pmix/pmix4x/pmix/INSTALL b/opal/mca/pmix/pmix4x/openpmix/INSTALL similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/INSTALL rename to opal/mca/pmix/pmix4x/openpmix/INSTALL diff --git a/opal/mca/pmix/pmix4x/pmix/LICENSE b/opal/mca/pmix/pmix4x/openpmix/LICENSE similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/LICENSE rename to opal/mca/pmix/pmix4x/openpmix/LICENSE diff --git a/opal/mca/pmix/pmix4x/pmix/Makefile.am b/opal/mca/pmix/pmix4x/openpmix/Makefile.am similarity index 95% rename from opal/mca/pmix/pmix4x/pmix/Makefile.am rename to opal/mca/pmix/pmix4x/openpmix/Makefile.am index 13d1c300b3..d39f0d6a87 100644 --- a/opal/mca/pmix/pmix4x/pmix/Makefile.am +++ b/opal/mca/pmix/pmix4x/openpmix/Makefile.am @@ -11,7 +11,7 @@ # All rights reserved. # 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) 2013-2019 Intel, Inc. All rights reserved. # Copyright (c) 2019 Amazon.com, Inc. or its affiliates. All Rights # reserved. # $COPYRIGHT$ @@ -32,7 +32,7 @@ AM_DISTCHECK_CONFIGURE_FLAGS = --disable-dlopen headers = sources = nodist_headers = -EXTRA_DIST = AUTHORS README HACKING INSTALL VERSION LICENSE autogen.pl +EXTRA_DIST = AUTHORS README HACKING INSTALL VERSION LICENSE autogen.pl Makefile.pmix-rules # Only install the valgrind suppressions file and man pages # if we're building in standalone mode diff --git a/opal/mca/pmix/pmix4x/openpmix/Makefile.pmix-rules b/opal/mca/pmix/pmix4x/openpmix/Makefile.pmix-rules new file mode 100644 index 0000000000..4250adb286 --- /dev/null +++ b/opal/mca/pmix/pmix4x/openpmix/Makefile.pmix-rules @@ -0,0 +1,37 @@ +# -*- makefile -*- +# Copyright (c) 2008-2018 Cisco Systems, Inc. All rights reserved. +# Copyright (c) 2008 Sun Microsystems, Inc. All rights reserved. +# Copyright (c) 2019 Intel, Inc. All rights reserved. +# $COPYRIGHT$ +# +# Additional copyrights may follow +# +# $HEADER$ +# + +TRIM_OPTIONS= + +.1in.1: + $(PMIX_V_GEN) $(top_srcdir)/contrib/make_manpage.pl \ + --package-name='@PACKAGE_NAME@' \ + --package-version='@PACKAGE_VERSION@' \ + --pmix-date='@PMIX_RELEASE_DATE@' \ + --input=$< \ + --output=$@ + +.3in.3: + $(PMIX_V_GEN) $(top_srcdir)/contrib/make_manpage.pl \ + --package-name='@PACKAGE_NAME@' \ + --package-version='@PACKAGE_VERSION@' \ + --pmix-date='@PMIX_RELEASE_DATE@' \ + $(TRIM_OPTIONS) \ + --input=$< \ + --output=$@ + +.7in.7: + $(PMIX_V_GEN) $(top_srcdir)/contrib/make_manpage.pl \ + --package-name='@PACKAGE_NAME@' \ + --package-version='@PACKAGE_VERSION@' \ + --pmix-date='@PMIX_RELEASE_DATE@' \ + --input=$< \ + --output=$@ diff --git a/opal/mca/pmix/pmix4x/pmix/NEWS b/opal/mca/pmix/pmix4x/openpmix/NEWS similarity index 75% rename from opal/mca/pmix/pmix4x/pmix/NEWS rename to opal/mca/pmix/pmix4x/openpmix/NEWS index 77972b6d5e..807ef8103e 100644 --- a/opal/mca/pmix/pmix4x/pmix/NEWS +++ b/opal/mca/pmix/pmix4x/openpmix/NEWS @@ -23,6 +23,89 @@ multiple release branches. Master (not on release branches yet) ------------------------------------ +3.1.5 -- TBD +---------------------- +NOTE: The signature of the PMIx_Allocation_request has changed +in accordance with an Errata update of the PMIx v3 Standard +- PR #1382: dstore: fixed truncate key-names while restoring +- PR #1405: Fix xnspace dmodex and add verbose debug +- PR #1406: Resolve request for job-level data +- PR #1407/#1409/#1411: Fix xnspace get yet again +- PR #1434/#1436: Cleanup handling of info arrays +- PR #1435: Cleanup example and remove debug +- PR #1437: Update blocking Allocation_request signature +- PR #1440: Fix 'get' of data for unknown namespace +- PR #1442: Fix fences with namespaces where no local processes are running + + +3.1.4 -- 9 Aug 2019 +---------------------- +- PR #1342: Fix if_linux_ipv6_open interface filter +- PR #1344: Remove unnecessary libtool init for c++ +- PR #1346: Fix incorrect pointer casts/deref +- PR #1347/#1348: Fix use of gethostname +- PR #1353/#1357: util/environ: use setenv() if available +- PR #1354: Plug a misc memory leak in the pmix_query_caddy_t destructor +- PR #1356: Fix another pointer cast/deref in test suite +- PR #1358: Implement support for class-based info arrays +- PR #1359: Plug misc minor memory leaks +- PR #1368: Backport support for libev +- PR #1369: Fix legacy support for PMI-1 +- PR #1370: Cleanup handling of data requests for different nspaces +- PR #1193: Resolve get of proc-specific job-level info from another nspace +- PR #1376: Fix problems in the Log code path, updates to simple test suite +- PR #1377: Skip fastpath/dstore for NULL keys +- PR #1379: Change IF_NAMESIZE to PMIX_IF_NAMESIZE and set to safe size +- PR #1385: Check for EINVAL return from posix_fallocate +- PR #1389: Plug misc memory leaks in configure + + +3.1.3 -- 2 July 2019 +---------------------- +- PR #1096: Restore PMIX_NUM_SLOTS for backward compatibility +- PR #1106: Automatically generate PMIX_NUMERIC_VERSION +- PR #1143: Fix tool connection handshake for tools that are registered + clients +- PR #1163: Fix a compiler warning in atomics on POWER arch +- PR #1162: Fix race condition when clients fail while in a PMIx + collective operation +- PR #1166: Fix a regression in spinlock atomics +- PR #1159: Fix missing pointer update when shared memory segment + was re-attached +- PR #1180: Remove dependency on C++ compiler for thread detection +- PR #1180: Add detection for Flex when building in non-tarball situations +- PR #1165: Add dependency on libevent-devel to rpm spec file +- PR #1188: Link libpmix.so to MCA component libraries +- PR #1194: Ensure any cached notifications arrive after registration completes +- PR #1205: Add "make check" support +- PR #1209: Update configure logic for clock_gettime +- PR #1213/#1217/#1221: Add configure option "--enable-nonglobal-dlopen" + If the MCA component libraries should link back to libpmix.so +- PR #1231: SPEC: Allow splitting PMIx in pmix and pmix-libpmi packages +- PR #1222: Fix case of multiple launcher calls in job script +- PR #1237: Avoid double-free of collective tracker +- PR #1237: Ensure all participants are notified of fence complete +- PR #1237: Ensure all participants are notified of connect and disconnect complete +- PR #1250: Fix PMIx_server_finalize hang (rare) +- PR #1271: PTL/usock doesn't support tools +- PR #1280: Fix the PTL connection establishment protocol +- PR #1280: Fix tool connection in psec/handshake mode +- PR #1289: Avoid output_verbose overhead when it won't print +- PR #1296: Allow setup_fork to proceed even if gdds and pnet don't contribute +- PR #1296: Allow servers to pass NULL module +- PR #1297: Provide internal blocking ability to the register/deregister fns +- PR #1298: Add dummy handshake component to psec framework for testing +- PR #1303: Allow jobs to not specify proc-level info +- PR #1304: Provide proc data in cases where host does not +- PR #1305: Add some more values that can be computed +- PR #1308: Add missing tool rendezvous file +- PR #1309: Fix potential integer overflow in regex +- PR #1311: Work around memory bug in older gcc compilers +- PR #1321: Provide memory op hooks in user-facing macros +- PR #1329: Add -fPIC to static builds +- PR #1340: Do not use '==' in m4 test statements + + 3.1.2 -- 24 Jan 2019 ---------------------- - Fix a bug in macro identifying system events @@ -183,6 +266,57 @@ Master (not on release branches yet) - Fix several memory and file descriptor leaks +2.2.3 -- 15 Aug 2019 +---------------------- +- PR #1162: Fix race condition when clients fail while in a PMIx + collective operation +- PR #1163: Fix a compiler warning in atomics on POWER arch +- PR #1165: Add BuildRequires: libevent-devel to spec file +- PR #1180: Remove dependency on C++ compiler for thread detection +- PR #1180: Add detection for Flex when building in non-tarball situations +- PR #1182: configury: use PMIX_ENABLE_DLOPEN_SUPPORT instead of enable_dlopen +- PR #1188: Link libpmix.so to MCA component libraries +- PR #1190: Ensure any cached notifications arrive after reg completes +- PR #1194: Ensure any cached notifications arrive after registration completes +- PR #1209: Update configure logic for clock_gettime +- PR #1213/#1217/#1221: Add configure option "--enable-nonglobal-dlopen" + If the MCA component libraries should link back to libpmix.so +- PR #1231: SPEC: Allow splitting PMIx in pmix and pmix-libpmi packages +- PR #1253: Preserve user-provided CFLAGS to protect autotools +- PR #1267: Correct dmodex example +- PR #1275: IPv6 IF Read: Buffer Overflow +- PR #1295: Fix comment: IPv6 IF_NAMESIZE +- PR #1296: Allow setup_fork to proceed even if gdds and pnet don't contribute +- PR #1296: Allow servers to pass NULL module +- PR #1297: Provide internal blocking ability to the register/deregister fns +- PR #1298: Add dummy handshake component to psec framework for testing +- PR #1303: Allow jobs to not specify proc-level info +- PR #1304: Provide proc data in cases where host does not +- PR #1305: Add some more values that can be computed +- PR #1308: Add missing tool rendezvous file +- PR #1309: Fix potential integer overflow in regex +- PR #1311: Work around memory bug in older gcc compilers +- PR #1329: Add -fPIC to static builds +- PR #1334: Cache only -W CFLAG entries to fix 32-bit builds +- PR #1341: Do not use '==' in m4 test statements +- PR #1342: Fix if_linux_ipv6_open interface filter +- PR #1344: Remove unnecessary libtool init for c++ +- PR #1346: Fix incorrect pointer casts/deref +- PR #1347/#1348: Fix use of gethostname +- PR #1353/#1357: util/environ: use setenv() if available +- PR #1354: Plug a misc memory leak in the pmix_query_caddy_t destructor +- PR #1356: Fix another pointer cast/deref in test suite +- PR #1358: Implement support for class-based info arrays +- PR #1359: Plug misc minor memory leaks +- PR #1369: Fix legacy support for PMI-1 +- PR #1370: Cleanup handling of data requests for different nspaces +- PR #1193: Resolve get of proc-specific job-level info from another nspace +- PR #1377: Skip fastpath/dstore for NULL keys +- PR #1379: Change IF_NAMESIZE to PMIX_IF_NAMESIZE and set to safe size +- PR #1385: Check for EINVAL return from posix_fallocate +- PR #1389: Plug misc memory leaks in configure + + 2.2.2 -- 24 Jan 2019 ---------------------- - Fix a bug in macro identifying system events diff --git a/opal/mca/pmix/pmix4x/pmix/README b/opal/mca/pmix/pmix4x/openpmix/README similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/README rename to opal/mca/pmix/pmix4x/openpmix/README diff --git a/opal/mca/pmix/pmix4x/pmix/VERSION b/opal/mca/pmix/pmix4x/openpmix/VERSION similarity index 98% rename from opal/mca/pmix/pmix4x/pmix/VERSION rename to opal/mca/pmix/pmix4x/openpmix/VERSION index 8b0c9d9a0b..078d025948 100644 --- a/opal/mca/pmix/pmix4x/pmix/VERSION +++ b/opal/mca/pmix/pmix4x/openpmix/VERSION @@ -23,14 +23,14 @@ release=0 # The only requirement is that it must be entirely printable ASCII # characters and have no white space. -greek= +greek=a1 # If repo_rev is empty, then the repository version number will be # obtained during "make dist" via the "git describe --tags --always" # command, or with the date (if "git describe" fails) in the form of # "date". -repo_rev=gitf87459fe +repo_rev=gitea3b29b1 # 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="Sep 03, 2019" +date="Oct 01, 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/openpmix/autogen.pl similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/autogen.pl rename to opal/mca/pmix/pmix4x/openpmix/autogen.pl diff --git a/opal/mca/pmix/pmix4x/pmix/bindings/Makefile.am b/opal/mca/pmix/pmix4x/openpmix/bindings/Makefile.am similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/bindings/Makefile.am rename to opal/mca/pmix/pmix4x/openpmix/bindings/Makefile.am diff --git a/opal/mca/pmix/pmix4x/pmix/bindings/README b/opal/mca/pmix/pmix4x/openpmix/bindings/README similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/bindings/README rename to opal/mca/pmix/pmix4x/openpmix/bindings/README diff --git a/opal/mca/pmix/pmix4x/pmix/bindings/python/Makefile.am b/opal/mca/pmix/pmix4x/openpmix/bindings/python/Makefile.am similarity index 98% rename from opal/mca/pmix/pmix4x/pmix/bindings/python/Makefile.am rename to opal/mca/pmix/pmix4x/openpmix/bindings/python/Makefile.am index 87936338aa..fa9c588768 100644 --- a/opal/mca/pmix/pmix4x/pmix/bindings/python/Makefile.am +++ b/opal/mca/pmix/pmix4x/openpmix/bindings/python/Makefile.am @@ -23,6 +23,8 @@ helpers = setup.py pmix.pyx pmix.pxi construct.py +EXTRA_DIST = $(helpers) + if WANT_PYTHON_BINDINGS install-exec-local: $(helpers) diff --git a/opal/mca/pmix/pmix4x/pmix/bindings/python/README b/opal/mca/pmix/pmix4x/openpmix/bindings/python/README similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/bindings/python/README rename to opal/mca/pmix/pmix4x/openpmix/bindings/python/README diff --git a/opal/mca/pmix/pmix4x/openpmix/bindings/python/construct.py b/opal/mca/pmix/pmix4x/openpmix/bindings/python/construct.py new file mode 100755 index 0000000000..6e74fd0b38 --- /dev/null +++ b/opal/mca/pmix/pmix4x/openpmix/bindings/python/construct.py @@ -0,0 +1,520 @@ +#!/usr/bin/env python3 + +import os, os.path, sys, shutil, signal +from optparse import OptionParser, OptionGroup + +takeconst = False +takeapis = False +takedtypes = False + +def signal_handler(signal, frame): + print("Ctrl-C received") + sys.exit(0) + +def harvest_constants(options, src, constants, definitions): + global takeconst, takeapis, takedtypes + + path = os.path.join(options.src, src) + # open the file + try: + inputfile = open(path, "r") + except: + print("File", path, "could not be opened") + return + # read the file - these files aren't too large + # so ingest the whole thing at one gulp + lines = inputfile.readlines() + # cache the string constants, numeric, and typedef constants + # in separate lists + strconsts = [] + strconstlen = 0 + errconsts = [] + nconsts = [] + nconstlen = 0 + typedefs = [] + apis = [] + # loop over the lines + for n in range(len(lines)): + line = lines[n] + # remove white space at front and back + myline = line.strip() + # remove comment lines + if "/*" in myline or "*/" in myline or myline.startswith("*"): + n += 1 + continue + # if the line starts with #define, then we want it + if takeconst and myline.startswith("#define"): + value = myline[8:] + # skip some well-known unwanted values + if value.startswith("PMIx"): + continue + if value.startswith("PMIX_HAVE_VISIB"): + continue + tokens = value.split() + if len(tokens) >= 2: + if tokens[1][0] == '"': + strconsts.append(tokens[0]) + if len(tokens[0]) > strconstlen: + strconstlen = len(tokens[0]) + elif "PMIX_ERR_" in value or tokens[1].startswith("-"): + # numerical constant that looks just like a + # string constant - i.e., PMIX_ERR_FOO...1 + # we output them in a separate section, but + # consider them string constants + errconsts.append(tokens[0]) + if len(tokens[0]) > strconstlen: + strconstlen = len(tokens[0]) + elif tokens[1].isdigit() or tokens[1].startswith("UINT") or tokens[1].startswith("0x"): + # values that were defined as UINT32_MAX need to be converted + # to hex values as Python otherwise gets confused + if tokens[1] == "UINT32_MAX": + tokens[1] = "0xffffffff" + elif "UINT32_MAX-1" in tokens[1]: + tokens[1] = "0xfffffffe" + elif "UINT32_MAX-2" in tokens[1]: + tokens[1] = "0xfffffffd" + elif "UINT32_MAX-3" in tokens[1]: + tokens[1] = "0xfffffffc" + elif "UINT8_MAX" in tokens[1]: + tokens[1] = "0xff" + nconsts.append([tokens[0], tokens[1]]) + if len(tokens[0]) > nconstlen: + nconstlen = len(tokens[0]) + elif takeapis and myline.startswith("PMIX_EXPORT"): + value = myline[12:].strip() + # this is the name of an API - these + # are frequently multi-line, so collect + # all of them + if ";" in value: + value = value[:-1] + # check for bool type - must be converted to bint + value = value.replace("bool ", "bint ") + # a single-line API might have a "void" arg + # Python doesn't accept "void" as an arg, so + # we have to "snip" it out + start = value.find("(") + 1 + end = value.find(")") + snip = value[start:end] + if snip == "void": + value = value[0:start] + value[end:] + newapi = [value] + apis.append(newapi) + else: + value = value.replace("bool ", "bint ") + newapi = [value] + apirunning = True + while apirunning: + n += 1 + value = lines[n].strip() + # check for bool type - must be converted to bint + value = value.replace("bool ", "bint ") + if ";" in value: + apirunning = False + value = value[:-1] + newapi.append(value) + apis.append(newapi) + elif takedtypes and myline.startswith("typedef"): + # there are three types of typedef's in PMIx: + # + # 1. simple one-line typedef - e.g., "typedef int foo" + # + # 2. multi-line struct types + # + # 3. function definitions - by PMIx convention, these + # always have an "fn_t" in the name + # + # 4. enum definitions + # + # start with the fourth option by looking for "enum" + if "enum" in myline: + # each line after this one should contain a name + # so we just assign a value sequentially. + counter = 0 + n += 1 + value = lines[n].strip() + if ',' in value: + value = value[:-1] + while '}' not in value and n < len(lines): + tokens[0] = value + tokens[1] = str(counter) + counter += 1 + nconsts.append([tokens[0], tokens[1]]) + if len(tokens[0]) > nconstlen: + nconstlen = len(tokens[0]) + n += 1 + value = lines[n].strip() + if ',' in value: + value = value[:-1] + # the termination line contains the type name + # for this enum - declare it as integer here + value = "typedef int " + value[2:] + typedefs.append([value]) + # now address the first option - detectable by + # having a semi-colon at the end of the line and + # no "fn_t" or "cbfunc_t" in it + elif ";" in myline and not "fn_t" in myline and not "cbfunc_t" in myline: + value = myline[:-1] + # check for bool type - must be converted to bint + if "bool" in value: + value.replace("bool ", "bint ") + # check for pre-declaration statements of form + # typedef struct foo foo + ck = value.split() + if len(ck) == 4 and ck[1] == "struct" and ck[2] == ck[3]: + n += 1 + continue + else: + # check for a typedef that includes a named value + # of either PMIX_MAX_NSLEN or PMIX_MAX_KEYLEN + if "PMIX_MAX_NSLEN+1" in value: + value = value.replace("PMIX_MAX_NSLEN+1", str(256)) + elif "PMIX_MAX_NSLEN" in value: + value = value.replace("PMIX_MAX_NSLEN", str(255)) + elif "PMIX_MAX_KEYLEN+1" in value: + value = value.replace("PMIX_MAX_KEYLEN+1", str(512)) + elif "PMIX_MAX_KEYLEN" in value: + value = value.replace("PMIX_MAX_KEYLEN", str(511)) + typedefs.append([value]) + # now check the third option by looking for + # "fn_t" or "cbfunc_t" in it + elif "fn_t" in myline or "cbfunc_t" in myline: + if ";" in myline: + # this is a one-line function definition + value = myline[:-1] + # check for bool type - must be converted to bint + if "bool" in value: + value.replace("bool ", "bint ") + typedefs.append([value]) + else: + # this is a multi-line function definition + # check for bool type - must be converted to bint + if "bool" in myline: + myline.replace("bool ", "bint ") + newdef = [myline] + defrunning = True + while defrunning: + n += 1 + value = lines[n].strip() + # check for bool type - must be converted to bint + if "bool" in value: + value.replace("bool ", "bint ") + if ";" in value: + defrunning = False + value = value[:-1] + newdef.append(value) + typedefs.append(newdef) + # must be a multi-line struct type definition + # we capture these in the typedef list + # so we output their type definition + else: + # check for pre-declaration statements of form + # typedef struct foo foo + value = myline + ck = value.split() + if len(ck) == 4 and ck[1] == "struct" and ck[2] == ck[3]: + n += 1 + continue + else: + newdef = [] + n += 1 + value = lines[n].strip() + nbrk = 1 + while nbrk > 0: + # avoid comments + if "/*" in value or "*/" in value or value.startswith("*"): + n += 1 + value = lines[n].strip() + continue + if "}" in value: + nbrk -= 1 + if nbrk > 0: + n += 1 + value = lines[n].strip() + continue + if "union" in value: + # we have to create another definition that contains + # just the union and then add that back into the + # current typedef + uniondef = [] + n += 1 + value = lines[n].strip() + while "}" not in value: + # terminate at the semi-colon + idx = value.rfind(';') + value = " " + value[:idx] + # check for bool type - must be converted to bint + if "bool" in value: + value = value.replace("bool ", "bint ") + elif "struct timeval " in value: + value = value.replace("struct timeval", "timeval") + # add it to the union def + uniondef.append(value) + n += 1 + value = lines[n].strip() + # terminate at the semi-colon + idx = value.rfind(';') + value = value[:idx] + # extract the name of the union + idx = value.rfind(' ') + value = value[idx+1:] + # save this name + lowname = value + # capitalize the first letter + value = value.title() + # create the union definition - the output + # routine will prepend a 'c' + myvalue = "def union " + value + ":" + uniondef.insert(0, myvalue) + typedefs.append(uniondef) + # add the union to the struct + value = " " + value + " " + lowname + newdef.append(value) + nbrk -= 1 + n += 1 + value = lines[n].strip() + continue + # terminate at the semi-colon + idx = value.rfind(';') + value = " " + value[:idx] + # check for bool type - must be converted to bint + if "bool" in value: + value = value.replace("bool ", "bint ") + elif "struct timeval " in value: + value = value.replace("struct timeval", "timeval") + # we don't want any dimensions - if given, convert + # to the corresponding value + idx = value.find('[') + if idx >= 0: + # find the end of the dimension + dim = value.rfind(']') + dimstr = value[idx+1:dim] + # have to do this manually + if "MAX_KEYLEN" in dimstr: + value = value[:idx] + "[512]" + value[dim+1:] + elif "MAX_NSLEN" in dimstr: + value = value[:idx] + "[256]" + value[dim+1:] + else: + print("BAD DIMENSION " + dimstr) + exit(1) + newdef.append(value) + n += 1 + value = lines[n].strip() + # we need to extract the type name + value = "typedef struct " + value[2:] + value = value[:-1] + ":" + newdef.insert(0, value) + typedefs.append(newdef) + # only write the data sources once per file + defsrc = False + constsrc = False + + # start by pretty-printing the string constants + # prepended with an underscore to avoid conflicts + # with the Python version of the name + if takeconst and len(strconsts) > 0: + if not defsrc: + definitions.write("cdef extern from \"" + src + "\":\n") + defsrc = True + if not constsrc: + constants.write("# " + src + "\n") + constsrc = True + definitions.write("\n # STRING CONSTANTS\n") + for const in strconsts: + defname = "_" + const + definitions.write(" cdef const char* " + defname) + for i in range (4 + strconstlen - len(const)): + definitions.write(" ") + definitions.write("\"" + const + "\"\n") + # now output it into the constants file + constants.write(const) + for i in range (4 + strconstlen - len(const)): + constants.write(" ") + constants.write("= " + defname + "\n") + # add some space + definitions.write("\n") + constants.write("\n") + + if takeconst and len(errconsts) > 0: + if not defsrc: + definitions.write("cdef extern from \"" + src + "\":\n") + defsrc = True + if not constsrc: + constants.write("# " + src + "\n") + constsrc = True + definitions.write("\n # ERROR CONSTANTS\n") + for const in errconsts: + defname = "_" + const + definitions.write(" cdef int " + defname) + for i in range (4 + strconstlen - len(const)): + definitions.write(" ") + definitions.write("\"" + const + "\"\n") + # now output it into the constants file + constants.write(const) + for i in range (4 + strconstlen - len(const)): + constants.write(" ") + constants.write("= " + defname + "\n") + # add some space + definitions.write("\n") + constants.write("\n") + + if takeconst and len(nconsts) > 0: + if not constsrc: + constants.write("# " + src + "\n") + constsrc = True + # pretty-print the numeric constants + for num in nconsts: + constants.write(num[0]) + for i in range (4 + strconstlen - len(num[0])): + constants.write(" ") + constants.write("= " + num[1] + "\n") + # add some space + constants.write("\n") + + # pretty-print any typedefs + if takedtypes and len(typedefs) > 0: + if not defsrc: + definitions.write("cdef extern from \"" + src + "\":\n") + defsrc = True + definitions.write("\n # TYPEDEFS\n") + for t in typedefs: + if len(t) > 1: + definitions.write("\n") + definitions.write(" c" + t[0] + "\n") + if len(t) > 1: + # find the 2nd opening paren + idx = t[0].find("(") + 1 + idx = t[0].find("(", idx) + 2 + for n in range(1, len(t)): + definitions.write(" ") + for m in range(idx): + definitions.write(" ") + definitions.write(t[n] + "\n") + # add some space + definitions.write("\n") + + # pretty-print any APIs + if takeapis and len(apis) > 0: + if not defsrc: + definitions.write("cdef extern from \"" + src + "\":\n") + defsrc = True + definitions.write("\n # APIS\n") + for api in apis: + definitions.write(" " + api[0] + "\n") + if len(api) > 1: + # find the opening paren + idx = api[0].find("(") + 1 + for n in range(1, len(api)): + definitions.write(" ") + for m in range(idx): + definitions.write(" ") + definitions.write(api[n] + "\n") + definitions.write("\n") + return + +def main(): + global takeconst, takeapis, takedtypes + signal.signal(signal.SIGINT, signal_handler) + + parser = OptionParser("usage: %prog [options]") + debugGroup = OptionGroup(parser, "Debug Options") + debugGroup.add_option("--debug", + action="store_true", dest="debug", default=False, + help="Output lots of debug messages while processing") + debugGroup.add_option("--dryrun", + action="store_true", dest="dryrun", default=False, + help="Show commands, but do not execute them") + parser.add_option_group(debugGroup) + + execGroup = OptionGroup(parser, "Execution Options") + execGroup.add_option("--src", dest="src", + help="The directory where the PMIx header files will be found") + execGroup.add_option("--constants", + action="store_true", dest="constants", default=False, + help="Translate constants") + execGroup.add_option("--apis", + action="store_true", dest="apis", default=False, + help="Translate APIs") + execGroup.add_option("--datatypes", + action="store_true", dest="datatypes", default=False, + help="Translate datatypes") + parser.add_option_group(execGroup) + + (options, args) = parser.parse_args() + + if not options.constants and not options.apis and not options.datatypes: + takeconst = True + takeapis = True + takedtypes = True + + if options.constants: + takeconst = True + if options.apis: + takeapis = True + if options.datatypes: + takedtypes = True + + if options.dryrun or options.debug: + debug = True + else: + debug = False + + if options.src: + # see if the source directory exists + if not os.path.exists(options.src): + print("SOURCE directory",options.src,"does not exist") + sys.exit(1) + + if options.dryrun: + constants = sys.stdout + definitions = sys.stdout + else: + # open the .pxd file for the definitions + # if the output file exists, remove it + if os.path.exists("pmix_constants.pxd"): + if debug: + print("Remove pmix_constants.pxd") + if not options.dryrun: + os.remove("pmix_constants.pxd") + elif debug: + print("File pmix_constants.pxd not found") + definitions = open("pmix_constants.pxd", "w+") + # add the necessary imports + definitions.write("from posix.types cimport *\n") + definitions.write("from posix.time cimport *\n") + definitions.write("from libc.stdint cimport *\n\n") + + # open the .pxi file for the Python-level constants + if os.path.exists("pmix_constants.pxi"): + if debug: + print("Remove pmix_constants.pxi") + if not options.dryrun: + os.remove("pmix_constants.pxi") + elif debug: + print("File pmix_constants.pxi not found") + constants = open("pmix_constants.pxi", "w+") + # add the necessary import and provide a little space for neatness + constants.write("from pmix_constants cimport *\n\n") + + # scan across the header files in the src directory + # looking for constants and typedefs + # add some space + harvest_constants(options, "pmix_common.h", constants, definitions) + definitions.write("\n\n") + constants.write("\n\n") + harvest_constants(options, "pmix.h", constants, definitions) + # add some space + definitions.write("\n\n") + constants.write("\n\n") + harvest_constants(options, "pmix_server.h", constants, definitions) + # add some space + definitions.write("\n\n") + constants.write("\n\n") + harvest_constants(options, "pmix_tool.h", constants, definitions) + # add some space + definitions.write("\n\n") + constants.write("\n\n") + harvest_constants(options, "pmix_sched.h", constants, definitions) + +if __name__ == '__main__': + main() + diff --git a/opal/mca/pmix/pmix4x/openpmix/bindings/python/pmix.pxi b/opal/mca/pmix/pmix4x/openpmix/bindings/python/pmix.pxi new file mode 100644 index 0000000000..b2f2548d1a --- /dev/null +++ b/opal/mca/pmix/pmix4x/openpmix/bindings/python/pmix.pxi @@ -0,0 +1,1018 @@ +from libc.string cimport memset, strncpy, strcpy, strlen, strdup +from libc.stdlib cimport malloc, realloc, free +from libc.string cimport memcpy +from cpython.mem cimport PyMem_Malloc, PyMem_Realloc, PyMem_Free + +# pull in all the constant definitions - we +# store them in a separate file for neatness +include "pmix_constants.pxi" + +# provide a lock class for catching information +# returned in callback functions +class myLock(threading.Event): + def __init__(self): + threading.Event.__init__(self) + self.event = threading.Event() + self.status = PMIX_ERR_NOT_SUPPORTED + self.sz = 0 + self.info = [] + + def set(self, status): + self.status = status + self.event.set() + + def clear(self): + self.event.clear() + + def wait(self): + self.event.wait() + + def get_status(self): + return self.status + + def cache_data(self, data, sz): + self.data = array.array('B', data[0]) + # need to copy the data bytes as the + # PMIx server will free it upon return + n = 1 + while n < sz: + self.data.append(data[n]) + n += 1 + self.sz = sz + + def fetch_data(self): + return (self.data, self.sz) + + def cache_info(self, info:list): + # need to copy the info array as the + # PMIx server will free it upon execing + # the callback function + self.info = [] + for x in info: + self.info.append(x) + + def fetch_info(self, info:list): + for x in self.info: + info.append(x) + +ctypedef struct pmix_pyshift_fence_t: + char *op + pmix_byte_object_t bo + pmix_modex_cbfunc_t modex + void *cbdata + +ctypedef struct pmix_pyshift_lookup_t: + char *op + pmix_pdata_t *pdata + size_t ndata + pmix_lookup_cbfunc_t lookup + void *cbdata + +cdef void pmix_unload_argv(char **keys, argv:list): + n = 0 + while NULL != keys[n]: + mykey = str(keys[n]) + argv.append(mykey) + n += 1 + +cdef int pmix_load_argv(char **keys, argv:list): + n = 0 + for a in argv: + pya = str(a).encode('ascii') + keys[n] = strdup(pya) + n += 1 + return PMIX_SUCCESS + +# TODO: implement support for PMIX_BOOL and PMIX_BYTE +cdef int pmix_load_darray(pmix_data_array_t *array, mytype, mylist:list): + cdef pmix_info_t *infoptr; + mysize = len(mylist) + n = 0 + if PMIX_INFO == mytype: + array[0].array = PyMem_Malloc(mysize * sizeof(pmix_info_t)) + if not array[0].array: + return PMIX_ERR_NOMEM + n = 0 + infoptr = array[0].array + for item in mylist: + pykey = str(item['key']) + pmix_copy_key(infoptr[n].key, pykey) + try: + infoptr[n].flags = item['flags'] + except: + pass + val = {'value':item['value'], 'val_type':item['val_type']} + pmix_load_value(&infoptr[n].value, val) + elif PMIX_STRING == mytype: + array[0].array = PyMem_Malloc(mysize * sizeof(char*)) + if not array[0].array: + return PMIX_ERR_NOMEM + n = 0 + strptr = array[0].array + for item in mylist: + strptr[n] = strdup(item) + n += 1 + elif PMIX_STRING == mytype: + array[0].array = PyMem_Malloc(mysize * sizeof(char*)) + if not array[0].array: + return PMIX_ERR_NOMEM + n = 0 + strptr = array[0].array + for item in mylist: + strptr[n] = strdup(item) + n += 1 + elif PMIX_SIZE == mytype: + array[0].array = PyMem_Malloc(mysize * sizeof(size_t)) + if not array[0].array: + return PMIX_ERR_NOMEM + n = 0 + sptr = array[0].array + for item in mylist: + if not isinstance(item, pmix_int_types): + print("size_t value declared but non-integer provided") + return PMIX_ERR_TYPE_MISMATCH + sptr[n] = int(item) + n += 1 + elif PMIX_PID == mytype: + array[0].array = PyMem_Malloc(mysize * sizeof(pid_t)) + if not array[0].array: + return PMIX_ERR_NOMEM + n = 0 + pidptr = array[0].array + for item in mylist: + if not isinstance(item, pmix_int_types): + print("pid_t value declared but non-integer provided") + return PMIX_ERR_TYPE_MISMATCH + pidptr[n] = int(item) + n += 1 + elif PMIX_INT == mytype or PMIX_UINT == mytype: + array[0].array = PyMem_Malloc(mysize * sizeof(int)) + if not array[0].array: + return PMIX_ERR_NOMEM + n = 0 + iptr = array[0].array + for item in mylist: + if not isinstance(item, pmix_int_types): + print("int value declared but non-integer provided") + return PMIX_ERR_TYPE_MISMATCH + iptr[n] = int(item) + n += 1 + elif PMIX_INT8 == mytype or PMIX_UINT8 == mytype: + array[0].array = PyMem_Malloc(mysize * sizeof(int8_t)) + if not array[0].array: + return PMIX_ERR_NOMEM + n = 0 + i8ptr = array[0].array + for item in mylist: + if not isinstance(item, pmix_int_types): + print("8-bit int value declared but non-integer provided") + return PMIX_ERR_TYPE_MISMATCH + i8ptr[n] = int(item) + n += 1 + elif PMIX_INT16 == mytype or PMIX_UINT16 == mytype: + array[0].array = PyMem_Malloc(mysize * sizeof(int16_t)) + if not array[0].array: + return PMIX_ERR_NOMEM + n = 0 + i16ptr = array[0].array + for item in mylist: + if not isinstance(item, pmix_int_types): + print("16-bit int value declared but non-integer provided") + return PMIX_ERR_TYPE_MISMATCH + i16ptr[n] = int(item) + n += 1 + elif PMIX_INT32 == mytype or PMIX_UINT32 == mytype: + array[0].array = PyMem_Malloc(mysize * sizeof(int32_t)) + if not array[0].array: + return PMIX_ERR_NOMEM + n = 0 + i32ptr = array[0].array + for item in mylist: + if not isinstance(item, pmix_int_types): + print("32-bit int value declared but non-integer provided") + return PMIX_ERR_TYPE_MISMATCH + i32ptr[n] = int(item) + n += 1 + elif PMIX_INT64 == mytype or PMIX_UINT64 == mytype: + array[0].array = PyMem_Malloc(mysize * sizeof(int64_t)) + if not array[0].array: + return PMIX_ERR_NOMEM + n = 0 + i64ptr = array[0].array + for item in mylist: + if not isinstance(item, pmix_int_types): + print("64-bit int value declared but non-integer provided") + return PMIX_ERR_TYPE_MISMATCH + i64ptr[n] = int(item) + n += 1 + elif PMIX_FLOAT == mytype: + array[0].array = PyMem_Malloc(mysize * sizeof(float)) + if not array[0].array: + return PMIX_ERR_NOMEM + n = 0 + fptr = array[0].array + for item in mylist: + fptr[n] = float(item) + n += 1 + elif PMIX_DOUBLE == mytype: + array[0].array = PyMem_Malloc(mysize * sizeof(double)) + if not array[0].array: + return PMIX_ERR_NOMEM + n = 0 + dptr = array[0].array + for item in mylist: + dptr[n] = float(item) + n += 1 + n += 1 + elif PMIX_TIMEVAL == mytype: + # TODO: Not clear that "timeval" has the same size as + # "struct timeval" + array[0].array = PyMem_Malloc(mysize * sizeof(timeval)) + if not array[0].array: + return PMIX_ERR_NOMEM + n = 0 + tvptr = array[0].array + for item in mylist: + if isinstance(item, tuple): + tvptr[n].tv_sec = item[0] + tvptr[n].tv_usec = item[1] + else: + tvptr[n].tv_sec = item + tvptr[n].tv_usec = 0 + n += 1 + elif PMIX_TIME == mytype: + array[0].array = PyMem_Malloc(mysize * sizeof(time_t)) + if not array[0].array: + return PMIX_ERR_NOMEM + n = 0 + tmptr = array[0].array + for item in mylist: + tmptr[n] = item + n += 1 + elif PMIX_STATUS == mytype: + array[0].array = PyMem_Malloc(mysize * sizeof(int)) + if not array[0].array: + return PMIX_ERR_NOMEM + n = 0 + stptr = array[0].array + for item in mylist: + stptr[n] = item + n += 1 + elif PMIX_PROC_RANK == mytype: + array[0].array = PyMem_Malloc(mysize * sizeof(pmix_rank_t)) + if not array[0].array: + return PMIX_ERR_NOMEM + n = 0 + rkptr = array[0].array + for item in mylist: + rkptr[n] = item + n += 1 + elif PMIX_PROC == mytype: + array[0].array = PyMem_Malloc(mysize * sizeof(pmix_proc_t)) + if not array[0].array: + return PMIX_ERR_NOMEM + n = 0 + prcptr = array[0].array + for item in mylist: + pmix_copy_nspace(prcptr[n].nspace, item[0]) + prcptr[n].rank = item[1] + n += 1 + elif PMIX_BYTE_OBJECT == mytype: + array[0].array = PyMem_Malloc(mysize * sizeof(pmix_byte_object_t)) + if not array[0].array: + return PMIX_ERR_NOMEM + n = 0 + boptr = array[0].array + for item in mylist: + boptr[n].size = item[0] + boptr[n].bytes = PyMem_Malloc(item[0].data.bo.size) + if not boptr[n].bytes: + return PMIX_ERR_NOMEM + pyarr = bytes(item[1]) + pyptr = pyarr + memcpy(boptr[n].bytes, pyptr, boptr[n].size) + n += 1 + elif PMIX_PERSISTENCE == mytype: + array[0].array = PyMem_Malloc(mysize * sizeof(pmix_persistence_t)) + if not array[0].array: + return PMIX_ERR_NOMEM + n = 0 + perptr = array[0].array + for item in mylist: + perptr[n] = item + n += 1 + elif PMIX_SCOPE == mytype: + array[0].array = PyMem_Malloc(mysize * sizeof(pmix_scope_t)) + if not array[0].array: + return PMIX_ERR_NOMEM + n = 0 + scptr = array[0].array + for item in mylist: + scptr[n] = item + n += 1 + elif PMIX_RANGE == mytype: + array[0].array = PyMem_Malloc(mysize * sizeof(pmix_data_range_t)) + if not array[0].array: + return PMIX_ERR_NOMEM + n = 0 + rgptr = array[0].array + for item in mylist: + rgptr[n] = item + n += 1 + elif PMIX_PROC_STATE == mytype: + array[0].array = PyMem_Malloc(mysize * sizeof(pmix_proc_state_t)) + if not array[0].array: + return PMIX_ERR_NOMEM + n = 0 + psptr = array[0].array + for item in mylist: + psptr[n] = item + n += 1 + elif PMIX_PROC_INFO == mytype: + array[0].array = PyMem_Malloc(mysize * sizeof(pmix_proc_info_t)) + if not array[0].array: + return PMIX_ERR_NOMEM + n = 0 + piptr = array[0].array + for item in mylist: + pmix_copy_nspace(piptr[n].proc.nspace, item['proc'][0]) + piptr[n].proc.rank = item['proc'][1] + piptr[n].hostname = strdup(item['hostname']) + piptr[n].pid = item['pid'] + piptr[n].exit_code = item['exitcode'] + piptr[n].state = item['state'] + n += 1 + elif PMIX_DATA_ARRAY == mytype: + array[0].array = PyMem_Malloc(sizeof(pmix_data_array_t)) + if not array[0].array: + return PMIX_ERR_NOMEM + daptr = array[0].array + n = 0 + for item in mylist: + daptr[n].type = item[0] + daptr[n].size = len(item[1]) + daptr[n].array = PyMem_Malloc(sizeof(pmix_data_array_t)) + if not daptr[n].array: + return PMIX_ERR_NOMEM + mydaptr = daptr[n].array + try: + return pmix_load_darray(mydaptr, daptr[n].type, item[1]) + except: + return PMIX_ERR_NOT_SUPPORTED + elif PMIX_ALLOC_DIRECTIVE == mytype: + array[0].array = PyMem_Malloc(mysize * sizeof(pmix_alloc_directive_t)) + if not array[0].array: + return PMIX_ERR_NOMEM + n = 0 + aldptr = array[0].array + for item in mylist: + aldptr[n] = item + n += 1 + elif PMIX_ENVAR == mytype: + array[0].array = PyMem_Malloc(mysize * sizeof(pmix_envar_t)) + if not array[0].array: + return PMIX_ERR_NOMEM + n = 0 + envptr = array[0].array + for item in mylist: + envptr[n].envar = strdup(item['envar']) + envptr[n].value = strdup(item['value']) + envptr[n].separator = item['separator'] + n += 1 + else: + print("UNRECOGNIZED DATA TYPE IN ARRAY") + return PMIX_ERR_NOT_SUPPORTED + return PMIX_SUCCESS + + +# provide conversion programs that translate incoming +# PMIx structures into Python dictionaries, and incoming +# arrays into Python lists of objects + +def pmix_bool_convert(f): + if isinstance(f, str): + if f.startswith('t') or f.startswith('T'): + return 1 + elif f.startswith('f') or f.startswith('F'): + return 0 + else: + print("Incorrect boolean value provided") + return PMIX_ERR_DATA_VALUE_NOT_FOUND + else: + return f + +pmix_int_types = (int, long) + +# provide a safe way to copy a Python nspace into +# the pmix_nspace_t structure that guarantees the +# array is NULL-terminated +cdef void pmix_copy_nspace(pmix_nspace_t nspace, ns): + nslen = len(ns) + if PMIX_MAX_NSLEN < nslen: + nslen = PMIX_MAX_NSLEN + if isinstance(ns, str): + pyns = ns.encode('ascii') + else: + pyns = ns + pynsptr = (pyns) + memset(nspace, 0, PMIX_MAX_NSLEN+1) + memcpy(nspace, pynsptr, nslen) + +# provide a safe way to copy a Python key into +# the pmix_key_t structure that guarantees the +# array is NULL-terminated +cdef void pmix_copy_key(pmix_key_t key, ky): + klen = len(ky) + if PMIX_MAX_KEYLEN < klen: + klen = PMIX_MAX_KEYLEN + if isinstance(ky, str): + pykey = ky.encode('ascii') + else: + pykey = ky + pykeyptr = (pykey) + memset(key, 0, PMIX_MAX_KEYLEN+1) + if 'b' == ky[0]: + memcpy(key, &pykeyptr[2], klen-3) + else: + memcpy(key, pykeyptr, klen) + +# provide a function for transferring a Python 'value' +# object (a dict with value and val_type as keys) +# to a pmix_value_t +cdef int pmix_load_value(pmix_value_t *value, val:dict): + print("LOADING VALUE TYPE ", PMIx_Data_type_string(val['val_type'])) + value[0].type = val['val_type'] + if val['val_type'] == PMIX_BOOL: + value[0].data.flag = pmix_bool_convert(val['value']) + elif val['val_type'] == PMIX_BYTE: + value[0].data.byte = val['value'] + elif val['val_type'] == PMIX_STRING: + if isinstance(val['value'], str): + pykey = val['value'].encode('ascii') + else: + pykey = val['value'] + try: + value[0].data.string = strdup(pykey) + except: + print("String value declared but non-string provided") + return PMIX_ERR_TYPE_MISMATCH + elif val['val_type'] == PMIX_SIZE: + if not isinstance(val['value'], pmix_int_types): + print("size_t value declared but non-integer provided") + return PMIX_ERR_TYPE_MISMATCH + value[0].data.size = val['value'] + elif val['val_type'] == PMIX_PID: + if not isinstance(val['value'], pmix_int_types): + print("pid value declared but non-integer provided") + return PMIX_ERR_TYPE_MISMATCH + if val['value'] < 0: + print("pid value is negative") + return PMIX_ERR_INVALID_VAL + value[0].data.pid = val['value'] + elif val['val_type'] == PMIX_INT: + if not isinstance(val['value'], pmix_int_types): + print("integer value declared but non-integer provided") + return PMIX_ERR_TYPE_MISMATCH + value[0].data.integer = val['value'] + elif val['val_type'] == PMIX_INT8: + if not isinstance(val['value'], pmix_int_types): + print("int8 value declared but non-integer provided") + return PMIX_ERR_TYPE_MISMATCH + if val['value'] > 127 or val['value'] < -128: + print("int8 value is out of bounds") + return PMIX_ERR_INVALID_VAL + value[0].data.int8 = val['value'] + elif val['val_type'] == PMIX_INT16: + if not isinstance(val['value'], pmix_int_types): + print("int16 value declared but non-integer provided") + return PMIX_ERR_TYPE_MISMATCH + if val['value'] > 32767 or val['value'] < -32768: + print("int16 value is out of bounds") + return PMIX_ERR_INVALID_VAL + value[0].data.int16 = val['value'] + elif val['val_type'] == PMIX_INT32: + if not isinstance(val['value'], pmix_int_types): + print("int32 value declared but non-integer provided") + return PMIX_ERR_TYPE_MISMATCH + if val['value'] > 2147483647 or val['value'] < -2147483648: + print("int32 value is out of bounds") + return PMIX_ERR_INVALID_VAL + value[0].data.int32 = val['value'] + elif val['val_type'] == PMIX_INT64: + if not isinstance(val['value'], pmix_int_types): + print("int64 value declared but non-integer provided") + return PMIX_ERR_TYPE_MISMATCH + if val['value'] > (2147483647*2147483647) or val['value'] < -(2147483648*2147483648): + print("int64 value is out of bounds") + return PMIX_ERR_INVALID_VAL + value[0].data.int64 = val['value'] + elif val['val_type'] == PMIX_UINT: + if not isinstance(val['value'], pmix_int_types): + print("integer value declared but non-integer provided") + return PMIX_ERR_TYPE_MISMATCH + value[0].data.uint = val['value'] + elif val['val_type'] == PMIX_UINT8: + if not isinstance(val['value'], pmix_int_types): + print("uint8 value declared but non-integer provided") + return PMIX_ERR_TYPE_MISMATCH + if val['value'] > 255: + print("uint8 value is out of bounds") + return PMIX_ERR_INVALID_VAL + value[0].data.uint8 = val['value'] + elif val['val_type'] == PMIX_UINT16: + if not isinstance(val['value'], pmix_int_types): + print("uint16 value declared but non-integer provided") + return PMIX_ERR_TYPE_MISMATCH + if val['value'] > 65536: + print("uint16 value is out of bounds") + return PMIX_ERR_INVALID_VAL + value[0].data.uint16 = val['value'] + elif val['val_type'] == PMIX_UINT32: + if not isinstance(val['value'], pmix_int_types): + print("uint32 value declared but non-integer provided") + return PMIX_ERR_TYPE_MISMATCH + if val['value'] > (65536*65536): + print("uint32 value is out of bounds") + return PMIX_ERR_INVALID_VAL + value[0].data.uint32 = val['value'] + elif val['val_type'] == PMIX_UINT64: + if not isinstance(val['value'], pmix_int_types): + print("int64 value declared but non-integer provided") + return PMIX_ERR_TYPE_MISMATCH + if val['value'] > (2147483648*2147483648): + print("uint64 value is out of bounds") + return PMIX_ERR_INVALID_VAL + value[0].data.uint64 = val['value'] + elif val['val_type'] == PMIX_FLOAT: + value[0].data.fval = float(val['value']) + elif val['val_type'] == PMIX_DOUBLE: + value[0].data.dval = float(val['value']) + elif val['val_type'] == PMIX_TIMEVAL: + if isinstance(val['value'], tuple): + value[0].data.tv.tv_sec = val['value'][0] + value[0].data.tv.tv_usec = val['value'][1] + else: + value[0].data.tv.tv_sec = val['value'] + value[0].data.tv.tv_usec = 0 + elif val['val_type'] == PMIX_TIME: + value[0].data.time = val['val_type'] + elif val['val_type'] == PMIX_STATUS: + value[0].data.status = val['val_type'] + elif val['val_type'] == PMIX_PROC_RANK: + value[0].data.rank = val['value'] + elif val['val_type'] == PMIX_PROC: + value[0].data.proc = PyMem_Malloc(sizeof(pmix_proc_t)) + if not value[0].data.proc: + return PMIX_ERR_NOMEM + pmix_copy_nspace(value[0].data.proc[0].nspace, val['value'][0]) + value[0].data.proc[0].rank = val['value'][1] + elif val['val_type'] == PMIX_BYTE_OBJECT: + value[0].data.bo.bytes = PyMem_Malloc(value[0].data.bo.size) + if not value[0].data.bo.bytes: + return PMIX_ERR_NOMEM + pyptr = val['value'][0] + memcpy(value[0].data.bo.bytes, pyptr, value[0].data.bo.size) + elif val['val_type'] == PMIX_PERSISTENCE: + value[0].data.persist = val['val_type'] + elif val['val_type'] == PMIX_SCOPE: + value[0].data.scope = val['value'] + elif val['val_type'] == PMIX_RANGE: + value[0].data.range = val['value'] + elif val['val_type'] == PMIX_PROC_STATE: + value[0].data.state = val['value'] + elif val['val_type'] == PMIX_PROC_INFO: + value[0].data.pinfo = PyMem_Malloc(sizeof(pmix_proc_info_t)) + if not value[0].data.pinfo: + return PMIX_ERR_NOMEM + pmix_copy_nspace(value[0].data.pinfo[0].proc.nspace, val['value']['proc'][0]) + value[0].data.pinfo[0].proc.rank = val['value']['proc'][1] + value[0].data.pinfo[0].hostname = strdup(val['value']['hostname']) + value[0].data.pinfo[0].pid = val['value']['pid'] + value[0].data.pinfo[0].exit_code = val['value']['exitcode'] + value[0].data.pinfo[0].state = val['value']['state'] + elif val['val_type'] == PMIX_DATA_ARRAY: + value[0].data.darray = PyMem_Malloc(sizeof(pmix_data_array_t)) + if not value[0].data.darray: + return PMIX_ERR_NOMEM + value[0].data.darray[0].type = val['value']['type'] + value[0].data.darray[0].size = len(val['value']['array']) + try: + pmix_load_darray(value[0].data.darray, + value[0].data.darray[0].type, val['value']['array']) + except: + return PMIX_ERR_NOT_SUPPORTED + elif val['val_type'] == PMIX_ALLOC_DIRECTIVE: + if not isinstance(val['value'], pmix_int_types): + print("allocdirective value declared but non-integer provided") + return PMIX_ERR_TYPE_MISMATCH + if val['value'] > 255: + print("allocdirective value is out of bounds") + return PMIX_ERR_INVALID_VAL + value[0].data.adir = val['value'] + elif val['val_type'] == PMIX_ENVAR: + enval = val['value']['envar'] + if isinstance(enval, str): + pyns = enval.encode('ascii') + else: + pyns = enval + pynsptr = (pyns) + value[0].data.envar.envar = strdup(pynsptr) + enval = val['value']['value'] + if isinstance(enval, str): + pyns = enval.encode('ascii') + else: + pyns = enval + pynsptr = (pyns) + value[0].data.envar.value = strdup(pynsptr) + value[0].data.envar.separator = val['value']['separator'] + elif val['val_type'] == PMIX_REGEX: + if not isinstance(val['value'], bytearray): + return PMIX_ERR_TYPE_MISMATCH + value[0].data.bo.bytes = val['value'] + value[0].data.bo.size = len(val['value']) + else: + print("UNRECOGNIZED VALUE TYPE") + return PMIX_ERR_NOT_SUPPORTED + return PMIX_SUCCESS + +cdef dict pmix_unload_value(const pmix_value_t *value): + if PMIX_BOOL == value[0].type: + if value[0].data.flag: + return {'value':True, 'val_type':PMIX_BOOL} + else: + return {'value':False, 'val_type':PMIX_BOOL} + elif PMIX_BYTE == value[0].type: + return {'value':value[0].data.byte, 'val_type':PMIX_BYTE} + elif PMIX_STRING == value[0].type: + pyb = value[0].data.string + pystr = pyb.decode("ascii") + return {'value':pystr, 'val_type':PMIX_STRING} + elif PMIX_SIZE == value[0].type: + return {'value':value[0].data.size, 'val_type':PMIX_SIZE} + elif PMIX_PID == value[0].type: + return {'value':value[0].data.pid, 'val_type':PMIX_PID} + elif PMIX_INT == value[0].type: + return {'value':value[0].data.integer, 'val_type':PMIX_INT} + elif PMIX_INT8 == value[0].type: + return {'value':value[0].data.int8, 'val_type':PMIX_INT8} + elif PMIX_INT16 == value[0].type: + return {'value':value[0].data.int16, 'val_type':PMIX_INT16} + elif PMIX_INT32 == value[0].type: + return {'value':value[0].data.int32, 'val_type':PMIX_INT32} + elif PMIX_INT64 == value[0].type: + return {'value':value[0].data.int64, 'val_type':PMIX_INT64} + elif PMIX_UINT == value[0].type: + return {'value':value[0].data.uint, 'val_type':PMIX_UINT} + elif PMIX_UINT8 == value[0].type: + return {'value':value[0].data.uint8, 'val_type':PMIX_UINT8} + elif PMIX_UINT16 == value[0].type: + return {'value':value[0].data.uint16, 'val_type':PMIX_UINT16} + elif PMIX_UINT32 == value[0].type: + return {'value':value[0].data.uint32, 'val_type':PMIX_UINT32} + elif PMIX_UINT64 == value[0].type: + return {'value':value[0].data.uint64, 'val_type':PMIX_UINT64} + elif PMIX_FLOAT == value[0].type: + return {'value':value[0].data.fval, 'val_type':PMIX_FLOAT} + elif PMIX_DOUBLE == value[0].type: + return {'value':value[0].data.dval, 'val_type':PMIX_DOUBLE} + elif PMIX_TIMEVAL == value[0].type: + return {'value':(value[0].data.tv.tv_sec, value[0].data.tv.tv_used), + 'val_type':PMIX_TIMEVAL} + elif PMIX_TIME == value[0].type: + return {'value':value[0].data.time, 'val_type':PMIX_TIME} + elif PMIX_STATUS == value[0].type: + return {'value':value[0].data.status, 'val_type':PMIX_STATUS} + elif PMIX_PROC_RANK == value[0].type: + return {'value':value[0].data.rank, 'val_type':PMIX_PROC_RANK} + elif PMIX_PROC == value[0].type: + pyns = str(value[0].data.proc[0].nspace) + return {'value':(pyns, value[0].data.proc[0].rank), 'val_type':PMIX_PROC} + elif PMIX_BYTE_OBJECT == value[0].type: + mybytes = PyMem_Malloc(value[0].data.bo.size) + if not mybytes: + return PMIX_ERR_NOMEM + memcpy(mybytes, value[0].data.bo.bytes, value[0].data.bo.size) + return {'value':(mybytes, value[0].data.bo.size), 'val_type':PMIX_BYTE_OBJECT} + elif PMIX_PERSISTENCE == value[0].type: + return {'value':value[0].data.persist, 'val_type':PMIX_PERSISTENCE} + elif PMIX_SCOPE == value[0].type: + return {'value':value[0].data.scope, 'val_type':PMIX_SCOPE} + elif PMIX_RANGE == value[0].type: + return {'value':value[0].data.range, 'val_type':PMIX_RANGE} + elif PMIX_PROC_STATE == value[0].type: + return {'value':value[0].data.state, 'val_type':PMIX_PROC_STATE} + elif PMIX_PROC_INFO == value[0].type: + pins = str(value[0].data.pinfo[0].proc.nspace) + pirk = value[0].data.pinfo[0].proc.rank + pihost = str(value[0].data.pinfo[0].hostname) + pipid = value[0].data.pinfo[0].pid + piex = value[0].data.pinfo[0].exit_code + pist = value[0].data.pinfo[0].state + pians = {'proc': (pins, pirk), 'hostname': pihost, 'pid': pipid, 'exitcode': piex, 'state': pist} + return {'value':pians, 'val_type':PMIX_PROC_INFO} + elif PMIX_DATA_ARRAY == value[0].type: + print("Unload_value: data array not supported") + return PMIX_ERR_NOT_SUPPORTED + elif PMIX_ALLOC_DIRECTIVE == value[0].type: + return {'value':value[0].data.adir, 'val_type':PMIX_ALLOC_DIRECTIVE} + elif PMIX_ENVAR: + pyenv = str(value[0].data.envar.envar) + pyval = str(value[0].data.envar.value) + pysep = value[0].data.envar.separator + pyenvans = {'envar': pyenv, 'value': pyval, 'separator': pysep} + return {'value':pyenvans, 'val_type':PMIX_ENVAR} + elif PMIX_REGEX: + return {'value': value[0].data.bo.bytes, 'val_type': PMIX_REGEX} + else: + print("Unload_value: provided type is unknown") + return PMIX_ERR_TYPE_MISMATCH + + +cdef void pmix_destruct_value(pmix_value_t *value): + if value[0].type == PMIX_STRING: + free(value[0].data.string); + +cdef void pmix_free_value(self, pmix_value_t *value): + pmix_destruct_value(value); + PyMem_Free(value) + + +# Convert a dictionary of key-value pairs into an +# array of pmix_info_t structs +# +# @array [INPUT] +# - malloc'd array of pmix_info_t structs +# +# @dicts [INPUT] +# - a list of dictionaries, where each +# dictionary has a key, value, and val_type +# defined as such: +# [{key:y, value:val, val_type:ty}, … ] +# +cdef int pmix_load_info(pmix_info_t *array, dicts:list): + n = 0 + for d in dicts: + pykey = str(d['key']) + pmix_copy_key(array[n].key, pykey) + try: + array[n].flags = d['flags'] + except: + pass + val = {'value':d['value'], 'val_type':d['val_type']} + rc = pmix_load_value(&array[n].value, val) + print("LOAD INFO ", PMIx_Data_type_string(d['val_type'])) + if PMIX_SUCCESS != rc: + return rc + n += 1 + return PMIX_SUCCESS + +# Allocate memory and load pmix info structs +# +# @array [INPUT] +# - array of pmix_info_t structs +# +# @ninfo [INPUT] +# - length of the list of dictionaries +# +# @dicts [INPUT] +# - a list of dictionaries, where each +# dictionary has a key, value, and val_type +# defined as such: +# [{key:y, value:val, val_type:ty}, … ] +# +cdef int pmix_alloc_info(pmix_info_t **info_ptr, size_t *ninfo, dicts:list): + # Convert any provided dictionary to an array of pmix_info_t + if dicts is not None: + ninfo[0] = len(dicts) + if 0 < ninfo[0]: + info_ptr[0] = PyMem_Malloc(ninfo[0] * sizeof(pmix_info_t)) + if not info_ptr[0]: + return PMIX_ERR_NOMEM + rc = pmix_load_info(info_ptr[0], dicts) + if PMIX_SUCCESS != rc: + pmix_free_info(info_ptr[0], ninfo[0]) + return rc + else: + info_ptr[0] = NULL + ninfo[0] = 0 + else: + info_ptr[0] = NULL + ninfo[0] = 0 + return PMIX_SUCCESS + +cdef int pmix_unload_info(const pmix_info_t *info, size_t ninfo, ilist:list): + cdef char* kystr + cdef size_t n = 0 + while n < ninfo: + print("UNLOADING INFO ", info[n].key, " TYPE ", PMIx_Data_type_string(info[n].value.type)) + val = pmix_unload_value(&info[n].value) + if val['val_type'] == PMIX_UNDEF: + return PMIX_ERR_NOT_SUPPORTED + d = {} + kystr = strdup(info[n].key) + pykey = kystr.decode("ascii") + free(kystr) + d['key'] = pykey + d['flags'] = info[n].flags + d['value'] = val['value'] + d['val_type'] = val['val_type'] + ilist.append(d) + n += 1 + return PMIX_SUCCESS + +cdef void pmix_destruct_info(pmix_info_t *info): + pmix_destruct_value(&info[0].value) + +# Free a malloc'd array of pmix_info_t structures +# +# @array [INPUT] +# - array of pmix_info_t to be free'd +# +# @sz [INPUT] +# - number of elements in array +cdef void pmix_free_info(pmix_info_t *array, size_t sz): + n = 0 + while n < sz: + pmix_destruct_info(&array[n]) + n += 1 + PyMem_Free(array) + +# Convert a dictionary of key-value pairs into an +# array of pmix_pdata_t structs +# +# @array [INPUT] +# - malloc'd array of pmix_pdata_t structs +# +# @pdata [INPUT] +# - a list of dictionaries, where each +# dictionary has a key, value, val_type, +# and proc keys +# @proc [INPUT] +# - a dictionary with nspace, rank as keys +cdef int pmix_load_pdata(proc:dict, pmix_pdata_t *array, data:list): + n = 0 + for d in data: + pykey = str(d['key']) + pmix_copy_key(array[n].key, pykey) + val = {'value':d['value'], 'val_type':d['val_type']} + rc = pmix_load_value(&array[n].value, val) + array[n].proc.rank = proc['rank'] + pmix_copy_nspace(array[n].proc.nspace, proc['nspace']) + if PMIX_SUCCESS != rc: + return rc + n += 1 + return PMIX_SUCCESS + +cdef int pmix_unload_pdata(const pmix_pdata_t *pdata, size_t npdata, ilist:list): + cdef char* kystr + cdef size_t n = 0 + while n < npdata: + print("UNLOADING INFO ", pdata[n].key, " TYPE ", + PMIx_Data_type_string(pdata[n].value.type)) + val = pmix_unload_value(&pdata[n].value) + if val['val_type'] == PMIX_UNDEF: + return PMIX_ERR_NOT_SUPPORTED + d = {} + kystr = strdup(pdata[n].key) + pykey = kystr.decode("ascii") + free(kystr) + d['key'] = pykey + myns = str(pdata[n].proc.nspace) + proc = {'nspace':myns, 'rank':pdata[n].proc.rank} + d['proc'] = proc + d['value'] = val['value'] + d['val_type'] = val['val_type'] + ilist.append(d) + n += 1 + return PMIX_SUCCESS + +cdef void pmix_destruct_pdata(pmix_pdata_t *pdata): + pmix_destruct_value(&pdata[0].value) + +# Free a malloc'd array of pmix_pdata_t structures +# +# @array [INPUT] +# - array of pmix_pdata_t to be free'd +# +# @sz [INPUT] +# - number of elements in array +cdef void pmix_free_pdata(pmix_pdata_t *array, size_t sz): + n = 0 + while n < sz: + pmix_destruct_pdata(&array[n]) + n += 1 + PyMem_Free(array) + +# Convert a list of (nspace, rank) tuples into an +# array of pmix_proc_t structs +# +# @proc [INPUT] +# - malloc'd array of pmix_proc_t structs +# +# @peers [INPUT] +# - list of (nspace,rank) tuples +# +cdef int pmix_load_procs(pmix_proc_t *proc, peers:list): + n = 0 + for p in peers: + pmix_copy_nspace(proc[n].nspace, p['nspace']) + proc[n].rank = p['rank'] + n += 1 + return PMIX_SUCCESS + +cdef int pmix_unload_procs(const pmix_proc_t *procs, size_t nprocs, peers:list): + n = 0 + while n < nprocs: + myns = str(procs[n].nspace) + peers.append({'nspace':myns, 'rank':procs[n].rank}) + n += 1 + return PMIX_SUCCESS + +# Free a malloc'd array of pmix_proc_t structures +# +# @array [INPUT] +# - array of pmix_proc_t to be free'd +# +# @sz [INPUT] +# - number of elements in array +# +cdef void pmix_free_procs(pmix_proc_t *array, size_t sz): + PyMem_Free(array) + +cdef void pmix_unload_bytes(char *data, size_t ndata, blist:list): + cdef size_t n = 0 + while n < ndata: + blist.append(data[n]) + n += 1 + +cdef void pmix_free_apps(pmix_app_t *array, size_t sz): + n = 0 + while n < sz: + PyMem_Free(array[n].cmd) + # need to free the argv and env arrays + PyMem_Free(array[n].cwd) + if 0 < array[n].ninfo: + pmix_free_info(array[n].info, array[n].ninfo) + n += 1 + +cdef void pmix_unload_apps(const pmix_app_t *apps, size_t napps, pyapps:list): + cdef size_t n = 0 + while n < napps: + myapp = {} + myapp['cmd'] = str(apps[n].cmd) + myargv = [] + if NULL != apps[n].argv: + pmix_unload_argv(apps[n].argv, myargv) + myapp['argv'] = myargv + myenv = [] + if NULL != apps[n].env: + pmix_unload_argv(apps[n].env, myenv) + myapp['env'] = myenv + myapp['maxprocs'] = apps[n].maxprocs + keyvals = {} + if NULL != apps[n].info: + pmix_unload_info(apps[n].info, apps[n].ninfo, keyvals) + myapp['info'] = keyvals + pyapps.append(myapp) + n += 1 + +cdef int pmix_load_apps(pmix_app_t *apps, pyapps:list): + cdef size_t m + cdef size_t n + cdef char** argv + n = 0 + for p in pyapps: + pycmd = str(p['cmd']).encode('ascii') + try: + apps[n].cmd = strdup(pycmd) + except: + return PMIX_ERR_TYPE_MISMATCH + if p['argv'] is not None: + m = len(p['argv']) + 1 + argv = PyMem_Malloc(m * sizeof(char*)) + if not argv: + return PMIX_ERR_NOMEM + memset(argv, 0, m) + pmix_load_argv(argv, p['argv']) + if p['env'] is not None: + m = len(p['env']) + 1 + env = PyMem_Malloc(m * sizeof(char*)) + if not argv: + return PMIX_ERR_NOMEM + memset(env, 0, m) + pmix_load_argv(env, p['env']) + try: + pycwd = str(p['cwd']).encode('ascii') + apps[n].cwd = strdup(pycwd) + except: + pass + if p['info'] is not None: + apps[n].ninfo = len(p['info']) + apps[n].info = PyMem_Malloc(apps[n].ninfo * sizeof(pmix_info_t)) + if not apps[n].info: + return PMIX_ERR_NOMEM + rc = pmix_load_info(apps[n].info, p['info']) + if PMIX_SUCCESS != rc: + return rc + n += 1 + return PMIX_SUCCESS diff --git a/opal/mca/pmix/pmix4x/openpmix/bindings/python/pmix.pyx b/opal/mca/pmix/pmix4x/openpmix/bindings/python/pmix.pyx new file mode 100644 index 0000000000..6dddb98c5d --- /dev/null +++ b/opal/mca/pmix/pmix4x/openpmix/bindings/python/pmix.pyx @@ -0,0 +1,2265 @@ +#file: pmix.pyx + +from libc.string cimport memset, strncpy, strcpy, strlen, strdup +from libc.stdlib cimport malloc, free +from libc.string cimport memcpy +from ctypes import addressof, c_int +from cython.operator import address +import signal, time +import threading +import array +from cpython.pycapsule cimport PyCapsule_New, PyCapsule_GetPointer +#import time +from threading import Timer + +# pull in all the constant definitions - we +# store them in a separate file for neatness +include "pmix_constants.pxi" +include "pmix.pxi" + +active = myLock() +myhdlrs = [] +myname = {} + +cdef void pmix_opcbfunc(pmix_status_t status, void *cbdata) with gil: + global active + active.set(status) + return + +cdef void dmodx_cbfunc(pmix_status_t status, + char *data, size_t sz, + void *cbdata) with gil: + global active + if PMIX_SUCCESS == status: + active.cache_data(data, sz) + active.set(status) + return + +cdef void setupapp_cbfunc(pmix_status_t status, + pmix_info_t info[], size_t ninfo, + void *provided_cbdata, + pmix_op_cbfunc_t cbfunc, void *cbdata) with gil: + global active + if PMIX_SUCCESS == status: + ilist = [] + rc = pmix_unload_info(info, ninfo, ilist) + active.cache_info(ilist) + status = rc + active.set(status) + if (NULL != cbfunc): + cbfunc(PMIX_SUCCESS, cbdata) + return + +cdef void pyeventhandler(size_t evhdlr_registration_id, + pmix_status_t status, + const pmix_proc_t *source, + pmix_info_t info[], size_t ninfo, + pmix_info_t *results, size_t nresults, + pmix_event_notification_cbfunc_fn_t cbfunc, + void *cbdata) with gil: + # convert the source + # convert the inbound info + + # find the handler being called + for h in myhdlrs: + try: + if evhdlr_registration_id == h['refid']: + print("REFID", h['refid']) + # execute the handler - we will need to provide + # our own notification cbfunc for the handler to + # call when done so we can convert the results array + # it provides before calling cbfunc + except: + pass + return + +cdef void lookup_cb(capsule, ret): + cdef pmix_pyshift_lookup_t *shifter + shifter = PyCapsule_GetPointer(capsule, "lookup") + shifter[0].lookup(ret, shifter[0].pdata, shifter[0].ndata, shifter[0].cbdata) + print("SHIFTER:", shifter[0].op) + return + +cdef void fence_cb(capsule, ret): + cdef pmix_pyshift_fence_t *shifter + shifter = PyCapsule_GetPointer(capsule, "fence") + print("SHIFTER:", shifter[0].op) + return + +cdef class PMIxClient: + cdef pmix_proc_t myproc; + def __init__(self): + global myhdlrs, myname + memset(self.myproc.nspace, 0, sizeof(self.myproc.nspace)) + self.myproc.rank = PMIX_RANK_UNDEF + myhdlrs = [] + myname = {} + + def initialized(self): + return PMIx_Initialized() + + def get_version(self): + return PMIx_Get_version() + + # Initialize the PMIx client library, connecting + # us to the local PMIx server + # + # @dicts [INPUT] + # - a list of dictionaries, where each + # dictionary has a key, value, and val_type + # defined as such: + # [{key:y, value:val, val_type:ty}, … ] + # + def init(self, dicts:list): + cdef size_t klen + global myname + cdef pmix_info_t *info + cdef pmix_info_t **info_ptr + + # allocate and load pmix info structs from python list of dictionaries + info_ptr = &info + rc = pmix_alloc_info(info_ptr, &klen, dicts) + rc = PMIx_Init(&self.myproc, info, klen) + if 0 < klen: + pmix_free_info(info, klen) + if PMIX_SUCCESS == rc: + # convert the returned name + myname = {'nspace': str(self.myproc.nspace), 'rank': self.myproc.rank} + return rc, myname + + # Finalize the client library + def finalize(self, dicts:list): + cdef size_t klen + cdef pmix_info_t *info + cdef pmix_info_t **info_ptr + + # allocate and load pmix info structs from python list of dictionaries + info_ptr = &info + rc = pmix_alloc_info(info_ptr, &klen, dicts) + rc = PMIx_Finalize(info, klen) + if 0 < klen: + pmix_free_info(info, klen) + return rc + + def initialized(self): + return PMIx_Initialized() + + # Request that the provided array of procs be aborted, returning the + # provided _status_ and printing the provided message. + # + # @status [INPUT] + # - PMIx status to be returned on exit + # + # @msg [INPUT] + # - string message to be printed + # + # @procs [INPUT] + # - list of proc nspace,rank dicts + def abort(self, status, msg, peers:list): + cdef pmix_proc_t *procs + cdef size_t sz + # convert list of procs to array of pmix_proc_t's + if peers is not None: + sz = len(peers) + if 0 < sz: + procs = PyMem_Malloc(sz * sizeof(pmix_proc_t)) + if not procs: + return PMIX_ERR_NOMEM + rc = pmix_load_procs(procs, peers) + if PMIX_SUCCESS != rc: + pmix_free_procs(procs, sz) + return rc + else: + # if they didn't give us a set of procs, + # then we default to our entire job + sz = 1 + procs = PyMem_Malloc(sz * sizeof(pmix_proc_t)) + if not procs: + return PMIX_ERR_NOMEM + pmix_copy_nspace(procs[0].nspace, self.myproc.nspace) + procs[0].rank = PMIX_RANK_WILDCARD + else: + # if they didn't give us a set of procs, + # then we default to our entire job + sz = 1 + procs = PyMem_Malloc(sz * sizeof(pmix_proc_t)) + if not procs: + return PMIX_ERR_NOMEM + pmix_copy_nspace(procs[0].nspace, self.myproc.nspace) + procs[0].rank = PMIX_RANK_WILDCARD + if isinstance(msg, str): + pymsg = msg.encode('ascii') + else: + pymsg = msg + # pass into PMIx_Abort + rc = PMIx_Abort(status, pymsg, procs, sz) + if 0 < sz: + pmix_free_procs(procs, sz) + return rc + + # put a value into the keystore + # + # @scope [INPUT] + # - the scope of the data + # + # @key [INPUT] + # - the key to be stored + # + # @value [INPUT] + # - a dict to be stored with keys (value, val_type) + def put(self, scope, ky, val): + cdef pmix_key_t key + cdef pmix_value_t value + # convert the keyval tuple to a pmix_info_t + pmix_copy_key(key, ky) + pmix_load_value(&value, val) + # pass it into the PMIx_Put function + rc = PMIx_Put(scope, key, &value) + pmix_destruct_value(&value) + return rc + + def commit(self): + rc = PMIx_Commit() + return rc + + def fence(self, peers:list, dicts:list): + cdef pmix_proc_t *procs + cdef pmix_info_t *info + cdef pmix_info_t **info_ptr + cdef size_t ninfo, nprocs + nprocs = 0 + ninfo = 0 + # convert list of procs to array of pmix_proc_t's + if peers is not None: + nprocs = len(peers) + if 0 < nprocs: + procs = PyMem_Malloc(nprocs * sizeof(pmix_proc_t)) + if not procs: + return PMIX_ERR_NOMEM + rc = pmix_load_procs(procs, peers) + if PMIX_SUCCESS != rc: + pmix_free_procs(procs, nprocs) + return rc + else: + nprocs = 1 + procs = PyMem_Malloc(nprocs * sizeof(pmix_proc_t)) + if not procs: + return PMIX_ERR_NOMEM + pmix_copy_nspace(procs[0].nspace, self.myproc.nspace) + procs[0].rank = PMIX_RANK_WILDCARD + else: + nprocs = 1 + procs = PyMem_Malloc(nprocs * sizeof(pmix_proc_t)) + if not procs: + return PMIX_ERR_NOMEM + pmix_copy_nspace(procs[0].nspace, self.myproc.nspace) + procs[0].rank = PMIX_RANK_WILDCARD + + + # allocate and load pmix info structs from python list of dictionaries + info_ptr = &info + rc = pmix_alloc_info(info_ptr, &ninfo, dicts) + if PMIX_SUCCESS != rc: + pmix_free_procs(procs, nprocs) + return rc + + # pass it into the fence API + print("FENCE", nprocs, ninfo) + rc = PMIx_Fence(procs, nprocs, info, ninfo) + if 0 < nprocs: + pmix_free_procs(procs, nprocs) + if 0 < ninfo: + pmix_free_info(info, ninfo) + return rc + + # retrieve a value from the keystore + # + # @proc [INPUT] + # - namespace and rank of the client (dict) + # + # @key [INPUT] + # - the key to be retrieved + # + # @dicts [INPUT] + # - a list of dictionaries, where each + # dictionary has a key, value, and val_type + # defined as such: + # [{key:y, value:val, val_type:ty}, … ] + def get(self, proc:dict, ky, dicts:list): + cdef pmix_info_t *info; + cdef pmix_info_t **info_ptr; + cdef size_t ninfo; + cdef pmix_key_t key; + cdef pmix_value_t *val_ptr; + cdef pmix_proc_t p; + + ninfo = 0 + val_ptr = NULL + + # convert proc to pmix_proc_t + if proc is None: + pmix_copy_nspace(p.nspace, self.myproc.nspace) + p.rank = self.myproc.rank + else: + pmix_copy_nspace(p.nspace, proc['nspace']) + p.rank = proc['rank'] + + # convert key,val to pmix_value_t and pmix_key_t + pmix_copy_key(key, ky) + + # allocate and load pmix info structs from python list of dictionaries + info_ptr = &info + rc = pmix_alloc_info(info_ptr, &ninfo, dicts) + + # pass it into the get API + print("GET") + rc = PMIx_Get(&p, key, info, ninfo, &val_ptr) + if PMIX_SUCCESS == rc: + val = pmix_unload_value(val_ptr) + pmix_free_value(self, val_ptr) + if 0 < ninfo: + pmix_free_info(info, ninfo) + return rc, val + + # Publish the data in the info array for lookup + # + # @dicts [INPUT] + # - a list of dictionaries, where + # a key, flags, value, and val_type + # can be defined as keys + def publish(self, dicts:list): + cdef pmix_info_t *info; + cdef pmix_info_t **info_ptr; + cdef size_t ninfo; + ninfo = 0 + + # allocate and load pmix info structs from python list of dictionaries + info_ptr = &info + rc = pmix_alloc_info(info_ptr, &ninfo, dicts) + + # pass it into the publish API + print("PUBLISH") + rc = PMIx_Publish(info, ninfo) + if 0 < ninfo: + pmix_free_info(info, ninfo) + return rc + + # unpublish the data in the data store + # + # @dicts [INPUT] + # - a list of dictionaries, where + # a key, flags, value, and val_type + # can be defined as keys + # @pykeys [INPUT] + # - list of python info key strings + def unpublish(self, pykeys:list, dicts:list): + cdef pmix_info_t *info; + cdef pmix_info_t **info_ptr; + cdef size_t ninfo; + cdef size_t nstrings; + cdef char **keys; + ninfo = 0 + nstrings = 0 + + # load pykeys into char **keys + if pykeys is not None: + nstrings = len(pykeys) + if 0 < nstrings: + keys = PyMem_Malloc(nstrings * sizeof(char*)) + if not keys: + PMIX_ERR_NOMEM + rc = pmix_load_argv(keys, pykeys) + if PMIX_SUCCESS != rc: + n = 0 + while keys != NULL: + PyMem_Free(keys[n]) + n += 1 + return rc + else: + keys = NULL + else: + keys = NULL + + # allocate and load pmix info structs from python list of dictionaries + info_ptr = &info + rc = pmix_alloc_info(info_ptr, &ninfo, dicts) + + # pass it into the unpublish API + print("UNPUBLISH") + rc = PMIx_Unpublish(keys, info, ninfo) + if 0 < ninfo: + pmix_free_info(info, ninfo) + return rc + + # lookup info published by this or another process + # @pdata [INPUT] + # - a list of dictionaries, where key is + # recorded in the pdata dictionary and + # passed to PMIx_Lookup + # pdata = {‘proc’: {‘nspace’: mynspace, ‘rank’: myrank}, ‘key’: ky, + # ‘value’: v, ‘val_type’: t} + # @dicts [INPUT] + # - a list of dictionaries, where + # a key, flags, value, and val_type + # can be defined as keys + def lookup(self, data:list, dicts:list): + cdef pmix_pdata_t *pdata; + cdef pmix_info_t *info; + cdef pmix_info_t **info_ptr; + cdef size_t npdata; + cdef size_t ninfo; + + npdata = 0 + ninfo = 0 + + # allocate and load pmix info structs from python list of dictionaries + info_ptr = &info + rc = pmix_alloc_info(info_ptr, &ninfo, dicts) + + # convert the list of dictionaries to array of + # pmix_pdata_t structs + if data is not None: + npdata = len(data) + if 0 < npdata: + pdata = PyMem_Malloc(npdata * sizeof(pmix_pdata_t)) + if not pdata: + return PMIX_ERR_NOMEM + n = 0 + for d in data: + pykey = str(d['key']) + pmix_copy_key(pdata[n].key, pykey) + rc = 0 + n += 1 + if PMIX_SUCCESS != rc: + pmix_free_pdata(pdata, npdata) + return rc + else: + pdata = NULL + else: + pdata = NULL + + # pass it into the lookup API + print("LOOKUP") + rc = PMIx_Lookup(pdata, npdata, info, ninfo) + if PMIX_SUCCESS == rc: + rc = pmix_unload_pdata(pdata, npdata, data) + # remove the first element, which is just the key + data.pop(0) + pmix_free_info(info, ninfo) + pmix_free_pdata(pdata, npdata) + return rc, data + + # Spawn a new job + # + # + def spawn(self, jobInfo:list, pyapps:list): + cdef pmix_info_t *jinfo; + cdef pmix_info_t **jinfo_ptr; + cdef pmix_app_t *apps; + cdef size_t ninfo + cdef size_t napps; + cdef pmix_nspace_t nspace; + + # protect against bad input + if pyapps is None: + return PMIX_ERR_BAD_PARAM, None + + # allocate and load pmix info structs from python list of dictionaries + jinfo_ptr = &jinfo + rc = pmix_alloc_info(jinfo_ptr, &ninfo, jobInfo) + + # convert the list of apps to an array of pmix_app_t + napps = len(pyapps) + apps = PyMem_Malloc(napps * sizeof(pmix_app_t)) + if not napps: + pmix_free_info(jinfo, ninfo) + return PMIX_ERR_NOMEM, None + rc = pmix_load_apps(apps, pyapps) + if PMIX_SUCCESS != rc: + pmix_free_apps(apps, napps) + if 0 < ninfo: + pmix_free_info(jinfo, ninfo) + return rc, None + rc = PMIx_Spawn(jinfo, ninfo, apps, napps, nspace) + pmix_free_apps(apps, napps) + if 0 < ninfo: + pmix_free_info(jinfo, ninfo) + pyns = nspace + return rc, pyns.decode('ascii') + + def connect(self, peers:list, pyinfo:list): + cdef pmix_proc_t *procs + cdef pmix_info_t *info + cdef pmix_info_t **info_ptr + cdef size_t ninfo + cdef size_t nprocs + nprocs = 0 + ninfo = 0 + + # convert list of procs to array of pmix_proc_t's + if peers is not None: + nprocs = len(peers) + if 0 < nprocs: + procs = PyMem_Malloc(nprocs * sizeof(pmix_proc_t)) + if not procs: + return PMIX_ERR_NOMEM + rc = pmix_load_procs(procs, peers) + if PMIX_SUCCESS != rc: + pmix_free_procs(procs, nprocs) + return rc + else: + nprocs = 1 + procs = PyMem_Malloc(nprocs * sizeof(pmix_proc_t)) + if not procs: + return PMIX_ERR_NOMEM + pmix_copy_nspace(procs[0].nspace, self.myproc.nspace) + procs[0].rank = PMIX_RANK_WILDCARD + else: + nprocs = 1 + procs = PyMem_Malloc(nprocs * sizeof(pmix_proc_t)) + if not procs: + return PMIX_ERR_NOMEM + pmix_copy_nspace(procs[0].nspace, self.myproc.nspace) + procs[0].rank = PMIX_RANK_WILDCARD + + # allocate and load pmix info structs from python list of dictionaries + info_ptr = &info + rc = pmix_alloc_info(info_ptr, &ninfo, pyinfo) + + # Call the library + rc = PMIx_Connect(procs, nprocs, info, ninfo) + if 0 < nprocs: + pmix_free_procs(procs, nprocs) + if 0 < ninfo: + pmix_free_info(info, ninfo) + return rc + + def disconnect(self, peers:list, pyinfo:list): + cdef pmix_proc_t *procs + cdef pmix_info_t *info + cdef pmix_info_t **info_ptr + cdef size_t ninfo + cdef size_t nprocs + nprocs = 0 + ninfo = 0 + + # convert list of procs to array of pmix_proc_t's + if peers is not None: + nprocs = len(peers) + if 0 < nprocs: + procs = PyMem_Malloc(nprocs * sizeof(pmix_proc_t)) + if not procs: + return PMIX_ERR_NOMEM + rc = pmix_load_procs(procs, peers) + if PMIX_SUCCESS != rc: + pmix_free_procs(procs, nprocs) + return rc + else: + nprocs = 1 + procs = PyMem_Malloc(nprocs * sizeof(pmix_proc_t)) + if not procs: + return PMIX_ERR_NOMEM + pmix_copy_nspace(procs[0].nspace, self.myproc.nspace) + procs[0].rank = PMIX_RANK_WILDCARD + else: + nprocs = 1 + procs = PyMem_Malloc(nprocs * sizeof(pmix_proc_t)) + if not procs: + return PMIX_ERR_NOMEM + pmix_copy_nspace(procs[0].nspace, self.myproc.nspace) + procs[0].rank = PMIX_RANK_WILDCARD + + # allocate and load pmix info structs from python list of dictionaries + info_ptr = &info + rc = pmix_alloc_info(info_ptr, &ninfo, pyinfo) + + # Call the library + rc = PMIx_Disconnect(procs, nprocs, info, ninfo) + if 0 < nprocs: + pmix_free_procs(procs, nprocs) + if 0 < ninfo: + pmix_free_info(info, ninfo) + return rc + + def resolve_peers(self, pynode:str, pyns:str): + cdef pmix_nspace_t nspace + cdef char *nodename + cdef pmix_proc_t *procs + cdef size_t nprocs + peers = [] + + nodename = NULL + memset(nspace, 0, sizeof(nspace)) + procs = NULL + if pynode is not None: + pyn = pynode.encode('ascii') + nodename = strdup(pyn) + if pyns is not None: + pmix_copy_nspace(nspace, pyns) + rc = PMIx_Resolve_peers(nodename, nspace, &procs, &nprocs) + if PMIX_SUCCESS == rc and 0 < nprocs: + rc = pmix_unload_procs(procs, nprocs, peers) + pmix_free_procs(procs, nprocs) + return rc, peers + + def resolve_nodes(self, pyns:str): + cdef pmix_nspace_t nspace + cdef char *nodelist + + nodelist = NULL + memset(nspace, 0, sizeof(nspace)) + if pyns is not None: + pmix_copy_nspace(nspace, pyns) + rc = PMIx_Resolve_nodes(nspace, &nodelist) + if PMIX_SUCCESS == rc: + pyn = nodelist + pynodes = pyn.decode('ascii') + PyMem_Free(nodelist) + return rc, pynodes + + def query_info(self, pyq:list): + rc = PMIX_ERR_NOT_SUPPORTED + results = [] + return rc, results + + def log(self, pydata:list, pydirs:list): + cdef pmix_info_t *data + cdef pmix_info_t **data_ptr + cdef pmix_info_t *directives + cdef pmix_info_t **directives_ptr + cdef size_t ndata + cdef size_t ndirs + + # allocate and load pmix info structs from python list of dictionaries + data_ptr = &data + directives_ptr = &directives + rc = pmix_alloc_info(data_ptr, &ndata, pydata) + rc = pmix_alloc_info(directives_ptr, &ndirs, pydirs) + + # call the API + rc = PMIx_Log(data, ndata, directives, ndirs) + pmix_free_info(data, ndata) + if 0 < ndirs: + pmix_free_info(directives, ndirs) + return rc + + def allocation_request(self, directive, pyinfo:list): + cdef pmix_info_t *info + cdef pmix_info_t **info_ptr + cdef pmix_info_t *results + cdef size_t ninfo + cdef size_t nresults + + results = NULL + nresults = 0 + pyres = [] + + # allocate and load pmix info structs from python list of dictionaries + info_ptr = &info + rc = pmix_alloc_info(info_ptr, &ninfo, pyinfo) + + # call the API + rc = PMIx_Allocation_request(directive, info, ninfo, &results, &nresults) + if 0 < ninfo: + pmix_free_info(info, ninfo) + if PMIX_SUCCESS == rc and 0 < nresults: + # convert the results + rc = pmix_unload_info(results, nresults, pyres) + pmix_free_info(results, nresults) + return rc, pyres + + def job_control(self, pytargets:list, pydirs:list): + cdef pmix_proc_t *targets + cdef pmix_info_t *directives + cdef pmix_info_t **directives_ptr + cdef pmix_info_t *results + cdef size_t ntargets + cdef size_t ndirs + cdef size_t nresults + + results = NULL + nresults = 0 + pyres = [] + # convert list of procs to array of pmix_proc_t's + if pytargets is not None: + ntargets = len(pytargets) + if 0 < ntargets: + targets = PyMem_Malloc(ntargets * sizeof(pmix_proc_t)) + if not targets: + return PMIX_ERR_NOMEM, pyres + rc = pmix_load_procs(targets, pytargets) + if PMIX_SUCCESS != rc: + pmix_free_procs(targets, ntargets) + return rc, pyres + else: + ntargets = 1 + targets = PyMem_Malloc(ntargets * sizeof(pmix_proc_t)) + if not targets: + return PMIX_ERR_NOMEM, pyres + pmix_copy_nspace(targets[0].nspace, self.myproc.nspace) + targets[0].rank = PMIX_RANK_WILDCARD + else: + ntargets = 1 + targets = PyMem_Malloc(ntargets * sizeof(pmix_proc_t)) + if not targets: + return PMIX_ERR_NOMEM, pyres + pmix_copy_nspace(targets[0].nspace, self.myproc.nspace) + targets[0].rank = PMIX_RANK_WILDCARD + + # allocate and load pmix info structs from python list of dictionaries + directives_ptr = &directives + rc = pmix_alloc_info(directives_ptr, &ndirs, pydirs) + if PMIX_SUCCESS != rc: + if 0 < ntargets: + pmix_free_procs(targets, ntargets) + return rc + + # call the API + rc = PMIx_Job_control(targets, ntargets, directives, ndirs, &results, &nresults) + if 0 < ndirs: + pmix_free_info(directives, ndirs) + if 0 < ntargets: + pmix_free_procs(targets, ntargets) + if PMIX_SUCCESS == rc and 0 < nresults: + # convert the results + rc = pmix_unload_info(results, nresults, pyres) + pmix_free_info(results, nresults) + return rc, pyres + + def group_construct(self, group:str, peers:list, pyinfo:list): + cdef pmix_proc_t *procs + cdef pmix_info_t *info + cdef pmix_info_t **info_ptr + cdef pmix_info_t *results + cdef size_t ninfo + cdef size_t nprocs + cdef size_t nresults + nprocs = 0 + ninfo = 0 + + # convert group name + pygrp = group.encode('ascii') + # convert list of procs to array of pmix_proc_t's + if peers is not None: + nprocs = len(peers) + procs = PyMem_Malloc(nprocs * sizeof(pmix_proc_t)) + if not procs: + return PMIX_ERR_NOMEM + rc = pmix_load_procs(procs, peers) + if PMIX_SUCCESS != rc: + pmix_free_procs(procs, nprocs) + return rc + else: + nprocs = 1 + procs = PyMem_Malloc(nprocs * sizeof(pmix_proc_t)) + if not procs: + return PMIX_ERR_NOMEM + pmix_copy_nspace(procs[0].nspace, self.myproc.nspace) + procs[0].rank = PMIX_RANK_WILDCARD + + # allocate and load pmix info structs from python list of dictionaries + info_ptr = &info + rc = pmix_alloc_info(info_ptr, &ninfo, pyinfo) + + # Call the library + rc = PMIx_Group_construct(pygrp, procs, nprocs, info, ninfo, &results, &nresults) + if 0 < nprocs: + pmix_free_procs(procs, nprocs) + if 0 < ninfo: + pmix_free_info(info, ninfo) + pyres = [] + if 0 < nresults: + # convert results + pmix_unload_info(results, nresults, pyres) + pmix_free_info(results, nresults) + return rc, pyres + + def group_invite(self, group:str, peers:list, pyinfo:list): + cdef pmix_proc_t *procs + cdef pmix_info_t *info + cdef pmix_info_t **info_ptr + cdef pmix_info_t *results + cdef size_t ninfo + cdef size_t nprocs + cdef size_t nresults + nprocs = 0 + ninfo = 0 + + # convert group name + pygrp = group.encode('ascii') + # convert list of procs to array of pmix_proc_t's + if peers is not None: + nprocs = len(peers) + procs = PyMem_Malloc(nprocs * sizeof(pmix_proc_t)) + if not procs: + return PMIX_ERR_NOMEM + rc = pmix_load_procs(procs, peers) + if PMIX_SUCCESS != rc: + pmix_free_procs(procs, nprocs) + return rc + else: + nprocs = 1 + procs = PyMem_Malloc(nprocs * sizeof(pmix_proc_t)) + if not procs: + return PMIX_ERR_NOMEM + pmix_copy_nspace(procs[0].nspace, self.myproc.nspace) + procs[0].rank = PMIX_RANK_WILDCARD + + # allocate and load pmix info structs from python list of dictionaries + info_ptr = &info + rc = pmix_alloc_info(info_ptr, &ninfo, pyinfo) + + # Call the library + rc = PMIx_Group_invite(pygrp, procs, nprocs, info, ninfo, &results, &nresults) + if 0 < nprocs: + pmix_free_procs(procs, nprocs) + if 0 < ninfo: + pmix_free_info(info, ninfo) + pyres = [] + if 0 < nresults: + # convert results + pmix_unload_info(results, nresults, pyres) + pmix_free_info(results, nresults) + return rc, pyres + + def group_join(self, group:str, leader:dict, opt:int, pyinfo:list): + cdef pmix_proc_t proc + cdef pmix_info_t *info + cdef pmix_info_t **info_ptr + cdef pmix_info_t *results + cdef size_t ninfo + cdef size_t nprocs + cdef size_t nresults + ninfo = 0 + + # convert group name + pygrp = group.encode('ascii') + # convert leader to proc + if leader is not None: + pmix_copy_nspace(proc.nspace, leader['nspace']) + proc.rank = leader['rank'] + else: + pmix_copy_nspace(proc.nspace, self.myproc.nspace) + proc.rank = self.myproc.rank + + # allocate and load pmix info structs from python list of dictionaries + info_ptr = &info + rc = pmix_alloc_info(info_ptr, &ninfo, pyinfo) + + # Call the library + rc = PMIx_Group_join(pygrp, &proc, opt, info, ninfo, &results, &nresults) + if 0 < ninfo: + pmix_free_info(info, ninfo) + pyres = [] + if 0 < nresults: + # convert results + pmix_unload_info(results, nresults, pyres) + pmix_free_info(results, nresults) + return rc, pyres + + def group_leave(self, group:str, pyinfo:list): + cdef pmix_info_t *info + cdef pmix_info_t **info_ptr + cdef size_t ninfo + ninfo = 0 + + # convert group name + pygrp = group.encode('ascii') + + # allocate and load pmix info structs from python list of dictionaries + info_ptr = &info + rc = pmix_alloc_info(info_ptr, &ninfo, pyinfo) + + # Call the library + rc = PMIx_Group_leave(pygrp, info, ninfo) + if 0 < ninfo: + pmix_free_info(info, ninfo) + return rc + + def group_destruct(self, group:str, pyinfo:list): + cdef pmix_info_t *info + cdef pmix_info_t **info_ptr + cdef size_t ninfo + ninfo = 0 + + # convert group name + pygrp = group.encode('ascii') + + # allocate and load pmix info structs from python list of dictionaries + info_ptr = &info + rc = pmix_alloc_info(info_ptr, &ninfo, pyinfo) + + # Call the library + rc = PMIx_Group_destruct(pygrp, info, ninfo) + if 0 < ninfo: + pmix_free_info(info, ninfo) + return rc + + def register_event_handler(self, pycodes:list, pyinfo:list, hdlr): + cdef pmix_status_t *codes + cdef size_t ncodes + cdef pmix_info_t *info + cdef pmix_info_t **info_ptr + cdef size_t ninfo + + # convert the codes to an array of ints + if pycodes is not None: + ncodes = len(pycodes) + codes = PyMem_Malloc(ncodes * sizeof(int)) + if not codes: + return PMIX_ERR_NOMEM + n = 0 + for c in pycodes: + codes[n] = c + n += 1 + else: + codes = NULL + ncodes = 0 + + # allocate and load pmix info structs from python list of dictionaries + info_ptr = &info + rc = pmix_alloc_info(info_ptr, &ninfo, pyinfo) + + # pass our hdlr switchyard to the API + rc = PMIx_Register_event_handler(codes, ncodes, info, ninfo, pyeventhandler, NULL, NULL) + # cleanup + if 0 < ninfo: + pmix_free_info(info, ninfo) + if 0 < ncodes: + PyMem_Free(codes) + # if rc < 0, then there was an error + if 0 > rc: + return rc + # otherwise, this is our ref ID for this hdlr + myhdlrs.append({'refid': rc, 'hdlr': hdlr}) + return rc + + def dregister_event_handler(self, ref:int): + rc = PMIx_Deregister_event_handler(ref, NULL, NULL) + return rc + + def notify_event(self, status, pysrc:dict, range, pyinfo:list): + cdef pmix_proc_t proc + cdef pmix_info_t *info + cdef pmix_info_t **info_ptr + cdef size_t ninfo + + # convert the proc + pmix_copy_nspace(proc.nspace, pysrc['nspace']) + proc.rank = pysrc['rank'] + + # allocate and load pmix info structs from python list of dictionaries + info_ptr = &info + rc = pmix_alloc_info(info_ptr, &ninfo, pyinfo) + + # call the library + rc = PMIx_Notify_event(status, &proc, range, info, ninfo, NULL, NULL) + if 0 < ninfo: + pmix_free_info(info, ninfo) + return rc + + def error_string(self, pystat:int): + cdef char *string + + string = PMIx_Error_string(pystat) + pystr = string + val = pystr.decode('ascii') + return val + + def proc_state_string(self, pystat:int): + cdef char *string + + string = PMIx_Proc_state_string(pystat) + pystr = string + return pystr.decode('ascii') + + def scope_string(self, pystat:int): + cdef char *string + + string = PMIx_Scope_string(pystat) + pystr = string + return pystr.decode('ascii') + + def persistence_string(self, pystat:int): + cdef char *string + + string = PMIx_Persistence_string(pystat) + pystr = string + return pystr.decode('ascii') + + def data_range_string(self, pystat:int): + cdef char *string + + string = PMIx_Data_range_string(pystat) + pystr = string + return pystr.decode('ascii') + + def info_directives_string(self, pystat:int): + cdef char *string + + string = PMIx_Info_directives_string(pystat) + pystr = string + return pystr.decode('ascii') + + def data_type_string(self, pystat:int): + cdef char *string + + string = PMIx_Data_type_string(pystat) + pystr = string + return pystr.decode('ascii') + + def alloc_directive_string(self, pystat:int): + cdef char *string + + string = PMIx_Alloc_directive_string(pystat) + pystr = string + return pystr.decode('ascii') + + def iof_channel_string(self, pystat:int): + cdef char *string + + string = PMIx_IOF_channel_string(pystat) + pystr = string + return pystr.decode('ascii') + + +pmixservermodule = {} +def setmodulefn(k, f): + global pmixservermodule + permitted = ['clientconnected', 'clientfinalized', 'abort', + 'fencenb', 'directmodex', 'publish', 'lookup', 'unpublish', + 'spawn', 'connect', 'disconnect', 'registerevents', + 'deregisterevents', 'listener', 'notify_event', 'query', + 'toolconnected', 'log', 'allocate', 'jobcontrol', + 'monitor', 'getcredential', 'validatecredential', + 'iofpull', 'pushstdin', 'group'] + if k not in permitted: + return PMIX_ERR_INVALID_KEY + if not k in pmixservermodule: + pmixservermodule[k] = f + +cdef class PMIxServer(PMIxClient): + cdef pmix_server_module_t myserver; + cdef pmix_fabric_t fabric; + cdef int fabric_set; + def __init__(self): + self.fabric_set = 0 + memset(self.myproc.nspace, 0, sizeof(self.myproc.nspace)) + self.myproc.rank = PMIX_RANK_UNDEF + # v1.x interfaces + self.myserver.client_connected = clientconnected + self.myserver.client_finalized = clientfinalized + self.myserver.abort = clientaborted + self.myserver.fence_nb = fencenb + self.myserver.direct_modex = directmodex + self.myserver.publish = publish + self.myserver.lookup = lookup + self.myserver.unpublish = unpublish + self.myserver.spawn = spawn + self.myserver.connect = connect + self.myserver.disconnect = disconnect + self.myserver.register_events = registerevents + self.myserver.deregister_events = deregisterevents + # skip the listener entry as Python servers will never + # provide their own socket listener thread + # + # v2.x interfaces + self.myserver.notify_event = notifyevent + self.myserver.query = query + self.myserver.tool_connected = toolconnected + self.myserver.log = log + self.myserver.allocate = allocate + self.myserver.job_control = jobcontrol + self.myserver.monitor = monitor + # v3.x interfaces + self.myserver.get_credential = getcredential + self.myserver.validate_credential = validatecredential + self.myserver.iof_pull = iofpull + self.myserver.push_stdin = pushstdin + # v4.x interfaces + self.myserver.group = group + + # Initialize the PMIx server library + # + # @dicts [INPUT] + # - a list of dictionaries, where each + # dictionary has a key, value, and val_type + # defined as such: + # [{key:y, value:val, val_type:ty}, … ] + # + # @map [INPUT] + # - a dictionary of key-function pairs that map + # server module callback functions to provided + # implementations + def init(self, dicts:list, map:dict): + cdef pmix_info_t *info + cdef pmix_info_t **info_ptr + cdef size_t sz + + if map is None or 0 == len(map): + print("SERVER REQUIRES AT LEAST ONE MODULE FUNCTION TO OPERATE") + return PMIX_ERR_INIT + kvkeys = list(map.keys()) + for key in kvkeys: + try: + setmodulefn(key, map[key]) + except KeyError: + print("SERVER MODULE FUNCTION ", key, " IS NOT RECOGNIZED") + return PMIX_ERR_INIT + + # allocate and load pmix info structs from python list of dictionaries + info_ptr = &info + rc = pmix_alloc_info(info_ptr, &sz, dicts) + if sz > 0: + rc = PMIx_server_init(&self.myserver, info, sz) + else: + rc = PMIx_server_init(&self.myserver, NULL, 0) + return rc + + def finalize(self): + return PMIx_server_finalize() + + # Register a namespace + # + # @ns [INPUT] + # - Namespace of job (string) + # + # @nlocalprocs [INPUT] + # - number of local procs for this job (int) + # + # @dicts [INPUT] + # - a list of dictionaries, where each + # dictionary has a key, value, and val_type + # defined as such: + # [{key:y, value:val, val_type:ty}, … ] + # + def register_nspace(self, ns, nlocalprocs, dicts:list): + cdef pmix_nspace_t nspace + cdef pmix_info_t *info + cdef pmix_info_t **info_ptr + cdef size_t sz + global active + # convert the args into the necessary C-arguments + pmix_copy_nspace(nspace, ns) + active.clear() + + # allocate and load pmix info structs from python list of dictionaries + info_ptr = &info + rc = pmix_alloc_info(info_ptr, &sz, dicts) + + if sz > 0: + rc = PMIx_server_register_nspace(nspace, nlocalprocs, info, sz, pmix_opcbfunc, NULL) + else: + rc = PMIx_server_register_nspace(nspace, nlocalprocs, NULL, 0, pmix_opcbfunc, NULL) + if PMIX_SUCCESS == rc: + active.wait() + rc = active.get_status() + active.clear() + return rc + + # Deregister a namespace + # + # @ns [INPUT] + # - Namespace of job (string) + # + def deregister_nspace(self, ns): + cdef pmix_nspace_t nspace + global active + # convert the args into the necessary C-arguments + pmix_copy_nspace(nspace, ns) + active.clear() + PMIx_server_deregister_nspace(nspace, pmix_opcbfunc, NULL) + active.wait() + active.clear() + return + + # Register a client process + # + # @proc [INPUT] + # - namespace and rank of the client (dict) + # + # @uid [INPUT] + # - User ID (uid) of the client (int) + # + # @gid [INPUT] + # - Group ID (gid) of the client (int) + # + def register_client(self, proc:dict, uid, gid): + global active + cdef pmix_proc_t p; + pmix_copy_nspace(p.nspace, proc['nspace']) + p.rank = proc['rank'] + active.clear() + rc = PMIx_server_register_client(&p, uid, gid, NULL, pmix_opcbfunc, NULL) + if PMIX_SUCCESS == rc: + active.wait() + rc = active.get_status() + return rc + + # Deregister a client process + # + # @proc [INPUT] + # - namespace and rank of the client (dict) + # + def deregister_client(self, proc:dict): + global active + cdef pmix_proc_t p; + pmix_copy_nspace(p.nspace, proc['nspace']) + p.rank = proc['rank'] + active.clear() + rc = PMIx_server_deregister_client(&p, pmix_opcbfunc, NULL) + if PMIX_SUCCESS == rc: + active.wait() + rc = active.get_status() + return rc + + # Setup the environment of a child process that is to be forked + # by the host + # + # @proc [INPUT] + # - namespace,rank of client process (tuple) + # + # @envin [INPUT/OUTPUT] + # - environ of client proc that will be updated + # with PMIx envars (dict) + # + def setup_fork(self, proc:dict, envin:dict): + cdef pmix_proc_t p; + cdef char **penv = NULL; + cdef unicode pstring + pmix_copy_nspace(p.nspace, proc['nspace']) + p.rank = proc['rank'] + # convert the incoming dictionary to an array + # of strings + rc = PMIx_server_setup_fork(&p, &penv) + if PMIX_SUCCESS == rc: + # update the incoming dictionary + n = 0 + while NULL != penv[n]: + ln = strlen(penv[n]) + pstring = penv[n].decode('ascii') + kv = pstring.split('=') + envin[kv[0]] = kv[1] + free(penv[n]) + n += 1 + free(penv) + return rc + + def dmodex_request(self, proc, dataout:dict): + global active + cdef pmix_proc_t p; + pmix_copy_nspace(p.nspace, proc['nspace']) + p.rank = proc['rank'] + active.clear() + rc = PMIx_server_dmodex_request(&p, dmodx_cbfunc, NULL); + if PMIX_SUCCESS == rc: + active.wait() + # transfer the data to the dictionary + (data, sz) = active.fetch_data() + dataout["dmodx"] = (data, sz) + return rc + + def setup_application(self, ns, dicts:list): + global active + cdef pmix_nspace_t nspace; + cdef pmix_info_t *info + cdef pmix_info_t **info_ptr + cdef size_t sz + dataout = [] + pmix_copy_nspace(nspace, ns) + + # allocate and load pmix info structs from python list of dictionaries + info_ptr = &info + rc = pmix_alloc_info(info_ptr, &sz, dicts) + + active.clear() + rc = PMIx_server_setup_application(nspace, info, sz, setupapp_cbfunc, NULL); + if PMIX_SUCCESS == rc: + active.wait() + # transfer the data to the dictionary + active.fetch_info(dataout) + return (rc, dataout) + + def setup_local_support(self, ns, ilist:list): + global active + cdef pmix_nspace_t nspace; + cdef pmix_info_t *info + cdef size_t sz + pmix_copy_nspace(nspace, ns) + if ilist is not None: + sz = len(ilist) + info = PyMem_Malloc(sz * sizeof(pmix_info_t)) + if not info: + return PMIX_ERR_NOMEM + n = 0 + for d in ilist: + pykey = str(d['key']) + pmix_copy_key(info[n].key, pykey) + # the value also needs to be transferred + print("SETUP LOCAL ", info[n].key, " TYPE ", PMIx_Data_type_string(d['val_type'])) + val = {'value':d['value'], 'val_type':d['val_type']} + # send dict of value and val_type to pmix_load_value + pmix_load_value(&info[n].value, val) + n += 1 + break + else: + info = NULL + sz = 0 + rc = PMIx_server_setup_local_support(nspace, info, sz, pmix_opcbfunc, NULL); + if PMIX_SUCCESS == rc: + active.wait() + return rc + + def register_fabric(self, dicts:list): + cdef pmix_info_t *info + cdef pmix_info_t **info_ptr + cdef size_t sz + if 1 == self.fabric_set: + return _PMIX_ERR_RESOURCE_BUSY + + # allocate and load pmix info structs from python list of dictionaries + info_ptr = &info + rc = pmix_alloc_info(info_ptr, &sz, dicts) + + if sz > 0: + rc = PMIx_server_register_fabric(&self.fabric, info, sz) + pmix_free_info(info, sz) + else: + rc = PMIx_server_register_fabric(&self.fabric, NULL, 0) + if PMIX_SUCCESS == rc: + self.fabric_set = 1 + return rc + + def deregister_fabric(self): + if 0 == self.fabric_set: + return PMIX_ERR_INIT + rc = PMIx_server_deregister_fabric(&self.fabric) + self.fabric_set = 0 + return rc; + + def get_vertex_info(self, i): + cdef pmix_value_t vertex; + cdef char *nodename; + rc = PMIx_server_get_vertex_info(&self.fabric, i, &vertex, &nodename) + if PMIX_SUCCESS == rc: + # convert the vertex to a tuple + pyvertex = pmix_unload_value(&vertex) + # convert the nodename to a Python string + pyb = nodename + pystr = pyb.decode("ascii") + # return it as a tuple + return (rc, pyvertex, pystr) + else: + return (rc, None, None) + + def get_index(self, pyvertex:dict): + cdef pmix_value_t vertex; + cdef uint32_t i; + # convert the dict to a pmix_value_t + rc = pmix_load_value(&vertex, pyvertex) + if PMIX_SUCCESS != rc: + return (rc, -1, None) + rc = PMIx_server_get_index(&self.fabric, &vertex, &i) + if PMIX_SUCCESS != rc: + return (rc, -1, None) + # return it as a tuple + return (rc, i) + + def generate_regex(self, hosts): + cdef char *regex; + if isinstance(hosts, str): + pyhosts = hosts.encode('ascii') + else: + pyhosts = hosts + rc = PMIx_generate_regex(pyhosts, ®ex) + if "pmix" == regex[:4].decode("ascii"): + # remove null characters + if b'\x00' in regex: + regex.replace(b'\x00', '') + ba = bytearray(regex) + elif "blob" == regex[:4].decode("ascii"): + sz_str = len(regex) + sz_prefix = 5 + # extract length of bytearray + regex.split(b'\x00') + len_bytearray = regex[1] + length = len(len_bytearray) + sz_prefix + sz_str + ba = bytearray(length) + pyregex = regex[:length] + index = 0 + while index < length: + ba[index] = pyregex[index] + index += 1 + else: + # last case with no ':' in string + ba = bytearray(regex) + return (rc, ba) + + def generate_ppn(self, procs): + cdef char *ppn; + if isinstance(procs, str): + pyprocs = procs.encode('ascii') + else: + pyprocs = procs + rc = PMIx_generate_ppn(pyprocs, &ppn) + if "pmix" == ppn[:4].decode("ascii"): + if b'\x00' in ppn: + ppn.replace(b'\x00', '') + ba = bytearray(ppn) + elif "blob" == ppn[:4].decode("ascii"): + sz_str = len(ppn) + sz_prefix = 5 + # extract length of bytearray + ppn.split(b'\x00') + len_bytearray = ppn[1] + length = len(len_bytearray) + sz_prefix + sz_str + ba = bytearray(length) + index = 0 + pyppn = ppn[:length] + while index < length: + ba[index] = pyppn[index] + index += 1 + else: + # last case with no ':' in string + ba = bytearray(ppn) + return (rc, ba) + +cdef int clientconnected(pmix_proc_t *proc, void *server_object, + pmix_op_cbfunc_t cbfunc, void *cbdata) with gil: + keys = pmixservermodule.keys() + if 'clientconnected' in keys: + if not proc: + return PMIX_ERR_BAD_PARAM + myproc = [] + pmix_unload_procs(proc, 1, myproc) + rc = pmixservermodule['clientconnected'](myproc[0]) + else: + return PMIX_ERR_NOT_SUPPORTED + # we cannot execute a callback function here as + # that would cause PMIx to lockup. Likewise, the + # Python function we called can't do it as it + # would require them to call a C-function. So + # if they succeeded in processing this request, + # we return a PMIX_OPERATION_SUCCEEDED status + # that let's the underlying PMIx library know + # the situation so it can generate its own + # callback + if PMIX_SUCCESS == rc: + rc = PMIX_OPERATION_SUCCEEDED + return rc + +cdef int clientfinalized(pmix_proc_t *proc, void *server_object, + pmix_op_cbfunc_t cbfunc, void *cbdata) with gil: + keys = pmixservermodule.keys() + if 'clientfinalized' in keys: + if not proc: + return PMIX_ERR_BAD_PARAM + myproc = [] + pmix_unload_procs(proc, 1, myproc) + rc = pmixservermodule['clientfinalized'](myproc[0]) + else: + return PMIX_ERR_NOT_SUPPORTED + # we cannot execute a callback function here as + # that would cause PMIx to lockup. Likewise, the + # Python function we called can't do it as it + # would require them to call a C-function. So + # if they succeeded in processing this request, + # we return a PMIX_OPERATION_SUCCEEDED status + # that let's the underlying PMIx library know + # the situation so it can generate its own + # callback + if PMIX_SUCCESS == rc: + rc = PMIX_OPERATION_SUCCEEDED + return rc + +cdef int clientaborted(const pmix_proc_t *proc, void *server_object, + int status, const char msg[], + pmix_proc_t procs[], size_t nprocs, + pmix_op_cbfunc_t cbfunc, void *cbdata) with gil: + keys = pmixservermodule.keys() + if 'abort' in keys: + args = {} + myproc = [] + myprocs = [] + # convert the caller's name + pmix_unload_procs(proc, 1, myproc) + args['caller'] = myproc[0] + # record the status + args['status'] = status + # record the msg, if given + if NULL != msg: + args['msg'] = str(msg) + # convert any provided array of procs to be aborted + if NULL != procs: + pmix_unload_procs(procs, nprocs, myprocs) + args['targets'] = myprocs + # upcall it + rc = pmixservermodule['abort'](args) + else: + return PMIX_ERR_NOT_SUPPORTED + # we cannot execute a callback function here as + # that would cause PMIx to lockup. Likewise, the + # Python function we called can't do it as it + # would require them to call a C-function. So + # if they succeeded in processing this request, + # we return a PMIX_OPERATION_SUCCEEDED status + # that let's the underlying PMIx library know + # the situation so it can generate its own + # callback + if PMIX_SUCCESS == rc: + rc = PMIX_OPERATION_SUCCEEDED + return rc + +cdef int fencenb(const pmix_proc_t procs[], size_t nprocs, + const pmix_info_t info[], size_t ninfo, + char *data, size_t ndata, + pmix_modex_cbfunc_t cbfunc, void *cbdata) with gil: + keys = pmixservermodule.keys() + if 'fencenb' in keys: + myprocs = [] + blist = [] + ilist = [] + barray = None + if NULL == procs: + myprocs.append({'nspace': myname.nspace, 'rank': PMIX_RANK_WILDCARD}) + else: + pmix_unload_procs(procs, nprocs, myprocs) + if NULL != info: + rc = pmix_unload_info(info, ninfo, ilist) + if PMIX_SUCCESS != rc: + return rc + if NULL != data: + pmix_unload_bytes(data, ndata, blist) + barray = bytearray(blist) + rc,data = pmixservermodule['fencenb'](myprocs, ilist, barray) + else: + return PMIX_ERR_NOT_SUPPORTED + # we cannot execute a callback function here as + # that would cause PMIx to lockup. Likewise, the + # Python function we called can't do it as it + # would require them to call a C-function. So + # if they succeeded in processing this request, + # we return a PMIX_OPERATION_SUCCEEDED status + # that let's the underlying PMIx library know + # the situation so it can generate its own + # callback + + if PMIX_SUCCESS == rc or PMIX_OPERATION_SUCCEEDED == rc: + print("CREATE CADDY") + mycaddy = PyMem_Malloc(sizeof(pmix_pyshift_fence_t)) + mycaddy.op = strdup("fence") + mycaddy.bo.bytes = data + mycaddy.bo.size = ndata + mycaddy.modex = cbfunc + mycaddy.cbdata = cbdata + cb = PyCapsule_New(mycaddy, "fence", NULL) + print("EXECUTE CALLBACK") + rc = PMIX_OPERATION_SUCCEEDED + fence_cb(cb, rc) + # execute the timer delay + return rc + +# TODO: This function requires that the server execute the +# provided callback function to return retrieved data, and +# it is not allowed to do so until _after_ it returns from +# this upcall. We'll need to figure out a way to 'save' the +# cbfunc until the server calls us back, possibly by passing +# an appropriate caddy object in 'cbdata' +cdef int directmodex(const pmix_proc_t *proc, + const pmix_info_t info[], size_t ninfo, + pmix_modex_cbfunc_t cbfunc, void *cbdata) with gil: + keys = pmixservermodule.keys() + if 'directmodex' in keys: + args = {} + myprocs = [] + ilist = [] + pmix_unload_procs(proc, 1, myprocs) + args['proc'] = myprocs[0] + if NULL != info: + pmix_unload_info(info, ninfo, ilist) + args['info'] = ilist + rc = pmixservermodule['directmodex'](args) + else: + return PMIX_ERR_NOT_SUPPORTED + # we cannot execute a callback function here as + # that would cause PMIx to lockup. Likewise, the + # Python function we called can't do it as it + # would require them to call a C-function. So + # if they succeeded in processing this request, + # we return a PMIX_OPERATION_SUCCEEDED status + # that let's the underlying PMIx library know + # the situation so it can generate its own + # callback + if PMIX_SUCCESS == rc: + rc = PMIX_OPERATION_SUCCEEDED + return rc + +cdef int publish(const pmix_proc_t *proc, + const pmix_info_t info[], size_t ninfo, + pmix_op_cbfunc_t cbfunc, void *cbdata) with gil: + keys = pmixservermodule.keys() + if 'publish' in keys: + myprocs = [] + ilist = [] + pmix_unload_procs(proc, 1, myprocs) + if NULL != info: + pmix_unload_info(info, ninfo, ilist) + rc = pmixservermodule['publish'](myprocs[0], ilist) + else: + return PMIX_ERR_NOT_SUPPORTED + # we cannot execute a callback function here as + # that would cause PMIx to lockup. Likewise, the + # Python function we called can't do it as it + # would require them to call a C-function. So + # if they succeeded in processing this request, + # we return a PMIX_OPERATION_SUCCEEDED status + # that let's the underlying PMIx library know + # the situation so it can generate its own + # callback + if PMIX_SUCCESS == rc: + rc = PMIX_OPERATION_SUCCEEDED + return rc + +# TODO: This function requires that the server execute the +# provided callback function to return retrieved data, and +# it is not allowed to do so until _after_ it returns from +# this upcall. We'll need to figure out a way to 'save' the +# cbfunc until the server calls us back, possibly by passing +# an appropriate caddy object in 'cbdata' +cdef int lookup(const pmix_proc_t *proc, char **keys, + const pmix_info_t info[], size_t ninfo, + pmix_lookup_cbfunc_t cbfunc, void *cbdata) with gil: + srvkeys = pmixservermodule.keys() + if 'lookup' in srvkeys: + pdata = [] + myprocs = [] + ilist = [] + pykeys = [] + n = 0 + while NULL != keys[n]: + pykeys.append(keys[n]) + n += 1 + pmix_unload_procs(proc, 1, myprocs) + if NULL != info: + pmix_unload_info(info, ninfo, ilist) + pdata, rc = pmixservermodule['lookup'](myprocs[0], pykeys, ilist) + else: + return PMIX_ERR_NOT_SUPPORTED + + # convert the list of dictionaries to array of + # pmix_pdata_t structs + cdef pmix_pdata_t *pd; + cdef size_t ndata; + if pdata is not None: + ndata = len(pdata) + if 0 < ndata: + pd = PyMem_Malloc(ndata * sizeof(pmix_pdata_t)) + if not pdata: + return PMIX_ERR_NOMEM + rc = pmix_load_pdata(myprocs[0], pd, pdata) + if PMIX_SUCCESS != rc: + pmix_free_pdata(pd, ndata) + return rc + else: + pd = NULL + else: + pd = NULL + + if PMIX_SUCCESS == rc or PMIX_OPERATION_SUCCEEDED == rc: + print("CREATE CADDY") + mycaddy = PyMem_Malloc(sizeof(pmix_pyshift_lookup_t)) + mycaddy.op = strdup("lookup") + mycaddy.pdata = pd + mycaddy.ndata = ndata + mycaddy.lookup = cbfunc + mycaddy.cbdata = cbdata + cb = PyCapsule_New(mycaddy, "lookup", NULL) + print("EXECUTE CALLBACK") + rc = PMIX_SUCCESS + threading.Timer(1, lookup_cb, [cb, rc]).start() + return rc + +cdef int unpublish(const pmix_proc_t *proc, char **keys, + const pmix_info_t info[], size_t ninfo, + pmix_op_cbfunc_t cbfunc, void *cbdata) with gil: + srvkeys = pmixservermodule.keys() + if 'unpublish' in srvkeys: + myprocs = [] + ilist = [] + pykeys = [] + if NULL != keys: + pmix_unload_argv(keys, pykeys) + pmix_unload_procs(proc, 1, myprocs) + if NULL != info: + pmix_unload_info(info, ninfo, ilist) + rc = pmixservermodule['unpublish'](myprocs[0], pykeys, ilist) + else: + return PMIX_ERR_NOT_SUPPORTED + # we cannot execute a callback function here as + # that would cause PMIx to lockup. Likewise, the + # Python function we called can't do it as it + # would require them to call a C-function. So + # if they succeeded in processing this request, + # we return a PMIX_OPERATION_SUCCEEDED status + # that let's the underlying PMIx library know + # the situation so it can generate its own + # callback + if PMIX_SUCCESS == rc: + rc = PMIX_OPERATION_SUCCEEDED + return rc + +# TODO: This function requires that the server execute the +# provided callback function to return the spawned nspace, and +# it is not allowed to do so until _after_ it returns from +# this upcall. We'll need to figure out a way to 'save' the +# cbfunc until the server calls us back, possibly by passing +# an appropriate caddy object in 'cbdata' +cdef int spawn(const pmix_proc_t *proc, + const pmix_info_t job_info[], size_t ninfo, + const pmix_app_t apps[], size_t napps, + pmix_spawn_cbfunc_t cbfunc, void *cbdata) with gil: + keys = pmixservermodule.keys() + if 'spawn' in keys: + args = {} + myprocs = [] + ilist = [] + pyapps = [] + pmix_unload_procs(proc, 1, myprocs) + args['proc'] = myprocs[0] + if NULL != job_info: + pmix_unload_info(job_info, ninfo, ilist) + args['jobinfo'] = ilist + pmix_unload_apps(apps, napps, pyapps) + args['apps'] = pyapps + rc = pmixservermodule['spawn'](args) + else: + rc = PMIX_ERR_NOT_SUPPORTED + return rc + +cdef int connect(const pmix_proc_t procs[], size_t nprocs, + const pmix_info_t info[], size_t ninfo, + pmix_op_cbfunc_t cbfunc, void *cbdata) with gil: + keys = pmixservermodule.keys() + if 'connect' in keys: + args = {} + myprocs = [] + ilist = [] + if NULL != procs: + pmix_unload_procs(procs, nprocs, myprocs) + args['procs'] = myprocs + if NULL != info: + pmix_unload_info(info, ninfo, ilist) + args['info'] = ilist + rc = pmixservermodule['connect'](args) + else: + return PMIX_ERR_NOT_SUPPORTED + # we cannot execute a callback function here as + # that would cause PMIx to lockup. Likewise, the + # Python function we called can't do it as it + # would require them to call a C-function. So + # if they succeeded in processing this request, + # we return a PMIX_OPERATION_SUCCEEDED status + # that let's the underlying PMIx library know + # the situation so it can generate its own + # callback + if PMIX_SUCCESS == rc: + rc = PMIX_OPERATION_SUCCEEDED + return rc + +cdef int disconnect(const pmix_proc_t procs[], size_t nprocs, + const pmix_info_t info[], size_t ninfo, + pmix_op_cbfunc_t cbfunc, void *cbdata) with gil: + keys = pmixservermodule.keys() + if 'disconnect' in keys: + args = {} + myprocs = [] + ilist = [] + if NULL != procs: + pmix_unload_procs(procs, nprocs, myprocs) + args['procs'] = myprocs + if NULL != info: + pmix_unload_info(info, ninfo, ilist) + args['info'] = ilist + rc = pmixservermodule['disconnect'](args) + else: + return PMIX_ERR_NOT_SUPPORTED + # we cannot execute a callback function here as + # that would cause PMIx to lockup. Likewise, the + # Python function we called can't do it as it + # would require them to call a C-function. So + # if they succeeded in processing this request, + # we return a PMIX_OPERATION_SUCCEEDED status + # that let's the underlying PMIx library know + # the situation so it can generate its own + # callback + if PMIX_SUCCESS == rc: + rc = PMIX_OPERATION_SUCCEEDED + return rc + +cdef int registerevents(pmix_status_t *codes, size_t ncodes, + const pmix_info_t info[], size_t ninfo, + pmix_op_cbfunc_t cbfunc, void *cbdata) with gil: + keys = pmixservermodule.keys() + if 'registerevents' in keys: + args = {} + mycodes = [] + ilist = [] + if NULL != codes: + n = 0 + while n < ncodes: + mycodes.append(codes[n]) + n += 1 + args['codes'] = mycodes + if NULL != info: + pmix_unload_info(info, ninfo, ilist) + args['info'] = ilist + rc = pmixservermodule['registerevents'](args) + else: + return PMIX_ERR_NOT_SUPPORTED + # we cannot execute a callback function here as + # that would cause PMIx to lockup. Likewise, the + # Python function we called can't do it as it + # would require them to call a C-function. So + # if they succeeded in processing this request, + # we return a PMIX_OPERATION_SUCCEEDED status + # that let's the underlying PMIx library know + # the situation so it can generate its own + # callback + if PMIX_SUCCESS == rc: + rc = PMIX_OPERATION_SUCCEEDED + return rc + +cdef int deregisterevents(pmix_status_t *codes, size_t ncodes, + pmix_op_cbfunc_t cbfunc, void *cbdata) with gil: + keys = pmixservermodule.keys() + if 'deregisterevents' in keys: + args = {} + mycodes = [] + if NULL != codes: + n = 0 + while n < ncodes: + mycodes.append(codes[n]) + n += 1 + args['codes'] = mycodes + rc = pmixservermodule['deregisterevents'](args) + else: + return PMIX_ERR_NOT_SUPPORTED + # we cannot execute a callback function here as + # that would cause PMIx to lockup. Likewise, the + # Python function we called can't do it as it + # would require them to call a C-function. So + # if they succeeded in processing this request, + # we return a PMIX_OPERATION_SUCCEEDED status + # that let's the underlying PMIx library know + # the situation so it can generate its own + # callback + if PMIX_SUCCESS == rc: + rc = PMIX_OPERATION_SUCCEEDED + return rc + +cdef int notifyevent(pmix_status_t code, + const pmix_proc_t *source, + pmix_data_range_t drange, + pmix_info_t info[], size_t ninfo, + pmix_op_cbfunc_t cbfunc, void *cbdata) with gil: + keys = pmixservermodule.keys() + if 'notifyevent' in keys: + args = {} + ilist = [] + myproc = [] + args['code'] = code + pmix_unload_procs(source, 1, myproc) + args['source'] = myproc[0] + args['range'] = drange + if NULL != info: + pmix_unload_info(info, ninfo, ilist) + args['info'] = ilist + rc = pmixservermodule['notifyevent'](args) + else: + return PMIX_ERR_NOT_SUPPORTED + # we cannot execute a callback function here as + # that would cause PMIx to lockup. Likewise, the + # Python function we called can't do it as it + # would require them to call a C-function. So + # if they succeeded in processing this request, + # we return a PMIX_OPERATION_SUCCEEDED status + # that let's the underlying PMIx library know + # the situation so it can generate its own + # callback + if PMIX_SUCCESS == rc: + rc = PMIX_OPERATION_SUCCEEDED + return rc + +# TODO: This function requires that the server execute the +# provided callback function to return retrieved data, and +# it is not allowed to do so until _after_ it returns from +# this upcall. We'll need to figure out a way to 'save' the +# cbfunc until the server calls us back, possibly by passing +# an appropriate caddy object in 'cbdata' +cdef int query(pmix_proc_t *source, + pmix_query_t *queries, size_t nqueries, + pmix_info_cbfunc_t cbfunc, + void *cbdata) with gil: + keys = pmixservermodule.keys() + if 'query' in keys: + args = {} + myproc = [] + if NULL != source: + pmix_unload_procs(source, 1, myproc) + args['source'] = myproc[0] + rc = pmixservermodule['query'](args) + else: + rc = PMIX_ERR_NOT_SUPPORTED + return rc + +# TODO: This function requires that the server execute the +# provided callback function to return an assigned ID, and +# it is not allowed to do so until _after_ it returns from +# this upcall. We'll need to figure out a way to 'save' the +# cbfunc until the server calls us back, possibly by passing +# an appropriate caddy object in 'cbdata' +cdef void toolconnected(pmix_info_t *info, size_t ninfo, + pmix_tool_connection_cbfunc_t cbfunc, + void *cbdata) with gil: + keys = pmixservermodule.keys() + if 'toolconnected' in keys: + args = {} + ilist = {} + if NULL != info: + pmix_unload_info(info, ninfo, ilist) + args['info'] = ilist + pmixservermodule['toolconnected'](args) + return + +cdef void log(const pmix_proc_t *client, + const pmix_info_t data[], size_t ndata, + const pmix_info_t directives[], size_t ndirs, + pmix_op_cbfunc_t cbfunc, void *cbdata) with gil: + keys = pmixservermodule.keys() + if 'log' in keys: + args = {} + ilist = [] + myproc = [] + mydirs = [] + pmix_unload_procs(client, 1, myproc) + args['client'] = myproc[0] + if NULL != data: + pmix_unload_info(data, ndata, ilist) + args['data'] = ilist + if NULL != directives: + pmix_unload_info(directives, ndirs, mydirs) + args['directives'] = mydirs + rc = pmixservermodule['log'](args) + else: + rc = PMIX_ERR_NOT_SUPPORTED + # we cannot execute a callback function here as + # that would cause PMIx to lockup. Likewise, the + # Python function we called can't do it as it + # would require them to call a C-function. So + # if they succeeded in processing this request, + # we return a PMIX_OPERATION_SUCCEEDED status + # that let's the underlying PMIx library know + # the situation so it can generate its own + # callback + if PMIX_SUCCESS == rc: + rc = PMIX_OPERATION_SUCCEEDED + return + +# TODO: This function requires that the server execute the +# provided callback function to return the allocation, and +# it is not allowed to do so until _after_ it returns from +# this upcall. We'll need to figure out a way to 'save' the +# cbfunc until the server calls us back, possibly by passing +# an appropriate caddy object in 'cbdata' +cdef int allocate(const pmix_proc_t *client, + pmix_alloc_directive_t directive, + const pmix_info_t data[], size_t ndata, + pmix_info_cbfunc_t cbfunc, void *cbdata) with gil: + keys = pmixservermodule.keys() + if 'allocate' in keys: + args = {} + myproc = [] + mydirs = {} + keyvals = [] + if NULL != client: + pmix_unload_procs(client, 1, myproc) + args['client'] = myproc[0] + args['directive'] = directive + if NULL != data: + pmix_unload_info(data, ndata, keyvals) + args['data'] = keyvals + rc = pmixservermodule['allocate'](args) + else: + rc = PMIX_ERR_NOT_SUPPORTED + return rc + +# TODO: This function requires that the server execute the +# provided callback function to return the outcome of the op, and +# it is not allowed to do so until _after_ it returns from +# this upcall. We'll need to figure out a way to 'save' the +# cbfunc until the server calls us back, possibly by passing +# an appropriate caddy object in 'cbdata' +cdef int jobcontrol(const pmix_proc_t *requestor, + const pmix_proc_t targets[], size_t ntargets, + const pmix_info_t directives[], size_t ndirs, + pmix_info_cbfunc_t cbfunc, void *cbdata) with gil: + keys = pmixservermodule.keys() + if 'jobcontrol' in keys: + args = {} + myproc = [] + mytargets = [] + mydirs = {} + if NULL != requestor: + pmix_unload_procs(requestor, 1, myproc) + args['requestor'] = myproc[0] + if NULL != targets: + pmix_unload_procs(targets, ntargets, mytargets) + args['targets'] = mytargets + if NULL != directives: + pmix_unload_info(directives, ndirs, mydirs) + args['directives'] = mydirs + rc = pmixservermodule['jobcontrol'](args) + else: + rc = PMIX_ERR_NOT_SUPPORTED + return rc + +# TODO: This function requires that the server execute the +# provided callback function to return the monitoring response, and +# it is not allowed to do so until _after_ it returns from +# this upcall. We'll need to figure out a way to 'save' the +# cbfunc until the server calls us back, possibly by passing +# an appropriate caddy object in 'cbdata' +cdef int monitor(const pmix_proc_t *requestor, + const pmix_info_t *monitor, pmix_status_t error, + const pmix_info_t directives[], size_t ndirs, + pmix_info_cbfunc_t cbfunc, void *cbdata) with gil: + keys = pmixservermodule.keys() + if 'monitor' in keys: + args = {} + mymon = {} + myproc = [] + mydirs = {} + blist = [] + if NULL != requestor: + pmix_unload_procs(requestor, 1, myproc) + args['requestor'] = myproc[0] + if NULL != monitor: + pmix_unload_info(monitor, 1, mymon) + args['monitor'] = mymon + args['error'] = error + if NULL != directives: + pmix_unload_info(directives, ndirs, mydirs) + args['directives'] = mydirs + rc = pmixservermodule['monitor'](args) + else: + rc = PMIX_ERR_NOT_SUPPORTED + return rc + +# TODO: This function requires that the server execute the +# provided callback function to return the credential, and +# it is not allowed to do so until _after_ it returns from +# this upcall. We'll need to figure out a way to 'save' the +# cbfunc until the server calls us back, possibly by passing +# an appropriate caddy object in 'cbdata' +cdef int getcredential(const pmix_proc_t *proc, + const pmix_info_t directives[], size_t ndirs, + pmix_credential_cbfunc_t cbfunc, void *cbdata) with gil: + keys = pmixservermodule.keys() + if 'getcredential' in keys: + args = {} + myproc = [] + mydirs = {} + if NULL != proc: + pmix_unload_procs(proc, 1, myproc) + args['proc'] = myproc[0] + if NULL != directives: + pmix_unload_info(directives, ndirs, mydirs) + args['directives'] = mydirs + rc = pmixservermodule['getcredential'](args) + else: + rc = PMIX_ERR_NOT_SUPPORTED + return rc + +# TODO: This function requires that the server execute the +# provided callback function to return the validation, and +# it is not allowed to do so until _after_ it returns from +# this upcall. We'll need to figure out a way to 'save' the +# cbfunc until the server calls us back, possibly by passing +# an appropriate caddy object in 'cbdata' +cdef int validatecredential(const pmix_proc_t *proc, + const pmix_byte_object_t *cred, + const pmix_info_t directives[], size_t ndirs, + pmix_validation_cbfunc_t cbfunc, void *cbdata) with gil: + keys = pmixservermodule.keys() + if 'validatecredential' in keys: + args = {} + keyvals = {} + myproc = [] + mydirs = {} + blist = [] + if NULL != proc: + pmix_unload_procs(proc, 1, myproc) + args['proc'] = myproc[0] + if NULL != cred: + pmix_unload_bytes(cred[0].bytes, cred[0].size, blist) + args['cred'] = blist + if NULL != directives: + pmix_unload_info(directives, ndirs, mydirs) + args['directives'] = mydirs + rc = pmixservermodule['validatecredential'](args) + else: + rc = PMIX_ERR_NOT_SUPPORTED + return rc + +cdef int iofpull(const pmix_proc_t procs[], size_t nprocs, + const pmix_info_t directives[], size_t ndirs, + pmix_iof_channel_t channels, + pmix_op_cbfunc_t cbfunc, void *cbdata) with gil: + keys = pmixservermodule.keys() + if 'iofpull' in keys: + args = {} + keyvals = {} + myprocs = [] + mydirs = {} + if NULL != procs: + pmix_unload_procs(procs, nprocs, myprocs) + args['procs'] = myprocs + if NULL != directives: + pmix_unload_info(directives, ndirs, mydirs) + args['directives'] = mydirs + rc = pmixservermodule['iofpull'](args) + else: + rc = PMIX_ERR_NOT_SUPPORTED + # we cannot execute a callback function here as + # that would cause PMIx to lockup. Likewise, the + # Python function we called can't do it as it + # would require them to call a C-function. So + # if they succeeded in processing this request, + # we return a PMIX_OPERATION_SUCCEEDED status + # that let's the underlying PMIx library know + # the situation so it can generate its own + # callback + if PMIX_SUCCESS == rc: + rc = PMIX_OPERATION_SUCCEEDED + return rc + +cdef int pushstdin(const pmix_proc_t *source, + const pmix_proc_t targets[], size_t ntargets, + const pmix_info_t directives[], size_t ndirs, + const pmix_byte_object_t *bo, + pmix_op_cbfunc_t cbfunc, void *cbdata) with gil: + keys = pmixservermodule.keys() + if 'pushstdin' in keys: + args = {} + keyvals = {} + myproc = [] + mytargets = [] + mydirs = {} + if NULL != source: + pmix_unload_procs(source, 1, myproc) + args['source'] = myproc[0] + if NULL != targets: + pmix_unload_procs(targets, ntargets, mytargets) + args['targets'] = mytargets + if NULL != directives: + pmix_unload_info(directives, ndirs, mydirs) + args['directives'] = mydirs + rc = pmixservermodule['pushstdin'](args) + else: + rc = PMIX_ERR_NOT_SUPPORTED + # we cannot execute a callback function here as + # that would cause PMIx to lockup. Likewise, the + # Python function we called can't do it as it + # would require them to call a C-function. So + # if they succeeded in processing this request, + # we return a PMIX_OPERATION_SUCCEEDED status + # that let's the underlying PMIx library know + # the situation so it can generate its own + # callback + if PMIX_SUCCESS == rc: + rc = PMIX_OPERATION_SUCCEEDED + return rc + +# TODO: This function requires that the server execute the +# provided callback function to return the group info, and +# it is not allowed to do so until _after_ it returns from +# this upcall. We'll need to figure out a way to 'save' the +# cbfunc until the server calls us back, possibly by passing +# an appropriate caddy object in 'cbdata' +cdef int group(pmix_group_operation_t op, char grp[], + const pmix_proc_t procs[], size_t nprocs, + const pmix_info_t directives[], size_t ndirs, + pmix_info_cbfunc_t cbfunc, void *cbdata) with gil: + keys = pmixservermodule.keys() + if 'group' in keys: + args = {} + keyvals = {} + myprocs = [] + mydirs = {} + args['op'] = op + args['grp'] = str(grp) + pmix_unload_procs(procs, nprocs, myprocs) + args['procs'] = myprocs + if NULL != directives: + pmix_unload_info(directives, ndirs, mydirs) + args['directives'] = mydirs + rc = pmixservermodule['group'](args) + else: + rc = PMIX_ERR_NOT_SUPPORTED + return rc + +cdef class PMIxTool(PMIxServer): + def __init__(self): + memset(self.myproc.nspace, 0, sizeof(self.myproc.nspace)) + self.myproc.rank = PMIX_RANK_UNDEF + + # Initialize the PMIx tool library + # + # @dicts [INPUT] + # - a list of dictionaries, where each + # dictionary has a key, value, and val_type + # defined as such: + # [{key:y, value:val, val_type:ty}, … ] + def init(self, dicts:list): + cdef pmix_info_t *info + cdef pmix_info_t **info_ptr + cdef size_t sz + + # allocate and load pmix info structs from python list of dictionaries + info_ptr = &info + rc = pmix_alloc_info(info_ptr, &sz, dicts) + + if sz > 0: + rc = PMIx_tool_init(&self.myproc, info, sz) + pmix_free_info(info, sz) + else: + rc = PMIx_tool_init(&self.myproc, NULL, 0) + return rc + + # Finalize the tool library + def finalize(self): + rc = PMIx_tool_finalize() + return rc + + # Connect to a server + # + # @dicts [INPUT] + # - a list of dictionaries, where each + # dictionary has a key, value, and val_type + # defined as such: + # [{key:y, value:val, val_type:ty}, … ] + def connect_to_server(self, dicts:list): + cdef pmix_info_t *info + cdef pmix_info_t **info_ptr + cdef size_t sz + + # allocate and load pmix info structs from python list of dictionaries + info_ptr = &info + rc = pmix_alloc_info(info_ptr, &sz, dicts) + + if sz > 0: + rc = PMIx_tool_connect_to_server(&self.myproc, info, sz) + pmix_free_info(info, sz) + else: + rc = PMIx_tool_connect_to_server(&self.myproc, NULL, 0) + return rc diff --git a/opal/mca/pmix/pmix4x/openpmix/bindings/python/setup.py b/opal/mca/pmix/pmix4x/openpmix/bindings/python/setup.py new file mode 100755 index 0000000000..4737c60df1 --- /dev/null +++ b/opal/mca/pmix/pmix4x/openpmix/bindings/python/setup.py @@ -0,0 +1,47 @@ +from distutils.core import setup +from distutils.extension import Extension +from Cython.Build import cythonize +from sys import platform, maxsize, version_info +import os +from subprocess import check_output, CalledProcessError + +def getVersion(): + dir = os.path.dirname(__file__) + vers_path = os.path.join(dir, '../../include', 'pmix_version.h') + with open(vers_path) as verFile: + lines = verFile.readlines() + for l in lines: + if 'MAJOR' in l: + major = l.split()[2] + major = major[:-1] + elif 'MINOR' in l: + minor = l.split()[2] + minor = minor[:-1] + elif 'RELEASE' in l: + release = l.split()[2] + release = release[:-1] + vers = [major, minor, release] + version = ".".join(vers) + return version + +setup( + name = 'pypmix', + version = getVersion(), + url = 'https://pmix.org', + license = '3-clause BSD', + author = 'Ralph H. Castain', + author_email = 'ralph.h.castain@intel.com', + description = 'Python bindings for PMIx', + classifiers = [ + 'Development Status :: 1 - Under Construction', + 'Intended Audience :: Developers', + 'Topic :: HPC :: Parallel Programming :: System Management', + 'License :: 3-clause BSD', + 'Programming Language :: Python :: 3.4', + 'Programming Language :: Python :: 3.5', + 'Programming Language :: Python :: 3.6'], + keywords = 'PMI PMIx HPC MPI SHMEM', + platforms = 'any', + ext_modules = cythonize([Extension("pmix", ["pmix.pyx"], libraries=["pmix"])], + compiler_directives={'language_level': 3}) +) diff --git a/opal/mca/pmix/pmix4x/pmix/config/Makefile.am b/opal/mca/pmix/pmix4x/openpmix/config/Makefile.am similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/config/Makefile.am rename to opal/mca/pmix/pmix4x/openpmix/config/Makefile.am diff --git a/opal/mca/pmix/pmix4x/pmix/config/c_get_alignment.m4 b/opal/mca/pmix/pmix4x/openpmix/config/c_get_alignment.m4 similarity index 98% rename from opal/mca/pmix/pmix4x/pmix/config/c_get_alignment.m4 rename to opal/mca/pmix/pmix4x/openpmix/config/c_get_alignment.m4 index 6596c0ae88..4ef0ba25e3 100644 --- a/opal/mca/pmix/pmix4x/pmix/config/c_get_alignment.m4 +++ b/opal/mca/pmix/pmix4x/openpmix/config/c_get_alignment.m4 @@ -11,7 +11,7 @@ dnl University of Stuttgart. All rights reserved. dnl Copyright (c) 2004-2005 The Regents of the University of California. dnl All rights reserved. dnl Copyright (c) 2009 Sun Microsystems, Inc. All rights reserved. -dnl Copyright (c) 2014-2019 Intel, Inc. All rights reserved. +dnl Copyright (c) 2014-2015 Intel, Inc. All rights reserved. dnl Copyright (c) 2015-2019 Research Organization for Information Science dnl and Technology (RIST). All rights reserved. dnl $COPYRIGHT$ diff --git a/opal/mca/pmix/pmix4x/pmix/config/distscript.sh b/opal/mca/pmix/pmix4x/openpmix/config/distscript.sh similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/config/distscript.sh rename to opal/mca/pmix/pmix4x/openpmix/config/distscript.sh diff --git a/opal/mca/pmix/pmix4x/pmix/config/pmix.m4 b/opal/mca/pmix/pmix4x/openpmix/config/pmix.m4 similarity index 98% rename from opal/mca/pmix/pmix4x/pmix/config/pmix.m4 rename to opal/mca/pmix/pmix4x/openpmix/config/pmix.m4 index dc4af4b36a..bf4ba32491 100644 --- a/opal/mca/pmix/pmix4x/pmix/config/pmix.m4 +++ b/opal/mca/pmix/pmix4x/openpmix/config/pmix.m4 @@ -664,7 +664,7 @@ AC_DEFUN([PMIX_SETUP_CORE],[ # -lrt might be needed for clock_gettime PMIX_SEARCH_LIBS_CORE([clock_gettime], [rt]) - AC_CHECK_FUNCS([asprintf snprintf vasprintf vsnprintf strsignal socketpair strncpy_s usleep statfs statvfs getpeereid getpeerucred strnlen posix_fallocate tcgetpgrp setpgid ptsname openpty setenv]) + AC_CHECK_FUNCS([asprintf snprintf vasprintf vsnprintf strsignal socketpair strncpy_s usleep statfs statvfs getpeereid getpeerucred strnlen posix_fallocate tcgetpgrp setpgid ptsname openpty setenv fork execve waitpid]) # On some hosts, htonl is a define, so the AC_CHECK_FUNC will get # confused. On others, it's in the standard library, but stubbed with @@ -729,6 +729,9 @@ AC_DEFUN([PMIX_SETUP_CORE],[ LDFLAGS="$LDFLAGS $THREAD_LDFLAGS" LIBS="$LIBS $THREAD_LIBS" + PMIX_WRAPPER_FLAGS_ADD([CFLAGS], [$THREAD_CFLAGS]) + PMIX_WRAPPER_FLAGS_ADD([LDFLAGS], [$THREAD_LDFLAGS]) + # # What is the local equivalent of "ln -s" # @@ -851,6 +854,18 @@ AC_DEFUN([PMIX_SETUP_CORE],[ CPPFLAGS="-I$PMIX_top_srcdir -I$PMIX_top_srcdir/src -I$PMIX_top_srcdir/include $CPPFLAGS" fi + ############################################################################ + # final wrapper compiler config + ############################################################################ + opal_show_subtitle "Wrapper compiler final setup" + + # The PMIx wrapper script (i.e., not the C-compiled + # executables) need perl. + AC_PATH_PROG(PERL, perl, perl) + + PMIX_SETUP_WRAPPER_FINAL + + ############################################################################ # pmixdatadir, pmixlibdir, and pmixinclude are essentially the same as # pkg*dir, but will always be */pmix. pmixdatadir='${datadir}/pmix' @@ -913,6 +928,9 @@ AC_DEFUN([PMIX_SETUP_CORE],[ pmix_config_prefix[src/tools/plookup/Makefile] pmix_config_prefix[src/tools/pps/Makefile] pmix_config_prefix[src/tools/pattrs/Makefile] + pmix_config_prefix[src/tools/wrapper/Makefile] + pmix_config_prefix[src/tools/wrapper/pmixcc-wrapper-data.txt] + pmix_config_prefix[src/tools/wrapper/pmix.pc] ) # publish any embedded flags so external wrappers can use them diff --git a/opal/mca/pmix/pmix4x/pmix/config/pmix_check_attributes.m4 b/opal/mca/pmix/pmix4x/openpmix/config/pmix_check_attributes.m4 similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/config/pmix_check_attributes.m4 rename to opal/mca/pmix/pmix4x/openpmix/config/pmix_check_attributes.m4 diff --git a/opal/mca/pmix/pmix4x/pmix/config/pmix_check_broken_qsort.m4 b/opal/mca/pmix/pmix4x/openpmix/config/pmix_check_broken_qsort.m4 similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/config/pmix_check_broken_qsort.m4 rename to opal/mca/pmix/pmix4x/openpmix/config/pmix_check_broken_qsort.m4 diff --git a/opal/mca/pmix/pmix4x/pmix/config/pmix_check_compiler_version.m4 b/opal/mca/pmix/pmix4x/openpmix/config/pmix_check_compiler_version.m4 similarity index 98% rename from opal/mca/pmix/pmix4x/pmix/config/pmix_check_compiler_version.m4 rename to opal/mca/pmix/pmix4x/openpmix/config/pmix_check_compiler_version.m4 index da822b0481..4704b8f1c6 100644 --- a/opal/mca/pmix/pmix4x/pmix/config/pmix_check_compiler_version.m4 +++ b/opal/mca/pmix/pmix4x/openpmix/config/pmix_check_compiler_version.m4 @@ -1,7 +1,7 @@ dnl -*- shell-script -*- dnl dnl Copyright (c) 2009 Oak Ridge National Labs. All rights reserved. -dnl Copyright (c) 2013-2019 Intel, Inc. All rights reserved. +dnl Copyright (c) 2013-2017 Intel, Inc. All rights reserved. dnl Copyright (c) 2019 Research Organization for Information Science dnl and Technology (RIST). All rights reserved. dnl diff --git a/opal/mca/pmix/pmix4x/pmix/config/pmix_check_icc.m4 b/opal/mca/pmix/pmix4x/openpmix/config/pmix_check_icc.m4 similarity index 96% rename from opal/mca/pmix/pmix4x/pmix/config/pmix_check_icc.m4 rename to opal/mca/pmix/pmix4x/openpmix/config/pmix_check_icc.m4 index 05ce9431bd..de92a5d66c 100644 --- a/opal/mca/pmix/pmix4x/pmix/config/pmix_check_icc.m4 +++ b/opal/mca/pmix/pmix4x/openpmix/config/pmix_check_icc.m4 @@ -10,7 +10,7 @@ dnl Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, dnl University of Stuttgart. All rights reserved. dnl Copyright (c) 2004-2005 The Regents of the University of California. dnl All rights reserved. -dnl Copyright (c) 2014-2019 Intel, Inc. All rights reserved. +dnl Copyright (c) 2014 Intel, Inc. All rights reserved. dnl Copyright (c) 2016-2019 Research Organization for Information Science dnl and Technology (RIST). All rights reserved. dnl $COPYRIGHT$ diff --git a/opal/mca/pmix/pmix4x/pmix/config/pmix_check_ident.m4 b/opal/mca/pmix/pmix4x/openpmix/config/pmix_check_ident.m4 similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/config/pmix_check_ident.m4 rename to opal/mca/pmix/pmix4x/openpmix/config/pmix_check_ident.m4 diff --git a/opal/mca/pmix/pmix4x/pmix/config/pmix_check_lock.m4 b/opal/mca/pmix/pmix4x/openpmix/config/pmix_check_lock.m4 similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/config/pmix_check_lock.m4 rename to opal/mca/pmix/pmix4x/openpmix/config/pmix_check_lock.m4 diff --git a/opal/mca/pmix/pmix4x/pmix/config/pmix_check_os_flavors.m4 b/opal/mca/pmix/pmix4x/openpmix/config/pmix_check_os_flavors.m4 similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/config/pmix_check_os_flavors.m4 rename to opal/mca/pmix/pmix4x/openpmix/config/pmix_check_os_flavors.m4 diff --git a/opal/mca/pmix/pmix4x/pmix/config/pmix_check_package.m4 b/opal/mca/pmix/pmix4x/openpmix/config/pmix_check_package.m4 similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/config/pmix_check_package.m4 rename to opal/mca/pmix/pmix4x/openpmix/config/pmix_check_package.m4 diff --git a/opal/mca/pmix/pmix4x/pmix/config/pmix_check_pthread_pids.m4 b/opal/mca/pmix/pmix4x/openpmix/config/pmix_check_pthread_pids.m4 similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/config/pmix_check_pthread_pids.m4 rename to opal/mca/pmix/pmix4x/openpmix/config/pmix_check_pthread_pids.m4 diff --git a/opal/mca/pmix/pmix4x/pmix/config/pmix_check_vendor.m4 b/opal/mca/pmix/pmix4x/openpmix/config/pmix_check_vendor.m4 similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/config/pmix_check_vendor.m4 rename to opal/mca/pmix/pmix4x/openpmix/config/pmix_check_vendor.m4 diff --git a/opal/mca/pmix/pmix4x/pmix/config/pmix_check_visibility.m4 b/opal/mca/pmix/pmix4x/openpmix/config/pmix_check_visibility.m4 similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/config/pmix_check_visibility.m4 rename to opal/mca/pmix/pmix4x/openpmix/config/pmix_check_visibility.m4 diff --git a/opal/mca/pmix/pmix4x/pmix/config/pmix_check_withdir.m4 b/opal/mca/pmix/pmix4x/openpmix/config/pmix_check_withdir.m4 similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/config/pmix_check_withdir.m4 rename to opal/mca/pmix/pmix4x/openpmix/config/pmix_check_withdir.m4 diff --git a/opal/mca/pmix/pmix4x/pmix/config/pmix_config_asm.m4 b/opal/mca/pmix/pmix4x/openpmix/config/pmix_config_asm.m4 similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/config/pmix_config_asm.m4 rename to opal/mca/pmix/pmix4x/openpmix/config/pmix_config_asm.m4 diff --git a/opal/mca/pmix/pmix4x/pmix/config/pmix_config_pthreads.m4 b/opal/mca/pmix/pmix4x/openpmix/config/pmix_config_pthreads.m4 similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/config/pmix_config_pthreads.m4 rename to opal/mca/pmix/pmix4x/openpmix/config/pmix_config_pthreads.m4 diff --git a/opal/mca/pmix/pmix4x/pmix/config/pmix_config_subdir.m4 b/opal/mca/pmix/pmix4x/openpmix/config/pmix_config_subdir.m4 similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/config/pmix_config_subdir.m4 rename to opal/mca/pmix/pmix4x/openpmix/config/pmix_config_subdir.m4 diff --git a/opal/mca/pmix/pmix4x/pmix/config/pmix_config_subdir_args.m4 b/opal/mca/pmix/pmix4x/openpmix/config/pmix_config_subdir_args.m4 similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/config/pmix_config_subdir_args.m4 rename to opal/mca/pmix/pmix4x/openpmix/config/pmix_config_subdir_args.m4 diff --git a/opal/mca/pmix/pmix4x/pmix/config/pmix_config_threads.m4 b/opal/mca/pmix/pmix4x/openpmix/config/pmix_config_threads.m4 similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/config/pmix_config_threads.m4 rename to opal/mca/pmix/pmix4x/openpmix/config/pmix_config_threads.m4 diff --git a/opal/mca/pmix/pmix4x/pmix/config/pmix_ensure_contains_optflags.m4 b/opal/mca/pmix/pmix4x/openpmix/config/pmix_ensure_contains_optflags.m4 similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/config/pmix_ensure_contains_optflags.m4 rename to opal/mca/pmix/pmix4x/openpmix/config/pmix_ensure_contains_optflags.m4 diff --git a/opal/mca/pmix/pmix4x/pmix/config/pmix_functions.m4 b/opal/mca/pmix/pmix4x/openpmix/config/pmix_functions.m4 similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/config/pmix_functions.m4 rename to opal/mca/pmix/pmix4x/openpmix/config/pmix_functions.m4 diff --git a/opal/mca/pmix/pmix4x/pmix/config/pmix_get_version.sh b/opal/mca/pmix/pmix4x/openpmix/config/pmix_get_version.sh similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/config/pmix_get_version.sh rename to opal/mca/pmix/pmix4x/openpmix/config/pmix_get_version.sh diff --git a/opal/mca/pmix/pmix4x/pmix/config/pmix_load_platform.m4 b/opal/mca/pmix/pmix4x/openpmix/config/pmix_load_platform.m4 similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/config/pmix_load_platform.m4 rename to opal/mca/pmix/pmix4x/openpmix/config/pmix_load_platform.m4 diff --git a/opal/mca/pmix/pmix4x/pmix/config/pmix_mca.m4 b/opal/mca/pmix/pmix4x/openpmix/config/pmix_mca.m4 similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/config/pmix_mca.m4 rename to opal/mca/pmix/pmix4x/openpmix/config/pmix_mca.m4 diff --git a/opal/mca/pmix/pmix4x/pmix/config/pmix_mca_priority_sort.pl b/opal/mca/pmix/pmix4x/openpmix/config/pmix_mca_priority_sort.pl similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/config/pmix_mca_priority_sort.pl rename to opal/mca/pmix/pmix4x/openpmix/config/pmix_mca_priority_sort.pl diff --git a/opal/mca/pmix/pmix4x/pmix/config/pmix_search_libs.m4 b/opal/mca/pmix/pmix4x/openpmix/config/pmix_search_libs.m4 similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/config/pmix_search_libs.m4 rename to opal/mca/pmix/pmix4x/openpmix/config/pmix_search_libs.m4 diff --git a/opal/mca/pmix/pmix4x/pmix/config/pmix_set_mca_prefix.m4 b/opal/mca/pmix/pmix4x/openpmix/config/pmix_set_mca_prefix.m4 similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/config/pmix_set_mca_prefix.m4 rename to opal/mca/pmix/pmix4x/openpmix/config/pmix_set_mca_prefix.m4 diff --git a/opal/mca/pmix/pmix4x/pmix/config/pmix_setup_cc.m4 b/opal/mca/pmix/pmix4x/openpmix/config/pmix_setup_cc.m4 similarity index 98% rename from opal/mca/pmix/pmix4x/pmix/config/pmix_setup_cc.m4 rename to opal/mca/pmix/pmix4x/openpmix/config/pmix_setup_cc.m4 index 026c3a800b..d935c977f4 100644 --- a/opal/mca/pmix/pmix4x/pmix/config/pmix_setup_cc.m4 +++ b/opal/mca/pmix/pmix4x/openpmix/config/pmix_setup_cc.m4 @@ -16,7 +16,7 @@ dnl Copyright (c) 2012-2017 Los Alamos National Security, LLC. All rights dnl reserved. dnl Copyright (c) 2015-2019 Research Organization for Information Science dnl and Technology (RIST). All rights reserved. -dnl Copyright (c) 2018 Intel, Inc. All rights reserved. +dnl Copyright (c) 2018-2019 Intel, Inc. All rights reserved. dnl $COPYRIGHT$ dnl dnl Additional copyrights may follow @@ -135,6 +135,11 @@ AC_DEFUN([PMIX_SETUP_CC],[ PMIX_VAR_SCOPE_PUSH([pmix_prog_cc_c11_helper__Thread_local_available pmix_prog_cc_c11_helper_atomic_var_available pmix_prog_cc_c11_helper__Atomic_available pmix_prog_cc_c11_helper__static_assert_available pmix_prog_cc_c11_helper__Generic_available pmix_prog_cc__thread_available pmix_prog_cc_c11_helper_atomic_fetch_xor_explicit_available]) + # AC_PROG_CC_C99 changes CC (instead of CFLAGS) so save CC (without c99 + # flags) for use in our wrappers. + WRAPPER_CC="$CC" + AC_SUBST([WRAPPER_CC]) + PMIX_PROG_CC_C11 if test $pmix_cv_c11_supported = no ; then diff --git a/opal/mca/pmix/pmix4x/pmix/config/pmix_setup_cli.m4 b/opal/mca/pmix/pmix4x/openpmix/config/pmix_setup_cli.m4 similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/config/pmix_setup_cli.m4 rename to opal/mca/pmix/pmix4x/openpmix/config/pmix_setup_cli.m4 diff --git a/opal/mca/pmix/pmix4x/pmix/config/pmix_setup_hwloc.m4 b/opal/mca/pmix/pmix4x/openpmix/config/pmix_setup_hwloc.m4 similarity index 96% rename from opal/mca/pmix/pmix4x/pmix/config/pmix_setup_hwloc.m4 rename to opal/mca/pmix/pmix4x/openpmix/config/pmix_setup_hwloc.m4 index 00d7da2578..207fccc6da 100644 --- a/opal/mca/pmix/pmix4x/pmix/config/pmix_setup_hwloc.m4 +++ b/opal/mca/pmix/pmix4x/openpmix/config/pmix_setup_hwloc.m4 @@ -108,11 +108,14 @@ AC_DEFUN([_PMIX_HWLOC_EXTERNAL],[ [pmix_hwloc_support=0]) AS_IF([test "$pmix_hwloc_standard_header_location" != "yes"], - [PMIX_FLAGS_APPEND_UNIQ(CPPFLAGS, $pmix_hwloc_CPPFLAGS)]) + [PMIX_FLAGS_APPEND_UNIQ(CPPFLAGS, $pmix_hwloc_CPPFLAGS) + PMIX_WRAPPER_FLAGS_ADD(CPPFLAGS, $pmix_hwloc_CPPFLAGS)]) AS_IF([test "$pmix_hwloc_standard_lib_location" != "yes"], - [PMIX_FLAGS_APPEND_UNIQ(LDFLAGS, $pmix_hwloc_LDFLAGS)]) + [PMIX_FLAGS_APPEND_UNIQ(LDFLAGS, $pmix_hwloc_LDFLAGS) + PMIX_WRAPPER_FLAGS_ADD(LDFLAGS, $pmix_hwloc_LDFLAGS)]) PMIX_FLAGS_APPEND_UNIQ(LIBS, $pmix_hwloc_LIBS) + PMIX_WRAPPER_FLAGS_ADD(LIBS, $pmix_hwloc_LIBS) fi if test ! -z "$with_hwloc" && test "$with_hwloc" != "no" && test "$pmix_hwloc_support" != "1"; then diff --git a/opal/mca/pmix/pmix4x/pmix/config/pmix_setup_libev.m4 b/opal/mca/pmix/pmix4x/openpmix/config/pmix_setup_libev.m4 similarity index 90% rename from opal/mca/pmix/pmix4x/pmix/config/pmix_setup_libev.m4 rename to opal/mca/pmix/pmix4x/openpmix/config/pmix_setup_libev.m4 index 494cc2a2c3..f8d93fb729 100644 --- a/opal/mca/pmix/pmix4x/pmix/config/pmix_setup_libev.m4 +++ b/opal/mca/pmix/pmix4x/openpmix/config/pmix_setup_libev.m4 @@ -72,12 +72,15 @@ AC_DEFUN([PMIX_LIBEV_CONFIG],[ LIBS="$pmix_check_libev_save_LIBS"]) AS_IF([test $pmix_libev_support -eq 1], - [LIBS="$LIBS $pmix_libev_LIBS" + [PMIX_FLAGS_APPEND_UNIQ(LIBS, $pmix_libev_LIBS) + PMIX_WRAPPER_FLAGS_ADD(LIBS, $pmix_libev_LIBS) AS_IF([test "$pmix_libev_standard_header_location" != "yes"], - [CPPFLAGS="$CPPFLAGS $pmix_libev_CPPFLAGS"]) + [PMIX_FLAGS_APPEND_UNIQ(CPPFLAGS, $pmix_libev_CPPFLAGS) + PMIX_WRAPPER_FLAGS_ADD(CPPFLAGS, $pmix_libev_CPPFLAGS)]) AS_IF([test "$pmix_libev_standard_lib_location" != "yes"], - [LDFLAGS="$LDFLAGS $pmix_libev_LDFLAGS"])]) + [PMIX_FLAGS_APPEND_UNIQ(LDFLAGS, $pmix_libevent_LDFLAGS) + PMIX_WRAPPER_FLAGS_ADD(LDFLAGS, $pmix_libevent_LDFLAGS)])]) AC_MSG_CHECKING([will libev support be built]) if test $pmix_libev_support -eq 1; then diff --git a/opal/mca/pmix/pmix4x/pmix/config/pmix_setup_libevent.m4 b/opal/mca/pmix/pmix4x/openpmix/config/pmix_setup_libevent.m4 similarity index 97% rename from opal/mca/pmix/pmix4x/pmix/config/pmix_setup_libevent.m4 rename to opal/mca/pmix/pmix4x/openpmix/config/pmix_setup_libevent.m4 index 28e3a41227..1d121f68ca 100644 --- a/opal/mca/pmix/pmix4x/pmix/config/pmix_setup_libevent.m4 +++ b/opal/mca/pmix/pmix4x/openpmix/config/pmix_setup_libevent.m4 @@ -118,8 +118,11 @@ AC_DEFUN([_PMIX_LIBEVENT_EXTERNAL],[ AS_IF([test "$pmix_event_defaults" = "no"], [PMIX_FLAGS_APPEND_UNIQ(CPPFLAGS, $pmix_libevent_CPPFLAGS) - PMIX_FLAGS_APPEND_UNIQ(LDFLAGS, $pmix_libevent_LDFLAGS)]) + PMIX_WRAPPER_FLAGS_ADD(CPPFLAGS, $pmix_libevent_CPPFLAGS) + PMIX_FLAGS_APPEND_UNIQ(LDFLAGS, $pmix_libevent_LDFLAGS) + PMIX_WRAPPER_FLAGS_ADD(LDFLAGS, $pmix_libevent_LDFLAGS)]) PMIX_FLAGS_APPEND_UNIQ(LIBS, $pmix_libevent_LIBS) + PMIX_WRAPPER_FLAGS_ADD(LIBS, $pmix_libevent_LIBS) if test $pmix_libevent_support -eq 1; then # Ensure that this libevent has the symbol diff --git a/opal/mca/pmix/pmix4x/openpmix/config/pmix_setup_wrappers.m4 b/opal/mca/pmix/pmix4x/openpmix/config/pmix_setup_wrappers.m4 new file mode 100644 index 0000000000..8195ab45a2 --- /dev/null +++ b/opal/mca/pmix/pmix4x/openpmix/config/pmix_setup_wrappers.m4 @@ -0,0 +1,311 @@ +dnl -*- shell-script -*- +dnl +dnl Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana +dnl University Research and Technology +dnl Corporation. All rights reserved. +dnl Copyright (c) 2004-2005 The University of Tennessee and The University +dnl of Tennessee Research Foundation. All rights +dnl reserved. +dnl Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, +dnl University of Stuttgart. All rights reserved. +dnl Copyright (c) 2004-2005 The Regents of the University of California. +dnl All rights reserved. +dnl Copyright (c) 2006-2010 Oracle and/or its affiliates. All rights reserved. +dnl Copyright (c) 2009-2016 Cisco Systems, Inc. All rights reserved. +dnl Copyright (c) 2015-2017 Research Organization for Information Science +dnl and Technology (RIST). All rights reserved. +dnl Copyright (c) 2016 IBM Corporation. All rights reserved. +dnl Copyright (c) 2017-2019 Intel, Inc. All rights reserved. +dnl $COPYRIGHT$ +dnl +dnl Additional copyrights may follow +dnl +dnl $HEADER$ +dnl + +# PMIX_WRAPPER_FLAGS_ADD(variable, new_argument) +# ---------------------------------------------- +# Add new_argument to the list of arguments for variable in the +# wrapper compilers, if it's not already there. For example: +# PMIX_WRAPPER_FLAGS_ADD(CFLAGS, "-pthread") +# will add -pthread to the list of CFLAGS the wrappers use when invoked. +# +# This macro MAY NOT be invoked from configure macros for MCA components. +# See the comment in SETUP_WRAPPER_INIT (below) for more information. +AC_DEFUN([PMIX_WRAPPER_FLAGS_ADD], [ + m4_ifdef([mca_component_configure_active], + [m4_fatal([PMIX_WRAPPER_FLAGS_ADD can not be called from a component configure])]) + m4_if([$1], [CPPFLAGS], [PMIX_FLAGS_APPEND_UNIQ([wrapper_extra_cppflags], [$2])], + [$1], [CFLAGS], [PMIX_FLAGS_APPEND_UNIQ([wrapper_extra_cflags], [$2])], + [$1], [LDFLAGS], [PMIX_FLAGS_APPEND_UNIQ([wrapper_extra_ldflags], [$2])], + [$1], [LIBS], [PMIX_FLAGS_APPEND_UNIQ([wrapper_extra_libs], [$2])], + [m4_fatal([Unknown wrapper flag type $1])]) +]) + + +# PMIX_SETUP_WRAPPER_INIT() +# ------------------------- +# Setup wrapper compiler configuration information. Should be called early to +# prevent lots of calculations and then an abort for a silly user typo. This +# macro works in pair with PMIX_SETUP_WRAPPER_FINAL, which should be called +# almost at the end of configure (after the last call to PMIX_WRAPPER_FLAGS_ADD +# and after the MCA system has been setup). +# +# The wrapper compiler arguments are a little fragile and should NOT +# be edited by configure directly. Instead, main configure should use +# PMIX_WRAPPER_FLAGS_ADD. +# +# When building statically, the MCA system will add +# __WRAPPER_EXTRA_{LDFLAGS, LIBS} if set and try +# to add __{LDFLAGS, LIBS} (if not an external +# configure) to the wrapper LDFLAGS and LIBS. Any arguments in +# __WRAPPER_EXTRA_CPPFLAGS are passed to the +# wrapper compilers IF AND ONLY IF the framework was a STOP_AT_FIRST +# framework, the component is a static component, and devel headers +# are installed. Note that MCA components are ONLY allowed to +# (indirectly) influence the wrapper CPPFLAGS, LDFLAGS, and LIBS. +# That is, a component may not influence CFLAGS, CXXFLAGS, or FCFLAGS. +# +# Notes: +# * Keep user flags separate as 1) they should have no influence +# over build and 2) they don't go through the uniqification we do +# with the other wrapper compiler options +# * While the user (the person who runs configure) is allowed to set +# _prefix, configure is not. There's no known use case for +# doing so, and we'd like to force the issue. +AC_DEFUN([PMIX_SETUP_WRAPPER_INIT],[ + AC_ARG_WITH([wrapper-cflags], + [AC_HELP_STRING([--with-wrapper-cflags], + [Extra flags to add to CFLAGS when using mpicc])]) + AS_IF([test "$with_wrapper_cflags" = "yes" || test "$with_wrapper_cflags" = "no"], + [AC_MSG_ERROR([--with-wrapper-cflags must have an argument.])]) + + AC_ARG_WITH([wrapper-cflags-prefix], + [AC_HELP_STRING([--with-wrapper-cflags-prefix], + [Extra flags (before user flags) to add to CFLAGS when using mpicc])]) + AS_IF([test "$with_wrapper_cflags_prefix" = "yes" || test "$with_wrapper_cflags_prefix" = "no"], + [AC_MSG_ERROR([--with-wrapper-cflags-prefix must have an argument.])]) + + AC_ARG_WITH([wrapper-ldflags], + [AC_HELP_STRING([--with-wrapper-ldflags], + [Extra flags to add to LDFLAGS when using wrapper compilers])]) + AS_IF([test "$with_wrapper_ldflags" = "yes" || test "$with_wrapper_ldflags" = "no"], + [AC_MSG_ERROR([--with-wrapper-ldflags must have an argument.])]) + + AC_ARG_WITH([wrapper-libs], + [AC_HELP_STRING([--with-wrapper-libs], + [Extra flags to add to LIBS when using wrapper compilers])]) + AS_IF([test "$with_wrapper_libs" = "yes" || test "$with_wrapper_libs" = "no"], + [AC_MSG_ERROR([--with-wrapper-libs must have an argument.])]) + + AC_MSG_CHECKING([if want wrapper compiler rpath support]) + AC_ARG_ENABLE([wrapper-rpath], + [AS_HELP_STRING([--enable-wrapper-rpath], + [enable rpath/runpath support in the wrapper compilers (default=yes)])]) + AS_IF([test "$enable_wrapper_rpath" != "no"], [enable_wrapper_rpath=yes]) + AC_MSG_RESULT([$enable_wrapper_rpath]) + + AC_MSG_CHECKING([if want wrapper compiler runpath support]) + AC_ARG_ENABLE([wrapper-runpath], + [AS_HELP_STRING([--enable-wrapper-runpath], + [enable runpath in the wrapper compilers if linker supports it (default: enabled, unless wrapper-rpath is disabled).])]) + AS_IF([test "$enable_wrapper_runpath" != "no"], [enable_wrapper_runpath=yes]) + AC_MSG_RESULT([$enable_wrapper_runpath]) + + AS_IF([test "$enable_wrapper_rpath" = "no" && test "$enable_wrapper_runpath" = "yes"], + [AC_MSG_ERROR([--enable-wrapper-runpath cannot be selected with --disable-wrapper-rpath])]) +]) + +# PMIX_LIBTOOL_CONFIG(libtool-variable, result-variable, +# libtool-tag, extra-code) +# Retrieve information from the generated libtool +AC_DEFUN([PMIX_LIBTOOL_CONFIG],[ + PMIX_VAR_SCOPE_PUSH([rpath_script rpath_outfile]) + # Output goes into globally-visible variable. Run this in a + # sub-process so that we don't pollute the current process + # environment. + rpath_script=conftest.$$.sh + rpath_outfile=conftest.$$.out + rm -f $rpath_script $rpath_outfile + cat > $rpath_script < $rpath_outfile + +chmod +x $rpath_outfile +. ./$rpath_outfile +rm -f $rpath_outfile + +# Evaluate \$$1, and substitute in LIBDIR for \$libdir +$4 +flags="\`eval echo \$$1\`" +echo \$flags + +# Done +exit 0 +EOF + chmod +x $rpath_script + $2=`./$rpath_script` + rm -f $rpath_script + PMIX_VAR_SCOPE_POP +]) + +# Check to see whether the linker supports DT_RPATH. We'll need to +# use config.rpath to find the flags that it needs, if it does (see +# comments in config.rpath for an explanation of where it came from). +AC_DEFUN([PMIX_SETUP_RPATH],[ + PMIX_VAR_SCOPE_PUSH([rpath_libdir_save]) + AC_MSG_CHECKING([if linker supports RPATH]) + PMIX_LIBTOOL_CONFIG([hardcode_libdir_flag_spec],[rpath_args],[],[libdir=LIBDIR]) + + AS_IF([test -n "$rpath_args"], + [WRAPPER_RPATH_SUPPORT=rpath + PMIX_LIBTOOL_CONFIG([hardcode_libdir_flag_spec],[rpath_fc_args],[--tag=FC],[libdir=LIBDIR]) + AC_MSG_RESULT([yes ($rpath_args + $rpath_fc_args)])], + [WRAPPER_RPATH_SUPPORT=unnecessary + AC_MSG_RESULT([yes (no extra flags needed)])]) + + PMIX_VAR_SCOPE_POP + + # If we found RPATH support, check for RUNPATH support, too + AS_IF([test "$WRAPPER_RPATH_SUPPORT" = "rpath"], + [PMIX_SETUP_RUNPATH]) +]) + +# Check to see if the linker supports the DT_RUNPATH flags via +# --enable-new-dtags (a GNU ld-specific option). These flags are more +# social than DT_RPATH -- they can be overridden by LD_LIBRARY_PATH +# (where a regular DT_RPATH cannot). +# +# If DT_RUNPATH is supported, then we'll use *both* the RPATH and +# RUNPATH flags in the LDFLAGS. +AC_DEFUN([PMIX_SETUP_RUNPATH],[ + PMIX_VAR_SCOPE_PUSH([LDFLAGS_save wl_fc]) + + # Set the output in $runpath_args + runpath_args= + LDFLAGS_save=$LDFLAGS + LDFLAGS="$LDFLAGS -Wl,--enable-new-dtags" + AS_IF([test x"$enable_wrapper_runpath" = x"yes"], + [AC_LANG_PUSH([C]) + AC_MSG_CHECKING([if linker supports RUNPATH]) + AC_LINK_IFELSE([AC_LANG_PROGRAM([], [return 7;])], + [WRAPPER_RPATH_SUPPORT=runpath + runpath_args="-Wl,--enable-new-dtags" + AC_MSG_RESULT([yes (-Wl,--enable-new-dtags)])], + [AC_MSG_RESULT([no])]) + AC_LANG_POP([C])]) + LDFLAGS=$LDFLAGS_save + + PMIX_VAR_SCOPE_POP +]) + +# Called to find all -L arguments in the LDFLAGS and add in RPATH args +# for each of them. Then also add in an RPATH for @{libdir} (which +# will be replaced by the wrapper compile to the installdir libdir at +# runtime), and the RUNPATH args, if we have them. +AC_DEFUN([RPATHIFY_LDFLAGS_INTERNAL],[ + PMIX_VAR_SCOPE_PUSH([rpath_out rpath_dir rpath_tmp]) + AS_IF([test "$enable_wrapper_rpath" = "yes" && test "$WRAPPER_RPATH_SUPPORT" != "disabled" && test "$WRAPPER_RPATH_SUPPORT" != "unnecessary"], [ + rpath_out="" + for val in ${$1}; do + case $val in + -L*) + rpath_dir=`echo $val | cut -c3-` + rpath_tmp=`echo ${$2} | sed -e s@LIBDIR@$rpath_dir@` + rpath_out="$rpath_out $rpath_tmp" + ;; + esac + done + + # Now add in the RPATH args for @{libdir}, and the RUNPATH args + rpath_tmp=`echo ${$2} | sed -e s/LIBDIR/@{libdir}/` + $1="${$1} $rpath_out $rpath_tmp ${$3}" + ]) + PMIX_VAR_SCOPE_POP +]) + +AC_DEFUN([RPATHIFY_LDFLAGS],[RPATHIFY_LDFLAGS_INTERNAL([$1], [rpath_args], [runpath_args])]) + +AC_DEFUN([RPATHIFY_FC_LDFLAGS],[RPATHIFY_LDFLAGS_INTERNAL([$1], [rpath_fc_args], [runpath_fc_args])]) + +dnl +dnl Avoid some repetitive code below +dnl +AC_DEFUN([_PMIX_SETUP_WRAPPER_FINAL_PKGCONFIG],[ + AC_MSG_CHECKING([for $1 pkg-config LDFLAGS]) + $1_PKG_CONFIG_LDFLAGS=`echo "$$1_WRAPPER_EXTRA_LDFLAGS" | sed -e 's/@{libdir}/\${libdir}/g'` + AC_SUBST([$1_PKG_CONFIG_LDFLAGS]) + AC_MSG_RESULT([$$1_PKG_CONFIG_LDFLAGS]) +]) + + +# PMIX_SETUP_WRAPPER_FINAL() +# --------------------------- +AC_DEFUN([PMIX_SETUP_WRAPPER_FINAL],[ + + # Setup RPATH support, if desired + WRAPPER_RPATH_SUPPORT=disabled + AS_IF([test "$enable_wrapper_rpath" = "yes"], + [PMIX_SETUP_RPATH]) + AS_IF([test "$enable_wrapper_rpath" = "yes" && test "$WRAPPER_RPATH_SUPPORT" = "disabled"], + [AC_MSG_WARN([RPATH support requested but not available]) + AC_MSG_ERROR([Cannot continue])]) + + # Note that we have to setup _PKG_CONFIG_LDFLAGS for the + # pkg-config files to parallel the + # _WRAPPER_EXTRA_LDFLAGS. This is because pkg-config + # will not understand the @{libdir} notation in + # *_WRAPPER_EXTRA_LDFLAGS; we have to translate it to ${libdir}. + + # We now have all relevant flags. Substitute them in everywhere. + AC_MSG_CHECKING([for PMIX CPPFLAGS]) + if test "$WANT_INSTALL_HEADERS" = "1" ; then + PMIX_WRAPPER_EXTRA_CPPFLAGS='-I${includedir}' + fi + PMIX_WRAPPER_EXTRA_CPPFLAGS="$PMIX_WRAPPER_EXTRA_CPPFLAGS $pmix_mca_wrapper_extra_cppflags $wrapper_extra_cppflags $with_wrapper_cppflags" + PMIX_FLAGS_UNIQ(PMIX_WRAPPER_EXTRA_CPPFLAGS) + AC_SUBST([PMIX_WRAPPER_EXTRA_CPPFLAGS]) + AC_MSG_RESULT([$PMIX_WRAPPER_EXTRA_CPPFLAGS]) + + AC_MSG_CHECKING([for PMIX CFLAGS]) + PMIX_WRAPPER_EXTRA_CFLAGS="$wrapper_extra_cflags $with_wrapper_cflags" + PMIX_FLAGS_UNIQ(PMIX_WRAPPER_EXTRA_CFLAGS) + AC_SUBST([PMIX_WRAPPER_EXTRA_CFLAGS]) + AC_MSG_RESULT([$PMIX_WRAPPER_EXTRA_CFLAGS]) + + AC_MSG_CHECKING([for PMIX CFLAGS_PREFIX]) + PMIX_WRAPPER_EXTRA_CFLAGS_PREFIX="$with_wrapper_cflags_prefix" + PMIX_FLAGS_UNIQ(PMIX_WRAPPER_EXTRA_CFLAGS_PREFIX) + AC_SUBST([PMIX_WRAPPER_EXTRA_CFLAGS_PREFIX]) + AC_MSG_RESULT([$PMIX_WRAPPER_EXTRA_CFLAGS_PREFIX]) + + AC_MSG_CHECKING([for PMIX LDFLAGS]) + PMIX_WRAPPER_EXTRA_LDFLAGS="$pmix_mca_wrapper_extra_ldflags $wrapper_extra_ldflags $with_wrapper_ldflags" + PMIX_FLAGS_UNIQ(PMIX_WRAPPER_EXTRA_LDFLAGS) + RPATHIFY_LDFLAGS([PMIX_WRAPPER_EXTRA_LDFLAGS]) + AC_SUBST([PMIX_WRAPPER_EXTRA_LDFLAGS]) + AC_MSG_RESULT([$PMIX_WRAPPER_EXTRA_LDFLAGS]) + + # Convert @{libdir} to ${libdir} for pkg-config + _PMIX_SETUP_WRAPPER_FINAL_PKGCONFIG([PMIX]) + + # wrapper_extra_libs doesn't really get populated until after the mca system runs + # since most of the libs come from libtool. So this is the first time we can + # uniq them. ROMIO in particular adds lots of things already in wrapper_extra_libs, + # and this cleans the duplication up a bunch. Always add everything the user + # asked for, as they know better than us. + AC_MSG_CHECKING([for PMIX LIBS]) + PMIX_WRAPPER_EXTRA_LIBS="$pmix_mca_wrapper_extra_libs" + PMIX_FLAGS_APPEND_UNIQ([PMIX_WRAPPER_EXTRA_LIBS], [$wrapper_extra_libs]) + PMIX_WRAPPER_EXTRA_LIBS="$PMIX_WRAPPER_EXTRA_LIBS $with_wrapper_libs" + PMIX_FLAGS_UNIQ(PMIX_WRAPPER_EXTRA_LIBS) + AC_SUBST([PMIX_WRAPPER_EXTRA_LIBS]) + AC_MSG_RESULT([$PMIX_WRAPPER_EXTRA_LIBS]) +]) diff --git a/opal/mca/pmix/pmix4x/pmix/config/pmix_summary.m4 b/opal/mca/pmix/pmix4x/openpmix/config/pmix_summary.m4 similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/config/pmix_summary.m4 rename to opal/mca/pmix/pmix4x/openpmix/config/pmix_summary.m4 diff --git a/opal/mca/pmix/pmix4x/pmix/config/pmix_try_assemble.m4 b/opal/mca/pmix/pmix4x/openpmix/config/pmix_try_assemble.m4 similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/config/pmix_try_assemble.m4 rename to opal/mca/pmix/pmix4x/openpmix/config/pmix_try_assemble.m4 diff --git a/opal/mca/pmix/pmix4x/pmix/configure.ac b/opal/mca/pmix/pmix4x/openpmix/configure.ac similarity index 99% rename from opal/mca/pmix/pmix4x/pmix/configure.ac rename to opal/mca/pmix/pmix4x/openpmix/configure.ac index 0e1ae0465e..23b70218f2 100644 --- a/opal/mca/pmix/pmix4x/pmix/configure.ac +++ b/opal/mca/pmix/pmix4x/openpmix/configure.ac @@ -176,6 +176,7 @@ AS_IF([test ! -z "$enable_static" && test "$enable_static" = "yes"], AM_ENABLE_SHARED AM_DISABLE_STATIC +PMIX_SETUP_WRAPPER_INIT # This did not exist pre AM 1.11.x (where x is somewhere >0 and <3), # but it is necessary in AM 1.12.x. diff --git a/opal/mca/pmix/pmix4x/pmix/contrib/Makefile.am b/opal/mca/pmix/pmix4x/openpmix/contrib/Makefile.am similarity index 91% rename from opal/mca/pmix/pmix4x/pmix/contrib/Makefile.am rename to opal/mca/pmix/pmix4x/openpmix/contrib/Makefile.am index 2086924a85..8b99100add 100644 --- a/opal/mca/pmix/pmix4x/pmix/contrib/Makefile.am +++ b/opal/mca/pmix/pmix4x/openpmix/contrib/Makefile.am @@ -14,7 +14,7 @@ # Copyright (c) 2010-2011 Oak Ridge National Labs. All rights reserved. # Copyright (c) 2013-2016 Los Alamos National Security, Inc. All rights # reserved. -# Copyright (c) 2013-2016 Intel, Inc. All rights reserved. +# Copyright (c) 2013-2019 Intel, Inc. All rights reserved. # $COPYRIGHT$ # # Additional copyrights may follow @@ -30,7 +30,8 @@ EXTRA_DIST = \ pmix-release.sh \ pmix.spec \ update-my-copyright.pl \ - whitespace-purge.sh + whitespace-purge.sh \ + make_manpage.pl include perf_tools/Makefile.include diff --git a/opal/mca/pmix/pmix4x/pmix/contrib/buildrpm.sh b/opal/mca/pmix/pmix4x/openpmix/contrib/buildrpm.sh similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/contrib/buildrpm.sh rename to opal/mca/pmix/pmix4x/openpmix/contrib/buildrpm.sh diff --git a/opal/mca/pmix/pmix4x/pmix/contrib/make_dist_tarball b/opal/mca/pmix/pmix4x/openpmix/contrib/make_dist_tarball similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/contrib/make_dist_tarball rename to opal/mca/pmix/pmix4x/openpmix/contrib/make_dist_tarball diff --git a/opal/mca/pmix/pmix4x/openpmix/contrib/make_manpage.pl b/opal/mca/pmix/pmix4x/openpmix/contrib/make_manpage.pl new file mode 100755 index 0000000000..7a2c2de169 --- /dev/null +++ b/opal/mca/pmix/pmix4x/openpmix/contrib/make_manpage.pl @@ -0,0 +1,56 @@ +#!/usr/bin/env perl +# +# Copyright (c) 2015 Research Organization for Information Science +# and Technology (RIST). All rights reserved. +# Copyright (c) 2015 Cisco Systems, Inc. All rights reserved. +# Copyright (c) 2016-2019 Intel, Inc. All rights reserved. +# $COPYRIGHT$ +# +# Subroutine to generate a bunch of Fortran declarations and symbols +# + +use strict; + +use Getopt::Long; + +my $package_name; +my $package_version; +my $pmix_date; +my $input; +my $output; +my $help_arg = 0; + +&Getopt::Long::Configure("bundling"); +my $ok = Getopt::Long::GetOptions("package-name=s" => \$package_name, + "package-version=s" => \$package_version, + "pmix-date=s" => \$pmix_date, + "input=s" => \$input, + "output=s" => \$output); + +if ($help_arg || !$ok || + !defined($input) || + !defined($output) || + !defined($package_name) || + !defined($package_version) || + !defined($pmix_date)) { + print "Usage: $0 --package-name= --package-version= --pmix-date= --input= --output=\n"; + exit(1 - $ok); +} + +open(FILE, $input) || + die "Can't open $input"; +my $file; +$file .= $_ + while(); +close(FILE); + +$file =~ s/#PACKAGE_NAME#/$package_name/g; +$file =~ s/#PACKAGE_VERSION#/$package_version/g; +$file =~ s/#PMIX_DATE#/$pmix_date/g; + +open(FILE, ">$output") || + die "Can't open $output"; +print FILE $file; +close(FILE); + +exit(0); diff --git a/opal/mca/pmix/pmix4x/pmix/contrib/perf_tools/Makefile b/opal/mca/pmix/pmix4x/openpmix/contrib/perf_tools/Makefile similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/contrib/perf_tools/Makefile rename to opal/mca/pmix/pmix4x/openpmix/contrib/perf_tools/Makefile diff --git a/opal/mca/pmix/pmix4x/pmix/contrib/perf_tools/Makefile.include b/opal/mca/pmix/pmix4x/openpmix/contrib/perf_tools/Makefile.include similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/contrib/perf_tools/Makefile.include rename to opal/mca/pmix/pmix4x/openpmix/contrib/perf_tools/Makefile.include diff --git a/opal/mca/pmix/pmix4x/pmix/contrib/perf_tools/README b/opal/mca/pmix/pmix4x/openpmix/contrib/perf_tools/README similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/contrib/perf_tools/README rename to opal/mca/pmix/pmix4x/openpmix/contrib/perf_tools/README diff --git a/opal/mca/pmix/pmix4x/pmix/contrib/perf_tools/pmi.h b/opal/mca/pmix/pmix4x/openpmix/contrib/perf_tools/pmi.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/contrib/perf_tools/pmi.h rename to opal/mca/pmix/pmix4x/openpmix/contrib/perf_tools/pmi.h diff --git a/opal/mca/pmix/pmix4x/pmix/contrib/perf_tools/pmi2.c b/opal/mca/pmix/pmix4x/openpmix/contrib/perf_tools/pmi2.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/contrib/perf_tools/pmi2.c rename to opal/mca/pmix/pmix4x/openpmix/contrib/perf_tools/pmi2.c diff --git a/opal/mca/pmix/pmix4x/pmix/contrib/perf_tools/pmi2_pmap_parser.c b/opal/mca/pmix/pmix4x/openpmix/contrib/perf_tools/pmi2_pmap_parser.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/contrib/perf_tools/pmi2_pmap_parser.c rename to opal/mca/pmix/pmix4x/openpmix/contrib/perf_tools/pmi2_pmap_parser.c diff --git a/opal/mca/pmix/pmix4x/pmix/contrib/perf_tools/pmi2_pmap_parser.h b/opal/mca/pmix/pmix4x/openpmix/contrib/perf_tools/pmi2_pmap_parser.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/contrib/perf_tools/pmi2_pmap_parser.h rename to opal/mca/pmix/pmix4x/openpmix/contrib/perf_tools/pmi2_pmap_parser.h diff --git a/opal/mca/pmix/pmix4x/pmix/contrib/perf_tools/pmi2_utils.c b/opal/mca/pmix/pmix4x/openpmix/contrib/perf_tools/pmi2_utils.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/contrib/perf_tools/pmi2_utils.c rename to opal/mca/pmix/pmix4x/openpmix/contrib/perf_tools/pmi2_utils.c diff --git a/opal/mca/pmix/pmix4x/pmix/contrib/perf_tools/pmi2_utils.h b/opal/mca/pmix/pmix4x/openpmix/contrib/perf_tools/pmi2_utils.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/contrib/perf_tools/pmi2_utils.h rename to opal/mca/pmix/pmix4x/openpmix/contrib/perf_tools/pmi2_utils.h diff --git a/opal/mca/pmix/pmix4x/pmix/contrib/perf_tools/pmi_intra_perf.c b/opal/mca/pmix/pmix4x/openpmix/contrib/perf_tools/pmi_intra_perf.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/contrib/perf_tools/pmi_intra_perf.c rename to opal/mca/pmix/pmix4x/openpmix/contrib/perf_tools/pmi_intra_perf.c diff --git a/opal/mca/pmix/pmix4x/pmix/contrib/perf_tools/pmix.c b/opal/mca/pmix/pmix4x/openpmix/contrib/perf_tools/pmix.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/contrib/perf_tools/pmix.c rename to opal/mca/pmix/pmix4x/openpmix/contrib/perf_tools/pmix.c diff --git a/opal/mca/pmix/pmix4x/pmix/contrib/perf_tools/run.sh b/opal/mca/pmix/pmix4x/openpmix/contrib/perf_tools/run.sh similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/contrib/perf_tools/run.sh rename to opal/mca/pmix/pmix4x/openpmix/contrib/perf_tools/run.sh diff --git a/opal/mca/pmix/pmix4x/pmix/contrib/platform/optimized b/opal/mca/pmix/pmix4x/openpmix/contrib/platform/optimized similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/contrib/platform/optimized rename to opal/mca/pmix/pmix4x/openpmix/contrib/platform/optimized diff --git a/opal/mca/pmix/pmix4x/pmix/contrib/pmix-release.sh b/opal/mca/pmix/pmix4x/openpmix/contrib/pmix-release.sh similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/contrib/pmix-release.sh rename to opal/mca/pmix/pmix4x/openpmix/contrib/pmix-release.sh diff --git a/opal/mca/pmix/pmix4x/pmix/contrib/pmix-valgrind.supp b/opal/mca/pmix/pmix4x/openpmix/contrib/pmix-valgrind.supp similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/contrib/pmix-valgrind.supp rename to opal/mca/pmix/pmix4x/openpmix/contrib/pmix-valgrind.supp diff --git a/opal/mca/pmix/pmix4x/pmix/contrib/pmix.spec b/opal/mca/pmix/pmix4x/openpmix/contrib/pmix.spec similarity index 99% rename from opal/mca/pmix/pmix4x/pmix/contrib/pmix.spec rename to opal/mca/pmix/pmix4x/openpmix/contrib/pmix.spec index 498899125c..1b53681a31 100644 --- a/opal/mca/pmix/pmix4x/pmix/contrib/pmix.spec +++ b/opal/mca/pmix/pmix4x/openpmix/contrib/pmix.spec @@ -12,7 +12,7 @@ # Copyright (c) 2006-2016 Cisco Systems, Inc. All rights reserved. # Copyright (c) 2013 Mellanox Technologies, Inc. # All rights reserved. -# Copyright (c) 2015-2019 Intel, Inc. All rights reserved. +# Copyright (c) 2015-2018 Intel, Inc. All rights reserved. # Copyright (c) 2015 Research Organization for Information Science # and Technology (RIST). All rights reserved. # $COPYRIGHT$ @@ -192,7 +192,7 @@ Summary: An extended/exascale implementation of PMI Name: %{?_name:%{_name}}%{!?_name:pmix} -Version: 4.0.0 +Version: 4.0.0a1 Release: 1%{?dist} License: BSD Group: Development/Libraries diff --git a/opal/mca/pmix/pmix4x/pmix/contrib/pmix_jenkins.sh b/opal/mca/pmix/pmix4x/openpmix/contrib/pmix_jenkins.sh similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/contrib/pmix_jenkins.sh rename to opal/mca/pmix/pmix4x/openpmix/contrib/pmix_jenkins.sh diff --git a/opal/mca/pmix/pmix4x/pmix/contrib/update-my-copyright.pl b/opal/mca/pmix/pmix4x/openpmix/contrib/update-my-copyright.pl similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/contrib/update-my-copyright.pl rename to opal/mca/pmix/pmix4x/openpmix/contrib/update-my-copyright.pl diff --git a/opal/mca/pmix/pmix4x/pmix/contrib/whitespace-purge.sh b/opal/mca/pmix/pmix4x/openpmix/contrib/whitespace-purge.sh similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/contrib/whitespace-purge.sh rename to opal/mca/pmix/pmix4x/openpmix/contrib/whitespace-purge.sh diff --git a/opal/mca/pmix/pmix4x/pmix/etc/Makefile.am b/opal/mca/pmix/pmix4x/openpmix/etc/Makefile.am similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/etc/Makefile.am rename to opal/mca/pmix/pmix4x/openpmix/etc/Makefile.am diff --git a/opal/mca/pmix/pmix4x/pmix/etc/pmix-mca-params.conf b/opal/mca/pmix/pmix4x/openpmix/etc/pmix-mca-params.conf similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/etc/pmix-mca-params.conf rename to opal/mca/pmix/pmix4x/openpmix/etc/pmix-mca-params.conf diff --git a/opal/mca/pmix/pmix4x/pmix/examples/Makefile.am b/opal/mca/pmix/pmix4x/openpmix/examples/Makefile.am similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/examples/Makefile.am rename to opal/mca/pmix/pmix4x/openpmix/examples/Makefile.am diff --git a/opal/mca/pmix/pmix4x/pmix/examples/alloc.c b/opal/mca/pmix/pmix4x/openpmix/examples/alloc.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/examples/alloc.c rename to opal/mca/pmix/pmix4x/openpmix/examples/alloc.c diff --git a/opal/mca/pmix/pmix4x/pmix/examples/asyncgroup.c b/opal/mca/pmix/pmix4x/openpmix/examples/asyncgroup.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/examples/asyncgroup.c rename to opal/mca/pmix/pmix4x/openpmix/examples/asyncgroup.c diff --git a/opal/mca/pmix/pmix4x/pmix/examples/client.c b/opal/mca/pmix/pmix4x/openpmix/examples/client.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/examples/client.c rename to opal/mca/pmix/pmix4x/openpmix/examples/client.c diff --git a/opal/mca/pmix/pmix4x/pmix/examples/client2.c b/opal/mca/pmix/pmix4x/openpmix/examples/client2.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/examples/client2.c rename to opal/mca/pmix/pmix4x/openpmix/examples/client2.c diff --git a/opal/mca/pmix/pmix4x/pmix/examples/debugger.c b/opal/mca/pmix/pmix4x/openpmix/examples/debugger.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/examples/debugger.c rename to opal/mca/pmix/pmix4x/openpmix/examples/debugger.c diff --git a/opal/mca/pmix/pmix4x/pmix/examples/debuggerd.c b/opal/mca/pmix/pmix4x/openpmix/examples/debuggerd.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/examples/debuggerd.c rename to opal/mca/pmix/pmix4x/openpmix/examples/debuggerd.c diff --git a/opal/mca/pmix/pmix4x/openpmix/examples/dmodex.c b/opal/mca/pmix/pmix4x/openpmix/examples/dmodex.c new file mode 100644 index 0000000000..8a95a405b7 --- /dev/null +++ b/opal/mca/pmix/pmix4x/openpmix/examples/dmodex.c @@ -0,0 +1,215 @@ +/* + * Copyright (c) 2004-2010 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2011 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, + * University of Stuttgart. All rights reserved. + * Copyright (c) 2004-2005 The Regents of the University of California. + * All rights reserved. + * Copyright (c) 2006-2013 Los Alamos National Security, LLC. + * All rights reserved. + * Copyright (c) 2009-2012 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2011 Oak Ridge National Labs. All rights reserved. + * Copyright (c) 2013-2019 Intel, Inc. All rights reserved. + * Copyright (c) 2015 Mellanox Technologies, Inc. All rights reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + * + */ + +#include +#include + +#include +#include +#include +#include + +static uint32_t nprocs; +static pmix_proc_t myproc; + +int main(int argc, char **argv) +{ + int rc; + pmix_value_t value; + pmix_value_t *val = &value; + char *tmp; + pmix_proc_t proc; + uint32_t n, k, nlocal; + bool local, all_local; + char **peers; + pmix_rank_t *locals; + uint8_t j; + + /* init us */ + if (PMIX_SUCCESS != (rc = PMIx_Init(&myproc, NULL, 0))) { + fprintf(stderr, "Client ns %s rank %d: PMIx_Init failed: %d\n", myproc.nspace, myproc.rank, rc); + exit(0); + } + fprintf(stderr, "Client ns %s rank %d: Running\n", myproc.nspace, myproc.rank); + + /* get our job size */ + (void)strncpy(proc.nspace, myproc.nspace, PMIX_MAX_NSLEN); + proc.rank = PMIX_RANK_WILDCARD; + if (PMIX_SUCCESS != (rc = PMIx_Get(&proc, PMIX_JOB_SIZE, NULL, 0, &val))) { + fprintf(stderr, "Client ns %s rank %d: PMIx_Get job size failed: %s\n", + myproc.nspace, myproc.rank, PMIx_Error_string(rc)); + goto done; + } + nprocs = val->data.uint32; + PMIX_VALUE_RELEASE(val); + fprintf(stderr, "Client %s:%d job size %d\n", myproc.nspace, myproc.rank, nprocs); + + /* put a few values */ + (void)asprintf(&tmp, "%s-%d-internal", myproc.nspace, myproc.rank); + value.type = PMIX_UINT32; + value.data.uint32 = 1234; + if (PMIX_SUCCESS != (rc = PMIx_Store_internal(&myproc, tmp, &value))) { + fprintf(stderr, "Client ns %s rank %d: PMIx_Store_internal failed: %d\n", myproc.nspace, myproc.rank, rc); + goto done; + } + + (void)asprintf(&tmp, "%s-%d-local", myproc.nspace, myproc.rank); + value.type = PMIX_UINT64; + value.data.uint64 = 1234; + if (PMIX_SUCCESS != (rc = PMIx_Put(PMIX_LOCAL, tmp, &value))) { + fprintf(stderr, "Client ns %s rank %d: PMIx_Put internal failed: %d\n", myproc.nspace, myproc.rank, rc); + goto done; + } + + (void)asprintf(&tmp, "%s-%d-remote", myproc.nspace, myproc.rank); + value.type = PMIX_STRING; + value.data.string = "1234"; + if (PMIX_SUCCESS != (rc = PMIx_Put(PMIX_GLOBAL, tmp, &value))) { + fprintf(stderr, "Client ns %s rank %d: PMIx_Put internal failed: %d\n", myproc.nspace, myproc.rank, rc); + goto done; + } + + value.type = PMIX_BYTE_OBJECT; + value.data.bo.bytes = (char*)malloc(128); + for (j=0; j < 128; j++) { + value.data.bo.bytes[j] = j; + } + value.data.bo.size = 128; + if (PMIX_SUCCESS != (rc = PMIx_Put(PMIX_GLOBAL, "ghex", &value))) { + fprintf(stderr, "Client ns %s rank %d: PMIx_Put ghex failed: %d\n", myproc.nspace, myproc.rank, rc); + PMIX_VALUE_DESTRUCT(&value); + goto done; + } + PMIX_VALUE_DESTRUCT(&value); + + /* commit the data to the server */ + if (PMIX_SUCCESS != (rc = PMIx_Commit())) { + fprintf(stderr, "Client ns %s rank %d: PMIx_Commit failed: %d\n", myproc.nspace, myproc.rank, rc); + goto done; + } + + /* get a list of our local peers */ + if (PMIX_SUCCESS != (rc = PMIx_Get(&proc, PMIX_LOCAL_PEERS, NULL, 0, &val))) { + fprintf(stderr, "Client ns %s rank %d: PMIx_Get local peers failed: %s\n", + myproc.nspace, myproc.rank, PMIx_Error_string(rc)); + goto done; + } + /* split the returned string to get the rank of each local peer */ + peers = pmix_argv_split(val->data.string, ','); + PMIX_VALUE_RELEASE(val); + nlocal = pmix_argv_count(peers); + if (nprocs == nlocal) { + all_local = true; + } else { + all_local = false; + locals = (pmix_rank_t*)malloc(pmix_argv_count(peers) * sizeof(pmix_rank_t)); + for (n=0; NULL != peers[n]; n++) { + locals[n] = strtoul(peers[n], NULL, 10); + } + } + pmix_argv_free(peers); + + /* get the committed data - ask for someone who doesn't exist as well */ + for (n=0; n < nprocs; n++) { + if (all_local) { + local = true; + } else { + local = false; + /* see if this proc is local to us */ + for (k=0; k < nlocal; k++) { + if (proc.rank == locals[k]) { + local = true; + break; + } + } + } + if (local) { + (void)asprintf(&tmp, "%s-%d-local", myproc.nspace, n); + proc.rank = n; + if (PMIX_SUCCESS != (rc = PMIx_Get(&proc, tmp, NULL, 0, &val))) { + fprintf(stderr, "Client ns %s rank %d: PMIx_Get %s failed: %d\n", myproc.nspace, n, tmp, rc); + goto done; + } + if (PMIX_UINT64 != val->type) { + fprintf(stderr, "%s:%d: PMIx_Get Key %s returned wrong type: %d\n", myproc.nspace, myproc.rank, tmp, val->type); + goto done; + } + if (1234 != val->data.uint64) { + fprintf(stderr, "%s:%d: PMIx_Get Key %s returned wrong value: %d\n", myproc.nspace, myproc.rank, tmp, (int)val->data.uint64); + goto done; + } + fprintf(stderr, "%s:%d Local value for %s:%d successfully retrieved\n", myproc.nspace, myproc.rank, proc.nspace, proc.rank); + } else { + (void)asprintf(&tmp, "%s-%d-remote", myproc.nspace, n); + if (PMIX_SUCCESS != (rc = PMIx_Get(&proc, tmp, NULL, 0, &val))) { + fprintf(stderr, "Client ns %s rank %d: PMIx_Get %s failed: %d\n", myproc.nspace, n, tmp, rc); + goto done; + } + if (PMIX_STRING != val->type) { + fprintf(stderr, "%s:%d: PMIx_Get Key %s returned wrong type: %d\n", myproc.nspace, myproc.rank, tmp, val->type); + goto done; + } + if (0 != strcmp(val->data.string, "1234")) { + fprintf(stderr, "%s:%d: PMIx_Get Key %s returned wrong value: %s\n", myproc.nspace, myproc.rank, tmp, val->data.string); + goto done; + } + fprintf(stderr, "%s:%d Remote value for %s:%d successfully retrieved\n", myproc.nspace, myproc.rank, proc.nspace, proc.rank); + } + /* if this isn't us, then get the ghex key */ + if (n != myproc.rank) { + if (PMIX_SUCCESS != (rc = PMIx_Get(&proc, "ghex", NULL, 0, &val))) { + fprintf(stderr, "Client ns %s rank %d: PMIx_Get ghex failed: %d\n", myproc.nspace, n, rc); + goto done; + } + if (PMIX_BYTE_OBJECT != val->type) { + fprintf(stderr, "%s:%d: PMIx_Get ghex returned wrong type: %d\n", myproc.nspace, myproc.rank, val->type); + goto done; + } + if (128 != val->data.bo.size) { + fprintf(stderr, "%s:%d: PMIx_Get ghex returned wrong size: %d\n", myproc.nspace, myproc.rank, (int)val->data.bo.size); + goto done; + } + fprintf(stderr, "%s:%d Ghex for %s:%d successfully retrieved\n", myproc.nspace, myproc.rank, proc.nspace, proc.rank); + } + } + + /* call fence so everyone waits before leaving */ + proc.rank = PMIX_RANK_WILDCARD; + if (PMIX_SUCCESS != (rc = PMIx_Fence(&proc, 1, NULL, 0))) { + fprintf(stderr, "Client ns %s rank %d: PMIx_Fence failed: %d\n", myproc.nspace, myproc.rank, rc); + goto done; + } + + done: + /* finalize us */ + fprintf(stderr, "Client ns %s rank %d: Finalizing\n", myproc.nspace, myproc.rank); + if (PMIX_SUCCESS != (rc = PMIx_Finalize(NULL, 0))) { + fprintf(stderr, "Client ns %s rank %d:PMIx_Finalize failed: %d\n", myproc.nspace, myproc.rank, rc); + } else { + fprintf(stderr, "Client ns %s rank %d:PMIx_Finalize successfully completed\n", myproc.nspace, myproc.rank); + } + fflush(stderr); + return(0); +} diff --git a/opal/mca/pmix/pmix4x/pmix/examples/dynamic.c b/opal/mca/pmix/pmix4x/openpmix/examples/dynamic.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/examples/dynamic.c rename to opal/mca/pmix/pmix4x/openpmix/examples/dynamic.c diff --git a/opal/mca/pmix/pmix4x/pmix/examples/examples.h b/opal/mca/pmix/pmix4x/openpmix/examples/examples.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/examples/examples.h rename to opal/mca/pmix/pmix4x/openpmix/examples/examples.h diff --git a/opal/mca/pmix/pmix4x/pmix/examples/fault.c b/opal/mca/pmix/pmix4x/openpmix/examples/fault.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/examples/fault.c rename to opal/mca/pmix/pmix4x/openpmix/examples/fault.c diff --git a/opal/mca/pmix/pmix4x/pmix/examples/group.c b/opal/mca/pmix/pmix4x/openpmix/examples/group.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/examples/group.c rename to opal/mca/pmix/pmix4x/openpmix/examples/group.c diff --git a/opal/mca/pmix/pmix4x/pmix/examples/jctrl.c b/opal/mca/pmix/pmix4x/openpmix/examples/jctrl.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/examples/jctrl.c rename to opal/mca/pmix/pmix4x/openpmix/examples/jctrl.c diff --git a/opal/mca/pmix/pmix4x/pmix/examples/pub.c b/opal/mca/pmix/pmix4x/openpmix/examples/pub.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/examples/pub.c rename to opal/mca/pmix/pmix4x/openpmix/examples/pub.c diff --git a/opal/mca/pmix/pmix4x/pmix/examples/pubi.c b/opal/mca/pmix/pmix4x/openpmix/examples/pubi.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/examples/pubi.c rename to opal/mca/pmix/pmix4x/openpmix/examples/pubi.c diff --git a/opal/mca/pmix/pmix4x/pmix/examples/server.c b/opal/mca/pmix/pmix4x/openpmix/examples/server.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/examples/server.c rename to opal/mca/pmix/pmix4x/openpmix/examples/server.c diff --git a/opal/mca/pmix/pmix4x/pmix/examples/tool.c b/opal/mca/pmix/pmix4x/openpmix/examples/tool.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/examples/tool.c rename to opal/mca/pmix/pmix4x/openpmix/examples/tool.c diff --git a/opal/mca/pmix/pmix4x/pmix/include/Makefile.am b/opal/mca/pmix/pmix4x/openpmix/include/Makefile.am similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/include/Makefile.am rename to opal/mca/pmix/pmix4x/openpmix/include/Makefile.am diff --git a/opal/mca/pmix/pmix4x/pmix/include/pmi.h b/opal/mca/pmix/pmix4x/openpmix/include/pmi.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/include/pmi.h rename to opal/mca/pmix/pmix4x/openpmix/include/pmi.h diff --git a/opal/mca/pmix/pmix4x/pmix/include/pmi2.h b/opal/mca/pmix/pmix4x/openpmix/include/pmi2.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/include/pmi2.h rename to opal/mca/pmix/pmix4x/openpmix/include/pmi2.h diff --git a/opal/mca/pmix/pmix4x/pmix/include/pmix.h b/opal/mca/pmix/pmix4x/openpmix/include/pmix.h similarity index 96% rename from opal/mca/pmix/pmix4x/pmix/include/pmix.h rename to opal/mca/pmix/pmix4x/openpmix/include/pmix.h index 2137deafb7..0075438c02 100644 --- a/opal/mca/pmix/pmix4x/pmix/include/pmix.h +++ b/opal/mca/pmix/pmix4x/openpmix/include/pmix.h @@ -474,7 +474,8 @@ PMIX_EXPORT pmix_status_t PMIx_Log_nb(const pmix_info_t data[], size_t ndata, * previously released is included. */ PMIX_EXPORT pmix_status_t PMIx_Allocation_request(pmix_alloc_directive_t directive, - pmix_info_t *info, size_t ninfo); + pmix_info_t *info, size_t ninfo, + pmix_info_t **results, size_t *nresults); PMIX_EXPORT pmix_status_t PMIx_Allocation_request_nb(pmix_alloc_directive_t directive, pmix_info_t *info, size_t ninfo, @@ -495,7 +496,8 @@ PMIX_EXPORT pmix_status_t PMIx_Allocation_request_nb(pmix_alloc_directive_t dire * any provided pmix_info_t array. */ PMIX_EXPORT pmix_status_t PMIx_Job_control(const pmix_proc_t targets[], size_t ntargets, - const pmix_info_t directives[], size_t ndirs); + const pmix_info_t directives[], size_t ndirs, + pmix_info_t **results, size_t *nresults); PMIX_EXPORT pmix_status_t PMIx_Job_control_nb(const pmix_proc_t targets[], size_t ntargets, const pmix_info_t directives[], size_t ndirs, @@ -529,7 +531,8 @@ PMIX_EXPORT pmix_status_t PMIx_Job_control_nb(const pmix_proc_t targets[], size_ * Note: a process can send a heartbeat to the server using the PMIx_Heartbeat * macro provided below*/ PMIX_EXPORT pmix_status_t PMIx_Process_monitor(const pmix_info_t *monitor, pmix_status_t error, - const pmix_info_t directives[], size_t ndirs); + const pmix_info_t directives[], size_t ndirs, + pmix_info_t **results, size_t *nresults); PMIX_EXPORT pmix_status_t PMIx_Process_monitor_nb(const pmix_info_t *monitor, pmix_status_t error, const pmix_info_t directives[], size_t ndirs, @@ -573,8 +576,10 @@ PMIX_EXPORT pmix_status_t PMIx_Process_monitor_nb(const pmix_info_t *monitor, pm * will _not_ be called in such cases. */ PMIX_EXPORT pmix_status_t PMIx_Get_credential(const pmix_info_t info[], size_t ninfo, - pmix_credential_cbfunc_t cbfunc, void *cbdata); + pmix_byte_object_t *credential); +PMIX_EXPORT pmix_status_t PMIx_Get_credential_nb(const pmix_info_t info[], size_t ninfo, + pmix_credential_cbfunc_t cbfunc, void *cbdata); /* Request validation of a credential by the PMIx server/SMS * Input values include: @@ -607,7 +612,11 @@ PMIX_EXPORT pmix_status_t PMIx_Get_credential(const pmix_info_t info[], size_t n */ PMIX_EXPORT pmix_status_t PMIx_Validate_credential(const pmix_byte_object_t *cred, const pmix_info_t info[], size_t ninfo, - pmix_validation_cbfunc_t cbfunc, void *cbdata); + pmix_info_t **results, size_t *nresults); + +PMIX_EXPORT pmix_status_t PMIx_Validate_credential_nb(const pmix_byte_object_t *cred, + const pmix_info_t info[], size_t ninfo, + pmix_validation_cbfunc_t cbfunc, void *cbdata); /* Define a callback function for delivering forwarded IO to a process * This function will be called whenever data becomes available, or a @@ -663,6 +672,11 @@ PMIX_EXPORT pmix_status_t PMIx_Validate_credential(const pmix_byte_object_t *cre * a non-success error if the registration cannot * be submitted - in this case, the regcbfunc * will _not_ be called. + * If regcbfunc is NULL, then this will be treated + * as a BLOCKING call - a positive return value + * represents the reference ID for the request, + * while negative values indicate the corresponding + * error * * cbdata - pointer to object to be returned in regcbfunc */ @@ -685,7 +699,9 @@ PMIX_EXPORT pmix_status_t PMIx_IOF_pull(const pmix_proc_t procs[], size_t nprocs * cbfunc - function to be called when deregistration has * been completed. Note that any IO to be flushed * may continue to be received after deregistration - * has completed. + * has completed. If cbfunc is NULL, then this is + * treated as a BLOCKING call and the result of + * the operation will be provided in the returned status * * cbdata - pointer to object to be returned in cbfunc */ @@ -712,7 +728,10 @@ PMIX_EXPORT pmix_status_t PMIx_IOF_deregister(size_t iofhdlr, * * bo - pointer to a byte object containing the stdin data * - * cbfunc - callback function when the data has been forwarded + * cbfunc - callback function when the data has been forwarded. If + * cbfunc is NULL, then this is treated as a BLOCKING call + * and the result of the operation will be provided in the + * returned status * * cbdata - object to be returned in cbfunc */ diff --git a/opal/mca/pmix/pmix4x/pmix/include/pmix_common.h.in b/opal/mca/pmix/pmix4x/openpmix/include/pmix_common.h.in similarity index 98% rename from opal/mca/pmix/pmix4x/pmix/include/pmix_common.h.in rename to opal/mca/pmix/pmix4x/openpmix/include/pmix_common.h.in index 2893a8ff25..0690ab6e51 100644 --- a/opal/mca/pmix/pmix4x/pmix/include/pmix_common.h.in +++ b/opal/mca/pmix/pmix4x/openpmix/include/pmix_common.h.in @@ -112,6 +112,9 @@ typedef uint32_t pmix_rank_t; /* define a boundary for valid ranks */ #define PMIX_RANK_VALID UINT32_MAX-50 +/* define a value to indicate that data applies + * to all apps in a job */ +#define PMIX_APP_WILDCARD UINT32_MAX /**** PMIX ENVIRONMENTAL PARAMETERS ****/ /* There are a few environmental parameters used by PMIx for @@ -797,7 +800,7 @@ typedef int pmix_status_t; * at least defined to ensure older codes will compile */ #define PMIX_SUCCESS 0 #define PMIX_ERROR -1 // general error -#define PMIX_ERR_SILENT -2 // internal-only +#define PMIX_ERR_SILENT -2 /* debugger release flag */ #define PMIX_ERR_DEBUGGER_RELEASE -3 /* fault tolerance */ @@ -811,45 +814,45 @@ typedef int pmix_status_t; /* communication failures */ #define PMIX_ERR_SERVER_FAILED_REQUEST -10 #define PMIX_EXISTS -11 -#define PMIX_ERR_INVALID_CRED -12 // internal-only -#define PMIX_ERR_HANDSHAKE_FAILED -13 // internal-only -#define PMIX_ERR_READY_FOR_HANDSHAKE -14 // internal-only +#define PMIX_ERR_INVALID_CRED -12 +#define PMIX_ERR_HANDSHAKE_FAILED -13 +#define PMIX_ERR_READY_FOR_HANDSHAKE -14 #define PMIX_ERR_WOULD_BLOCK -15 -#define PMIX_ERR_UNKNOWN_DATA_TYPE -16 // internal-only -#define PMIX_ERR_PROC_ENTRY_NOT_FOUND -17 // internal-only -#define PMIX_ERR_TYPE_MISMATCH -18 // internal-only -#define PMIX_ERR_UNPACK_INADEQUATE_SPACE -19 // internal-only -#define PMIX_ERR_UNPACK_FAILURE -20 // internal-only -#define PMIX_ERR_PACK_FAILURE -21 // internal-only -#define PMIX_ERR_PACK_MISMATCH -22 // internal-only +#define PMIX_ERR_UNKNOWN_DATA_TYPE -16 +#define PMIX_ERR_PROC_ENTRY_NOT_FOUND -17 +#define PMIX_ERR_TYPE_MISMATCH -18 +#define PMIX_ERR_UNPACK_INADEQUATE_SPACE -19 +#define PMIX_ERR_UNPACK_FAILURE -20 +#define PMIX_ERR_PACK_FAILURE -21 +#define PMIX_ERR_PACK_MISMATCH -22 #define PMIX_ERR_NO_PERMISSIONS -23 #define PMIX_ERR_TIMEOUT -24 #define PMIX_ERR_UNREACH -25 -#define PMIX_ERR_IN_ERRNO -26 // internal-only +#define PMIX_ERR_IN_ERRNO -26 #define PMIX_ERR_BAD_PARAM -27 -#define PMIX_ERR_RESOURCE_BUSY -28 // internal-only +#define PMIX_ERR_RESOURCE_BUSY -28 #define PMIX_ERR_OUT_OF_RESOURCE -29 #define PMIX_ERR_DATA_VALUE_NOT_FOUND -30 #define PMIX_ERR_INIT -31 -#define PMIX_ERR_NOMEM -32 // internal-only -#define PMIX_ERR_INVALID_ARG -33 // internal-only -#define PMIX_ERR_INVALID_KEY -34 // internal-only -#define PMIX_ERR_INVALID_KEY_LENGTH -35 // internal-only -#define PMIX_ERR_INVALID_VAL -36 // internal-only -#define PMIX_ERR_INVALID_VAL_LENGTH -37 // internal-only -#define PMIX_ERR_INVALID_LENGTH -38 // internal-only -#define PMIX_ERR_INVALID_NUM_ARGS -39 // internal-only -#define PMIX_ERR_INVALID_ARGS -40 // internal-only -#define PMIX_ERR_INVALID_NUM_PARSED -41 // internal-only -#define PMIX_ERR_INVALID_KEYVALP -42 // internal-only +#define PMIX_ERR_NOMEM -32 +#define PMIX_ERR_INVALID_ARG -33 +#define PMIX_ERR_INVALID_KEY -34 +#define PMIX_ERR_INVALID_KEY_LENGTH -35 +#define PMIX_ERR_INVALID_VAL -36 +#define PMIX_ERR_INVALID_VAL_LENGTH -37 +#define PMIX_ERR_INVALID_LENGTH -38 +#define PMIX_ERR_INVALID_NUM_ARGS -39 +#define PMIX_ERR_INVALID_ARGS -40 +#define PMIX_ERR_INVALID_NUM_PARSED -41 +#define PMIX_ERR_INVALID_KEYVALP -42 #define PMIX_ERR_INVALID_SIZE -43 #define PMIX_ERR_INVALID_NAMESPACE -44 -#define PMIX_ERR_SERVER_NOT_AVAIL -45 // internal-only +#define PMIX_ERR_SERVER_NOT_AVAIL -45 #define PMIX_ERR_NOT_FOUND -46 #define PMIX_ERR_NOT_SUPPORTED -47 #define PMIX_ERR_NOT_IMPLEMENTED -48 #define PMIX_ERR_COMM_FAILURE -49 -#define PMIX_ERR_UNPACK_READ_PAST_END_OF_BUFFER -50 // internal-only +#define PMIX_ERR_UNPACK_READ_PAST_END_OF_BUFFER -50 #define PMIX_ERR_CONFLICTING_CLEANUP_DIRECTIVES -51 /* define a starting point for v2.x error values */ @@ -1116,10 +1119,10 @@ static inline void* pmix_calloc(size_t n, size_t m) }while(0) /* define a convenience macro for loading nspaces */ -#define PMIX_LOAD_NSPACE(a, b) \ - do { \ - memset((a), 0, PMIX_MAX_NSLEN+1); \ - pmix_strncpy((a), (b), PMIX_MAX_NSLEN); \ +#define PMIX_LOAD_NSPACE(a, b) \ + do { \ + memset((a), 0, PMIX_MAX_NSLEN+1); \ + pmix_strncpy((char*)(a), (b), PMIX_MAX_NSLEN); \ }while(0) /* define a convenience macro for checking nspaces */ @@ -2431,20 +2434,24 @@ typedef void (*pmix_validation_cbfunc_t)(pmix_status_t status, * deregistering the current evhdlr, and then registering it * using a new set of info values. * + * If cbfunc is NULL, then this is treated as a BLOCKING call - a positive + * return value represents the reference ID for the request, while + * negative values indicate the corresponding error + * * See pmix_common.h for a description of the notification function */ -PMIX_EXPORT void PMIx_Register_event_handler(pmix_status_t codes[], size_t ncodes, - pmix_info_t info[], size_t ninfo, - pmix_notification_fn_t evhdlr, - pmix_hdlr_reg_cbfunc_t cbfunc, - void *cbdata); +PMIX_EXPORT pmix_status_t PMIx_Register_event_handler(pmix_status_t codes[], size_t ncodes, + pmix_info_t info[], size_t ninfo, + pmix_notification_fn_t evhdlr, + pmix_hdlr_reg_cbfunc_t cbfunc, + void *cbdata); /* Deregister an event handler * evhdlr_ref is the reference returned by PMIx from the call to * PMIx_Register_event_handler. If non-NULL, the provided cbfunc * will be called to confirm removal of the designated handler */ -PMIX_EXPORT void PMIx_Deregister_event_handler(size_t evhdlr_ref, - pmix_op_cbfunc_t cbfunc, - void *cbdata); +PMIX_EXPORT pmix_status_t PMIx_Deregister_event_handler(size_t evhdlr_ref, + pmix_op_cbfunc_t cbfunc, + void *cbdata); /* Report an event for notification via any * registered evhdlr. @@ -2483,6 +2490,9 @@ PMIX_EXPORT void PMIx_Deregister_event_handler(size_t evhdlr_ref, * will have been queued, but may not have been transmitted * by this time. Note that the caller is required to maintain * the input data until the callback function has been executed! + * If cbfunc is NULL, then this is treated as a BLOCKING call and + * the result of the operation is provided in the returned + * status * * cbdata - the caller's provided void* object */ @@ -2908,10 +2918,12 @@ static inline void pmix_darray_destruct(pmix_data_array_t *m) (m)->array = NULL; \ } \ } while(0) -#define PMIX_DATA_ARRAY_CREATE(m, n, t) \ - do { \ - (m) = (pmix_data_array_t*)pmix_calloc(1, sizeof(pmix_data_array_t)); \ - PMIX_DATA_ARRAY_CONSTRUCT((m), (n), (t)); \ +#define PMIX_DATA_ARRAY_CREATE(m, n, t) \ + do { \ + (m) = (pmix_data_array_t*)pmix_calloc(1, sizeof(pmix_data_array_t)); \ + if (NULL != (m)) { \ + PMIX_DATA_ARRAY_CONSTRUCT((m), (n), (t)); \ + } \ } while(0) #define PMIX_DATA_ARRAY_DESTRUCT(m) pmix_darray_destruct(m) diff --git a/opal/mca/pmix/pmix4x/pmix/include/pmix_extend.h b/opal/mca/pmix/pmix4x/openpmix/include/pmix_extend.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/include/pmix_extend.h rename to opal/mca/pmix/pmix4x/openpmix/include/pmix_extend.h diff --git a/opal/mca/pmix/pmix4x/pmix/include/pmix_rename.h.in b/opal/mca/pmix/pmix4x/openpmix/include/pmix_rename.h.in similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/include/pmix_rename.h.in rename to opal/mca/pmix/pmix4x/openpmix/include/pmix_rename.h.in diff --git a/opal/mca/pmix/pmix4x/pmix/include/pmix_sched.h b/opal/mca/pmix/pmix4x/openpmix/include/pmix_sched.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/include/pmix_sched.h rename to opal/mca/pmix/pmix4x/openpmix/include/pmix_sched.h diff --git a/opal/mca/pmix/pmix4x/pmix/include/pmix_server.h b/opal/mca/pmix/pmix4x/openpmix/include/pmix_server.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/include/pmix_server.h rename to opal/mca/pmix/pmix4x/openpmix/include/pmix_server.h diff --git a/opal/mca/pmix/pmix4x/pmix/include/pmix_tool.h b/opal/mca/pmix/pmix4x/openpmix/include/pmix_tool.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/include/pmix_tool.h rename to opal/mca/pmix/pmix4x/openpmix/include/pmix_tool.h diff --git a/opal/mca/pmix/pmix4x/pmix/include/pmix_version.h.in b/opal/mca/pmix/pmix4x/openpmix/include/pmix_version.h.in similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/include/pmix_version.h.in rename to opal/mca/pmix/pmix4x/openpmix/include/pmix_version.h.in diff --git a/opal/mca/pmix/pmix4x/pmix/src/Makefile.am b/opal/mca/pmix/pmix4x/openpmix/src/Makefile.am similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/Makefile.am rename to opal/mca/pmix/pmix4x/openpmix/src/Makefile.am diff --git a/opal/mca/pmix/pmix4x/pmix/src/atomics/sys/Makefile.include b/opal/mca/pmix/pmix4x/openpmix/src/atomics/sys/Makefile.include similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/atomics/sys/Makefile.include rename to opal/mca/pmix/pmix4x/openpmix/src/atomics/sys/Makefile.include diff --git a/opal/mca/pmix/pmix4x/pmix/src/atomics/sys/architecture.h b/opal/mca/pmix/pmix4x/openpmix/src/atomics/sys/architecture.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/atomics/sys/architecture.h rename to opal/mca/pmix/pmix4x/openpmix/src/atomics/sys/architecture.h diff --git a/opal/mca/pmix/pmix4x/pmix/src/atomics/sys/arm/Makefile.include b/opal/mca/pmix/pmix4x/openpmix/src/atomics/sys/arm/Makefile.include similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/atomics/sys/arm/Makefile.include rename to opal/mca/pmix/pmix4x/openpmix/src/atomics/sys/arm/Makefile.include diff --git a/opal/mca/pmix/pmix4x/pmix/src/atomics/sys/arm/atomic.h b/opal/mca/pmix/pmix4x/openpmix/src/atomics/sys/arm/atomic.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/atomics/sys/arm/atomic.h rename to opal/mca/pmix/pmix4x/openpmix/src/atomics/sys/arm/atomic.h diff --git a/opal/mca/pmix/pmix4x/pmix/src/atomics/sys/arm/timer.h b/opal/mca/pmix/pmix4x/openpmix/src/atomics/sys/arm/timer.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/atomics/sys/arm/timer.h rename to opal/mca/pmix/pmix4x/openpmix/src/atomics/sys/arm/timer.h diff --git a/opal/mca/pmix/pmix4x/pmix/src/atomics/sys/arm64/Makefile.include b/opal/mca/pmix/pmix4x/openpmix/src/atomics/sys/arm64/Makefile.include similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/atomics/sys/arm64/Makefile.include rename to opal/mca/pmix/pmix4x/openpmix/src/atomics/sys/arm64/Makefile.include diff --git a/opal/mca/pmix/pmix4x/pmix/src/atomics/sys/arm64/atomic.h b/opal/mca/pmix/pmix4x/openpmix/src/atomics/sys/arm64/atomic.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/atomics/sys/arm64/atomic.h rename to opal/mca/pmix/pmix4x/openpmix/src/atomics/sys/arm64/atomic.h diff --git a/opal/mca/pmix/pmix4x/pmix/src/atomics/sys/arm64/timer.h b/opal/mca/pmix/pmix4x/openpmix/src/atomics/sys/arm64/timer.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/atomics/sys/arm64/timer.h rename to opal/mca/pmix/pmix4x/openpmix/src/atomics/sys/arm64/timer.h diff --git a/opal/mca/pmix/pmix4x/pmix/src/atomics/sys/atomic.h b/opal/mca/pmix/pmix4x/openpmix/src/atomics/sys/atomic.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/atomics/sys/atomic.h rename to opal/mca/pmix/pmix4x/openpmix/src/atomics/sys/atomic.h diff --git a/opal/mca/pmix/pmix4x/pmix/src/atomics/sys/atomic_impl.h b/opal/mca/pmix/pmix4x/openpmix/src/atomics/sys/atomic_impl.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/atomics/sys/atomic_impl.h rename to opal/mca/pmix/pmix4x/openpmix/src/atomics/sys/atomic_impl.h diff --git a/opal/mca/pmix/pmix4x/pmix/src/atomics/sys/atomic_stdc.h b/opal/mca/pmix/pmix4x/openpmix/src/atomics/sys/atomic_stdc.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/atomics/sys/atomic_stdc.h rename to opal/mca/pmix/pmix4x/openpmix/src/atomics/sys/atomic_stdc.h diff --git a/opal/mca/pmix/pmix4x/pmix/src/atomics/sys/cma.h b/opal/mca/pmix/pmix4x/openpmix/src/atomics/sys/cma.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/atomics/sys/cma.h rename to opal/mca/pmix/pmix4x/openpmix/src/atomics/sys/cma.h diff --git a/opal/mca/pmix/pmix4x/pmix/src/atomics/sys/gcc_builtin/Makefile.include b/opal/mca/pmix/pmix4x/openpmix/src/atomics/sys/gcc_builtin/Makefile.include similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/atomics/sys/gcc_builtin/Makefile.include rename to opal/mca/pmix/pmix4x/openpmix/src/atomics/sys/gcc_builtin/Makefile.include diff --git a/opal/mca/pmix/pmix4x/pmix/src/atomics/sys/gcc_builtin/atomic.h b/opal/mca/pmix/pmix4x/openpmix/src/atomics/sys/gcc_builtin/atomic.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/atomics/sys/gcc_builtin/atomic.h rename to opal/mca/pmix/pmix4x/openpmix/src/atomics/sys/gcc_builtin/atomic.h diff --git a/opal/mca/pmix/pmix4x/pmix/src/atomics/sys/ia32/Makefile.include b/opal/mca/pmix/pmix4x/openpmix/src/atomics/sys/ia32/Makefile.include similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/atomics/sys/ia32/Makefile.include rename to opal/mca/pmix/pmix4x/openpmix/src/atomics/sys/ia32/Makefile.include diff --git a/opal/mca/pmix/pmix4x/pmix/src/atomics/sys/ia32/atomic.h b/opal/mca/pmix/pmix4x/openpmix/src/atomics/sys/ia32/atomic.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/atomics/sys/ia32/atomic.h rename to opal/mca/pmix/pmix4x/openpmix/src/atomics/sys/ia32/atomic.h diff --git a/opal/mca/pmix/pmix4x/pmix/src/atomics/sys/ia32/timer.h b/opal/mca/pmix/pmix4x/openpmix/src/atomics/sys/ia32/timer.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/atomics/sys/ia32/timer.h rename to opal/mca/pmix/pmix4x/openpmix/src/atomics/sys/ia32/timer.h diff --git a/opal/mca/pmix/pmix4x/pmix/src/atomics/sys/powerpc/Makefile.include b/opal/mca/pmix/pmix4x/openpmix/src/atomics/sys/powerpc/Makefile.include similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/atomics/sys/powerpc/Makefile.include rename to opal/mca/pmix/pmix4x/openpmix/src/atomics/sys/powerpc/Makefile.include diff --git a/opal/mca/pmix/pmix4x/pmix/src/atomics/sys/powerpc/atomic.h b/opal/mca/pmix/pmix4x/openpmix/src/atomics/sys/powerpc/atomic.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/atomics/sys/powerpc/atomic.h rename to opal/mca/pmix/pmix4x/openpmix/src/atomics/sys/powerpc/atomic.h diff --git a/opal/mca/pmix/pmix4x/pmix/src/atomics/sys/powerpc/timer.h b/opal/mca/pmix/pmix4x/openpmix/src/atomics/sys/powerpc/timer.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/atomics/sys/powerpc/timer.h rename to opal/mca/pmix/pmix4x/openpmix/src/atomics/sys/powerpc/timer.h diff --git a/opal/mca/pmix/pmix4x/pmix/src/atomics/sys/sparcv9/Makefile.include b/opal/mca/pmix/pmix4x/openpmix/src/atomics/sys/sparcv9/Makefile.include similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/atomics/sys/sparcv9/Makefile.include rename to opal/mca/pmix/pmix4x/openpmix/src/atomics/sys/sparcv9/Makefile.include diff --git a/opal/mca/pmix/pmix4x/pmix/src/atomics/sys/sparcv9/atomic.h b/opal/mca/pmix/pmix4x/openpmix/src/atomics/sys/sparcv9/atomic.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/atomics/sys/sparcv9/atomic.h rename to opal/mca/pmix/pmix4x/openpmix/src/atomics/sys/sparcv9/atomic.h diff --git a/opal/mca/pmix/pmix4x/pmix/src/atomics/sys/sparcv9/timer.h b/opal/mca/pmix/pmix4x/openpmix/src/atomics/sys/sparcv9/timer.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/atomics/sys/sparcv9/timer.h rename to opal/mca/pmix/pmix4x/openpmix/src/atomics/sys/sparcv9/timer.h diff --git a/opal/mca/pmix/pmix4x/pmix/src/atomics/sys/sync_builtin/Makefile.include b/opal/mca/pmix/pmix4x/openpmix/src/atomics/sys/sync_builtin/Makefile.include similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/atomics/sys/sync_builtin/Makefile.include rename to opal/mca/pmix/pmix4x/openpmix/src/atomics/sys/sync_builtin/Makefile.include diff --git a/opal/mca/pmix/pmix4x/pmix/src/atomics/sys/sync_builtin/atomic.h b/opal/mca/pmix/pmix4x/openpmix/src/atomics/sys/sync_builtin/atomic.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/atomics/sys/sync_builtin/atomic.h rename to opal/mca/pmix/pmix4x/openpmix/src/atomics/sys/sync_builtin/atomic.h diff --git a/opal/mca/pmix/pmix4x/pmix/src/atomics/sys/timer.h b/opal/mca/pmix/pmix4x/openpmix/src/atomics/sys/timer.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/atomics/sys/timer.h rename to opal/mca/pmix/pmix4x/openpmix/src/atomics/sys/timer.h diff --git a/opal/mca/pmix/pmix4x/pmix/src/atomics/sys/x86_64/Makefile.include b/opal/mca/pmix/pmix4x/openpmix/src/atomics/sys/x86_64/Makefile.include similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/atomics/sys/x86_64/Makefile.include rename to opal/mca/pmix/pmix4x/openpmix/src/atomics/sys/x86_64/Makefile.include diff --git a/opal/mca/pmix/pmix4x/pmix/src/atomics/sys/x86_64/atomic.h b/opal/mca/pmix/pmix4x/openpmix/src/atomics/sys/x86_64/atomic.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/atomics/sys/x86_64/atomic.h rename to opal/mca/pmix/pmix4x/openpmix/src/atomics/sys/x86_64/atomic.h diff --git a/opal/mca/pmix/pmix4x/pmix/src/atomics/sys/x86_64/timer.h b/opal/mca/pmix/pmix4x/openpmix/src/atomics/sys/x86_64/timer.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/atomics/sys/x86_64/timer.h rename to opal/mca/pmix/pmix4x/openpmix/src/atomics/sys/x86_64/timer.h diff --git a/opal/mca/pmix/pmix4x/pmix/src/class/Makefile.include b/opal/mca/pmix/pmix4x/openpmix/src/class/Makefile.include similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/class/Makefile.include rename to opal/mca/pmix/pmix4x/openpmix/src/class/Makefile.include diff --git a/opal/mca/pmix/pmix4x/pmix/src/class/pmix_bitmap.c b/opal/mca/pmix/pmix4x/openpmix/src/class/pmix_bitmap.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/class/pmix_bitmap.c rename to opal/mca/pmix/pmix4x/openpmix/src/class/pmix_bitmap.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/class/pmix_bitmap.h b/opal/mca/pmix/pmix4x/openpmix/src/class/pmix_bitmap.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/class/pmix_bitmap.h rename to opal/mca/pmix/pmix4x/openpmix/src/class/pmix_bitmap.h diff --git a/opal/mca/pmix/pmix4x/pmix/src/class/pmix_hash_table.c b/opal/mca/pmix/pmix4x/openpmix/src/class/pmix_hash_table.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/class/pmix_hash_table.c rename to opal/mca/pmix/pmix4x/openpmix/src/class/pmix_hash_table.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/class/pmix_hash_table.h b/opal/mca/pmix/pmix4x/openpmix/src/class/pmix_hash_table.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/class/pmix_hash_table.h rename to opal/mca/pmix/pmix4x/openpmix/src/class/pmix_hash_table.h diff --git a/opal/mca/pmix/pmix4x/pmix/src/class/pmix_hotel.c b/opal/mca/pmix/pmix4x/openpmix/src/class/pmix_hotel.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/class/pmix_hotel.c rename to opal/mca/pmix/pmix4x/openpmix/src/class/pmix_hotel.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/class/pmix_hotel.h b/opal/mca/pmix/pmix4x/openpmix/src/class/pmix_hotel.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/class/pmix_hotel.h rename to opal/mca/pmix/pmix4x/openpmix/src/class/pmix_hotel.h diff --git a/opal/mca/pmix/pmix4x/pmix/src/class/pmix_list.c b/opal/mca/pmix/pmix4x/openpmix/src/class/pmix_list.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/class/pmix_list.c rename to opal/mca/pmix/pmix4x/openpmix/src/class/pmix_list.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/class/pmix_list.h b/opal/mca/pmix/pmix4x/openpmix/src/class/pmix_list.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/class/pmix_list.h rename to opal/mca/pmix/pmix4x/openpmix/src/class/pmix_list.h diff --git a/opal/mca/pmix/pmix4x/pmix/src/class/pmix_object.c b/opal/mca/pmix/pmix4x/openpmix/src/class/pmix_object.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/class/pmix_object.c rename to opal/mca/pmix/pmix4x/openpmix/src/class/pmix_object.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/class/pmix_object.h b/opal/mca/pmix/pmix4x/openpmix/src/class/pmix_object.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/class/pmix_object.h rename to opal/mca/pmix/pmix4x/openpmix/src/class/pmix_object.h diff --git a/opal/mca/pmix/pmix4x/pmix/src/class/pmix_pointer_array.c b/opal/mca/pmix/pmix4x/openpmix/src/class/pmix_pointer_array.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/class/pmix_pointer_array.c rename to opal/mca/pmix/pmix4x/openpmix/src/class/pmix_pointer_array.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/class/pmix_pointer_array.h b/opal/mca/pmix/pmix4x/openpmix/src/class/pmix_pointer_array.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/class/pmix_pointer_array.h rename to opal/mca/pmix/pmix4x/openpmix/src/class/pmix_pointer_array.h diff --git a/opal/mca/pmix/pmix4x/pmix/src/class/pmix_ring_buffer.c b/opal/mca/pmix/pmix4x/openpmix/src/class/pmix_ring_buffer.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/class/pmix_ring_buffer.c rename to opal/mca/pmix/pmix4x/openpmix/src/class/pmix_ring_buffer.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/class/pmix_ring_buffer.h b/opal/mca/pmix/pmix4x/openpmix/src/class/pmix_ring_buffer.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/class/pmix_ring_buffer.h rename to opal/mca/pmix/pmix4x/openpmix/src/class/pmix_ring_buffer.h diff --git a/opal/mca/pmix/pmix4x/pmix/src/class/pmix_value_array.c b/opal/mca/pmix/pmix4x/openpmix/src/class/pmix_value_array.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/class/pmix_value_array.c rename to opal/mca/pmix/pmix4x/openpmix/src/class/pmix_value_array.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/class/pmix_value_array.h b/opal/mca/pmix/pmix4x/openpmix/src/class/pmix_value_array.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/class/pmix_value_array.h rename to opal/mca/pmix/pmix4x/openpmix/src/class/pmix_value_array.h diff --git a/opal/mca/pmix/pmix4x/pmix/src/client/Makefile.include b/opal/mca/pmix/pmix4x/openpmix/src/client/Makefile.include similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/client/Makefile.include rename to opal/mca/pmix/pmix4x/openpmix/src/client/Makefile.include diff --git a/opal/mca/pmix/pmix4x/pmix/src/client/pmi1.c b/opal/mca/pmix/pmix4x/openpmix/src/client/pmi1.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/client/pmi1.c rename to opal/mca/pmix/pmix4x/openpmix/src/client/pmi1.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/client/pmi2.c b/opal/mca/pmix/pmix4x/openpmix/src/client/pmi2.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/client/pmi2.c rename to opal/mca/pmix/pmix4x/openpmix/src/client/pmi2.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/client/pmix_client.c b/opal/mca/pmix/pmix4x/openpmix/src/client/pmix_client.c similarity index 86% rename from opal/mca/pmix/pmix4x/pmix/src/client/pmix_client.c rename to opal/mca/pmix/pmix4x/openpmix/src/client/pmix_client.c index f5b8b0c90c..93470e3b49 100644 --- a/opal/mca/pmix/pmix4x/pmix/src/client/pmix_client.c +++ b/opal/mca/pmix/pmix4x/openpmix/src/client/pmix_client.c @@ -220,7 +220,11 @@ static void job_data(struct pmix_peer_t *pr, /* unpack the nspace - should be same as our own */ PMIX_BFROPS_UNPACK(rc, pmix_client_globals.myserver, buf, &nspace, &cnt, PMIX_STRING); - if (PMIX_SUCCESS != rc) { + if (PMIX_SUCCESS != rc || + !PMIX_CHECK_NSPACE(nspace, pmix_globals.myid.nspace)) { + if (PMIX_SUCCESS == rc) { + rc = PMIX_ERR_INVALID_VAL; + } PMIX_ERROR_LOG(rc); cb->status = PMIX_ERROR; PMIX_POST_OBJECT(cb); @@ -232,6 +236,15 @@ static void job_data(struct pmix_peer_t *pr, PMIX_GDS_STORE_JOB_INFO(cb->status, pmix_client_globals.myserver, nspace, buf); + + /* if anything is left in the buffer, let the + * internal hash component have it - e.g., we + * may have been passed node and app info for + * our own nspace */ + PMIX_GDS_STORE_JOB_INFO(cb->status, + pmix_globals.mypeer, + nspace, buf); + free(nspace); cb->status = PMIX_SUCCESS; PMIX_POST_OBJECT(cb); @@ -1225,25 +1238,23 @@ static void _commitfn(int sd, short args, void *cbdata) return rc; } -static void _resolve_peers(int sd, short args, void *cbdata) -{ - pmix_cb_t *cb = (pmix_cb_t*)cbdata; - - cb->status = pmix_preg.resolve_peers(cb->key, cb->pname.nspace, - &cb->procs, &cb->nprocs); - /* post the data so the receiving thread can acquire it */ - PMIX_POST_OBJECT(cb); - PMIX_WAKEUP_THREAD(&cb->lock); -} - /* need to thread-shift this request */ PMIX_EXPORT pmix_status_t PMIx_Resolve_peers(const char *nodename, const pmix_nspace_t nspace, pmix_proc_t **procs, size_t *nprocs) { - pmix_cb_t *cb; + pmix_info_t info[2]; pmix_status_t rc; pmix_proc_t proc; + pmix_value_t *val; + char **p, **tmp=NULL, *prs; + pmix_proc_t *pa; + size_t m, n, np; + pmix_namespace_t *ns; + + /* set default response */ + *procs = NULL; + *nprocs = 0; PMIX_ACQUIRE_THREAD(&pmix_global_lock); if (pmix_globals.init_cntr <= 0) { @@ -1252,70 +1263,139 @@ PMIX_EXPORT pmix_status_t PMIx_Resolve_peers(const char *nodename, } PMIX_RELEASE_THREAD(&pmix_global_lock); + proc.rank = PMIX_RANK_UNDEF; + PMIX_INFO_LOAD(&info[0], PMIX_NODE_INFO, NULL, PMIX_BOOL); + PMIX_INFO_LOAD(&info[1], PMIX_HOSTNAME, nodename, PMIX_STRING); - cb = PMIX_NEW(pmix_cb_t); - cb->key = (char*)nodename; - cb->pname.nspace = strdup(nspace); + if (NULL == nspace || 0 == strlen(nspace)) { + rc = PMIX_ERR_NOT_FOUND; + np = 0; + /* cycle across all known nspaces and aggregate the results */ + PMIX_LIST_FOREACH(ns, &pmix_globals.nspaces, pmix_namespace_t) { + PMIX_LOAD_NSPACE(proc.nspace, ns->nspace); + rc = PMIx_Get(&proc, PMIX_LOCAL_PEERS, info, 2, &val); + if (PMIX_SUCCESS != rc) { + continue; + } - PMIX_THREADSHIFT(cb, _resolve_peers); - - /* wait for the result */ - PMIX_WAIT_THREAD(&cb->lock); - - /* if the nspace wasn't found, then we need to - * ask the server for that info */ - if (PMIX_ERR_INVALID_NAMESPACE == cb->status) { - pmix_strncpy(proc.nspace, nspace, PMIX_MAX_NSLEN); - proc.rank = PMIX_RANK_WILDCARD; - /* any key will suffice as it will bring down - * the entire data blob */ - rc = PMIx_Get(&proc, PMIX_UNIV_SIZE, NULL, 0, NULL); - if (PMIX_SUCCESS != rc) { - PMIX_RELEASE(cb); - return rc; + /* sanity check */ + if (NULL == val) { + rc = PMIX_ERR_NOT_FOUND; + continue; + } + if (PMIX_STRING != val->type) { + rc = PMIX_ERR_INVALID_VAL; + PMIX_VALUE_FREE(val, 1); + continue; + } + if (NULL == val->data.string) { + /* no local peers on this node */ + PMIX_VALUE_FREE(val, 1); + continue; + } + /* prepend the nspace */ + if (0 > asprintf(&prs, "%s:%s", ns->nspace, val->data.string)) { + PMIX_VALUE_FREE(val, 1); + continue; + } + /* add to our list of results */ + pmix_argv_append_nosize(&tmp, prs); + /* split to count the npeers */ + p = pmix_argv_split(val->data.string, ','); + np += pmix_argv_count(p); + /* done with this entry */ + pmix_argv_free(p); + free(prs); + PMIX_VALUE_FREE(val, 1); } - /* retry the fetch */ - cb->lock.active = true; - PMIX_THREADSHIFT(cb, _resolve_peers); - PMIX_WAIT_THREAD(&cb->lock); + if (0 < np) { + /* allocate the proc array */ + PMIX_PROC_CREATE(pa, np); + if (NULL == pa) { + rc = PMIX_ERR_NOMEM; + pmix_argv_free(tmp); + goto done; + } + *procs = pa; + *nprocs = np; + /* transfer the results */ + np = 0; + for (n=0; NULL != tmp[n]; n++) { + /* find the nspace delimiter */ + prs = strchr(tmp[n], ':'); + *prs = '\0'; + ++prs; + p = pmix_argv_split(prs, ','); + for (m=0; NULL != p[m]; m++) { + PMIX_LOAD_NSPACE(&pa[np].nspace, tmp[n]); + pa[n].rank = strtoul(p[m], NULL, 10); + } + pmix_argv_free(p); + } + pmix_argv_free(tmp); + rc = PMIX_SUCCESS; + } + goto done; } - *procs = cb->procs; - *nprocs = cb->nprocs; - rc = cb->status; - PMIX_RELEASE(cb); + /* get the list of local peers for this nspace and node */ + PMIX_LOAD_NSPACE(proc.nspace, nspace); + + rc = PMIx_Get(&proc, PMIX_LOCAL_PEERS, info, 2, &val); + if (PMIX_SUCCESS != rc) { + goto done; + } + + /* sanity check */ + if (NULL == val) { + rc = PMIX_ERR_NOT_FOUND; + goto done; + } + if (PMIX_STRING != val->type || + NULL == val->data.string) { + rc = PMIX_ERR_INVALID_VAL; + PMIX_VALUE_FREE(val, 1); + goto done; + } + + /* split the procs to get a list */ + p = pmix_argv_split(val->data.string, ','); + np = pmix_argv_count(p); + PMIX_VALUE_FREE(val, 1); + + /* allocate the proc array */ + PMIX_PROC_CREATE(pa, np); + if (NULL == pa) { + rc = PMIX_ERR_NOMEM; + pmix_argv_free(p); + goto done; + } + /* transfer the results */ + for (n=0; n < np; n++) { + PMIX_LOAD_NSPACE(&pa[n].nspace, nspace); + pa[n].rank = strtoul(p[n], NULL, 10); + } + pmix_argv_free(p); + *procs = pa; + *nprocs = np; + + done: + PMIX_INFO_DESTRUCT(&info[0]); + PMIX_INFO_DESTRUCT(&info[1]); return rc; } -static void _resolve_nodes(int fd, short args, void *cbdata) -{ - pmix_cb_t *cb = (pmix_cb_t*)cbdata; - char *regex, **names; - - /* get a regular expression describing the PMIX_NODE_MAP */ - cb->status = pmix_preg.resolve_nodes(cb->pname.nspace, ®ex); - if (PMIX_SUCCESS == cb->status) { - /* parse it into an argv array of names */ - cb->status = pmix_preg.parse_nodes(regex, &names); - if (PMIX_SUCCESS == cb->status) { - /* assemble it into a comma-delimited list */ - cb->key = pmix_argv_join(names, ','); - pmix_argv_free(names); - } else { - free(regex); - } - } - /* post the data so the receiving thread can acquire it */ - PMIX_POST_OBJECT(cb); - PMIX_WAKEUP_THREAD(&cb->lock); -} - -/* need to thread-shift this request */ PMIX_EXPORT pmix_status_t PMIx_Resolve_nodes(const pmix_nspace_t nspace, char **nodelist) { - pmix_cb_t *cb; pmix_status_t rc; pmix_proc_t proc; + pmix_value_t *val; + char **tmp = NULL, **p; + size_t n; + pmix_namespace_t *ns; + + /* set default response */ + *nodelist = NULL; PMIX_ACQUIRE_THREAD(&pmix_global_lock); if (pmix_globals.init_cntr <= 0) { @@ -1324,35 +1404,69 @@ PMIX_EXPORT pmix_status_t PMIx_Resolve_nodes(const pmix_nspace_t nspace, char ** } PMIX_RELEASE_THREAD(&pmix_global_lock); - cb = PMIX_NEW(pmix_cb_t); - cb->pname.nspace = strdup(nspace); + /* get the list of nodes for this nspace */ + proc.rank = PMIX_RANK_WILDCARD; - PMIX_THREADSHIFT(cb, _resolve_nodes); + if (NULL == nspace || 0 == strlen(nspace)) { + rc = PMIX_ERR_NOT_FOUND; + /* cycle across all known nspaces and aggregate the results */ + PMIX_LIST_FOREACH(ns, &pmix_globals.nspaces, pmix_namespace_t) { + PMIX_LOAD_NSPACE(proc.nspace, ns->nspace); + rc = PMIx_Get(&proc, PMIX_NODE_LIST, NULL, 0, &val); + if (PMIX_SUCCESS != rc) { + continue; + } - /* wait for the result */ - PMIX_WAIT_THREAD(&cb->lock); - - /* if the nspace wasn't found, then we need to - * ask the server for that info */ - if (PMIX_ERR_INVALID_NAMESPACE == cb->status) { - pmix_strncpy(proc.nspace, nspace, PMIX_MAX_NSLEN); - proc.rank = PMIX_RANK_WILDCARD; - /* any key will suffice as it will bring down - * the entire data blob */ - rc = PMIx_Get(&proc, PMIX_UNIV_SIZE, NULL, 0, NULL); - if (PMIX_SUCCESS != rc) { - PMIX_RELEASE(cb); - return rc; + /* sanity check */ + if (NULL == val) { + rc = PMIX_ERR_NOT_FOUND; + continue; + } + if (PMIX_STRING != val->type) { + rc = PMIX_ERR_INVALID_VAL; + PMIX_VALUE_FREE(val, 1); + continue; + } + if (NULL == val->data.string) { + /* no nodes found */ + PMIX_VALUE_FREE(val, 1); + continue; + } + /* add to our list of results, ensuring uniqueness */ + p = pmix_argv_split(val->data.string, ','); + for (n=0; NULL != p[n]; n++) { + pmix_argv_append_unique_nosize(&tmp, p[n]); + } + pmix_argv_free(p); + PMIX_VALUE_FREE(val, 1); } - /* retry the fetch */ - cb->lock.active = true; - PMIX_THREADSHIFT(cb, _resolve_nodes); - PMIX_WAIT_THREAD(&cb->lock); + if (0 < pmix_argv_count(tmp)) { + *nodelist = pmix_argv_join(tmp, ','); + pmix_argv_free(tmp); + rc = PMIX_SUCCESS; + } + return rc; } - /* the string we want is in the key field */ - *nodelist = cb->key; - rc = cb->status; - PMIX_RELEASE(cb); - return rc; + PMIX_LOAD_NSPACE(proc.nspace, nspace); + rc = PMIx_Get(&proc, PMIX_NODE_LIST, NULL, 0, &val); + if (PMIX_SUCCESS != rc) { + return rc; + } + + /* sanity check */ + if (NULL == val) { + return PMIX_ERR_NOT_FOUND; + } + if (PMIX_STRING != val->type || + NULL == val->data.string) { + PMIX_VALUE_FREE(val, 1); + return PMIX_ERR_INVALID_VAL; + } + + /* pass back the result */ + *nodelist = strdup(val->data.string); + PMIX_VALUE_FREE(val, 1); + + return PMIX_SUCCESS; } diff --git a/opal/mca/pmix/pmix4x/pmix/src/client/pmix_client_connect.c b/opal/mca/pmix/pmix4x/openpmix/src/client/pmix_client_connect.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/client/pmix_client_connect.c rename to opal/mca/pmix/pmix4x/openpmix/src/client/pmix_client_connect.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/client/pmix_client_fence.c b/opal/mca/pmix/pmix4x/openpmix/src/client/pmix_client_fence.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/client/pmix_client_fence.c rename to opal/mca/pmix/pmix4x/openpmix/src/client/pmix_client_fence.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/client/pmix_client_get.c b/opal/mca/pmix/pmix4x/openpmix/src/client/pmix_client_get.c similarity index 97% rename from opal/mca/pmix/pmix4x/pmix/src/client/pmix_client_get.c rename to opal/mca/pmix/pmix4x/openpmix/src/client/pmix_client_get.c index e0705e7601..9aafacd7d0 100644 --- a/opal/mca/pmix/pmix4x/pmix/src/client/pmix_client_get.c +++ b/opal/mca/pmix/pmix4x/openpmix/src/client/pmix_client_get.c @@ -86,6 +86,7 @@ PMIX_EXPORT pmix_status_t PMIx_Get(const pmix_proc_t *proc, { pmix_cb_t *cb; pmix_status_t rc; + size_t n; PMIX_ACQUIRE_THREAD(&pmix_global_lock); @@ -100,13 +101,25 @@ PMIX_EXPORT pmix_status_t PMIx_Get(const pmix_proc_t *proc, (NULL == proc) ? "NULL" : PMIX_NAME_PRINT(proc), (NULL == key) ? "NULL" : key); - /* try to get data directly, without threadshift */ - if (PMIX_RANK_UNDEF != proc->rank && NULL != key) { - if (PMIX_SUCCESS == (rc = _getfn_fastpath(proc, key, info, ninfo, val))) { - goto done; - } + if (PMIX_RANK_UNDEF == proc->rank || NULL == key) { + goto doget; } + /* see if they are requesting session, node, or app-level info */ + for (n=0; n < ninfo; n++) { + if (PMIX_CHECK_KEY(info, PMIX_NODE_INFO) || + PMIX_CHECK_KEY(info, PMIX_APP_INFO) || + PMIX_CHECK_KEY(info, PMIX_SESSION_INFO)) { + goto doget; + } + + } + /* try to get data directly, without threadshift */ + if (PMIX_SUCCESS == (rc = _getfn_fastpath(proc, key, info, ninfo, val))) { + goto done; + } + + doget: /* create a callback object as we need to pass it to the * recv routine so we know which callback to use when * the return message is recvd */ @@ -598,14 +611,6 @@ static void _getnbfn(int fd, short flags, void *cbdata) } } else if (PMIX_CHECK_KEY(&cb->info[n], PMIX_DATA_SCOPE)) { cb->scope = cb->info[n].value.data.scope; - } else if (PMIX_CHECK_KEY(&cb->info[n], PMIX_SESSION_INFO)) { - cb->level = PMIX_LEVEL_SESSION; - } else if (PMIX_CHECK_KEY(&cb->info[n], PMIX_JOB_INFO)) { - cb->level = PMIX_LEVEL_JOB; - } else if (PMIX_CHECK_KEY(&cb->info[n], PMIX_APP_INFO)) { - cb->level = PMIX_LEVEL_APP; - } else if (PMIX_CHECK_KEY(&cb->info[n], PMIX_NODE_INFO)) { - cb->level = PMIX_LEVEL_NODE; } } } @@ -765,9 +770,9 @@ static void _getnbfn(int fd, short flags, void *cbdata) } pmix_output_verbose(2, pmix_client_globals.get_output, - "%s REQUESTING DATA FROM SERVER FOR %s KEY %s", + "%s REQUESTING DATA FROM SERVER FOR %s:%s KEY %s", PMIX_NAME_PRINT(&pmix_globals.myid), - PMIX_NAME_PRINT(cb->proc), cb->key); + cb->proc->nspace, PMIX_RANK_PRINT(proc.rank), cb->key); /* track the callback object */ pmix_list_append(&pmix_client_globals.pending_requests, &cb->super); diff --git a/opal/mca/pmix/pmix4x/pmix/src/client/pmix_client_group.c b/opal/mca/pmix/pmix4x/openpmix/src/client/pmix_client_group.c similarity index 88% rename from opal/mca/pmix/pmix4x/pmix/src/client/pmix_client_group.c rename to opal/mca/pmix/pmix4x/openpmix/src/client/pmix_client_group.c index 86038be4e6..c61fd7f8de 100644 --- a/opal/mca/pmix/pmix4x/pmix/src/client/pmix_client_group.c +++ b/opal/mca/pmix/pmix4x/openpmix/src/client/pmix_client_group.c @@ -351,9 +351,6 @@ PMIX_EXPORT pmix_status_t PMIx_Group_destruct_nb(const char grp[], pmix_cmd_t cmd = PMIX_GROUP_DESTRUCT_CMD; pmix_status_t rc; pmix_group_tracker_t *cb = NULL; - size_t n, num; - bool embed = true; - pmix_info_t *iptr = NULL; PMIX_ACQUIRE_THREAD(&pmix_global_lock); @@ -377,27 +374,6 @@ PMIX_EXPORT pmix_status_t PMIx_Group_destruct_nb(const char grp[], return PMIX_ERR_BAD_PARAM; } - /* need to add the fence request to the provided info - * structs as this is a blocking operation - only add - * it if the user didn't specify this themselves */ - for (n=0; n < ninfo; n++) { - if (PMIX_CHECK_KEY(&info[n], PMIX_EMBED_BARRIER)) { - embed = PMIX_INFO_TRUE(&info[n]); - break; - } - } - if (embed) { - PMIX_INFO_CREATE(iptr, ninfo + 1); - num = ninfo + 1; - for (n=0; n < ninfo; n++) { - PMIX_INFO_XFER(&iptr[n], &info[n]); - } - PMIX_INFO_LOAD(&iptr[ninfo], PMIX_EMBED_BARRIER, &embed, PMIX_BOOL); - } else { - iptr = (pmix_info_t*)info; - num = ninfo; - } - msg = PMIX_NEW(pmix_buffer_t); /* pack the cmd */ PMIX_BFROPS_PACK(rc, pmix_client_globals.myserver, @@ -448,9 +424,6 @@ PMIX_EXPORT pmix_status_t PMIx_Group_destruct_nb(const char grp[], } done: - if (embed && NULL != iptr) { - PMIX_INFO_FREE(iptr, num); - } if (PMIX_SUCCESS != rc && NULL != msg) { PMIX_RELEASE(msg); } @@ -919,6 +892,139 @@ PMIX_EXPORT pmix_status_t PMIx_Group_join_nb(const char grp[], return rc; } +PMIX_EXPORT pmix_status_t PMIx_Group_leave(const char grp[], + const pmix_info_t info[], size_t ninfo) +{ + pmix_status_t rc; + pmix_group_tracker_t cb; + + PMIX_ACQUIRE_THREAD(&pmix_global_lock); + + pmix_output_verbose(2, pmix_client_globals.connect_output, + "pmix: group_leave called"); + + if (pmix_globals.init_cntr <= 0) { + PMIX_RELEASE_THREAD(&pmix_global_lock); + return PMIX_ERR_INIT; + } + + /* if we aren't connected, don't attempt to send */ + if (!pmix_globals.connected) { + PMIX_RELEASE_THREAD(&pmix_global_lock); + return PMIX_ERR_UNREACH; + } + PMIX_RELEASE_THREAD(&pmix_global_lock); + + /* create a callback object as we need to pass it to the + * recv routine so we know which callback to use when + * the return message is recvd */ + PMIX_CONSTRUCT(&cb, pmix_group_tracker_t); + + /* push the message into our event base to send to the server */ + if (PMIX_SUCCESS != (rc = PMIx_Group_leave_nb(grp, info, ninfo, op_cbfunc, (void*)&cb))) { + PMIX_ERROR_LOG(rc); + PMIX_DESTRUCT(&cb); + return rc; + } + + /* wait for the connect to complete */ + PMIX_WAIT_THREAD(&cb.lock); + rc = cb.status; + PMIX_DESTRUCT(&cb); + + pmix_output_verbose(2, pmix_client_globals.connect_output, + "pmix: group leave completed"); + + return rc; +} + +PMIX_EXPORT pmix_status_t PMIx_Group_leave_nb(const char grp[], + const pmix_info_t info[], size_t ninfo, + pmix_op_cbfunc_t cbfunc, void *cbdata) +{ + pmix_buffer_t *msg = NULL; + pmix_cmd_t cmd = PMIX_GROUP_LEAVE_CMD; + pmix_status_t rc; + pmix_group_tracker_t *cb = NULL; + + PMIX_ACQUIRE_THREAD(&pmix_global_lock); + + pmix_output_verbose(2, pmix_client_globals.connect_output, + "pmix:group_leave_nb called"); + + if (pmix_globals.init_cntr <= 0) { + PMIX_RELEASE_THREAD(&pmix_global_lock); + return PMIX_ERR_INIT; + } + + /* if we aren't connected, don't attempt to send */ + if (!pmix_globals.connected) { + PMIX_RELEASE_THREAD(&pmix_global_lock); + return PMIX_ERR_UNREACH; + } + PMIX_RELEASE_THREAD(&pmix_global_lock); + + /* check for bozo input */ + if (NULL == grp) { + return PMIX_ERR_BAD_PARAM; + } + + msg = PMIX_NEW(pmix_buffer_t); + /* pack the cmd */ + PMIX_BFROPS_PACK(rc, pmix_client_globals.myserver, + msg, &cmd, 1, PMIX_COMMAND); + if (PMIX_SUCCESS != rc) { + PMIX_ERROR_LOG(rc); + goto done; + } + + /* pack the group ID */ + PMIX_BFROPS_PACK(rc, pmix_client_globals.myserver, + msg, &grp, 1, PMIX_STRING); + if (PMIX_SUCCESS != rc) { + PMIX_ERROR_LOG(rc); + goto done; + } + + /* pack the info structs */ + PMIX_BFROPS_PACK(rc, pmix_client_globals.myserver, + msg, &ninfo, 1, PMIX_SIZE); + if (PMIX_SUCCESS != rc) { + PMIX_ERROR_LOG(rc); + PMIX_RELEASE(msg); + goto done; + } + if (0 < ninfo) { + PMIX_BFROPS_PACK(rc, pmix_client_globals.myserver, + msg, info, ninfo, PMIX_INFO); + if (PMIX_SUCCESS != rc) { + PMIX_ERROR_LOG(rc); + PMIX_RELEASE(msg); + goto done; + } + } + + /* create a callback object as we need to pass it to the + * recv routine so we know which callback to use when + * the return message is recvd */ + cb = PMIX_NEW(pmix_group_tracker_t); + cb->opcbfunc = cbfunc; + cb->cbdata = cbdata; + + /* push the message into our event base to send to the server */ + PMIX_PTL_SEND_RECV(rc, pmix_client_globals.myserver, + msg, grp_cbfunc, (void*)cb); + if (PMIX_SUCCESS != rc) { + PMIX_RELEASE(cb); + } + + done: + if (PMIX_SUCCESS != rc && NULL != msg) { + PMIX_RELEASE(msg); + } + return rc; +} + static void op_cbfunc(pmix_status_t status, void *cbdata) { pmix_group_tracker_t *cb = (pmix_group_tracker_t*)cbdata; diff --git a/opal/mca/pmix/pmix4x/pmix/src/client/pmix_client_ops.h b/opal/mca/pmix/pmix4x/openpmix/src/client/pmix_client_ops.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/client/pmix_client_ops.h rename to opal/mca/pmix/pmix4x/openpmix/src/client/pmix_client_ops.h diff --git a/opal/mca/pmix/pmix4x/pmix/src/client/pmix_client_pub.c b/opal/mca/pmix/pmix4x/openpmix/src/client/pmix_client_pub.c similarity index 99% rename from opal/mca/pmix/pmix4x/pmix/src/client/pmix_client_pub.c rename to opal/mca/pmix/pmix4x/openpmix/src/client/pmix_client_pub.c index 54b72ace91..37dd9f2fba 100644 --- a/opal/mca/pmix/pmix4x/pmix/src/client/pmix_client_pub.c +++ b/opal/mca/pmix/pmix4x/openpmix/src/client/pmix_client_pub.c @@ -1,6 +1,6 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ /* - * Copyright (c) 2014-2018 Intel, Inc. All rights reserved. + * Copyright (c) 2014-2019 Intel, Inc. All rights reserved. * Copyright (c) 2014-2019 Research Organization for Information Science * and Technology (RIST). All rights reserved. * Copyright (c) 2014 Artem Y. Polyakov . @@ -522,13 +522,13 @@ static void wait_cbfunc(struct pmix_peer_t *pr, (NULL == buf) ? -1 : (int)buf->bytes_used); if (NULL == buf) { - rc = PMIX_ERR_BAD_PARAM; + ret = PMIX_ERR_BAD_PARAM; goto report; } /* a zero-byte buffer indicates that this recv is being * completed due to a lost connection */ if (PMIX_BUFFER_IS_EMPTY(buf)) { - rc = PMIX_ERR_UNREACH; + ret = PMIX_ERR_UNREACH; goto report; } @@ -538,11 +538,12 @@ static void wait_cbfunc(struct pmix_peer_t *pr, buf, &ret, &cnt, PMIX_STATUS); if (PMIX_SUCCESS != rc) { PMIX_ERROR_LOG(rc); + ret = rc; } report: if (NULL != cb->cbfunc.opfn) { - cb->cbfunc.opfn(rc, cb->cbdata); + cb->cbfunc.opfn(ret, cb->cbdata); } PMIX_RELEASE(cb); } diff --git a/opal/mca/pmix/pmix4x/pmix/src/client/pmix_client_spawn.c b/opal/mca/pmix/pmix4x/openpmix/src/client/pmix_client_spawn.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/client/pmix_client_spawn.c rename to opal/mca/pmix/pmix4x/openpmix/src/client/pmix_client_spawn.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/common/Makefile.include b/opal/mca/pmix/pmix4x/openpmix/src/common/Makefile.include similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/common/Makefile.include rename to opal/mca/pmix/pmix4x/openpmix/src/common/Makefile.include diff --git a/opal/mca/pmix/pmix4x/pmix/src/common/pmix_attributes.c b/opal/mca/pmix/pmix4x/openpmix/src/common/pmix_attributes.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/common/pmix_attributes.c rename to opal/mca/pmix/pmix4x/openpmix/src/common/pmix_attributes.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/common/pmix_attributes.h b/opal/mca/pmix/pmix4x/openpmix/src/common/pmix_attributes.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/common/pmix_attributes.h rename to opal/mca/pmix/pmix4x/openpmix/src/common/pmix_attributes.h diff --git a/opal/mca/pmix/pmix4x/pmix/src/common/pmix_control.c b/opal/mca/pmix/pmix4x/openpmix/src/common/pmix_control.c similarity index 94% rename from opal/mca/pmix/pmix4x/pmix/src/common/pmix_control.c rename to opal/mca/pmix/pmix4x/openpmix/src/common/pmix_control.c index 9ed53ef829..307969e49d 100644 --- a/opal/mca/pmix/pmix4x/pmix/src/common/pmix_control.c +++ b/opal/mca/pmix/pmix4x/openpmix/src/common/pmix_control.c @@ -1,6 +1,6 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ /* - * Copyright (c) 2014-2018 Intel, Inc. All rights reserved. + * Copyright (c) 2014-2019 Intel, Inc. All rights reserved. * Copyright (c) 2016 Mellanox Technologies, Inc. * All rights reserved. * Copyright (c) 2016 IBM Corporation. All rights reserved. @@ -119,7 +119,16 @@ static void acb(pmix_status_t status, void *release_cbdata) { pmix_cb_t *cb = (pmix_cb_t*)cbdata; + size_t n; + cb->status = status; + if (0 < ninfo) { + PMIX_INFO_CREATE(cb->info, ninfo); + cb->ninfo = ninfo; + for (n=0; n < ninfo; n++) { + PMIX_INFO_XFER(&cb->info[n], &info[n]); + } + } if (NULL != release_fn) { release_fn(release_cbdata); } @@ -127,7 +136,8 @@ static void acb(pmix_status_t status, } PMIX_EXPORT pmix_status_t PMIx_Job_control(const pmix_proc_t targets[], size_t ntargets, - const pmix_info_t directives[], size_t ndirs) + const pmix_info_t directives[], size_t ndirs, + pmix_info_t **results, size_t *nresults) { pmix_cb_t cb; pmix_status_t rc; @@ -157,6 +167,12 @@ PMIX_EXPORT pmix_status_t PMIx_Job_control(const pmix_proc_t targets[], size_t n /* wait for the operation to complete */ PMIX_WAIT_THREAD(&cb.lock); rc = cb.status; + if (0 < cb.ninfo) { + *results = cb.info; + *nresults = cb.ninfo; + cb.info = NULL; + cb.ninfo = 0; + } PMIX_DESTRUCT(&cb); pmix_output_verbose(2, pmix_globals.debug_output, @@ -278,7 +294,8 @@ PMIX_EXPORT pmix_status_t PMIx_Job_control_nb(const pmix_proc_t targets[], size_ } PMIX_EXPORT pmix_status_t PMIx_Process_monitor(const pmix_info_t *monitor, pmix_status_t error, - const pmix_info_t directives[], size_t ndirs) + const pmix_info_t directives[], size_t ndirs, + pmix_info_t **results, size_t *nresults) { pmix_cb_t cb; pmix_status_t rc; @@ -308,6 +325,12 @@ PMIX_EXPORT pmix_status_t PMIx_Process_monitor(const pmix_info_t *monitor, pmix_ /* wait for the operation to complete */ PMIX_WAIT_THREAD(&cb.lock); rc = cb.status; + if (0 < cb.ninfo) { + *results = cb.info; + *nresults = cb.ninfo; + cb.info = NULL; + cb.ninfo = 0; + } PMIX_DESTRUCT(&cb); pmix_output_verbose(2, pmix_globals.debug_output, diff --git a/opal/mca/pmix/pmix4x/pmix/src/common/pmix_data.c b/opal/mca/pmix/pmix4x/openpmix/src/common/pmix_data.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/common/pmix_data.c rename to opal/mca/pmix/pmix4x/openpmix/src/common/pmix_data.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/common/pmix_iof.c b/opal/mca/pmix/pmix4x/openpmix/src/common/pmix_iof.c similarity index 95% rename from opal/mca/pmix/pmix4x/pmix/src/common/pmix_iof.c rename to opal/mca/pmix/pmix4x/openpmix/src/common/pmix_iof.c index 680800f120..cd37c75960 100644 --- a/opal/mca/pmix/pmix4x/pmix/src/common/pmix_iof.c +++ b/opal/mca/pmix/pmix4x/openpmix/src/common/pmix_iof.c @@ -72,6 +72,21 @@ static void msgcbfunc(struct pmix_peer_t *peer, PMIX_RELEASE(cd); } +static void mycbfn(pmix_status_t status, + size_t refid, + void *cbdata) +{ + pmix_shift_caddy_t *cd = (pmix_shift_caddy_t*)cbdata; + + PMIX_ACQUIRE_OBJECT(cd); + if (PMIX_SUCCESS == status) { + cd->status = refid; + } else { + cd->status = status; + } + PMIX_WAKEUP_THREAD(&cd->lock); +} + PMIX_EXPORT pmix_status_t PMIx_IOF_pull(const pmix_proc_t procs[], size_t nprocs, const pmix_info_t directives[], size_t ndirs, pmix_iof_channel_t channel, pmix_iof_cbfunc_t cbfunc, @@ -117,8 +132,15 @@ PMIX_EXPORT pmix_status_t PMIx_IOF_pull(const pmix_proc_t procs[], size_t nprocs if (NULL == cd) { return PMIX_ERR_NOMEM; } - cd->cbfunc.hdlrregcbfn = regcbfunc; - cd->cbdata = regcbdata; + if (NULL == regcbfunc) { + cd->cbfunc.hdlrregcbfn = mycbfn; + PMIX_RETAIN(cd); + cd->cbdata = cd; + } else { + cd->cbfunc.hdlrregcbfn = regcbfunc; + cd->cbdata = regcbdata; + } + /* setup the request item */ cd->iofreq = PMIX_NEW(pmix_iof_req_t); if (NULL == cd->iofreq) { @@ -188,15 +210,35 @@ PMIX_EXPORT pmix_status_t PMIx_IOF_pull(const pmix_proc_t procs[], size_t nprocs PMIX_RELEASE(msg); PMIX_RELEASE(cd->iofreq); PMIX_RELEASE(cd); + } else if (NULL == regcbfunc) { + PMIX_WAIT_THREAD(&cd->lock); + rc = cd->status; + PMIX_RELEASE(cd); } return rc; } typedef struct { + pmix_object_t super; + pmix_event_t ev; + pmix_lock_t lock; + pmix_status_t status; pmix_op_cbfunc_t cbfunc; void *cbdata; } pmix_ltcaddy_t; +static void ltcon(pmix_ltcaddy_t *p) +{ + PMIX_CONSTRUCT_LOCK(&p->lock); +} +static void ltdes(pmix_ltcaddy_t *p) +{ + PMIX_DESTRUCT_LOCK(&p->lock); +} +static PMIX_CLASS_INSTANCE(pmix_ltcaddy_t, + pmix_object_t, + ltcon, ltdes); + static pmix_event_t stdinsig_ev; static pmix_iof_read_event_t *stdinev = NULL; @@ -231,6 +273,14 @@ static void stdincbfunc(struct pmix_peer_t *peer, free(cd); } +static void myopcb(pmix_status_t status, void *cbdata) +{ + pmix_ltcaddy_t *cd = (pmix_ltcaddy_t*)cbdata; + + cd->status = status; + PMIX_WAKEUP_THREAD(&cd->lock); +} + pmix_status_t PMIx_IOF_push(const pmix_proc_t targets[], size_t ntargets, pmix_byte_object_t *bo, const pmix_info_t directives[], size_t ndirs, @@ -406,20 +456,30 @@ pmix_status_t PMIx_IOF_push(const pmix_proc_t targets[], size_t ntargets, } } - cd = (pmix_ltcaddy_t*)malloc(sizeof(pmix_ltcaddy_t)); + cd = PMIX_NEW(pmix_ltcaddy_t); if (NULL == cd) { PMIX_RELEASE(msg); rc = PMIX_ERR_NOMEM; return rc; } - cd->cbfunc = cbfunc; - cd->cbdata = cbdata; + if (NULL == cbfunc) { + cd->cbfunc = myopcb; + PMIX_RETAIN(cd); + cd->cbdata = cd; + } else { + cd->cbfunc = cbfunc; + cd->cbdata = cbdata; + } PMIX_PTL_SEND_RECV(rc, pmix_client_globals.myserver, msg, stdincbfunc, cd); if (PMIX_SUCCESS != rc) { PMIX_ERROR_LOG(rc); PMIX_RELEASE(msg); free(cd); + } else if (NULL == cbfunc) { + PMIX_WAIT_THREAD(&cd->lock); + rc = cd->status; + PMIX_RELEASE(cd); } return rc; } diff --git a/opal/mca/pmix/pmix4x/pmix/src/common/pmix_iof.h b/opal/mca/pmix/pmix4x/openpmix/src/common/pmix_iof.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/common/pmix_iof.h rename to opal/mca/pmix/pmix4x/openpmix/src/common/pmix_iof.h diff --git a/opal/mca/pmix/pmix4x/pmix/src/common/pmix_log.c b/opal/mca/pmix/pmix4x/openpmix/src/common/pmix_log.c similarity index 99% rename from opal/mca/pmix/pmix4x/pmix/src/common/pmix_log.c rename to opal/mca/pmix/pmix4x/openpmix/src/common/pmix_log.c index 12cf5684d6..8ae6cee168 100644 --- a/opal/mca/pmix/pmix4x/pmix/src/common/pmix_log.c +++ b/opal/mca/pmix/pmix4x/openpmix/src/common/pmix_log.c @@ -1,6 +1,6 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ /* - * Copyright (c) 2014-2019 Intel, Inc. All rights reserved. + * Copyright (c) 2014-2018 Intel, Inc. All rights reserved. * Copyright (c) 2016 Mellanox Technologies, Inc. * All rights reserved. * Copyright (c) 2016 IBM Corporation. All rights reserved. diff --git a/opal/mca/pmix/pmix4x/pmix/src/common/pmix_query.c b/opal/mca/pmix/pmix4x/openpmix/src/common/pmix_query.c similarity index 96% rename from opal/mca/pmix/pmix4x/pmix/src/common/pmix_query.c rename to opal/mca/pmix/pmix4x/openpmix/src/common/pmix_query.c index a0b01525fb..22b01c5bdb 100644 --- a/opal/mca/pmix/pmix4x/pmix/src/common/pmix_query.c +++ b/opal/mca/pmix/pmix4x/openpmix/src/common/pmix_query.c @@ -439,7 +439,22 @@ static void acb(pmix_status_t status, void *release_cbdata) { pmix_cb_t *cb = (pmix_cb_t*)cbdata; + size_t n; + cb->status = status; + if (NULL != info) { + PMIX_INFO_CREATE(cb->info, ninfo); + if (NULL == cb->info) { + cb->status = PMIX_ERR_NOMEM; + goto done; + } + cb->ninfo = ninfo; + for (n=0; n < ninfo; n++) { + PMIX_INFO_XFER(&cb->info[n], &info[n]); + } + } + + done: if (NULL != release_fn) { release_fn(release_cbdata); } @@ -447,7 +462,8 @@ static void acb(pmix_status_t status, } PMIX_EXPORT pmix_status_t PMIx_Allocation_request(pmix_alloc_directive_t directive, - pmix_info_t *info, size_t ninfo) + pmix_info_t *info, size_t ninfo, + pmix_info_t **results, size_t *nresults) { pmix_cb_t cb; pmix_status_t rc; @@ -463,6 +479,10 @@ PMIX_EXPORT pmix_status_t PMIx_Allocation_request(pmix_alloc_directive_t directi pmix_output_verbose(2, pmix_globals.debug_output, "%s pmix:allocate", PMIX_NAME_PRINT(&pmix_globals.myid)); + /* set the default response */ + *results = NULL; + *nresults = 0; + /* create a callback object as we need to pass it to the * recv routine so we know which callback to use when * the return message is recvd */ @@ -476,6 +496,13 @@ PMIX_EXPORT pmix_status_t PMIx_Allocation_request(pmix_alloc_directive_t directi /* wait for the operation to complete */ PMIX_WAIT_THREAD(&cb.lock); rc = cb.status; + if (NULL != cb.info) { + *results = cb.info; + *nresults = cb.ninfo; + /* protect the data */ + cb.info = NULL; + cb.ninfo = 0; + } PMIX_DESTRUCT(&cb); pmix_output_verbose(2, pmix_globals.debug_output, diff --git a/opal/mca/pmix/pmix4x/pmix/src/common/pmix_security.c b/opal/mca/pmix/pmix4x/openpmix/src/common/pmix_security.c similarity index 83% rename from opal/mca/pmix/pmix4x/pmix/src/common/pmix_security.c rename to opal/mca/pmix/pmix4x/openpmix/src/common/pmix_security.c index fef84599ae..9a33cc0043 100644 --- a/opal/mca/pmix/pmix4x/pmix/src/common/pmix_security.c +++ b/opal/mca/pmix/pmix4x/openpmix/src/common/pmix_security.c @@ -1,6 +1,6 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ /* - * Copyright (c) 2014-2018 Intel, Inc. All rights reserved. + * Copyright (c) 2014-2019 Intel, Inc. All rights reserved. * Copyright (c) 2016 Mellanox Technologies, Inc. * All rights reserved. * Copyright (c) 2016 IBM Corporation. All rights reserved. @@ -110,8 +110,46 @@ static void getcbfunc(struct pmix_peer_t *peer, PMIX_RELEASE(cd); } +static void mycdcb(pmix_status_t status, + pmix_byte_object_t *credential, + pmix_info_t info[], size_t ninfo, + void *cbdata) +{ + pmix_query_caddy_t *cb = (pmix_query_caddy_t*)cbdata; + + PMIX_ACQUIRE_OBJECT(cb); + cb->status = status; + if (PMIX_SUCCESS == status && NULL != credential) { + cb->bo.bytes = malloc(credential->size); + memcpy(cb->bo.bytes, credential->bytes, credential->size); + cb->bo.size = credential->size; + } + PMIX_WAKEUP_THREAD(&cb->lock); +} + PMIX_EXPORT pmix_status_t PMIx_Get_credential(const pmix_info_t info[], size_t ninfo, - pmix_credential_cbfunc_t cbfunc, void *cbdata) + pmix_byte_object_t *credential) +{ + pmix_query_caddy_t cb; + pmix_status_t rc; + + PMIX_CONSTRUCT(&cb, pmix_query_caddy_t); + rc = PMIx_Get_credential_nb(info, ninfo, mycdcb, &cb); + if (PMIX_SUCCESS == rc) { + PMIX_WAIT_THREAD(&cb.lock); + rc = cb.status; + if (NULL != cb.bo.bytes) { + credential->bytes = malloc(cb.bo.size); + memcpy(credential->bytes, cb.bo.bytes, cb.bo.size); + credential->size = cb.bo.size; + } + } + PMIX_DESTRUCT(&cb); + return rc; +} + +PMIX_EXPORT pmix_status_t PMIx_Get_credential_nb(const pmix_info_t info[], size_t ninfo, + pmix_credential_cbfunc_t cbfunc, void *cbdata) { pmix_buffer_t *msg; pmix_cmd_t cmd = PMIX_GET_CREDENTIAL_CMD; @@ -296,9 +334,52 @@ static void valid_cbfunc(struct pmix_peer_t *peer, PMIX_RELEASE(cd); } +static void myvalcb(pmix_status_t status, + pmix_info_t info[], size_t ninfo, + void *cbdata) +{ + pmix_query_caddy_t *cb = (pmix_query_caddy_t*)cbdata; + size_t n; + + PMIX_ACQUIRE_OBJECT(cb); + cb->status = status; + if (PMIX_SUCCESS == status && NULL != info) { + cb->ninfo = ninfo; + PMIX_INFO_CREATE(cb->info, cb->ninfo); + for (n=0; n < ninfo; n++) { + PMIX_INFO_XFER(&cb->info[n], &info[n]); + } + } + PMIX_WAKEUP_THREAD(&cb->lock); +} + PMIX_EXPORT pmix_status_t PMIx_Validate_credential(const pmix_byte_object_t *cred, const pmix_info_t directives[], size_t ndirs, - pmix_validation_cbfunc_t cbfunc, void *cbdata) + pmix_info_t *results[], size_t *nresults) +{ + pmix_query_caddy_t cb; + pmix_status_t rc; + + PMIX_CONSTRUCT(&cb, pmix_query_caddy_t); + rc = PMIx_Validate_credential_nb(cred, directives, ndirs, myvalcb, &cb); + if (PMIX_SUCCESS == rc) { + PMIX_WAIT_THREAD(&cb.lock); + rc = cb.status; + if (NULL != cb.info) { + *results = cb.info; + *nresults = cb.ninfo; + cb.info = NULL; + cb.ninfo = 0; + } + } + PMIX_DESTRUCT(&cb); + return rc; +} + + +PMIX_EXPORT pmix_status_t PMIx_Validate_credential_nb(const pmix_byte_object_t *cred, + const pmix_info_t directives[], size_t ndirs, + pmix_validation_cbfunc_t cbfunc, void *cbdata) { pmix_buffer_t *msg; pmix_cmd_t cmd = PMIX_VALIDATE_CRED_CMD; diff --git a/opal/mca/pmix/pmix4x/pmix/src/common/pmix_strings.c b/opal/mca/pmix/pmix4x/openpmix/src/common/pmix_strings.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/common/pmix_strings.c rename to opal/mca/pmix/pmix4x/openpmix/src/common/pmix_strings.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/event/Makefile.include b/opal/mca/pmix/pmix4x/openpmix/src/event/Makefile.include similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/event/Makefile.include rename to opal/mca/pmix/pmix4x/openpmix/src/event/Makefile.include diff --git a/opal/mca/pmix/pmix4x/pmix/src/event/pmix_event.h b/opal/mca/pmix/pmix4x/openpmix/src/event/pmix_event.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/event/pmix_event.h rename to opal/mca/pmix/pmix4x/openpmix/src/event/pmix_event.h diff --git a/opal/mca/pmix/pmix4x/pmix/src/event/pmix_event_notification.c b/opal/mca/pmix/pmix4x/openpmix/src/event/pmix_event_notification.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/event/pmix_event_notification.c rename to opal/mca/pmix/pmix4x/openpmix/src/event/pmix_event_notification.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/event/pmix_event_registration.c b/opal/mca/pmix/pmix4x/openpmix/src/event/pmix_event_registration.c similarity index 95% rename from opal/mca/pmix/pmix4x/pmix/src/event/pmix_event_registration.c rename to opal/mca/pmix/pmix4x/openpmix/src/event/pmix_event_registration.c index be2346048d..fa3b3808d3 100644 --- a/opal/mca/pmix/pmix4x/pmix/src/event/pmix_event_registration.c +++ b/opal/mca/pmix/pmix4x/openpmix/src/event/pmix_event_registration.c @@ -30,6 +30,8 @@ pmix_object_t super; volatile bool active; pmix_event_t ev; + pmix_lock_t lock; + pmix_status_t status; size_t index; bool firstoverall; bool enviro; @@ -48,6 +50,7 @@ } pmix_rshift_caddy_t; static void rscon(pmix_rshift_caddy_t *p) { + PMIX_CONSTRUCT_LOCK(&p->lock); p->firstoverall = false; p->enviro = false; p->list = NULL; @@ -65,6 +68,7 @@ static void rscon(pmix_rshift_caddy_t *p) } static void rsdes(pmix_rshift_caddy_t *p) { + PMIX_DESTRUCT_LOCK(&p->lock); if (0 < p->ncodes) { free(p->codes); } @@ -849,23 +853,36 @@ static void reg_event_hdlr(int sd, short args, void *cbdata) PMIX_RELEASE(cd); } -PMIX_EXPORT void PMIx_Register_event_handler(pmix_status_t codes[], size_t ncodes, - pmix_info_t info[], size_t ninfo, - pmix_notification_fn_t event_hdlr, - pmix_hdlr_reg_cbfunc_t cbfunc, - void *cbdata) +static void mycbfn(pmix_status_t status, + size_t refid, + void *cbdata) +{ + pmix_rshift_caddy_t *cd = (pmix_rshift_caddy_t*)cbdata; + + PMIX_ACQUIRE_OBJECT(cd); + if (PMIX_SUCCESS == status) { + cd->status = refid; + } else { + cd->status = status; + } + PMIX_WAKEUP_THREAD(&cd->lock); +} + +PMIX_EXPORT pmix_status_t PMIx_Register_event_handler(pmix_status_t codes[], size_t ncodes, + pmix_info_t info[], size_t ninfo, + pmix_notification_fn_t event_hdlr, + pmix_hdlr_reg_cbfunc_t cbfunc, + void *cbdata) { pmix_rshift_caddy_t *cd; size_t n; + pmix_status_t rc = PMIX_SUCCESS; PMIX_ACQUIRE_THREAD(&pmix_global_lock); if (pmix_globals.init_cntr <= 0) { PMIX_RELEASE_THREAD(&pmix_global_lock); - if (NULL != cbfunc) { - cbfunc(PMIX_ERR_INIT, 0, cbdata); - } - return; + return PMIX_ERR_INIT; } PMIX_RELEASE_THREAD(&pmix_global_lock); @@ -880,10 +897,7 @@ PMIX_EXPORT void PMIx_Register_event_handler(pmix_status_t codes[], size_t ncode if (NULL == cd->codes) { /* immediately return error */ PMIX_RELEASE(cd); - if (NULL != cbfunc) { - cbfunc(PMIX_ERR_NOMEM, SIZE_MAX, cbdata); - } - return; + return PMIX_ERR_NOMEM; } for (n=0; n < ncodes; n++) { cd->codes[n] = codes[n]; @@ -893,13 +907,25 @@ PMIX_EXPORT void PMIx_Register_event_handler(pmix_status_t codes[], size_t ncode cd->info = info; cd->ninfo = ninfo; cd->evhdlr = event_hdlr; - cd->evregcbfn = cbfunc; - cd->cbdata = cbdata; + if (NULL == cbfunc) { + cd->evregcbfn = mycbfn; + cd->cbdata = cd; + } else { + cd->evregcbfn = cbfunc; + cd->cbdata = cbdata; + } pmix_output_verbose(2, pmix_client_globals.event_output, "pmix_register_event_hdlr shifting to progress thread"); PMIX_THREADSHIFT(cd, reg_event_hdlr); + + if (NULL == cbfunc) { + PMIX_WAIT_THREAD(&cd->lock); + rc = cd->status; + PMIX_RELEASE(cd); + } + return rc; } static void dereg_event_hdlr(int sd, short args, void *cbdata) @@ -1090,29 +1116,49 @@ static void dereg_event_hdlr(int sd, short args, void *cbdata) PMIX_RELEASE(cd); } -PMIX_EXPORT void PMIx_Deregister_event_handler(size_t event_hdlr_ref, - pmix_op_cbfunc_t cbfunc, - void *cbdata) +static void myopcb(pmix_status_t status, void *cbdata) +{ + pmix_shift_caddy_t *cd = (pmix_shift_caddy_t*)cbdata; + + PMIX_ACQUIRE_OBJECT(cd); + cd->status = status; + PMIX_WAKEUP_THREAD(&cd->lock); +} + +PMIX_EXPORT pmix_status_t PMIx_Deregister_event_handler(size_t event_hdlr_ref, + pmix_op_cbfunc_t cbfunc, + void *cbdata) { pmix_shift_caddy_t *cd; + pmix_status_t rc = PMIX_SUCCESS; PMIX_ACQUIRE_THREAD(&pmix_global_lock); if (pmix_globals.init_cntr <= 0) { PMIX_RELEASE_THREAD(&pmix_global_lock); - if (NULL != cbfunc) { - cbfunc(PMIX_ERR_INIT, cbdata); - } - return; + return PMIX_ERR_INIT; } PMIX_RELEASE_THREAD(&pmix_global_lock); /* need to thread shift this request */ cd = PMIX_NEW(pmix_shift_caddy_t); - cd->cbfunc.opcbfn = cbfunc; - cd->cbdata = cbdata; + if (NULL == cbfunc) { + cd->cbfunc.opcbfn = myopcb; + PMIX_RETAIN(cd); + cd->cbdata = cd; + } else { + cd->cbfunc.opcbfn = cbfunc; + cd->cbdata = cbdata; + } cd->ref = event_hdlr_ref; pmix_output_verbose(2, pmix_client_globals.event_output, "pmix_deregister_event_hdlr shifting to progress thread"); PMIX_THREADSHIFT(cd, dereg_event_hdlr); + + if (NULL == cbfunc) { + PMIX_WAIT_THREAD(&cd->lock); + rc = cd->status; + PMIX_RELEASE(cd); + } + return rc; } diff --git a/opal/mca/pmix/pmix4x/pmix/src/hwloc/Makefile.include b/opal/mca/pmix/pmix4x/openpmix/src/hwloc/Makefile.include similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/hwloc/Makefile.include rename to opal/mca/pmix/pmix4x/openpmix/src/hwloc/Makefile.include diff --git a/opal/mca/pmix/pmix4x/pmix/src/hwloc/hwloc-internal.h b/opal/mca/pmix/pmix4x/openpmix/src/hwloc/hwloc-internal.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/hwloc/hwloc-internal.h rename to opal/mca/pmix/pmix4x/openpmix/src/hwloc/hwloc-internal.h diff --git a/opal/mca/pmix/pmix4x/pmix/src/hwloc/hwloc.c b/opal/mca/pmix/pmix4x/openpmix/src/hwloc/hwloc.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/hwloc/hwloc.c rename to opal/mca/pmix/pmix4x/openpmix/src/hwloc/hwloc.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/include/Makefile.include b/opal/mca/pmix/pmix4x/openpmix/src/include/Makefile.include similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/include/Makefile.include rename to opal/mca/pmix/pmix4x/openpmix/src/include/Makefile.include diff --git a/opal/mca/pmix/pmix4x/pmix/src/include/align.h b/opal/mca/pmix/pmix4x/openpmix/src/include/align.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/include/align.h rename to opal/mca/pmix/pmix4x/openpmix/src/include/align.h diff --git a/opal/mca/pmix/pmix4x/pmix/src/include/hash_string.h b/opal/mca/pmix/pmix4x/openpmix/src/include/hash_string.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/include/hash_string.h rename to opal/mca/pmix/pmix4x/openpmix/src/include/hash_string.h diff --git a/opal/mca/pmix/pmix4x/pmix/src/include/pmix_config_bottom.h b/opal/mca/pmix/pmix4x/openpmix/src/include/pmix_config_bottom.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/include/pmix_config_bottom.h rename to opal/mca/pmix/pmix4x/openpmix/src/include/pmix_config_bottom.h diff --git a/opal/mca/pmix/pmix4x/pmix/src/include/pmix_config_top.h b/opal/mca/pmix/pmix4x/openpmix/src/include/pmix_config_top.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/include/pmix_config_top.h rename to opal/mca/pmix/pmix4x/openpmix/src/include/pmix_config_top.h diff --git a/opal/mca/pmix/pmix4x/pmix/src/include/pmix_globals.c b/opal/mca/pmix/pmix4x/openpmix/src/include/pmix_globals.c similarity index 99% rename from opal/mca/pmix/pmix4x/pmix/src/include/pmix_globals.c rename to opal/mca/pmix/pmix4x/openpmix/src/include/pmix_globals.c index 49cb51101a..9e8bf845ee 100644 --- a/opal/mca/pmix/pmix4x/pmix/src/include/pmix_globals.c +++ b/opal/mca/pmix/pmix4x/openpmix/src/include/pmix_globals.c @@ -308,7 +308,6 @@ static void cbcon(pmix_cb_t *p) PMIX_CONSTRUCT(&p->kvs, pmix_list_t); p->copy = false; p->timer_running = false; - p->level = PMIX_LEVEL_UNDEF; } static void cbdes(pmix_cb_t *p) { @@ -388,6 +387,7 @@ void pmix_execute_epilog(pmix_epilog_t *epi) * some minimum level of protection */ tmp = pmix_argv_split(cf->path, ','); for (n=0; NULL != tmp[n]; n++) { + /* coverity[toctou] */ rc = stat(tmp[n], &statbuf); if (0 != rc) { pmix_output_verbose(10, pmix_globals.debug_output, @@ -421,6 +421,7 @@ void pmix_execute_epilog(pmix_epilog_t *epi) * some minimum level of protection */ tmp = pmix_argv_split(cd->path, ','); for (n=0; NULL != tmp[n]; n++) { + /* coverity[toctou] */ rc = stat(tmp[n], &statbuf); if (0 != rc) { pmix_output_verbose(10, pmix_globals.debug_output, @@ -506,6 +507,7 @@ static void dirpath_destroy(char *path, pmix_cleanup_dir_t *cd, pmix_epilog_t *e /* Check to see if it is a directory */ is_dir = false; + /* coverity[toctou] */ rc = stat(filenm, &buf); if (0 > rc) { /* Handle a race condition. filenm might have been deleted by an diff --git a/opal/mca/pmix/pmix4x/pmix/src/include/pmix_globals.h b/opal/mca/pmix/pmix4x/openpmix/src/include/pmix_globals.h similarity index 98% rename from opal/mca/pmix/pmix4x/pmix/src/include/pmix_globals.h rename to opal/mca/pmix/pmix4x/openpmix/src/include/pmix_globals.h index 442cdc892e..667e0e5d6b 100644 --- a/opal/mca/pmix/pmix4x/pmix/src/include/pmix_globals.h +++ b/opal/mca/pmix/pmix4x/openpmix/src/include/pmix_globals.h @@ -133,16 +133,6 @@ typedef enum { PMIX_COLLECT_MAX } pmix_collect_t; -/* define a set of flags indicating the level - * of information being stored/requested */ -typedef enum { - PMIX_LEVEL_UNDEF, - PMIX_LEVEL_SESSION, - PMIX_LEVEL_JOB, - PMIX_LEVEL_APP, - PMIX_LEVEL_NODE -} pmix_level_t; - /**** PEER STRUCTURES ****/ /* clients can only talk to their server, and servers are @@ -416,7 +406,6 @@ typedef struct { pmix_list_t kvs; bool copy; bool timer_running; - pmix_level_t level; } pmix_cb_t; PMIX_CLASS_DECLARATION(pmix_cb_t); diff --git a/opal/mca/pmix/pmix4x/pmix/src/include/pmix_portable_platform.h b/opal/mca/pmix/pmix4x/openpmix/src/include/pmix_portable_platform.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/include/pmix_portable_platform.h rename to opal/mca/pmix/pmix4x/openpmix/src/include/pmix_portable_platform.h diff --git a/opal/mca/pmix/pmix4x/pmix/src/include/pmix_socket_errno.h b/opal/mca/pmix/pmix4x/openpmix/src/include/pmix_socket_errno.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/include/pmix_socket_errno.h rename to opal/mca/pmix/pmix4x/openpmix/src/include/pmix_socket_errno.h diff --git a/opal/mca/pmix/pmix4x/pmix/src/include/pmix_stdatomic.h b/opal/mca/pmix/pmix4x/openpmix/src/include/pmix_stdatomic.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/include/pmix_stdatomic.h rename to opal/mca/pmix/pmix4x/openpmix/src/include/pmix_stdatomic.h diff --git a/opal/mca/pmix/pmix4x/pmix/src/include/pmix_stdint.h b/opal/mca/pmix/pmix4x/openpmix/src/include/pmix_stdint.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/include/pmix_stdint.h rename to opal/mca/pmix/pmix4x/openpmix/src/include/pmix_stdint.h diff --git a/opal/mca/pmix/pmix4x/pmix/src/include/prefetch.h b/opal/mca/pmix/pmix4x/openpmix/src/include/prefetch.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/include/prefetch.h rename to opal/mca/pmix/pmix4x/openpmix/src/include/prefetch.h diff --git a/opal/mca/pmix/pmix4x/pmix/src/include/types.h b/opal/mca/pmix/pmix4x/openpmix/src/include/types.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/include/types.h rename to opal/mca/pmix/pmix4x/openpmix/src/include/types.h diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/Makefile.include b/opal/mca/pmix/pmix4x/openpmix/src/mca/Makefile.include similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/Makefile.include rename to opal/mca/pmix/pmix4x/openpmix/src/mca/Makefile.include diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/base/Makefile.am b/opal/mca/pmix/pmix4x/openpmix/src/mca/base/Makefile.am similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/base/Makefile.am rename to opal/mca/pmix/pmix4x/openpmix/src/mca/base/Makefile.am diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/base/base.h b/opal/mca/pmix/pmix4x/openpmix/src/mca/base/base.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/base/base.h rename to opal/mca/pmix/pmix4x/openpmix/src/mca/base/base.h diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/base/help-pmix-mca-base.txt b/opal/mca/pmix/pmix4x/openpmix/src/mca/base/help-pmix-mca-base.txt similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/base/help-pmix-mca-base.txt rename to opal/mca/pmix/pmix4x/openpmix/src/mca/base/help-pmix-mca-base.txt diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/base/help-pmix-mca-var.txt b/opal/mca/pmix/pmix4x/openpmix/src/mca/base/help-pmix-mca-var.txt similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/base/help-pmix-mca-var.txt rename to opal/mca/pmix/pmix4x/openpmix/src/mca/base/help-pmix-mca-var.txt diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/base/pmix_mca_base_close.c b/opal/mca/pmix/pmix4x/openpmix/src/mca/base/pmix_mca_base_close.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/base/pmix_mca_base_close.c rename to opal/mca/pmix/pmix4x/openpmix/src/mca/base/pmix_mca_base_close.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/base/pmix_mca_base_cmd_line.c b/opal/mca/pmix/pmix4x/openpmix/src/mca/base/pmix_mca_base_cmd_line.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/base/pmix_mca_base_cmd_line.c rename to opal/mca/pmix/pmix4x/openpmix/src/mca/base/pmix_mca_base_cmd_line.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/base/pmix_mca_base_component_compare.c b/opal/mca/pmix/pmix4x/openpmix/src/mca/base/pmix_mca_base_component_compare.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/base/pmix_mca_base_component_compare.c rename to opal/mca/pmix/pmix4x/openpmix/src/mca/base/pmix_mca_base_component_compare.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/base/pmix_mca_base_component_find.c b/opal/mca/pmix/pmix4x/openpmix/src/mca/base/pmix_mca_base_component_find.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/base/pmix_mca_base_component_find.c rename to opal/mca/pmix/pmix4x/openpmix/src/mca/base/pmix_mca_base_component_find.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/base/pmix_mca_base_component_repository.c b/opal/mca/pmix/pmix4x/openpmix/src/mca/base/pmix_mca_base_component_repository.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/base/pmix_mca_base_component_repository.c rename to opal/mca/pmix/pmix4x/openpmix/src/mca/base/pmix_mca_base_component_repository.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/base/pmix_mca_base_component_repository.h b/opal/mca/pmix/pmix4x/openpmix/src/mca/base/pmix_mca_base_component_repository.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/base/pmix_mca_base_component_repository.h rename to opal/mca/pmix/pmix4x/openpmix/src/mca/base/pmix_mca_base_component_repository.h diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/base/pmix_mca_base_components_close.c b/opal/mca/pmix/pmix4x/openpmix/src/mca/base/pmix_mca_base_components_close.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/base/pmix_mca_base_components_close.c rename to opal/mca/pmix/pmix4x/openpmix/src/mca/base/pmix_mca_base_components_close.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/base/pmix_mca_base_components_open.c b/opal/mca/pmix/pmix4x/openpmix/src/mca/base/pmix_mca_base_components_open.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/base/pmix_mca_base_components_open.c rename to opal/mca/pmix/pmix4x/openpmix/src/mca/base/pmix_mca_base_components_open.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/base/pmix_mca_base_components_register.c b/opal/mca/pmix/pmix4x/openpmix/src/mca/base/pmix_mca_base_components_register.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/base/pmix_mca_base_components_register.c rename to opal/mca/pmix/pmix4x/openpmix/src/mca/base/pmix_mca_base_components_register.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/base/pmix_mca_base_components_select.c b/opal/mca/pmix/pmix4x/openpmix/src/mca/base/pmix_mca_base_components_select.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/base/pmix_mca_base_components_select.c rename to opal/mca/pmix/pmix4x/openpmix/src/mca/base/pmix_mca_base_components_select.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/base/pmix_mca_base_framework.c b/opal/mca/pmix/pmix4x/openpmix/src/mca/base/pmix_mca_base_framework.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/base/pmix_mca_base_framework.c rename to opal/mca/pmix/pmix4x/openpmix/src/mca/base/pmix_mca_base_framework.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/base/pmix_mca_base_framework.h b/opal/mca/pmix/pmix4x/openpmix/src/mca/base/pmix_mca_base_framework.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/base/pmix_mca_base_framework.h rename to opal/mca/pmix/pmix4x/openpmix/src/mca/base/pmix_mca_base_framework.h diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/base/pmix_mca_base_list.c b/opal/mca/pmix/pmix4x/openpmix/src/mca/base/pmix_mca_base_list.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/base/pmix_mca_base_list.c rename to opal/mca/pmix/pmix4x/openpmix/src/mca/base/pmix_mca_base_list.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/base/pmix_mca_base_open.c b/opal/mca/pmix/pmix4x/openpmix/src/mca/base/pmix_mca_base_open.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/base/pmix_mca_base_open.c rename to opal/mca/pmix/pmix4x/openpmix/src/mca/base/pmix_mca_base_open.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/base/pmix_mca_base_parse_paramfile.c b/opal/mca/pmix/pmix4x/openpmix/src/mca/base/pmix_mca_base_parse_paramfile.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/base/pmix_mca_base_parse_paramfile.c rename to opal/mca/pmix/pmix4x/openpmix/src/mca/base/pmix_mca_base_parse_paramfile.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/base/pmix_mca_base_var.c b/opal/mca/pmix/pmix4x/openpmix/src/mca/base/pmix_mca_base_var.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/base/pmix_mca_base_var.c rename to opal/mca/pmix/pmix4x/openpmix/src/mca/base/pmix_mca_base_var.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/base/pmix_mca_base_var.h b/opal/mca/pmix/pmix4x/openpmix/src/mca/base/pmix_mca_base_var.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/base/pmix_mca_base_var.h rename to opal/mca/pmix/pmix4x/openpmix/src/mca/base/pmix_mca_base_var.h diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/base/pmix_mca_base_var_enum.c b/opal/mca/pmix/pmix4x/openpmix/src/mca/base/pmix_mca_base_var_enum.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/base/pmix_mca_base_var_enum.c rename to opal/mca/pmix/pmix4x/openpmix/src/mca/base/pmix_mca_base_var_enum.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/base/pmix_mca_base_var_enum.h b/opal/mca/pmix/pmix4x/openpmix/src/mca/base/pmix_mca_base_var_enum.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/base/pmix_mca_base_var_enum.h rename to opal/mca/pmix/pmix4x/openpmix/src/mca/base/pmix_mca_base_var_enum.h diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/base/pmix_mca_base_var_group.c b/opal/mca/pmix/pmix4x/openpmix/src/mca/base/pmix_mca_base_var_group.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/base/pmix_mca_base_var_group.c rename to opal/mca/pmix/pmix4x/openpmix/src/mca/base/pmix_mca_base_var_group.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/base/pmix_mca_base_var_group.h b/opal/mca/pmix/pmix4x/openpmix/src/mca/base/pmix_mca_base_var_group.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/base/pmix_mca_base_var_group.h rename to opal/mca/pmix/pmix4x/openpmix/src/mca/base/pmix_mca_base_var_group.h diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/base/pmix_mca_base_vari.h b/opal/mca/pmix/pmix4x/openpmix/src/mca/base/pmix_mca_base_vari.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/base/pmix_mca_base_vari.h rename to opal/mca/pmix/pmix4x/openpmix/src/mca/base/pmix_mca_base_vari.h diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/bfrops/Makefile.am b/opal/mca/pmix/pmix4x/openpmix/src/mca/bfrops/Makefile.am similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/bfrops/Makefile.am rename to opal/mca/pmix/pmix4x/openpmix/src/mca/bfrops/Makefile.am diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/bfrops/base/Makefile.include b/opal/mca/pmix/pmix4x/openpmix/src/mca/bfrops/base/Makefile.include similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/bfrops/base/Makefile.include rename to opal/mca/pmix/pmix4x/openpmix/src/mca/bfrops/base/Makefile.include diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/bfrops/base/base.h b/opal/mca/pmix/pmix4x/openpmix/src/mca/bfrops/base/base.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/bfrops/base/base.h rename to opal/mca/pmix/pmix4x/openpmix/src/mca/bfrops/base/base.h diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/bfrops/base/bfrop_base_copy.c b/opal/mca/pmix/pmix4x/openpmix/src/mca/bfrops/base/bfrop_base_copy.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/bfrops/base/bfrop_base_copy.c rename to opal/mca/pmix/pmix4x/openpmix/src/mca/bfrops/base/bfrop_base_copy.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/bfrops/base/bfrop_base_fns.c b/opal/mca/pmix/pmix4x/openpmix/src/mca/bfrops/base/bfrop_base_fns.c similarity index 98% rename from opal/mca/pmix/pmix4x/pmix/src/mca/bfrops/base/bfrop_base_fns.c rename to opal/mca/pmix/pmix4x/openpmix/src/mca/bfrops/base/bfrop_base_fns.c index 7441289a9f..ffc2dc7d48 100644 --- a/opal/mca/pmix/pmix4x/pmix/src/mca/bfrops/base/bfrop_base_fns.c +++ b/opal/mca/pmix/pmix4x/openpmix/src/mca/bfrops/base/bfrop_base_fns.c @@ -564,23 +564,23 @@ pmix_value_cmp_t pmix_bfrops_base_value_cmp(pmix_value_t *p, rc = PMIX_EQUAL; break; case PMIX_COORD: - rc = memcmp(p->data.coord, p1->data.coord, sizeof(pmix_coord_t)); - if (0 > rc) { - rc = PMIX_VALUE2_GREATER; - } else if (0 < rc) { - rc = PMIX_VALUE1_GREATER; + ret = memcmp(p->data.coord, p1->data.coord, sizeof(pmix_coord_t)); + if (0 > ret) { + return PMIX_VALUE2_GREATER; + } else if (0 < ret) { + return PMIX_VALUE1_GREATER; } else { - rc = PMIX_EQUAL; + return PMIX_EQUAL; } break; case PMIX_REGATTR: - rc = memcmp(p->data.ptr, p1->data.ptr, sizeof(pmix_regattr_t)); - if (0 > rc) { - rc = PMIX_VALUE2_GREATER; - } else if (0 < rc) { - rc = PMIX_VALUE1_GREATER; + ret = memcmp(p->data.ptr, p1->data.ptr, sizeof(pmix_regattr_t)); + if (0 > ret) { + return PMIX_VALUE2_GREATER; + } else if (0 < ret) { + return PMIX_VALUE1_GREATER; } else { - rc = PMIX_EQUAL; + return PMIX_EQUAL; } break; diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/bfrops/base/bfrop_base_frame.c b/opal/mca/pmix/pmix4x/openpmix/src/mca/bfrops/base/bfrop_base_frame.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/bfrops/base/bfrop_base_frame.c rename to opal/mca/pmix/pmix4x/openpmix/src/mca/bfrops/base/bfrop_base_frame.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/bfrops/base/bfrop_base_pack.c b/opal/mca/pmix/pmix4x/openpmix/src/mca/bfrops/base/bfrop_base_pack.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/bfrops/base/bfrop_base_pack.c rename to opal/mca/pmix/pmix4x/openpmix/src/mca/bfrops/base/bfrop_base_pack.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/bfrops/base/bfrop_base_print.c b/opal/mca/pmix/pmix4x/openpmix/src/mca/bfrops/base/bfrop_base_print.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/bfrops/base/bfrop_base_print.c rename to opal/mca/pmix/pmix4x/openpmix/src/mca/bfrops/base/bfrop_base_print.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/bfrops/base/bfrop_base_select.c b/opal/mca/pmix/pmix4x/openpmix/src/mca/bfrops/base/bfrop_base_select.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/bfrops/base/bfrop_base_select.c rename to opal/mca/pmix/pmix4x/openpmix/src/mca/bfrops/base/bfrop_base_select.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/bfrops/base/bfrop_base_stubs.c b/opal/mca/pmix/pmix4x/openpmix/src/mca/bfrops/base/bfrop_base_stubs.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/bfrops/base/bfrop_base_stubs.c rename to opal/mca/pmix/pmix4x/openpmix/src/mca/bfrops/base/bfrop_base_stubs.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/bfrops/base/bfrop_base_unpack.c b/opal/mca/pmix/pmix4x/openpmix/src/mca/bfrops/base/bfrop_base_unpack.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/bfrops/base/bfrop_base_unpack.c rename to opal/mca/pmix/pmix4x/openpmix/src/mca/bfrops/base/bfrop_base_unpack.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/bfrops/bfrops.h b/opal/mca/pmix/pmix4x/openpmix/src/mca/bfrops/bfrops.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/bfrops/bfrops.h rename to opal/mca/pmix/pmix4x/openpmix/src/mca/bfrops/bfrops.h diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/bfrops/bfrops_types.h b/opal/mca/pmix/pmix4x/openpmix/src/mca/bfrops/bfrops_types.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/bfrops/bfrops_types.h rename to opal/mca/pmix/pmix4x/openpmix/src/mca/bfrops/bfrops_types.h diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/bfrops/v12/Makefile.am b/opal/mca/pmix/pmix4x/openpmix/src/mca/bfrops/v12/Makefile.am similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/bfrops/v12/Makefile.am rename to opal/mca/pmix/pmix4x/openpmix/src/mca/bfrops/v12/Makefile.am diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/bfrops/v12/bfrop_v12.c b/opal/mca/pmix/pmix4x/openpmix/src/mca/bfrops/v12/bfrop_v12.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/bfrops/v12/bfrop_v12.c rename to opal/mca/pmix/pmix4x/openpmix/src/mca/bfrops/v12/bfrop_v12.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/bfrops/v12/bfrop_v12.h b/opal/mca/pmix/pmix4x/openpmix/src/mca/bfrops/v12/bfrop_v12.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/bfrops/v12/bfrop_v12.h rename to opal/mca/pmix/pmix4x/openpmix/src/mca/bfrops/v12/bfrop_v12.h diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/bfrops/v12/bfrop_v12_component.c b/opal/mca/pmix/pmix4x/openpmix/src/mca/bfrops/v12/bfrop_v12_component.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/bfrops/v12/bfrop_v12_component.c rename to opal/mca/pmix/pmix4x/openpmix/src/mca/bfrops/v12/bfrop_v12_component.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/bfrops/v12/copy.c b/opal/mca/pmix/pmix4x/openpmix/src/mca/bfrops/v12/copy.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/bfrops/v12/copy.c rename to opal/mca/pmix/pmix4x/openpmix/src/mca/bfrops/v12/copy.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/bfrops/v12/internal.h b/opal/mca/pmix/pmix4x/openpmix/src/mca/bfrops/v12/internal.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/bfrops/v12/internal.h rename to opal/mca/pmix/pmix4x/openpmix/src/mca/bfrops/v12/internal.h diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/bfrops/v12/pack.c b/opal/mca/pmix/pmix4x/openpmix/src/mca/bfrops/v12/pack.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/bfrops/v12/pack.c rename to opal/mca/pmix/pmix4x/openpmix/src/mca/bfrops/v12/pack.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/bfrops/v12/print.c b/opal/mca/pmix/pmix4x/openpmix/src/mca/bfrops/v12/print.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/bfrops/v12/print.c rename to opal/mca/pmix/pmix4x/openpmix/src/mca/bfrops/v12/print.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/bfrops/v12/unpack.c b/opal/mca/pmix/pmix4x/openpmix/src/mca/bfrops/v12/unpack.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/bfrops/v12/unpack.c rename to opal/mca/pmix/pmix4x/openpmix/src/mca/bfrops/v12/unpack.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/bfrops/v20/Makefile.am b/opal/mca/pmix/pmix4x/openpmix/src/mca/bfrops/v20/Makefile.am similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/bfrops/v20/Makefile.am rename to opal/mca/pmix/pmix4x/openpmix/src/mca/bfrops/v20/Makefile.am diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/bfrops/v20/bfrop_pmix20.c b/opal/mca/pmix/pmix4x/openpmix/src/mca/bfrops/v20/bfrop_pmix20.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/bfrops/v20/bfrop_pmix20.c rename to opal/mca/pmix/pmix4x/openpmix/src/mca/bfrops/v20/bfrop_pmix20.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/bfrops/v20/bfrop_pmix20.h b/opal/mca/pmix/pmix4x/openpmix/src/mca/bfrops/v20/bfrop_pmix20.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/bfrops/v20/bfrop_pmix20.h rename to opal/mca/pmix/pmix4x/openpmix/src/mca/bfrops/v20/bfrop_pmix20.h diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/bfrops/v20/bfrop_pmix20_component.c b/opal/mca/pmix/pmix4x/openpmix/src/mca/bfrops/v20/bfrop_pmix20_component.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/bfrops/v20/bfrop_pmix20_component.c rename to opal/mca/pmix/pmix4x/openpmix/src/mca/bfrops/v20/bfrop_pmix20_component.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/bfrops/v20/copy.c b/opal/mca/pmix/pmix4x/openpmix/src/mca/bfrops/v20/copy.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/bfrops/v20/copy.c rename to opal/mca/pmix/pmix4x/openpmix/src/mca/bfrops/v20/copy.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/bfrops/v20/internal.h b/opal/mca/pmix/pmix4x/openpmix/src/mca/bfrops/v20/internal.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/bfrops/v20/internal.h rename to opal/mca/pmix/pmix4x/openpmix/src/mca/bfrops/v20/internal.h diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/bfrops/v20/pack.c b/opal/mca/pmix/pmix4x/openpmix/src/mca/bfrops/v20/pack.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/bfrops/v20/pack.c rename to opal/mca/pmix/pmix4x/openpmix/src/mca/bfrops/v20/pack.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/bfrops/v20/print.c b/opal/mca/pmix/pmix4x/openpmix/src/mca/bfrops/v20/print.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/bfrops/v20/print.c rename to opal/mca/pmix/pmix4x/openpmix/src/mca/bfrops/v20/print.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/bfrops/v20/unpack.c b/opal/mca/pmix/pmix4x/openpmix/src/mca/bfrops/v20/unpack.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/bfrops/v20/unpack.c rename to opal/mca/pmix/pmix4x/openpmix/src/mca/bfrops/v20/unpack.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/bfrops/v21/Makefile.am b/opal/mca/pmix/pmix4x/openpmix/src/mca/bfrops/v21/Makefile.am similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/bfrops/v21/Makefile.am rename to opal/mca/pmix/pmix4x/openpmix/src/mca/bfrops/v21/Makefile.am diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/bfrops/v21/bfrop_pmix21.c b/opal/mca/pmix/pmix4x/openpmix/src/mca/bfrops/v21/bfrop_pmix21.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/bfrops/v21/bfrop_pmix21.c rename to opal/mca/pmix/pmix4x/openpmix/src/mca/bfrops/v21/bfrop_pmix21.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/bfrops/v21/bfrop_pmix21.h b/opal/mca/pmix/pmix4x/openpmix/src/mca/bfrops/v21/bfrop_pmix21.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/bfrops/v21/bfrop_pmix21.h rename to opal/mca/pmix/pmix4x/openpmix/src/mca/bfrops/v21/bfrop_pmix21.h diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/bfrops/v21/bfrop_pmix21_component.c b/opal/mca/pmix/pmix4x/openpmix/src/mca/bfrops/v21/bfrop_pmix21_component.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/bfrops/v21/bfrop_pmix21_component.c rename to opal/mca/pmix/pmix4x/openpmix/src/mca/bfrops/v21/bfrop_pmix21_component.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/bfrops/v3/Makefile.am b/opal/mca/pmix/pmix4x/openpmix/src/mca/bfrops/v3/Makefile.am similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/bfrops/v3/Makefile.am rename to opal/mca/pmix/pmix4x/openpmix/src/mca/bfrops/v3/Makefile.am diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/bfrops/v3/bfrop_pmix3.c b/opal/mca/pmix/pmix4x/openpmix/src/mca/bfrops/v3/bfrop_pmix3.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/bfrops/v3/bfrop_pmix3.c rename to opal/mca/pmix/pmix4x/openpmix/src/mca/bfrops/v3/bfrop_pmix3.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/bfrops/v3/bfrop_pmix3.h b/opal/mca/pmix/pmix4x/openpmix/src/mca/bfrops/v3/bfrop_pmix3.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/bfrops/v3/bfrop_pmix3.h rename to opal/mca/pmix/pmix4x/openpmix/src/mca/bfrops/v3/bfrop_pmix3.h diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/bfrops/v3/bfrop_pmix3_component.c b/opal/mca/pmix/pmix4x/openpmix/src/mca/bfrops/v3/bfrop_pmix3_component.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/bfrops/v3/bfrop_pmix3_component.c rename to opal/mca/pmix/pmix4x/openpmix/src/mca/bfrops/v3/bfrop_pmix3_component.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/bfrops/v4/Makefile.am b/opal/mca/pmix/pmix4x/openpmix/src/mca/bfrops/v4/Makefile.am similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/bfrops/v4/Makefile.am rename to opal/mca/pmix/pmix4x/openpmix/src/mca/bfrops/v4/Makefile.am diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/bfrops/v4/bfrop_pmix4.c b/opal/mca/pmix/pmix4x/openpmix/src/mca/bfrops/v4/bfrop_pmix4.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/bfrops/v4/bfrop_pmix4.c rename to opal/mca/pmix/pmix4x/openpmix/src/mca/bfrops/v4/bfrop_pmix4.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/bfrops/v4/bfrop_pmix4.h b/opal/mca/pmix/pmix4x/openpmix/src/mca/bfrops/v4/bfrop_pmix4.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/bfrops/v4/bfrop_pmix4.h rename to opal/mca/pmix/pmix4x/openpmix/src/mca/bfrops/v4/bfrop_pmix4.h diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/bfrops/v4/bfrop_pmix4_component.c b/opal/mca/pmix/pmix4x/openpmix/src/mca/bfrops/v4/bfrop_pmix4_component.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/bfrops/v4/bfrop_pmix4_component.c rename to opal/mca/pmix/pmix4x/openpmix/src/mca/bfrops/v4/bfrop_pmix4_component.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/common/Makefile.am b/opal/mca/pmix/pmix4x/openpmix/src/mca/common/Makefile.am similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/common/Makefile.am rename to opal/mca/pmix/pmix4x/openpmix/src/mca/common/Makefile.am diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/common/dstore/Makefile.am b/opal/mca/pmix/pmix4x/openpmix/src/mca/common/dstore/Makefile.am similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/common/dstore/Makefile.am rename to opal/mca/pmix/pmix4x/openpmix/src/mca/common/dstore/Makefile.am diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/common/dstore/configure.m4 b/opal/mca/pmix/pmix4x/openpmix/src/mca/common/dstore/configure.m4 similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/common/dstore/configure.m4 rename to opal/mca/pmix/pmix4x/openpmix/src/mca/common/dstore/configure.m4 diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/common/dstore/dstore_base.c b/opal/mca/pmix/pmix4x/openpmix/src/mca/common/dstore/dstore_base.c similarity index 99% rename from opal/mca/pmix/pmix4x/pmix/src/mca/common/dstore/dstore_base.c rename to opal/mca/pmix/pmix4x/openpmix/src/mca/common/dstore/dstore_base.c index 88a7f216ae..5ddcf3e721 100644 --- a/opal/mca/pmix/pmix4x/pmix/src/mca/common/dstore/dstore_base.c +++ b/opal/mca/pmix/pmix4x/openpmix/src/mca/common/dstore/dstore_base.c @@ -208,6 +208,7 @@ static inline int _esh_dir_del(const char *path) while (NULL != (d_ptr = readdir(dir))) { snprintf(name, PMIX_PATH_MAX, "%s/%s", path, d_ptr->d_name); + /* coverity[toctou] */ if ( 0 > lstat(name, &st) ){ /* No fatal error here - just log this event * we will hit the error later at rmdir. Keep trying ... @@ -1764,6 +1765,7 @@ PMIX_EXPORT void pmix_common_dstor_finalize(pmix_common_dstore_ctx_t *ds_ctx) if (NULL != ds_ctx->base_path){ if(PMIX_PROC_IS_SERVER(pmix_globals.mypeer)) { + /* coverity[toctou] */ if (lstat(ds_ctx->base_path, &st) >= 0){ if (PMIX_SUCCESS != (rc = _esh_dir_del(ds_ctx->base_path))) { PMIX_ERROR_LOG(rc); @@ -2689,7 +2691,7 @@ static pmix_status_t _store_job_info(pmix_common_dstore_ctx_t *ds_ctx, ns_map_da } PMIX_LIST_FOREACH(kv, &cb.kvs, pmix_kval_t) { - if ((PMIX_PROC_IS_V1(_client_peer(ds_ctx)) || PMIX_PROC_IS_V20(_client_peer(ds_ctx))) && + if ((PMIX_PROC_IS_V1(_client_peer(ds_ctx)) || PMIX_PROC_IS_V20(_client_peer(ds_ctx))) && 0 != strncmp("pmix.", kv->key, 4) && kv->value->type == PMIX_DATA_ARRAY) { pmix_info_t *info; diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/common/dstore/dstore_base.h b/opal/mca/pmix/pmix4x/openpmix/src/mca/common/dstore/dstore_base.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/common/dstore/dstore_base.h rename to opal/mca/pmix/pmix4x/openpmix/src/mca/common/dstore/dstore_base.h diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/common/dstore/dstore_common.h b/opal/mca/pmix/pmix4x/openpmix/src/mca/common/dstore/dstore_common.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/common/dstore/dstore_common.h rename to opal/mca/pmix/pmix4x/openpmix/src/mca/common/dstore/dstore_common.h diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/common/dstore/dstore_file.h b/opal/mca/pmix/pmix4x/openpmix/src/mca/common/dstore/dstore_file.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/common/dstore/dstore_file.h rename to opal/mca/pmix/pmix4x/openpmix/src/mca/common/dstore/dstore_file.h diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/common/dstore/dstore_segment.c b/opal/mca/pmix/pmix4x/openpmix/src/mca/common/dstore/dstore_segment.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/common/dstore/dstore_segment.c rename to opal/mca/pmix/pmix4x/openpmix/src/mca/common/dstore/dstore_segment.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/common/dstore/dstore_segment.h b/opal/mca/pmix/pmix4x/openpmix/src/mca/common/dstore/dstore_segment.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/common/dstore/dstore_segment.h rename to opal/mca/pmix/pmix4x/openpmix/src/mca/common/dstore/dstore_segment.h diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/gds/Makefile.am b/opal/mca/pmix/pmix4x/openpmix/src/mca/gds/Makefile.am similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/gds/Makefile.am rename to opal/mca/pmix/pmix4x/openpmix/src/mca/gds/Makefile.am diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/gds/base/Makefile.include b/opal/mca/pmix/pmix4x/openpmix/src/mca/gds/base/Makefile.include similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/gds/base/Makefile.include rename to opal/mca/pmix/pmix4x/openpmix/src/mca/gds/base/Makefile.include diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/gds/base/base.h b/opal/mca/pmix/pmix4x/openpmix/src/mca/gds/base/base.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/gds/base/base.h rename to opal/mca/pmix/pmix4x/openpmix/src/mca/gds/base/base.h diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/gds/base/gds_base_fns.c b/opal/mca/pmix/pmix4x/openpmix/src/mca/gds/base/gds_base_fns.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/gds/base/gds_base_fns.c rename to opal/mca/pmix/pmix4x/openpmix/src/mca/gds/base/gds_base_fns.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/gds/base/gds_base_frame.c b/opal/mca/pmix/pmix4x/openpmix/src/mca/gds/base/gds_base_frame.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/gds/base/gds_base_frame.c rename to opal/mca/pmix/pmix4x/openpmix/src/mca/gds/base/gds_base_frame.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/gds/base/gds_base_select.c b/opal/mca/pmix/pmix4x/openpmix/src/mca/gds/base/gds_base_select.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/gds/base/gds_base_select.c rename to opal/mca/pmix/pmix4x/openpmix/src/mca/gds/base/gds_base_select.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/gds/ds12/Makefile.am b/opal/mca/pmix/pmix4x/openpmix/src/mca/gds/ds12/Makefile.am similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/gds/ds12/Makefile.am rename to opal/mca/pmix/pmix4x/openpmix/src/mca/gds/ds12/Makefile.am diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/gds/ds12/gds_ds12_base.c b/opal/mca/pmix/pmix4x/openpmix/src/mca/gds/ds12/gds_ds12_base.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/gds/ds12/gds_ds12_base.c rename to opal/mca/pmix/pmix4x/openpmix/src/mca/gds/ds12/gds_ds12_base.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/gds/ds12/gds_ds12_base.h b/opal/mca/pmix/pmix4x/openpmix/src/mca/gds/ds12/gds_ds12_base.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/gds/ds12/gds_ds12_base.h rename to opal/mca/pmix/pmix4x/openpmix/src/mca/gds/ds12/gds_ds12_base.h diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/gds/ds12/gds_ds12_component.c b/opal/mca/pmix/pmix4x/openpmix/src/mca/gds/ds12/gds_ds12_component.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/gds/ds12/gds_ds12_component.c rename to opal/mca/pmix/pmix4x/openpmix/src/mca/gds/ds12/gds_ds12_component.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/gds/ds12/gds_ds12_file.c b/opal/mca/pmix/pmix4x/openpmix/src/mca/gds/ds12/gds_ds12_file.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/gds/ds12/gds_ds12_file.c rename to opal/mca/pmix/pmix4x/openpmix/src/mca/gds/ds12/gds_ds12_file.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/gds/ds12/gds_ds12_file.h b/opal/mca/pmix/pmix4x/openpmix/src/mca/gds/ds12/gds_ds12_file.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/gds/ds12/gds_ds12_file.h rename to opal/mca/pmix/pmix4x/openpmix/src/mca/gds/ds12/gds_ds12_file.h diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/gds/ds12/gds_ds12_lock.c b/opal/mca/pmix/pmix4x/openpmix/src/mca/gds/ds12/gds_ds12_lock.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/gds/ds12/gds_ds12_lock.c rename to opal/mca/pmix/pmix4x/openpmix/src/mca/gds/ds12/gds_ds12_lock.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/gds/ds12/gds_ds12_lock.h b/opal/mca/pmix/pmix4x/openpmix/src/mca/gds/ds12/gds_ds12_lock.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/gds/ds12/gds_ds12_lock.h rename to opal/mca/pmix/pmix4x/openpmix/src/mca/gds/ds12/gds_ds12_lock.h diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/gds/ds12/gds_ds12_lock_fcntl.c b/opal/mca/pmix/pmix4x/openpmix/src/mca/gds/ds12/gds_ds12_lock_fcntl.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/gds/ds12/gds_ds12_lock_fcntl.c rename to opal/mca/pmix/pmix4x/openpmix/src/mca/gds/ds12/gds_ds12_lock_fcntl.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/gds/ds12/gds_ds12_lock_pthread.c b/opal/mca/pmix/pmix4x/openpmix/src/mca/gds/ds12/gds_ds12_lock_pthread.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/gds/ds12/gds_ds12_lock_pthread.c rename to opal/mca/pmix/pmix4x/openpmix/src/mca/gds/ds12/gds_ds12_lock_pthread.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/gds/ds12/gds_ds20_file.c b/opal/mca/pmix/pmix4x/openpmix/src/mca/gds/ds12/gds_ds20_file.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/gds/ds12/gds_ds20_file.c rename to opal/mca/pmix/pmix4x/openpmix/src/mca/gds/ds12/gds_ds20_file.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/gds/ds21/Makefile.am b/opal/mca/pmix/pmix4x/openpmix/src/mca/gds/ds21/Makefile.am similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/gds/ds21/Makefile.am rename to opal/mca/pmix/pmix4x/openpmix/src/mca/gds/ds21/Makefile.am diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/gds/ds21/gds_ds21_base.c b/opal/mca/pmix/pmix4x/openpmix/src/mca/gds/ds21/gds_ds21_base.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/gds/ds21/gds_ds21_base.c rename to opal/mca/pmix/pmix4x/openpmix/src/mca/gds/ds21/gds_ds21_base.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/gds/ds21/gds_ds21_base.h b/opal/mca/pmix/pmix4x/openpmix/src/mca/gds/ds21/gds_ds21_base.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/gds/ds21/gds_ds21_base.h rename to opal/mca/pmix/pmix4x/openpmix/src/mca/gds/ds21/gds_ds21_base.h diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/gds/ds21/gds_ds21_component.c b/opal/mca/pmix/pmix4x/openpmix/src/mca/gds/ds21/gds_ds21_component.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/gds/ds21/gds_ds21_component.c rename to opal/mca/pmix/pmix4x/openpmix/src/mca/gds/ds21/gds_ds21_component.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/gds/ds21/gds_ds21_file.c b/opal/mca/pmix/pmix4x/openpmix/src/mca/gds/ds21/gds_ds21_file.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/gds/ds21/gds_ds21_file.c rename to opal/mca/pmix/pmix4x/openpmix/src/mca/gds/ds21/gds_ds21_file.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/gds/ds21/gds_ds21_file.h b/opal/mca/pmix/pmix4x/openpmix/src/mca/gds/ds21/gds_ds21_file.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/gds/ds21/gds_ds21_file.h rename to opal/mca/pmix/pmix4x/openpmix/src/mca/gds/ds21/gds_ds21_file.h diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/gds/ds21/gds_ds21_lock.c b/opal/mca/pmix/pmix4x/openpmix/src/mca/gds/ds21/gds_ds21_lock.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/gds/ds21/gds_ds21_lock.c rename to opal/mca/pmix/pmix4x/openpmix/src/mca/gds/ds21/gds_ds21_lock.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/gds/ds21/gds_ds21_lock.h b/opal/mca/pmix/pmix4x/openpmix/src/mca/gds/ds21/gds_ds21_lock.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/gds/ds21/gds_ds21_lock.h rename to opal/mca/pmix/pmix4x/openpmix/src/mca/gds/ds21/gds_ds21_lock.h diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/gds/ds21/gds_ds21_lock_pthread.c b/opal/mca/pmix/pmix4x/openpmix/src/mca/gds/ds21/gds_ds21_lock_pthread.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/gds/ds21/gds_ds21_lock_pthread.c rename to opal/mca/pmix/pmix4x/openpmix/src/mca/gds/ds21/gds_ds21_lock_pthread.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/gds/gds.h b/opal/mca/pmix/pmix4x/openpmix/src/mca/gds/gds.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/gds/gds.h rename to opal/mca/pmix/pmix4x/openpmix/src/mca/gds/gds.h diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/gds/hash/Makefile.am b/opal/mca/pmix/pmix4x/openpmix/src/mca/gds/hash/Makefile.am similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/gds/hash/Makefile.am rename to opal/mca/pmix/pmix4x/openpmix/src/mca/gds/hash/Makefile.am diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/gds/hash/gds_hash.c b/opal/mca/pmix/pmix4x/openpmix/src/mca/gds/hash/gds_hash.c similarity index 86% rename from opal/mca/pmix/pmix4x/pmix/src/mca/gds/hash/gds_hash.c rename to opal/mca/pmix/pmix4x/openpmix/src/mca/gds/hash/gds_hash.c index 296d1f3a93..a287895cfa 100644 --- a/opal/mca/pmix/pmix4x/pmix/src/mca/gds/hash/gds_hash.c +++ b/opal/mca/pmix/pmix4x/openpmix/src/mca/gds/hash/gds_hash.c @@ -37,6 +37,7 @@ #include "src/client/pmix_client_ops.h" #include "src/server/pmix_server_ops.h" #include "src/mca/pcompress/base/base.h" +#include "src/mca/pmdl/pmdl.h" #include "src/mca/preg/preg.h" #include "src/util/argv.h" #include "src/util/error.h" @@ -243,7 +244,7 @@ static PMIX_CLASS_INSTANCE(pmix_apptrkr_t, static void ndinfocon(pmix_nodeinfo_t *p) { - p->nodeid = 0; + p->nodeid = UINT32_MAX; p->hostname = NULL; PMIX_CONSTRUCT(&p->info, pmix_list_t); } @@ -258,19 +259,29 @@ static PMIX_CLASS_INSTANCE(pmix_nodeinfo_t, pmix_list_item_t, ndinfocon, ndinfodes); +/********************************************** + * Forward Declarations + **********************************************/ +static pmix_status_t fetch_nodeinfo(const char *key, pmix_list_t *tgt, + pmix_info_t *info, size_t ninfo, + pmix_list_t *kvs); +static pmix_status_t fetch_appinfo(const char *key, pmix_list_t *tgt, + pmix_info_t *info, size_t ninfo, + pmix_list_t *kvs); + /**********************************************/ /* process a node array - contains an array of * node-level info for a single node. Either the * nodeid, hostname, or both must be included * in the array to identify the node */ -static pmix_status_t process_node_array(pmix_info_t *info, +static pmix_status_t process_node_array(pmix_value_t *val, pmix_list_t *tgt) { size_t size, j; pmix_info_t *iptr; pmix_status_t rc = PMIX_SUCCESS; - pmix_kval_t *kp2, *k1, *knext; + pmix_kval_t *kp2, *k1; pmix_list_t cache; pmix_nodeinfo_t *nd = NULL, *ndptr; bool update; @@ -279,14 +290,14 @@ static pmix_status_t process_node_array(pmix_info_t *info, "PROCESSING NODE ARRAY"); /* array of node-level info for a specific node */ - if (PMIX_DATA_ARRAY != info->value.type) { + if (PMIX_DATA_ARRAY != val->type) { PMIX_ERROR_LOG(PMIX_ERR_TYPE_MISMATCH); return PMIX_ERR_TYPE_MISMATCH; } /* setup arrays */ - size = info->value.data.darray->size; - iptr = (pmix_info_t*)info->value.data.darray->array; + size = val->data.darray->size; + iptr = (pmix_info_t*)val->data.darray->array; PMIX_CONSTRUCT(&cache, pmix_list_t); /* cache the values while searching for the nodeid @@ -356,7 +367,7 @@ static pmix_status_t process_node_array(pmix_info_t *info, /* if this is an update, we have to ensure each data * item only appears once on the list */ if (update) { - PMIX_LIST_FOREACH_SAFE(k1, knext, &nd->info, pmix_kval_t) { + PMIX_LIST_FOREACH(k1, &nd->info, pmix_kval_t) { if (PMIX_CHECK_KEY(k1, kp2->key)) { pmix_list_remove_item(&nd->info, &k1->super); PMIX_RELEASE(k1); @@ -369,7 +380,9 @@ static pmix_status_t process_node_array(pmix_info_t *info, } PMIX_LIST_DESTRUCT(&cache); - pmix_list_append(tgt, &nd->super); + if (!update) { + pmix_list_append(tgt, &nd->super); + } return PMIX_SUCCESS; } @@ -379,7 +392,7 @@ static pmix_status_t process_node_array(pmix_info_t *info, * it is assumed that only app is in the job. * This assumption is checked and generates * an error if violated */ -static pmix_status_t process_app_array(pmix_info_t *info, +static pmix_status_t process_app_array(pmix_value_t *val, pmix_job_t *trk) { pmix_list_t cache, ncache; @@ -388,7 +401,7 @@ static pmix_status_t process_app_array(pmix_info_t *info, pmix_status_t rc = PMIX_SUCCESS; uint32_t appnum; pmix_apptrkr_t *app = NULL, *apptr; - pmix_kval_t *kp2, *k1, *knext; + pmix_kval_t *kp2, *k1; pmix_nodeinfo_t *nd; bool update; @@ -401,7 +414,7 @@ static pmix_status_t process_app_array(pmix_info_t *info, } /* array of app-level info */ - if (PMIX_DATA_ARRAY != info->value.type) { + if (PMIX_DATA_ARRAY != val->type) { PMIX_ERROR_LOG(PMIX_ERR_TYPE_MISMATCH); return PMIX_ERR_TYPE_MISMATCH; } @@ -409,8 +422,8 @@ static pmix_status_t process_app_array(pmix_info_t *info, /* setup arrays and lists */ PMIX_CONSTRUCT(&cache, pmix_list_t); PMIX_CONSTRUCT(&ncache, pmix_list_t); - size = info->value.data.darray->size; - iptr = (pmix_info_t*)info->value.data.darray->array; + size = val->data.darray->size; + iptr = (pmix_info_t*)val->data.darray->array; for (j=0; j < size; j++) { if (PMIX_CHECK_KEY(&iptr[j], PMIX_APPNUM)) { @@ -430,7 +443,7 @@ static pmix_status_t process_app_array(pmix_info_t *info, app = PMIX_NEW(pmix_apptrkr_t); app->appnum = appnum; } else if (PMIX_CHECK_KEY(&iptr[j], PMIX_NODE_INFO_ARRAY)) { - if (PMIX_SUCCESS != (rc = process_node_array(&iptr[j], &ncache))) { + if (PMIX_SUCCESS != (rc = process_node_array(&iptr[j].value, &ncache))) { PMIX_ERROR_LOG(rc); goto release; } @@ -486,7 +499,7 @@ static pmix_status_t process_app_array(pmix_info_t *info, /* if this is an update, we have to ensure each data * item only appears once on the list */ if (update) { - PMIX_LIST_FOREACH_SAFE(k1, knext, &app->appinfo, pmix_kval_t) { + PMIX_LIST_FOREACH(k1, &app->appinfo, pmix_kval_t) { if (PMIX_CHECK_KEY(k1, kp2->key)) { pmix_list_remove_item(&app->appinfo, &k1->super); PMIX_RELEASE(k1); @@ -494,6 +507,12 @@ static pmix_status_t process_app_array(pmix_info_t *info, } } } + if (PMIX_CHECK_KEY(kp2, PMIX_MODEL_LIBRARY_NAME) || + PMIX_CHECK_KEY(kp2, PMIX_PROGRAMMING_MODEL) || + PMIX_CHECK_KEY(kp2, PMIX_MODEL_LIBRARY_VERSION)) { + // pass this info to the pmdl framework + pmix_pmdl.setup_nspace_kv(trk->nptr, app->appnum, kp2); + } pmix_list_append(&app->appinfo, &kp2->super); kp2 = (pmix_kval_t*)pmix_list_remove_first(&cache); } @@ -537,11 +556,11 @@ static pmix_status_t process_job_array(pmix_info_t *info, PMIX_CONSTRUCT(&cache, pmix_list_t); for (j=0; j < size; j++) { if (PMIX_CHECK_KEY(&iptr[j], PMIX_APP_INFO_ARRAY)) { - if (PMIX_SUCCESS != (rc = process_app_array(&iptr[j], trk))) { + if (PMIX_SUCCESS != (rc = process_app_array(&iptr[j].value, trk))) { return rc; } } else if (PMIX_CHECK_KEY(&iptr[j], PMIX_NODE_INFO_ARRAY)) { - if (PMIX_SUCCESS != (rc = process_node_array(&iptr[j], &trk->nodeinfo))) { + if (PMIX_SUCCESS != (rc = process_node_array(&iptr[j].value, &trk->nodeinfo))) { PMIX_ERROR_LOG(rc); return rc; } @@ -571,6 +590,11 @@ static pmix_status_t process_job_array(pmix_info_t *info, } /* mark that we got the map */ *flags |= PMIX_HASH_NODE_MAP; + } else if (PMIX_CHECK_KEY(&iptr[j], PMIX_MODEL_LIBRARY_NAME) || + PMIX_CHECK_KEY(&iptr[j], PMIX_PROGRAMMING_MODEL) || + PMIX_CHECK_KEY(&iptr[j], PMIX_MODEL_LIBRARY_VERSION)) { + // pass this info to the pmdl framework + pmix_pmdl.setup_nspace(trk->nptr, PMIX_APP_WILDCARD, &iptr[j]); } else { kp2 = PMIX_NEW(pmix_kval_t); kp2->key = strdup(iptr[j].key); @@ -634,20 +658,18 @@ static pmix_status_t hash_assign_module(pmix_info_t *info, size_t ninfo, return PMIX_SUCCESS; } -static pmix_status_t store_map(pmix_hash_table_t *ht, +static pmix_status_t store_map(pmix_job_t *trk, char **nodes, char **ppn, uint32_t flags) { pmix_status_t rc; - pmix_value_t *val; size_t m, n; - pmix_info_t *iptr, *info; pmix_rank_t rank; - bool updated; - pmix_kval_t *kp2; + pmix_kval_t *kp1, *kp2; char **procs; uint32_t totalprocs=0; - bool localldr; + pmix_hash_table_t *ht = &trk->internal; + pmix_nodeinfo_t *nd, *ndptr; pmix_output_verbose(2, pmix_gds_base_framework.framework_output, "[%s:%d] gds:hash:store_map", @@ -676,130 +698,71 @@ static pmix_status_t store_map(pmix_hash_table_t *ht, } for (n=0; NULL != nodes[n]; n++) { - /* check and see if we already have data for this node */ - val = NULL; - rc = pmix_hash_fetch(ht, PMIX_RANK_WILDCARD, nodes[n], &val); - if (PMIX_SUCCESS == rc && NULL != val) { - /* already have some data. See if we have the list of local peers */ - if (PMIX_DATA_ARRAY != val->type || - NULL == val->data.darray || - PMIX_INFO != val->data.darray->type || - 0 == val->data.darray->size) { - /* something is wrong */ - PMIX_VALUE_RELEASE(val); - PMIX_ERROR_LOG(PMIX_ERR_INVALID_VAL); - return PMIX_ERR_INVALID_VAL; + /* check and see if we already have this node */ + nd = NULL; + PMIX_LIST_FOREACH(ndptr, &trk->nodeinfo, pmix_nodeinfo_t) { + if (NULL != ndptr->hostname && 0 == strcmp(ndptr->hostname, nodes[n])) { + /* we assume that the data is updating the current + * values */ + if (NULL == ndptr->hostname) { + ndptr->hostname = strdup(nodes[n]); + } + nd = ndptr; + break; } - iptr = (pmix_info_t*)val->data.darray->array; - updated = false; - localldr = false; - for (m=0; m < val->data.darray->size; m++) { - if (PMIX_CHECK_KEY(&iptr[m], PMIX_LOCAL_PEERS)) { - /* we will update this entry */ - if (NULL != iptr[m].value.data.string) { - free(iptr[m].value.data.string); - } - iptr[m].value.data.string = strdup(ppn[n]); - updated = true; // no need to add the local_peers to the array - } else if (PMIX_CHECK_KEY(&iptr[m], PMIX_LOCALLDR)) { - rank = strtoul(ppn[n], NULL, 10); - iptr[m].value.data.rank = rank; - localldr = true; // no need to add localldr to the array - } - } - if (!updated || !localldr) { - /* append this entry to the current data */ - kp2 = PMIX_NEW(pmix_kval_t); - if (NULL == kp2) { - return PMIX_ERR_NOMEM; - } - kp2->key = strdup(nodes[n]); - kp2->value = (pmix_value_t*)malloc(sizeof(pmix_value_t)); - if (NULL == kp2->value) { - PMIX_RELEASE(kp2); - return PMIX_ERR_NOMEM; - } - kp2->value->type = PMIX_DATA_ARRAY; - kp2->value->data.darray = (pmix_data_array_t*)malloc(sizeof(pmix_data_array_t)); - if (NULL == kp2->value->data.darray) { - PMIX_RELEASE(kp2); - return PMIX_ERR_NOMEM; - } - kp2->value->data.darray->type = PMIX_INFO; - /* if we didn't update the local leader, then we will - * add it here */ - m = 0; - if (!localldr) { - kp2->value->data.darray->size = val->data.darray->size + 1; - ++m; - } - /* if they didn't update the local peers, then we add it here */ - if (!updated) { - kp2->value->data.darray->size = val->data.darray->size + 1; - ++m; - } - PMIX_INFO_CREATE(info, kp2->value->data.darray->size); - if (NULL == info) { - PMIX_RELEASE(kp2); - return PMIX_ERR_NOMEM; - } - /* copy the pre-existing data across */ - for (m=0; m < val->data.darray->size; m++) { - PMIX_INFO_XFER(&info[m], &iptr[m]); - } - if (!updated) { - PMIX_INFO_LOAD(&info[kp2->value->data.darray->size-m], PMIX_LOCAL_PEERS, ppn[n], PMIX_STRING); - --m; - } - if (!localldr) { - rank = strtoul(ppn[n], NULL, 10); - PMIX_INFO_LOAD(&info[kp2->value->data.darray->size-m], PMIX_LOCALLDR, &rank, PMIX_PROC_RANK); - --m; - } - kp2->value->data.darray->array = info; - if (PMIX_SUCCESS != (rc = pmix_hash_store(ht, PMIX_RANK_WILDCARD, kp2))) { - PMIX_ERROR_LOG(rc); - PMIX_RELEASE(kp2); - return rc; - } - PMIX_RELEASE(kp2); - } - } else { - /* store the list as-is */ - kp2 = PMIX_NEW(pmix_kval_t); - if (NULL == kp2) { - return PMIX_ERR_NOMEM; - } - kp2->key = strdup(nodes[n]); - kp2->value = (pmix_value_t*)malloc(sizeof(pmix_value_t)); - if (NULL == kp2->value) { - PMIX_RELEASE(kp2); - return PMIX_ERR_NOMEM; - } - kp2->value->type = PMIX_DATA_ARRAY; - kp2->value->data.darray = (pmix_data_array_t*)malloc(sizeof(pmix_data_array_t)); - if (NULL == kp2->value->data.darray) { - PMIX_RELEASE(kp2); - return PMIX_ERR_NOMEM; - } - kp2->value->data.darray->type = PMIX_INFO; - PMIX_INFO_CREATE(info, 2); - if (NULL == info) { - PMIX_RELEASE(kp2); - return PMIX_ERR_NOMEM; - } - PMIX_INFO_LOAD(&info[0], PMIX_LOCAL_PEERS, ppn[n], PMIX_STRING); - rank = strtoul(ppn[n], NULL, 10); - PMIX_INFO_LOAD(&info[1], PMIX_LOCALLDR, &rank, PMIX_PROC_RANK); - kp2->value->data.darray->array = info; - kp2->value->data.darray->size = 2; - if (PMIX_SUCCESS != (rc = pmix_hash_store(ht, PMIX_RANK_WILDCARD, kp2))) { - PMIX_ERROR_LOG(rc); - PMIX_RELEASE(kp2); - return rc; - } - PMIX_RELEASE(kp2); } + if (NULL == nd) { + nd = PMIX_NEW(pmix_nodeinfo_t); + nd->hostname = strdup(nodes[n]); + pmix_list_append(&trk->nodeinfo, &nd->super); + } + /* store the proc list as-is */ + kp2 = PMIX_NEW(pmix_kval_t); + if (NULL == kp2) { + return PMIX_ERR_NOMEM; + } + kp2->key = strdup(PMIX_LOCAL_PEERS); + kp2->value = (pmix_value_t*)malloc(sizeof(pmix_value_t)); + if (NULL == kp2->value) { + PMIX_RELEASE(kp2); + return PMIX_ERR_NOMEM; + } + kp2->value->type = PMIX_STRING; + kp2->value->data.string = strdup(ppn[n]); + /* ensure this item only appears once on the list */ + PMIX_LIST_FOREACH(kp1, &nd->info, pmix_kval_t) { + if (PMIX_CHECK_KEY(kp1, kp2->key)) { + pmix_list_remove_item(&nd->info, &kp1->super); + PMIX_RELEASE(kp1); + break; + } + } + pmix_list_append(&nd->info, &kp2->super); + + /* save the local leader */ + rank = strtoul(ppn[n], NULL, 10); + kp2 = PMIX_NEW(pmix_kval_t); + if (NULL == kp2) { + return PMIX_ERR_NOMEM; + } + kp2->key = strdup(PMIX_LOCALLDR); + kp2->value = (pmix_value_t*)malloc(sizeof(pmix_value_t)); + if (NULL == kp2->value) { + PMIX_RELEASE(kp2); + return PMIX_ERR_NOMEM; + } + kp2->value->type = PMIX_PROC_RANK; + kp2->value->data.rank = rank; + /* ensure this item only appears once on the list */ + PMIX_LIST_FOREACH(kp1, &nd->info, pmix_kval_t) { + if (PMIX_CHECK_KEY(kp1, kp2->key)) { + pmix_list_remove_item(&nd->info, &kp1->super); + PMIX_RELEASE(kp1); + break; + } + } + pmix_list_append(&nd->info, &kp2->super); + /* split the list of procs so we can store their * individual location data */ procs = pmix_argv_split(ppn[n], ','); @@ -1038,7 +1001,7 @@ pmix_status_t hash_cache_job_info(struct pmix_namespace_t *ns, pmix_list_append(&mysessions, &s->super); } } else if (PMIX_CHECK_KEY(&iptr[j], PMIX_NODE_INFO_ARRAY)) { - if (PMIX_SUCCESS != (rc = process_node_array(&iptr[j], &ncache))) { + if (PMIX_SUCCESS != (rc = process_node_array(&iptr[j].value, &ncache))) { PMIX_ERROR_LOG(rc); PMIX_LIST_DESTRUCT(&cache); PMIX_LIST_DESTRUCT(&ncache); @@ -1091,12 +1054,12 @@ pmix_status_t hash_cache_job_info(struct pmix_namespace_t *ns, goto release; } } else if (PMIX_CHECK_KEY(&info[n], PMIX_APP_INFO_ARRAY)) { - if (PMIX_SUCCESS != (rc = process_app_array(&info[n], trk))) { + if (PMIX_SUCCESS != (rc = process_app_array(&info[n].value, trk))) { PMIX_ERROR_LOG(rc); goto release; } } else if (PMIX_CHECK_KEY(&info[n], PMIX_NODE_INFO_ARRAY)) { - if (PMIX_SUCCESS != (rc = process_node_array(&info[n], &trk->nodeinfo))) { + if (PMIX_SUCCESS != (rc = process_node_array(&info[n].value, &trk->nodeinfo))) { PMIX_ERROR_LOG(rc); goto release; } @@ -1183,8 +1146,17 @@ pmix_status_t hash_cache_job_info(struct pmix_namespace_t *ns, PMIX_RELEASE(kp2); goto release; } + /* if this is the appnum, pass it to the pmdl framework */ + if (PMIX_CHECK_KEY(kp2, PMIX_APPNUM)) { + pmix_pmdl.setup_client(trk->nptr, rank, kp2->value->data.uint32); + } PMIX_RELEASE(kp2); // maintain acctg } + } else if (PMIX_CHECK_KEY(&info[n], PMIX_MODEL_LIBRARY_NAME) || + PMIX_CHECK_KEY(&info[n], PMIX_PROGRAMMING_MODEL) || + PMIX_CHECK_KEY(&info[n], PMIX_MODEL_LIBRARY_VERSION)) { + // pass this info to the pmdl framework + pmix_pmdl.setup_nspace(trk->nptr, PMIX_APP_WILDCARD, &info[n]); } else { /* just a value relating to the entire job */ kp2 = PMIX_NEW(pmix_kval_t); @@ -1263,7 +1235,7 @@ pmix_status_t hash_cache_job_info(struct pmix_namespace_t *ns, /* we must have the proc AND node maps */ if (NULL != procs && NULL != nodes) { - if (PMIX_SUCCESS != (rc = store_map(ht, nodes, procs, flags))) { + if (PMIX_SUCCESS != (rc = store_map(trk, nodes, procs, flags))) { PMIX_ERROR_LOG(rc); } } @@ -1291,6 +1263,7 @@ static pmix_status_t register_info(pmix_peer_t *peer, pmix_kval_t kv, *kvptr; pmix_buffer_t buf; pmix_rank_t rank; + pmix_list_t results; trk = NULL; PMIX_LIST_FOREACH(t, &myjobs, pmix_job_t) { @@ -1337,6 +1310,26 @@ static pmix_status_t register_info(pmix_peer_t *peer, PMIX_BFROPS_PACK(rc, peer, reply, kvptr, 1, PMIX_KVAL); } + /* get any node-level info for this job */ + PMIX_CONSTRUCT(&results, pmix_list_t); + rc = fetch_nodeinfo(NULL, &trk->nodeinfo, NULL, 0, &results); + if (PMIX_SUCCESS == rc) { + PMIX_LIST_FOREACH(kvptr, &results, pmix_kval_t) { + PMIX_BFROPS_PACK(rc, peer, reply, kvptr, 1, PMIX_KVAL); + } + } + PMIX_LIST_DESTRUCT(&results); + + /* get any app-level info for this job */ + PMIX_CONSTRUCT(&results, pmix_list_t); + rc = fetch_appinfo(NULL, &trk->apps, NULL, 0, &results); + if (PMIX_SUCCESS == rc) { + PMIX_LIST_FOREACH(kvptr, &results, pmix_kval_t) { + PMIX_BFROPS_PACK(rc, peer, reply, kvptr, 1, PMIX_KVAL); + } + } + PMIX_LIST_DESTRUCT(&results); + /* get the proc-level data for each proc in the job */ for (rank=0; rank < ns->nprocs; rank++) { val = NULL; @@ -1478,21 +1471,20 @@ static pmix_status_t hash_store_job_info(const char *nspace, pmix_buffer_t *buf) { pmix_status_t rc = PMIX_SUCCESS; - pmix_kval_t *kptr, *kp2, kv; - pmix_value_t *val; + pmix_kval_t *kptr, *kp2, *kp3, kv; int32_t cnt; - size_t nnodes, len, n; + size_t nnodes, len; uint32_t i, j; char **procs = NULL; uint8_t *tmp; pmix_byte_object_t *bo; pmix_buffer_t buf2; int rank; - pmix_job_t *htptr; + pmix_job_t *trk; pmix_hash_table_t *ht; char **nodelist = NULL; - pmix_info_t *info, *iptr; pmix_namespace_t *ns, *nptr; + pmix_nodeinfo_t *nd, *ndptr; pmix_output_verbose(2, pmix_gds_base_framework.framework_output, "[%s:%u] pmix:gds:hash store job info for nspace %s", @@ -1532,20 +1524,20 @@ static pmix_status_t hash_store_job_info(const char *nspace, /* see if we already have a hash table for this nspace */ ht = NULL; - PMIX_LIST_FOREACH(htptr, &myjobs, pmix_job_t) { - if (0 == strcmp(htptr->ns, nspace)) { - ht = &htptr->internal; + PMIX_LIST_FOREACH(trk, &myjobs, pmix_job_t) { + if (0 == strcmp(trk->ns, nspace)) { + ht = &trk->internal; break; } } if (NULL == ht) { /* nope - create one */ - htptr = PMIX_NEW(pmix_job_t); - htptr->ns = strdup(nspace); + trk = PMIX_NEW(pmix_job_t); + trk->ns = strdup(nspace); PMIX_RETAIN(nptr); - htptr->nptr = nptr; - pmix_list_append(&myjobs, &htptr->super); - ht = &htptr->internal; + trk->nptr = nptr; + pmix_list_append(&myjobs, &trk->super); + ht = &trk->internal; } cnt = 1; @@ -1621,8 +1613,8 @@ static pmix_status_t hash_store_job_info(const char *nspace, PMIX_DESTRUCT(&buf2); return rc; } - /* unpack the list of procs on each node */ for (i=0; i < nnodes; i++) { + /* unpack the list of procs on each node */ cnt = 1; PMIX_CONSTRUCT(&kv, pmix_kval_t); PMIX_BFROPS_UNPACK(rc, pmix_client_globals.myserver, @@ -1635,79 +1627,46 @@ static pmix_status_t hash_store_job_info(const char *nspace, } /* track the nodes in this nspace */ pmix_argv_append_nosize(&nodelist, kv.key); - /* save the list of peers for this node - but first - * check to see if we already have some data for this node */ - rc = pmix_hash_fetch(ht, PMIX_RANK_WILDCARD, kv.key, &val); - if (PMIX_SUCCESS == rc) { - /* already have some data, so we need to add to it */ - kp2 = PMIX_NEW(pmix_kval_t); - kp2->key = strdup(kv.key); - kp2->value = (pmix_value_t*)malloc(sizeof(pmix_value_t)); - kp2->value->type = PMIX_DATA_ARRAY; - kp2->value->data.darray = (pmix_data_array_t*)malloc(sizeof(pmix_data_array_t)); - if (NULL == kp2->value->data.darray) { - PMIX_DESTRUCT(&buf2); - PMIX_DESTRUCT(&kv); - PMIX_RELEASE(kp2); - return PMIX_ERR_NOMEM; + /* check and see if we already have this node */ + nd = NULL; + PMIX_LIST_FOREACH(ndptr, &trk->nodeinfo, pmix_nodeinfo_t) { + if (NULL != ndptr->hostname && 0 == strcmp(ndptr->hostname, kv.key)) { + /* we assume that the data is updating the current + * values */ + if (NULL == ndptr->hostname) { + ndptr->hostname = strdup(kv.key); + } + nd = ndptr; + break; } - kp2->value->data.darray->type = PMIX_INFO; - kp2->value->data.darray->size = val->data.darray->size + 1; - PMIX_INFO_CREATE(info, kp2->value->data.darray->size); - if (NULL == info) { - PMIX_DESTRUCT(&buf2); - PMIX_DESTRUCT(&kv); - PMIX_RELEASE(kp2); - return PMIX_ERR_NOMEM; - } - iptr = (pmix_info_t*)val->data.darray->array; - /* copy the pre-existing data across */ - for (n=0; n < val->data.darray->size; n++) { - PMIX_INFO_XFER(&info[n], &iptr[n]); - } - PMIX_INFO_LOAD(&info[kp2->value->data.darray->size-1], PMIX_LOCAL_PEERS, kv.value->data.string, PMIX_STRING); - kp2->value->data.darray->array = info; - if (PMIX_SUCCESS != (rc = pmix_hash_store(ht, PMIX_RANK_WILDCARD, kp2))) { - PMIX_ERROR_LOG(rc); - PMIX_RELEASE(kp2); - PMIX_DESTRUCT(&kv); - PMIX_DESTRUCT(&buf2); - return rc; - } - PMIX_RELEASE(kp2); // maintain acctg - } else { - /* nope - so add this by itself */ - kp2 = PMIX_NEW(pmix_kval_t); - kp2->key = strdup(kv.key); - kp2->value = (pmix_value_t*)malloc(sizeof(pmix_value_t)); - kp2->value->type = PMIX_DATA_ARRAY; - kp2->value->data.darray = (pmix_data_array_t*)malloc(sizeof(pmix_data_array_t)); - if (NULL == kp2->value->data.darray) { - PMIX_DESTRUCT(&buf2); - PMIX_DESTRUCT(&kv); - PMIX_RELEASE(kp2); - return PMIX_ERR_NOMEM; - } - kp2->value->data.darray->type = PMIX_INFO; - PMIX_INFO_CREATE(info, 1); - if (NULL == info) { - PMIX_DESTRUCT(&buf2); - PMIX_DESTRUCT(&kv); - PMIX_RELEASE(kp2); - return PMIX_ERR_NOMEM; - } - PMIX_INFO_LOAD(&info[0], PMIX_LOCAL_PEERS, kv.value->data.string, PMIX_STRING); - kp2->value->data.darray->array = info; - kp2->value->data.darray->size = 1; - if (PMIX_SUCCESS != (rc = pmix_hash_store(ht, PMIX_RANK_WILDCARD, kp2))) { - PMIX_ERROR_LOG(rc); - PMIX_RELEASE(kp2); - PMIX_DESTRUCT(&kv); - PMIX_DESTRUCT(&buf2); - return rc; - } - PMIX_RELEASE(kp2); // maintain acctg } + if (NULL == nd) { + nd = PMIX_NEW(pmix_nodeinfo_t); + nd->hostname = strdup(kv.key); + pmix_list_append(&trk->nodeinfo, &nd->super); + } + /* save the list of peers for this node */ + kp2 = PMIX_NEW(pmix_kval_t); + if (NULL == kp2) { + return PMIX_ERR_NOMEM; + } + kp2->key = strdup(PMIX_LOCAL_PEERS); + kp2->value = (pmix_value_t*)malloc(sizeof(pmix_value_t)); + if (NULL == kp2->value) { + PMIX_RELEASE(kp2); + return PMIX_ERR_NOMEM; + } + kp2->value->type = PMIX_STRING; + kp2->value->data.string = strdup(kv.value->data.string); + /* ensure this item only appears once on the list */ + PMIX_LIST_FOREACH(kp3, &nd->info, pmix_kval_t) { + if (PMIX_CHECK_KEY(kp3, kp2->key)) { + pmix_list_remove_item(&nd->info, &kp3->super); + PMIX_RELEASE(kp3); + break; + } + } + pmix_list_append(&nd->info, &kp2->super); /* split the list of procs so we can store their * individual location data */ procs = pmix_argv_split(kv.value->data.string, ','); @@ -1754,6 +1713,18 @@ static pmix_status_t hash_store_job_info(const char *nspace, } /* cleanup */ PMIX_DESTRUCT(&buf2); + } else if (PMIX_CHECK_KEY(kptr, PMIX_APP_INFO_ARRAY)) { + if (PMIX_SUCCESS != (rc = process_app_array(kptr->value, trk))) { + PMIX_ERROR_LOG(rc); + PMIX_RELEASE(kp2); + return rc; + } + } else if (PMIX_CHECK_KEY(kptr, PMIX_NODE_INFO_ARRAY)) { + if (PMIX_SUCCESS != (rc = process_node_array(kptr->value, &trk->nodeinfo))) { + PMIX_ERROR_LOG(rc); + PMIX_RELEASE(kp2); + return rc; + } } else { /* if the value contains a string that is longer than the * limit, then compress it */ @@ -2209,13 +2180,15 @@ static pmix_status_t fetch_nodeinfo(const char *key, pmix_list_t *tgt, pmix_info_t *info, size_t ninfo, pmix_list_t *kvs) { - size_t n; + size_t n, nds; pmix_status_t rc; uint32_t nid=0; char *hostname = NULL; bool found = false; pmix_nodeinfo_t *nd, *ndptr; pmix_kval_t *kv, *kp2; + pmix_data_array_t *darray; + pmix_info_t *iptr; pmix_output_verbose(2, pmix_gds_base_framework.framework_output, "FETCHING NODE INFO"); @@ -2237,15 +2210,69 @@ static pmix_status_t fetch_nodeinfo(const char *key, pmix_list_t *tgt, } } if (!found) { + /* if the key is NULL, then they want all the info from + * all nodes */ + if (NULL == key) { + PMIX_LIST_FOREACH(nd, tgt, pmix_nodeinfo_t) { + kv = PMIX_NEW(pmix_kval_t); + kv->key = strdup(PMIX_NODE_INFO_ARRAY); + kv->value = (pmix_value_t*)malloc(sizeof(pmix_value_t)); + if (NULL == kv->value) { + PMIX_RELEASE(kv); + return PMIX_ERR_NOMEM; + } + nds = pmix_list_get_size(&nd->info); + if (NULL != nd->hostname) { + ++nds; + } + if (UINT32_MAX != nd->nodeid) { + ++nds; + } + PMIX_DATA_ARRAY_CREATE(darray, nds, PMIX_INFO); + if (NULL == darray) { + PMIX_RELEASE(kv); + return PMIX_ERR_NOMEM; + } + iptr = (pmix_info_t*)darray->array; + n = 0; + if (NULL != nd->hostname) { + PMIX_INFO_LOAD(&iptr[n], PMIX_HOSTNAME, nd->hostname, PMIX_STRING); + ++n; + } + if (UINT32_MAX != nd->nodeid) { + PMIX_INFO_LOAD(&iptr[n], PMIX_NODEID, &nd->nodeid, PMIX_UINT32); + ++n; + } + PMIX_LIST_FOREACH(kp2, &nd->info, pmix_kval_t) { + PMIX_LOAD_KEY(iptr[n].key, kp2->key); + rc = pmix_value_xfer(&iptr[n].value, kp2->value); + if (PMIX_SUCCESS != rc) { + PMIX_ERROR_LOG(rc); + PMIX_DATA_ARRAY_FREE(darray); + PMIX_RELEASE(kv); + return rc; + } + ++n; + } + kv->value->data.darray = darray; + kv->value->type = PMIX_DATA_ARRAY; + pmix_list_append(kvs, &kv->super); + } + return PMIX_SUCCESS; + + } return PMIX_ERR_DATA_VALUE_NOT_FOUND; } /* scan the list of nodes to find the matching entry */ nd = NULL; PMIX_LIST_FOREACH(ndptr, tgt, pmix_nodeinfo_t) { - if (NULL != hostname && 0 == strcmp(ndptr->hostname, hostname)) { - nd = ndptr; - break; + if (NULL != hostname) { + nds = strlen(hostname) < strlen(ndptr->hostname) ? strlen(hostname) : strlen(ndptr->hostname); + if (0 == strncmp(ndptr->hostname, hostname, nds)) { + nd = ndptr; + break; + } } if (NULL == hostname && nid == ndptr->nodeid) { nd = ndptr; @@ -2255,6 +2282,7 @@ static pmix_status_t fetch_nodeinfo(const char *key, pmix_list_t *tgt, if (NULL == nd) { return PMIX_ERR_NOT_FOUND; } + /* scan the info list of this node to generate the results */ rc = PMIX_ERR_NOT_FOUND; PMIX_LIST_FOREACH(kv, &nd->info, pmix_kval_t) { @@ -2262,7 +2290,7 @@ static pmix_status_t fetch_nodeinfo(const char *key, pmix_list_t *tgt, kp2 = PMIX_NEW(pmix_kval_t); kp2->key = strdup(kv->key); kp2->value = (pmix_value_t*)malloc(sizeof(pmix_value_t)); - PMIX_VALUE_XFER(rc, kp2->value, kv->value); + rc = pmix_value_xfer(kp2->value, kv->value); if (PMIX_SUCCESS != rc) { PMIX_ERROR_LOG(rc); PMIX_RELEASE(kp2); @@ -2283,12 +2311,13 @@ static pmix_status_t fetch_appinfo(const char *key, pmix_list_t *tgt, pmix_info_t *info, size_t ninfo, pmix_list_t *kvs) { - size_t n; + size_t n, nds; pmix_status_t rc; uint32_t appnum; bool found = false; pmix_apptrkr_t *app, *apptr; pmix_kval_t *kv, *kp2; + pmix_data_array_t *darray; pmix_output_verbose(2, pmix_gds_base_framework.framework_output, "FETCHING APP INFO"); @@ -2306,6 +2335,46 @@ static pmix_status_t fetch_appinfo(const char *key, pmix_list_t *tgt, } } if (!found) { + /* if the key is NULL, then they want all the info from + * all apps */ + if (NULL == key) { + PMIX_LIST_FOREACH(apptr, tgt, pmix_apptrkr_t) { + kv = PMIX_NEW(pmix_kval_t); + kv->key = strdup(PMIX_APP_INFO_ARRAY); + kv->value = (pmix_value_t*)malloc(sizeof(pmix_value_t)); + if (NULL == kv->value) { + PMIX_RELEASE(kv); + return PMIX_ERR_NOMEM; + } + nds = pmix_list_get_size(&apptr->appinfo) + 1; + PMIX_DATA_ARRAY_CREATE(darray, nds, PMIX_INFO); + if (NULL == darray) { + PMIX_RELEASE(kv); + return PMIX_ERR_NOMEM; + } + info = (pmix_info_t*)darray->array; + n = 0; + /* put in the appnum */ + PMIX_INFO_LOAD(&info[n], PMIX_APPNUM, &apptr->appnum, PMIX_UINT32); + ++n; + PMIX_LIST_FOREACH(kp2, &apptr->appinfo, pmix_kval_t) { + PMIX_LOAD_KEY(info[n].key, kp2->key); + rc = pmix_value_xfer(&info[n].value, kp2->value); + if (PMIX_SUCCESS != rc) { + PMIX_ERROR_LOG(rc); + PMIX_DATA_ARRAY_FREE(darray); + PMIX_RELEASE(kv); + return rc; + } + ++n; + } + kv->value->data.darray = darray; + kv->value->type = PMIX_DATA_ARRAY; + pmix_list_append(kvs, &kv->super); + } + return PMIX_SUCCESS; + + } return PMIX_ERR_DATA_VALUE_NOT_FOUND; } @@ -2335,7 +2404,7 @@ static pmix_status_t fetch_appinfo(const char *key, pmix_list_t *tgt, kp2 = PMIX_NEW(pmix_kval_t); kp2->key = strdup(kv->key); kp2->value = (pmix_value_t*)malloc(sizeof(pmix_value_t)); - PMIX_VALUE_XFER(rc, kp2->value, kv->value); + rc = pmix_value_xfer(kp2->value, kv->value); if (PMIX_SUCCESS != rc) { PMIX_ERROR_LOG(rc); PMIX_RELEASE(kp2); @@ -2362,12 +2431,14 @@ static pmix_status_t hash_fetch(const pmix_proc_t *proc, pmix_status_t rc; pmix_kval_t *kv, *kvptr; pmix_info_t *info, *iptr; - size_t n, ninfo, niptr; + size_t m, n, ninfo, niptr; pmix_hash_table_t *ht; pmix_session_t *sptr; uint32_t sid; pmix_rank_t rnk; pmix_list_t rkvs; + bool nodeinfo = false; + bool appinfo = false; pmix_output_verbose(2, pmix_gds_base_framework.framework_output, "%s pmix:gds:hash fetch %s for proc %s on scope %s", @@ -2406,6 +2477,16 @@ static pmix_status_t hash_fetch(const pmix_proc_t *proc, } pmix_list_append(kvs, &kv->super); } + /* collect the relevant node-level info */ + rc = fetch_nodeinfo(NULL, &trk->nodeinfo, qualifiers, nqual, kvs); + if (PMIX_SUCCESS != rc) { + return rc; + } + /* collect the relevant app-level info */ + rc = fetch_appinfo(NULL, &trk->apps, qualifiers, nqual, kvs); + if (PMIX_SUCCESS != rc) { + return rc; + } /* finally, we need the job-level info for each rank in the job */ for (rnk=0; rnk < trk->nptr->nprocs; rnk++) { PMIX_CONSTRUCT(&rkvs, pmix_list_t); @@ -2445,52 +2526,55 @@ static pmix_status_t hash_fetch(const pmix_proc_t *proc, return PMIX_SUCCESS; } - /* if the nspace and rank are undefined, then they are asking - * for session-level information. */ - if (0 == strlen(proc->nspace) && PMIX_RANK_UNDEF == proc->rank) { - /* they must have included something identifying the info - * class they are querying */ - for (n=0; n < nqual; n++) { - if (PMIX_CHECK_KEY(&qualifiers[n], PMIX_SESSION_ID)) { - /* they want session-level info - see if we have - * that session */ - PMIX_VALUE_GET_NUMBER(rc, &qualifiers[n].value, sid, uint32_t); - if (PMIX_SUCCESS != rc) { - /* didn't provide a correct value */ - PMIX_ERROR_LOG(rc); - return rc; - } - PMIX_LIST_FOREACH(sptr, &mysessions, pmix_session_t) { - if (sptr->session == sid) { - /* see if they want info for a specific node */ - rc = fetch_nodeinfo(key, &sptr->nodeinfo, qualifiers, nqual, kvs); - /* if they did, then we are done */ - if (PMIX_ERR_DATA_VALUE_NOT_FOUND != rc) { - return rc; - } - /* check the session info */ - PMIX_LIST_FOREACH(kvptr, &sptr->sessioninfo, pmix_kval_t) { - if (NULL == key || PMIX_CHECK_KEY(kvptr, key)) { - kv = PMIX_NEW(pmix_kval_t); - kv->key = strdup(kvptr->key); - kv->value = (pmix_value_t*)malloc(sizeof(pmix_value_t)); - PMIX_VALUE_XFER(rc, kv->value, kvptr->value); - if (PMIX_SUCCESS != rc) { - PMIX_RELEASE(kv); - return rc; - } - pmix_list_append(kvs, &kv->super); - if (NULL != key) { - /* we are done */ - return PMIX_SUCCESS; + /* see if they are asking for session, node, or app-level info */ + for (n=0; n < nqual; n++) { + if (PMIX_CHECK_KEY(&qualifiers[n], PMIX_SESSION_INFO)) { + /* they must have provided a session ID */ + for (m=0; m < nqual; m++) { + if (PMIX_CHECK_KEY(&qualifiers[m], PMIX_SESSION_ID)) { + /* see if we have this session */ + PMIX_VALUE_GET_NUMBER(rc, &qualifiers[m].value, sid, uint32_t); + if (PMIX_SUCCESS != rc) { + /* didn't provide a correct value */ + PMIX_ERROR_LOG(rc); + return rc; + } + PMIX_LIST_FOREACH(sptr, &mysessions, pmix_session_t) { + if (sptr->session == sid) { + /* see if they want info for a specific node */ + rc = fetch_nodeinfo(key, &sptr->nodeinfo, qualifiers, nqual, kvs); + /* if they did, then we are done */ + if (PMIX_ERR_DATA_VALUE_NOT_FOUND != rc) { + return rc; + } + /* check the session info */ + PMIX_LIST_FOREACH(kvptr, &sptr->sessioninfo, pmix_kval_t) { + if (NULL == key || PMIX_CHECK_KEY(kvptr, key)) { + kv = PMIX_NEW(pmix_kval_t); + kv->key = strdup(kvptr->key); + kv->value = (pmix_value_t*)malloc(sizeof(pmix_value_t)); + PMIX_VALUE_XFER(rc, kv->value, kvptr->value); + if (PMIX_SUCCESS != rc) { + PMIX_RELEASE(kv); + return rc; + } + pmix_list_append(kvs, &kv->super); + if (NULL != key) { + /* we are done */ + return PMIX_SUCCESS; + } } } } } } - /* if we get here, then the session wasn't found */ - return PMIX_ERR_NOT_FOUND; } + /* if we get here, then the session wasn't found */ + return PMIX_ERR_NOT_FOUND; + } else if (PMIX_CHECK_KEY(&qualifiers[n], PMIX_NODE_INFO)) { + nodeinfo = PMIX_INFO_TRUE(&qualifiers[n]); + } else if (PMIX_CHECK_KEY(&qualifiers[n], PMIX_APP_INFO)) { + appinfo = PMIX_INFO_TRUE(&qualifiers[n]); } } @@ -2506,22 +2590,12 @@ static pmix_status_t hash_fetch(const pmix_proc_t *proc, return PMIX_ERR_INVALID_NAMESPACE; } - /* if the rank isn't specified, check to see if they - * are looking for app-level or node-level info for - * this job */ - if (PMIX_RANK_UNDEF == proc->rank) { - /* see if they want info for a specific node */ + if (nodeinfo) { rc = fetch_nodeinfo(key, &trk->nodeinfo, qualifiers, nqual, kvs); - /* if they did, then we are done */ - if (PMIX_ERR_DATA_VALUE_NOT_FOUND != rc) { - return rc; - } - /* see if they want info for a specific app */ + return rc; + } else if (appinfo) { rc = fetch_appinfo(key, &trk->apps, qualifiers, nqual, kvs); - /* if they did, then we are done */ - if (PMIX_ERR_DATA_VALUE_NOT_FOUND != rc) { - return rc; - } + return rc; } /* fetch from the corresponding hash table - note that diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/gds/hash/gds_hash.h b/opal/mca/pmix/pmix4x/openpmix/src/mca/gds/hash/gds_hash.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/gds/hash/gds_hash.h rename to opal/mca/pmix/pmix4x/openpmix/src/mca/gds/hash/gds_hash.h diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/gds/hash/gds_hash_component.c b/opal/mca/pmix/pmix4x/openpmix/src/mca/gds/hash/gds_hash_component.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/gds/hash/gds_hash_component.c rename to opal/mca/pmix/pmix4x/openpmix/src/mca/gds/hash/gds_hash_component.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/mca.h b/opal/mca/pmix/pmix4x/openpmix/src/mca/mca.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/mca.h rename to opal/mca/pmix/pmix4x/openpmix/src/mca/mca.h diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/pcompress/Makefile.am b/opal/mca/pmix/pmix4x/openpmix/src/mca/pcompress/Makefile.am similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/pcompress/Makefile.am rename to opal/mca/pmix/pmix4x/openpmix/src/mca/pcompress/Makefile.am diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/pcompress/base/Makefile.am b/opal/mca/pmix/pmix4x/openpmix/src/mca/pcompress/base/Makefile.am similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/pcompress/base/Makefile.am rename to opal/mca/pmix/pmix4x/openpmix/src/mca/pcompress/base/Makefile.am diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/pcompress/base/base.h b/opal/mca/pmix/pmix4x/openpmix/src/mca/pcompress/base/base.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/pcompress/base/base.h rename to opal/mca/pmix/pmix4x/openpmix/src/mca/pcompress/base/base.h diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/pcompress/base/pcompress_base_frame.c b/opal/mca/pmix/pmix4x/openpmix/src/mca/pcompress/base/pcompress_base_frame.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/pcompress/base/pcompress_base_frame.c rename to opal/mca/pmix/pmix4x/openpmix/src/mca/pcompress/base/pcompress_base_frame.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/pcompress/base/pcompress_base_select.c b/opal/mca/pmix/pmix4x/openpmix/src/mca/pcompress/base/pcompress_base_select.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/pcompress/base/pcompress_base_select.c rename to opal/mca/pmix/pmix4x/openpmix/src/mca/pcompress/base/pcompress_base_select.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/pcompress/pcompress.h b/opal/mca/pmix/pmix4x/openpmix/src/mca/pcompress/pcompress.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/pcompress/pcompress.h rename to opal/mca/pmix/pmix4x/openpmix/src/mca/pcompress/pcompress.h diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/pcompress/zlib/Makefile.am b/opal/mca/pmix/pmix4x/openpmix/src/mca/pcompress/zlib/Makefile.am similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/pcompress/zlib/Makefile.am rename to opal/mca/pmix/pmix4x/openpmix/src/mca/pcompress/zlib/Makefile.am diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/pcompress/zlib/compress_zlib.c b/opal/mca/pmix/pmix4x/openpmix/src/mca/pcompress/zlib/compress_zlib.c similarity index 94% rename from opal/mca/pmix/pmix4x/pmix/src/mca/pcompress/zlib/compress_zlib.c rename to opal/mca/pmix/pmix4x/openpmix/src/mca/pcompress/zlib/compress_zlib.c index 1f07f11dc3..218484d4bf 100644 --- a/opal/mca/pmix/pmix4x/pmix/src/mca/pcompress/zlib/compress_zlib.c +++ b/opal/mca/pmix/pmix4x/openpmix/src/mca/pcompress/zlib/compress_zlib.c @@ -69,7 +69,15 @@ bool pmix_compress_zlib_compress_block(char *instring, /* get an upper bound on the required output storage */ len = deflateBound(&strm, inlen); + /* if this isn't going to result in a smaller footprint, + * then don't do it */ + if (len >= inlen) { + (void)deflateEnd(&strm); + return false; + } + if (NULL == (tmp = (uint8_t*)malloc(len))) { + (void)deflateEnd(&strm); return false; } strm.next_in = (uint8_t*)instring; @@ -81,7 +89,7 @@ bool pmix_compress_zlib_compress_block(char *instring, strm.next_out = tmp; rc = deflate (&strm, Z_FINISH); - deflateEnd (&strm); + (void)deflateEnd (&strm); if (Z_OK != rc && Z_STREAM_END != rc) { free(tmp); return false; diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/pcompress/zlib/compress_zlib.h b/opal/mca/pmix/pmix4x/openpmix/src/mca/pcompress/zlib/compress_zlib.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/pcompress/zlib/compress_zlib.h rename to opal/mca/pmix/pmix4x/openpmix/src/mca/pcompress/zlib/compress_zlib.h diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/pcompress/zlib/compress_zlib_component.c b/opal/mca/pmix/pmix4x/openpmix/src/mca/pcompress/zlib/compress_zlib_component.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/pcompress/zlib/compress_zlib_component.c rename to opal/mca/pmix/pmix4x/openpmix/src/mca/pcompress/zlib/compress_zlib_component.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/pcompress/zlib/configure.m4 b/opal/mca/pmix/pmix4x/openpmix/src/mca/pcompress/zlib/configure.m4 similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/pcompress/zlib/configure.m4 rename to opal/mca/pmix/pmix4x/openpmix/src/mca/pcompress/zlib/configure.m4 diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/pdl/Makefile.am b/opal/mca/pmix/pmix4x/openpmix/src/mca/pdl/Makefile.am similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/pdl/Makefile.am rename to opal/mca/pmix/pmix4x/openpmix/src/mca/pdl/Makefile.am diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/pdl/base/Makefile.am b/opal/mca/pmix/pmix4x/openpmix/src/mca/pdl/base/Makefile.am similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/pdl/base/Makefile.am rename to opal/mca/pmix/pmix4x/openpmix/src/mca/pdl/base/Makefile.am diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/pdl/base/base.h b/opal/mca/pmix/pmix4x/openpmix/src/mca/pdl/base/base.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/pdl/base/base.h rename to opal/mca/pmix/pmix4x/openpmix/src/mca/pdl/base/base.h diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/pdl/base/pdl_base_close.c b/opal/mca/pmix/pmix4x/openpmix/src/mca/pdl/base/pdl_base_close.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/pdl/base/pdl_base_close.c rename to opal/mca/pmix/pmix4x/openpmix/src/mca/pdl/base/pdl_base_close.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/pdl/base/pdl_base_fns.c b/opal/mca/pmix/pmix4x/openpmix/src/mca/pdl/base/pdl_base_fns.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/pdl/base/pdl_base_fns.c rename to opal/mca/pmix/pmix4x/openpmix/src/mca/pdl/base/pdl_base_fns.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/pdl/base/pdl_base_open.c b/opal/mca/pmix/pmix4x/openpmix/src/mca/pdl/base/pdl_base_open.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/pdl/base/pdl_base_open.c rename to opal/mca/pmix/pmix4x/openpmix/src/mca/pdl/base/pdl_base_open.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/pdl/base/pdl_base_select.c b/opal/mca/pmix/pmix4x/openpmix/src/mca/pdl/base/pdl_base_select.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/pdl/base/pdl_base_select.c rename to opal/mca/pmix/pmix4x/openpmix/src/mca/pdl/base/pdl_base_select.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/pdl/configure.m4 b/opal/mca/pmix/pmix4x/openpmix/src/mca/pdl/configure.m4 similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/pdl/configure.m4 rename to opal/mca/pmix/pmix4x/openpmix/src/mca/pdl/configure.m4 diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/pdl/pdl.h b/opal/mca/pmix/pmix4x/openpmix/src/mca/pdl/pdl.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/pdl/pdl.h rename to opal/mca/pmix/pmix4x/openpmix/src/mca/pdl/pdl.h diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/pdl/pdlopen/Makefile.am b/opal/mca/pmix/pmix4x/openpmix/src/mca/pdl/pdlopen/Makefile.am similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/pdl/pdlopen/Makefile.am rename to opal/mca/pmix/pmix4x/openpmix/src/mca/pdl/pdlopen/Makefile.am diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/pdl/pdlopen/configure.m4 b/opal/mca/pmix/pmix4x/openpmix/src/mca/pdl/pdlopen/configure.m4 similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/pdl/pdlopen/configure.m4 rename to opal/mca/pmix/pmix4x/openpmix/src/mca/pdl/pdlopen/configure.m4 diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/pdl/pdlopen/pdl_pdlopen.h b/opal/mca/pmix/pmix4x/openpmix/src/mca/pdl/pdlopen/pdl_pdlopen.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/pdl/pdlopen/pdl_pdlopen.h rename to opal/mca/pmix/pmix4x/openpmix/src/mca/pdl/pdlopen/pdl_pdlopen.h diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/pdl/pdlopen/pdl_pdlopen_component.c b/opal/mca/pmix/pmix4x/openpmix/src/mca/pdl/pdlopen/pdl_pdlopen_component.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/pdl/pdlopen/pdl_pdlopen_component.c rename to opal/mca/pmix/pmix4x/openpmix/src/mca/pdl/pdlopen/pdl_pdlopen_component.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/pdl/pdlopen/pdl_pdlopen_module.c b/opal/mca/pmix/pmix4x/openpmix/src/mca/pdl/pdlopen/pdl_pdlopen_module.c similarity index 98% rename from opal/mca/pmix/pmix4x/pmix/src/mca/pdl/pdlopen/pdl_pdlopen_module.c rename to opal/mca/pmix/pmix4x/openpmix/src/mca/pdl/pdlopen/pdl_pdlopen_module.c index f9a61287a8..db3e29db54 100644 --- a/opal/mca/pmix/pmix4x/pmix/src/mca/pdl/pdlopen/pdl_pdlopen_module.c +++ b/opal/mca/pmix/pmix4x/openpmix/src/mca/pdl/pdlopen/pdl_pdlopen_module.c @@ -4,7 +4,7 @@ * Copyright (c) 2015 Los Alamos National Security, LLC. All rights * reserved. * Copyright (c) 2016 IBM Corporation. All rights reserved. - * Copyright (c) 2016-2017 Intel, Inc. All rights reserved. + * Copyright (c) 2016-2019 Intel, Inc. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -88,6 +88,7 @@ static int pdlopen_open(const char *fname, bool use_ext, bool private_namespace, /* Does the file exist? */ struct stat buf; + /* coverity[toctou] */ if (stat(name, &buf) < 0) { free(name); if (NULL != err_msg) { @@ -200,6 +201,7 @@ static int pdlopen_foreachfile(const char *search_path, /* Stat the file */ struct stat buf; + /* coverity[toctou] */ if (stat(abs_name, &buf) < 0) { free(abs_name); ret = PMIX_ERR_IN_ERRNO; diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/pdl/plibltdl/Makefile.am b/opal/mca/pmix/pmix4x/openpmix/src/mca/pdl/plibltdl/Makefile.am similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/pdl/plibltdl/Makefile.am rename to opal/mca/pmix/pmix4x/openpmix/src/mca/pdl/plibltdl/Makefile.am diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/pdl/plibltdl/configure.m4 b/opal/mca/pmix/pmix4x/openpmix/src/mca/pdl/plibltdl/configure.m4 similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/pdl/plibltdl/configure.m4 rename to opal/mca/pmix/pmix4x/openpmix/src/mca/pdl/plibltdl/configure.m4 diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/pdl/plibltdl/pdl_libltdl.h b/opal/mca/pmix/pmix4x/openpmix/src/mca/pdl/plibltdl/pdl_libltdl.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/pdl/plibltdl/pdl_libltdl.h rename to opal/mca/pmix/pmix4x/openpmix/src/mca/pdl/plibltdl/pdl_libltdl.h diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/pdl/plibltdl/pdl_libltdl_component.c b/opal/mca/pmix/pmix4x/openpmix/src/mca/pdl/plibltdl/pdl_libltdl_component.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/pdl/plibltdl/pdl_libltdl_component.c rename to opal/mca/pmix/pmix4x/openpmix/src/mca/pdl/plibltdl/pdl_libltdl_component.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/pdl/plibltdl/pdl_libltdl_module.c b/opal/mca/pmix/pmix4x/openpmix/src/mca/pdl/plibltdl/pdl_libltdl_module.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/pdl/plibltdl/pdl_libltdl_module.c rename to opal/mca/pmix/pmix4x/openpmix/src/mca/pdl/plibltdl/pdl_libltdl_module.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/pfexec/Makefile.am b/opal/mca/pmix/pmix4x/openpmix/src/mca/pfexec/Makefile.am similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/pfexec/Makefile.am rename to opal/mca/pmix/pmix4x/openpmix/src/mca/pfexec/Makefile.am diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/pfexec/base/Makefile.am b/opal/mca/pmix/pmix4x/openpmix/src/mca/pfexec/base/Makefile.am similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/pfexec/base/Makefile.am rename to opal/mca/pmix/pmix4x/openpmix/src/mca/pfexec/base/Makefile.am diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/pfexec/base/base.h b/opal/mca/pmix/pmix4x/openpmix/src/mca/pfexec/base/base.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/pfexec/base/base.h rename to opal/mca/pmix/pmix4x/openpmix/src/mca/pfexec/base/base.h diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/pfexec/base/help-pfexec-base.txt b/opal/mca/pmix/pmix4x/openpmix/src/mca/pfexec/base/help-pfexec-base.txt similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/pfexec/base/help-pfexec-base.txt rename to opal/mca/pmix/pmix4x/openpmix/src/mca/pfexec/base/help-pfexec-base.txt diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/pfexec/base/pfexec_base_default_fns.c b/opal/mca/pmix/pmix4x/openpmix/src/mca/pfexec/base/pfexec_base_default_fns.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/pfexec/base/pfexec_base_default_fns.c rename to opal/mca/pmix/pmix4x/openpmix/src/mca/pfexec/base/pfexec_base_default_fns.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/pfexec/base/pfexec_base_frame.c b/opal/mca/pmix/pmix4x/openpmix/src/mca/pfexec/base/pfexec_base_frame.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/pfexec/base/pfexec_base_frame.c rename to opal/mca/pmix/pmix4x/openpmix/src/mca/pfexec/base/pfexec_base_frame.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/pfexec/base/pfexec_base_select.c b/opal/mca/pmix/pmix4x/openpmix/src/mca/pfexec/base/pfexec_base_select.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/pfexec/base/pfexec_base_select.c rename to opal/mca/pmix/pmix4x/openpmix/src/mca/pfexec/base/pfexec_base_select.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/pfexec/linux/Makefile.am b/opal/mca/pmix/pmix4x/openpmix/src/mca/pfexec/linux/Makefile.am similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/pfexec/linux/Makefile.am rename to opal/mca/pmix/pmix4x/openpmix/src/mca/pfexec/linux/Makefile.am diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/pfexec/linux/configure.m4 b/opal/mca/pmix/pmix4x/openpmix/src/mca/pfexec/linux/configure.m4 similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/pfexec/linux/configure.m4 rename to opal/mca/pmix/pmix4x/openpmix/src/mca/pfexec/linux/configure.m4 diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/pfexec/linux/help-pfexec-linux.txt b/opal/mca/pmix/pmix4x/openpmix/src/mca/pfexec/linux/help-pfexec-linux.txt similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/pfexec/linux/help-pfexec-linux.txt rename to opal/mca/pmix/pmix4x/openpmix/src/mca/pfexec/linux/help-pfexec-linux.txt diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/pfexec/linux/pfexec_linux.c b/opal/mca/pmix/pmix4x/openpmix/src/mca/pfexec/linux/pfexec_linux.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/pfexec/linux/pfexec_linux.c rename to opal/mca/pmix/pmix4x/openpmix/src/mca/pfexec/linux/pfexec_linux.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/pfexec/linux/pfexec_linux.h b/opal/mca/pmix/pmix4x/openpmix/src/mca/pfexec/linux/pfexec_linux.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/pfexec/linux/pfexec_linux.h rename to opal/mca/pmix/pmix4x/openpmix/src/mca/pfexec/linux/pfexec_linux.h diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/pfexec/linux/pfexec_linux_component.c b/opal/mca/pmix/pmix4x/openpmix/src/mca/pfexec/linux/pfexec_linux_component.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/pfexec/linux/pfexec_linux_component.c rename to opal/mca/pmix/pmix4x/openpmix/src/mca/pfexec/linux/pfexec_linux_component.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/pfexec/pfexec.h b/opal/mca/pmix/pmix4x/openpmix/src/mca/pfexec/pfexec.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/pfexec/pfexec.h rename to opal/mca/pmix/pmix4x/openpmix/src/mca/pfexec/pfexec.h diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/pif/Makefile.am b/opal/mca/pmix/pmix4x/openpmix/src/mca/pif/Makefile.am similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/pif/Makefile.am rename to opal/mca/pmix/pmix4x/openpmix/src/mca/pif/Makefile.am diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/pif/base/Makefile.am b/opal/mca/pmix/pmix4x/openpmix/src/mca/pif/base/Makefile.am similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/pif/base/Makefile.am rename to opal/mca/pmix/pmix4x/openpmix/src/mca/pif/base/Makefile.am diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/pif/base/base.h b/opal/mca/pmix/pmix4x/openpmix/src/mca/pif/base/base.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/pif/base/base.h rename to opal/mca/pmix/pmix4x/openpmix/src/mca/pif/base/base.h diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/pif/base/pif_base_components.c b/opal/mca/pmix/pmix4x/openpmix/src/mca/pif/base/pif_base_components.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/pif/base/pif_base_components.c rename to opal/mca/pmix/pmix4x/openpmix/src/mca/pif/base/pif_base_components.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/pif/bsdx_ipv4/Makefile.am b/opal/mca/pmix/pmix4x/openpmix/src/mca/pif/bsdx_ipv4/Makefile.am similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/pif/bsdx_ipv4/Makefile.am rename to opal/mca/pmix/pmix4x/openpmix/src/mca/pif/bsdx_ipv4/Makefile.am diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/pif/bsdx_ipv4/configure.m4 b/opal/mca/pmix/pmix4x/openpmix/src/mca/pif/bsdx_ipv4/configure.m4 similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/pif/bsdx_ipv4/configure.m4 rename to opal/mca/pmix/pmix4x/openpmix/src/mca/pif/bsdx_ipv4/configure.m4 diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/pif/bsdx_ipv4/pif_bsdx.c b/opal/mca/pmix/pmix4x/openpmix/src/mca/pif/bsdx_ipv4/pif_bsdx.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/pif/bsdx_ipv4/pif_bsdx.c rename to opal/mca/pmix/pmix4x/openpmix/src/mca/pif/bsdx_ipv4/pif_bsdx.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/pif/bsdx_ipv6/Makefile.am b/opal/mca/pmix/pmix4x/openpmix/src/mca/pif/bsdx_ipv6/Makefile.am similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/pif/bsdx_ipv6/Makefile.am rename to opal/mca/pmix/pmix4x/openpmix/src/mca/pif/bsdx_ipv6/Makefile.am diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/pif/bsdx_ipv6/configure.m4 b/opal/mca/pmix/pmix4x/openpmix/src/mca/pif/bsdx_ipv6/configure.m4 similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/pif/bsdx_ipv6/configure.m4 rename to opal/mca/pmix/pmix4x/openpmix/src/mca/pif/bsdx_ipv6/configure.m4 diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/pif/bsdx_ipv6/pif_bsdx_ipv6.c b/opal/mca/pmix/pmix4x/openpmix/src/mca/pif/bsdx_ipv6/pif_bsdx_ipv6.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/pif/bsdx_ipv6/pif_bsdx_ipv6.c rename to opal/mca/pmix/pmix4x/openpmix/src/mca/pif/bsdx_ipv6/pif_bsdx_ipv6.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/pif/linux_ipv6/Makefile.am b/opal/mca/pmix/pmix4x/openpmix/src/mca/pif/linux_ipv6/Makefile.am similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/pif/linux_ipv6/Makefile.am rename to opal/mca/pmix/pmix4x/openpmix/src/mca/pif/linux_ipv6/Makefile.am diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/pif/linux_ipv6/configure.m4 b/opal/mca/pmix/pmix4x/openpmix/src/mca/pif/linux_ipv6/configure.m4 similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/pif/linux_ipv6/configure.m4 rename to opal/mca/pmix/pmix4x/openpmix/src/mca/pif/linux_ipv6/configure.m4 diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/pif/linux_ipv6/pif_linux_ipv6.c b/opal/mca/pmix/pmix4x/openpmix/src/mca/pif/linux_ipv6/pif_linux_ipv6.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/pif/linux_ipv6/pif_linux_ipv6.c rename to opal/mca/pmix/pmix4x/openpmix/src/mca/pif/linux_ipv6/pif_linux_ipv6.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/pif/pif.h b/opal/mca/pmix/pmix4x/openpmix/src/mca/pif/pif.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/pif/pif.h rename to opal/mca/pmix/pmix4x/openpmix/src/mca/pif/pif.h diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/pif/posix_ipv4/Makefile.am b/opal/mca/pmix/pmix4x/openpmix/src/mca/pif/posix_ipv4/Makefile.am similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/pif/posix_ipv4/Makefile.am rename to opal/mca/pmix/pmix4x/openpmix/src/mca/pif/posix_ipv4/Makefile.am diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/pif/posix_ipv4/configure.m4 b/opal/mca/pmix/pmix4x/openpmix/src/mca/pif/posix_ipv4/configure.m4 similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/pif/posix_ipv4/configure.m4 rename to opal/mca/pmix/pmix4x/openpmix/src/mca/pif/posix_ipv4/configure.m4 diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/pif/posix_ipv4/pif_posix.c b/opal/mca/pmix/pmix4x/openpmix/src/mca/pif/posix_ipv4/pif_posix.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/pif/posix_ipv4/pif_posix.c rename to opal/mca/pmix/pmix4x/openpmix/src/mca/pif/posix_ipv4/pif_posix.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/pif/solaris_ipv6/Makefile.am b/opal/mca/pmix/pmix4x/openpmix/src/mca/pif/solaris_ipv6/Makefile.am similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/pif/solaris_ipv6/Makefile.am rename to opal/mca/pmix/pmix4x/openpmix/src/mca/pif/solaris_ipv6/Makefile.am diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/pif/solaris_ipv6/configure.m4 b/opal/mca/pmix/pmix4x/openpmix/src/mca/pif/solaris_ipv6/configure.m4 similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/pif/solaris_ipv6/configure.m4 rename to opal/mca/pmix/pmix4x/openpmix/src/mca/pif/solaris_ipv6/configure.m4 diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/pif/solaris_ipv6/pif_solaris_ipv6.c b/opal/mca/pmix/pmix4x/openpmix/src/mca/pif/solaris_ipv6/pif_solaris_ipv6.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/pif/solaris_ipv6/pif_solaris_ipv6.c rename to opal/mca/pmix/pmix4x/openpmix/src/mca/pif/solaris_ipv6/pif_solaris_ipv6.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/pinstalldirs/Makefile.am b/opal/mca/pmix/pmix4x/openpmix/src/mca/pinstalldirs/Makefile.am similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/pinstalldirs/Makefile.am rename to opal/mca/pmix/pmix4x/openpmix/src/mca/pinstalldirs/Makefile.am diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/pinstalldirs/base/Makefile.am b/opal/mca/pmix/pmix4x/openpmix/src/mca/pinstalldirs/base/Makefile.am similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/pinstalldirs/base/Makefile.am rename to opal/mca/pmix/pmix4x/openpmix/src/mca/pinstalldirs/base/Makefile.am diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/pinstalldirs/base/base.h b/opal/mca/pmix/pmix4x/openpmix/src/mca/pinstalldirs/base/base.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/pinstalldirs/base/base.h rename to opal/mca/pmix/pmix4x/openpmix/src/mca/pinstalldirs/base/base.h diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/pinstalldirs/base/pinstalldirs_base_components.c b/opal/mca/pmix/pmix4x/openpmix/src/mca/pinstalldirs/base/pinstalldirs_base_components.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/pinstalldirs/base/pinstalldirs_base_components.c rename to opal/mca/pmix/pmix4x/openpmix/src/mca/pinstalldirs/base/pinstalldirs_base_components.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/pinstalldirs/base/pinstalldirs_base_expand.c b/opal/mca/pmix/pmix4x/openpmix/src/mca/pinstalldirs/base/pinstalldirs_base_expand.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/pinstalldirs/base/pinstalldirs_base_expand.c rename to opal/mca/pmix/pmix4x/openpmix/src/mca/pinstalldirs/base/pinstalldirs_base_expand.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/pinstalldirs/config/Makefile.am b/opal/mca/pmix/pmix4x/openpmix/src/mca/pinstalldirs/config/Makefile.am similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/pinstalldirs/config/Makefile.am rename to opal/mca/pmix/pmix4x/openpmix/src/mca/pinstalldirs/config/Makefile.am diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/pinstalldirs/config/configure.m4 b/opal/mca/pmix/pmix4x/openpmix/src/mca/pinstalldirs/config/configure.m4 similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/pinstalldirs/config/configure.m4 rename to opal/mca/pmix/pmix4x/openpmix/src/mca/pinstalldirs/config/configure.m4 diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/pinstalldirs/config/pinstall_dirs.h.in b/opal/mca/pmix/pmix4x/openpmix/src/mca/pinstalldirs/config/pinstall_dirs.h.in similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/pinstalldirs/config/pinstall_dirs.h.in rename to opal/mca/pmix/pmix4x/openpmix/src/mca/pinstalldirs/config/pinstall_dirs.h.in diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/pinstalldirs/config/pmix_pinstalldirs_config.c b/opal/mca/pmix/pmix4x/openpmix/src/mca/pinstalldirs/config/pmix_pinstalldirs_config.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/pinstalldirs/config/pmix_pinstalldirs_config.c rename to opal/mca/pmix/pmix4x/openpmix/src/mca/pinstalldirs/config/pmix_pinstalldirs_config.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/pinstalldirs/configure.m4 b/opal/mca/pmix/pmix4x/openpmix/src/mca/pinstalldirs/configure.m4 similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/pinstalldirs/configure.m4 rename to opal/mca/pmix/pmix4x/openpmix/src/mca/pinstalldirs/configure.m4 diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/pinstalldirs/env/Makefile.am b/opal/mca/pmix/pmix4x/openpmix/src/mca/pinstalldirs/env/Makefile.am similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/pinstalldirs/env/Makefile.am rename to opal/mca/pmix/pmix4x/openpmix/src/mca/pinstalldirs/env/Makefile.am diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/pinstalldirs/env/configure.m4 b/opal/mca/pmix/pmix4x/openpmix/src/mca/pinstalldirs/env/configure.m4 similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/pinstalldirs/env/configure.m4 rename to opal/mca/pmix/pmix4x/openpmix/src/mca/pinstalldirs/env/configure.m4 diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/pinstalldirs/env/pmix_pinstalldirs_env.c b/opal/mca/pmix/pmix4x/openpmix/src/mca/pinstalldirs/env/pmix_pinstalldirs_env.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/pinstalldirs/env/pmix_pinstalldirs_env.c rename to opal/mca/pmix/pmix4x/openpmix/src/mca/pinstalldirs/env/pmix_pinstalldirs_env.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/pinstalldirs/pinstalldirs.h b/opal/mca/pmix/pmix4x/openpmix/src/mca/pinstalldirs/pinstalldirs.h similarity index 95% rename from opal/mca/pmix/pmix4x/pmix/src/mca/pinstalldirs/pinstalldirs.h rename to opal/mca/pmix/pmix4x/openpmix/src/mca/pinstalldirs/pinstalldirs.h index 159fae893c..709fd9001b 100644 --- a/opal/mca/pmix/pmix4x/pmix/src/mca/pinstalldirs/pinstalldirs.h +++ b/opal/mca/pmix/pmix4x/openpmix/src/mca/pinstalldirs/pinstalldirs.h @@ -2,7 +2,7 @@ /* * Copyright (c) 2006-2015 Los Alamos National Security, LLC. All rights * reserved. - * Copyright (c) 2016-2017 Intel, Inc. All rights reserved. + * Copyright (c) 2016-2019 Intel, Inc. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -59,7 +59,7 @@ PMIX_EXPORT extern pmix_pinstall_dirs_t pmix_pinstall_dirs; /** * Expand out path variables (such as ${prefix}) in the input string * using the current pmix_pinstall_dirs structure */ -char * pmix_pinstall_dirs_expand(const char* input); +PMIX_EXPORT char * pmix_pinstall_dirs_expand(const char* input); /** diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/plog/Makefile.am b/opal/mca/pmix/pmix4x/openpmix/src/mca/plog/Makefile.am similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/plog/Makefile.am rename to opal/mca/pmix/pmix4x/openpmix/src/mca/plog/Makefile.am diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/plog/base/Makefile.include b/opal/mca/pmix/pmix4x/openpmix/src/mca/plog/base/Makefile.include similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/plog/base/Makefile.include rename to opal/mca/pmix/pmix4x/openpmix/src/mca/plog/base/Makefile.include diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/plog/base/base.h b/opal/mca/pmix/pmix4x/openpmix/src/mca/plog/base/base.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/plog/base/base.h rename to opal/mca/pmix/pmix4x/openpmix/src/mca/plog/base/base.h diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/plog/base/help-pmix-plog.txt b/opal/mca/pmix/pmix4x/openpmix/src/mca/plog/base/help-pmix-plog.txt similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/plog/base/help-pmix-plog.txt rename to opal/mca/pmix/pmix4x/openpmix/src/mca/plog/base/help-pmix-plog.txt diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/plog/base/plog_base_frame.c b/opal/mca/pmix/pmix4x/openpmix/src/mca/plog/base/plog_base_frame.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/plog/base/plog_base_frame.c rename to opal/mca/pmix/pmix4x/openpmix/src/mca/plog/base/plog_base_frame.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/plog/base/plog_base_select.c b/opal/mca/pmix/pmix4x/openpmix/src/mca/plog/base/plog_base_select.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/plog/base/plog_base_select.c rename to opal/mca/pmix/pmix4x/openpmix/src/mca/plog/base/plog_base_select.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/plog/base/plog_base_stubs.c b/opal/mca/pmix/pmix4x/openpmix/src/mca/plog/base/plog_base_stubs.c similarity index 99% rename from opal/mca/pmix/pmix4x/pmix/src/mca/plog/base/plog_base_stubs.c rename to opal/mca/pmix/pmix4x/openpmix/src/mca/plog/base/plog_base_stubs.c index 221ec775f8..5d3419a616 100644 --- a/opal/mca/pmix/pmix4x/pmix/src/mca/plog/base/plog_base_stubs.c +++ b/opal/mca/pmix/pmix4x/openpmix/src/mca/plog/base/plog_base_stubs.c @@ -1,6 +1,6 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ /* - * Copyright (c) 2018-2019 Intel, Inc. All rights reserved. + * Copyright (c) 2018 Intel, Inc. All rights reserved. * * $COPYRIGHT$ * diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/plog/default/Makefile.am b/opal/mca/pmix/pmix4x/openpmix/src/mca/plog/default/Makefile.am similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/plog/default/Makefile.am rename to opal/mca/pmix/pmix4x/openpmix/src/mca/plog/default/Makefile.am diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/plog/default/plog_default.c b/opal/mca/pmix/pmix4x/openpmix/src/mca/plog/default/plog_default.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/plog/default/plog_default.c rename to opal/mca/pmix/pmix4x/openpmix/src/mca/plog/default/plog_default.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/plog/default/plog_default.h b/opal/mca/pmix/pmix4x/openpmix/src/mca/plog/default/plog_default.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/plog/default/plog_default.h rename to opal/mca/pmix/pmix4x/openpmix/src/mca/plog/default/plog_default.h diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/plog/default/plog_default_component.c b/opal/mca/pmix/pmix4x/openpmix/src/mca/plog/default/plog_default_component.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/plog/default/plog_default_component.c rename to opal/mca/pmix/pmix4x/openpmix/src/mca/plog/default/plog_default_component.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/plog/plog.h b/opal/mca/pmix/pmix4x/openpmix/src/mca/plog/plog.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/plog/plog.h rename to opal/mca/pmix/pmix4x/openpmix/src/mca/plog/plog.h diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/plog/stdfd/Makefile.am b/opal/mca/pmix/pmix4x/openpmix/src/mca/plog/stdfd/Makefile.am similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/plog/stdfd/Makefile.am rename to opal/mca/pmix/pmix4x/openpmix/src/mca/plog/stdfd/Makefile.am diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/plog/stdfd/plog_stdfd.c b/opal/mca/pmix/pmix4x/openpmix/src/mca/plog/stdfd/plog_stdfd.c similarity index 98% rename from opal/mca/pmix/pmix4x/pmix/src/mca/plog/stdfd/plog_stdfd.c rename to opal/mca/pmix/pmix4x/openpmix/src/mca/plog/stdfd/plog_stdfd.c index 2aceac179a..77bc1bb79b 100644 --- a/opal/mca/pmix/pmix4x/pmix/src/mca/plog/stdfd/plog_stdfd.c +++ b/opal/mca/pmix/pmix4x/openpmix/src/mca/plog/stdfd/plog_stdfd.c @@ -10,7 +10,7 @@ * Copyright (c) 2004-2005 The Regents of the University of California. * All rights reserved. * Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved. - * Copyright (c) 2014-2019 Intel, Inc. All rights reserved. + * Copyright (c) 2014-2018 Intel, Inc. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/plog/stdfd/plog_stdfd.h b/opal/mca/pmix/pmix4x/openpmix/src/mca/plog/stdfd/plog_stdfd.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/plog/stdfd/plog_stdfd.h rename to opal/mca/pmix/pmix4x/openpmix/src/mca/plog/stdfd/plog_stdfd.h diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/plog/stdfd/plog_stdfd_component.c b/opal/mca/pmix/pmix4x/openpmix/src/mca/plog/stdfd/plog_stdfd_component.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/plog/stdfd/plog_stdfd_component.c rename to opal/mca/pmix/pmix4x/openpmix/src/mca/plog/stdfd/plog_stdfd_component.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/plog/syslog/Makefile.am b/opal/mca/pmix/pmix4x/openpmix/src/mca/plog/syslog/Makefile.am similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/plog/syslog/Makefile.am rename to opal/mca/pmix/pmix4x/openpmix/src/mca/plog/syslog/Makefile.am diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/plog/syslog/configure.m4 b/opal/mca/pmix/pmix4x/openpmix/src/mca/plog/syslog/configure.m4 similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/plog/syslog/configure.m4 rename to opal/mca/pmix/pmix4x/openpmix/src/mca/plog/syslog/configure.m4 diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/plog/syslog/plog_syslog.c b/opal/mca/pmix/pmix4x/openpmix/src/mca/plog/syslog/plog_syslog.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/plog/syslog/plog_syslog.c rename to opal/mca/pmix/pmix4x/openpmix/src/mca/plog/syslog/plog_syslog.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/plog/syslog/plog_syslog.h b/opal/mca/pmix/pmix4x/openpmix/src/mca/plog/syslog/plog_syslog.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/plog/syslog/plog_syslog.h rename to opal/mca/pmix/pmix4x/openpmix/src/mca/plog/syslog/plog_syslog.h diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/plog/syslog/plog_syslog_component.c b/opal/mca/pmix/pmix4x/openpmix/src/mca/plog/syslog/plog_syslog_component.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/plog/syslog/plog_syslog_component.c rename to opal/mca/pmix/pmix4x/openpmix/src/mca/plog/syslog/plog_syslog_component.c diff --git a/opal/mca/pmix/pmix4x/openpmix/src/mca/pmdl/Makefile.am b/opal/mca/pmix/pmix4x/openpmix/src/mca/pmdl/Makefile.am new file mode 100644 index 0000000000..6f7a5030a4 --- /dev/null +++ b/opal/mca/pmix/pmix4x/openpmix/src/mca/pmdl/Makefile.am @@ -0,0 +1,44 @@ +# -*- makefile -*- +# +# Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana +# University Research and Technology +# Corporation. All rights reserved. +# Copyright (c) 2004-2005 The University of Tennessee and The University +# of Tennessee Research Foundation. All rights +# reserved. +# Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, +# University of Stuttgart. All rights reserved. +# Copyright (c) 2004-2005 The Regents of the University of California. +# All rights reserved. +# Copyright (c) 2012 Los Alamos National Security, Inc. All rights reserved. +# Copyright (c) 2013-2019 Intel, Inc. All rights reserved. +# Copyright (c) 2016 Cisco Systems, Inc. All rights reserved. +# $COPYRIGHT$ +# +# Additional copyrights may follow +# +# $HEADER$ +# + +AM_CPPFLAGS = $(LTDLINCL) + +# main library setup +noinst_LTLIBRARIES = libmca_pmdl.la +libmca_pmdl_la_SOURCES = + +# local files +headers = pmdl.h +sources = + +# Conditionally install the header files +if WANT_INSTALL_HEADERS +pmixdir = $(pmixincludedir)/$(subdir) +nobase_pmix_HEADERS = $(headers) +endif + +include base/Makefile.include + +libmca_pmdl_la_SOURCES += $(headers) $(sources) + +distclean-local: + rm -f base/static-components.h diff --git a/opal/mca/pmix/pmix4x/openpmix/src/mca/pmdl/base/Makefile.include b/opal/mca/pmix/pmix4x/openpmix/src/mca/pmdl/base/Makefile.include new file mode 100644 index 0000000000..400066c952 --- /dev/null +++ b/opal/mca/pmix/pmix4x/openpmix/src/mca/pmdl/base/Makefile.include @@ -0,0 +1,32 @@ +# -*- makefile -*- +# +# Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana +# University Research and Technology +# Corporation. All rights reserved. +# Copyright (c) 2004-2005 The University of Tennessee and The University +# of Tennessee Research Foundation. All rights +# reserved. +# Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, +# University of Stuttgart. All rights reserved. +# Copyright (c) 2004-2005 The Regents of the University of California. +# All rights reserved. +# Copyright (c) 2012 Los Alamos National Security, Inc. All rights reserved. +# Copyright (c) 2013-2019 Intel, Inc. All rights reserved. +# Copyright (c) 2016 Cisco Systems, Inc. All rights reserved. +# $COPYRIGHT$ +# +# Additional copyrights may follow +# +# $HEADER$ +# + +# This makefile.am does not stand on its own - it is included from +# src/Makefile.am + +headers += \ + base/base.h + +sources += \ + base/pmdl_base_frame.c \ + base/pmdl_base_select.c \ + base/pmdl_base_stubs.c diff --git a/opal/mca/pmix/pmix4x/openpmix/src/mca/pmdl/base/base.h b/opal/mca/pmix/pmix4x/openpmix/src/mca/pmdl/base/base.h new file mode 100644 index 0000000000..15bc3d5ea4 --- /dev/null +++ b/opal/mca/pmix/pmix4x/openpmix/src/mca/pmdl/base/base.h @@ -0,0 +1,98 @@ +/* -*- C -*- + * + * Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2006 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, + * University of Stuttgart. All rights reserved. + * Copyright (c) 2004-2005 The Regents of the University of California. + * All rights reserved. + * Copyright (c) 2012 Los Alamos National Security, Inc. All rights reserved. + * Copyright (c) 2014-2019 Intel, Inc. All rights reserved. + * Copyright (c) 2015 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + * + */ +#ifndef PMIX_PMDL_BASE_H_ +#define PMIX_PMDL_BASE_H_ + +#include + + +#ifdef HAVE_SYS_TIME_H +#include /* for struct timeval */ +#endif +#ifdef HAVE_STRING_H +#include +#endif + +#include "src/class/pmix_list.h" +#include "src/class/pmix_pointer_array.h" +#include "src/mca/mca.h" +#include "src/mca/base/pmix_mca_base_framework.h" + +#include "src/mca/pmdl/pmdl.h" + + +BEGIN_C_DECLS + +/* + * MCA Framework + */ +PMIX_EXPORT extern pmix_mca_base_framework_t pmix_pmdl_base_framework; +/** + * PMDL select function + * + * Cycle across available components and construct the list + * of active modules + */ +PMIX_EXPORT pmix_status_t pmix_pmdl_base_select(void); + +/** + * Track an active component / module + */ +struct pmix_pmdl_base_active_module_t { + pmix_list_item_t super; + int pri; + pmix_pmdl_module_t *module; + pmix_pmdl_base_component_t *component; +}; +typedef struct pmix_pmdl_base_active_module_t pmix_pmdl_base_active_module_t; +PMIX_EXPORT PMIX_CLASS_DECLARATION(pmix_pmdl_base_active_module_t); + +/* framework globals */ +struct pmix_pmdl_globals_t { + pmix_lock_t lock; + pmix_list_t actives; + bool initialized; +}; +typedef struct pmix_pmdl_globals_t pmix_pmdl_globals_t; + +PMIX_EXPORT extern pmix_pmdl_globals_t pmix_pmdl_globals; + +PMIX_EXPORT pmix_status_t pmix_pmdl_base_harvest_envars(char *nspace, + pmix_info_t info[], size_t ninfo, + pmix_list_t *ilist); +PMIX_EXPORT pmix_status_t pmix_pmdl_base_setup_nspace(pmix_namespace_t *nptr, + uint32_t appnum, + pmix_info_t *info); +PMIX_EXPORT pmix_status_t pmix_pmdl_base_setup_nspace_kv(pmix_namespace_t *nptr, + uint32_t appnum, + pmix_kval_t *kv); +PMIX_EXPORT pmix_status_t pmix_pmdl_base_setup_client(pmix_namespace_t *nptr, + pmix_rank_t rank, + uint32_t appnum); +PMIX_EXPORT pmix_status_t pmix_pmdl_base_setup_fork(const pmix_proc_t *peer, char ***env); +PMIX_EXPORT void pmix_pmdl_base_deregister_nspace(const char *nptr); + +END_C_DECLS + +#endif diff --git a/opal/mca/pmix/pmix4x/openpmix/src/mca/pmdl/base/pmdl_base_frame.c b/opal/mca/pmix/pmix4x/openpmix/src/mca/pmdl/base/pmdl_base_frame.c new file mode 100644 index 0000000000..18f7a62ab1 --- /dev/null +++ b/opal/mca/pmix/pmix4x/openpmix/src/mca/pmdl/base/pmdl_base_frame.c @@ -0,0 +1,97 @@ +/* -*- Mode: C; c-basic-offset:4 ; -*- */ +/* + * Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2009 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, + * University of Stuttgart. All rights reserved. + * Copyright (c) 2004-2005 The Regents of the University of California. + * All rights reserved. + * Copyright (c) 2012-2013 Los Alamos National Security, Inc. All rights reserved. + * Copyright (c) 2014-2019 Intel, Inc. All rights reserved. + * Copyright (c) 2015-2016 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ +/** @file: + * + */ +#include + +#include + +#ifdef HAVE_STRING_H +#include +#endif + +#include "src/class/pmix_list.h" +#include "src/mca/base/base.h" +#include "src/mca/pmdl/base/base.h" + +/* + * The following file was created by configure. It contains extern + * statements and the definition of an array of pointers to each + * component's public mca_base_component_t struct. + */ + +#include "src/mca/pmdl/base/static-components.h" + +/* Instantiate the global vars */ +pmix_pmdl_globals_t pmix_pmdl_globals = {{0}}; +pmix_pmdl_API_module_t pmix_pmdl = { + .harvest_envars = pmix_pmdl_base_harvest_envars, + .setup_nspace = pmix_pmdl_base_setup_nspace, + .setup_nspace_kv = pmix_pmdl_base_setup_nspace_kv, + .setup_client = pmix_pmdl_base_setup_client, + .setup_fork = pmix_pmdl_base_setup_fork, + .deregister_nspace = pmix_pmdl_base_deregister_nspace +}; + +static pmix_status_t pmix_pmdl_close(void) +{ + pmix_pmdl_base_active_module_t *active, *prev; + + if (!pmix_pmdl_globals.initialized) { + return PMIX_SUCCESS; + } + pmix_pmdl_globals.initialized = false; + + PMIX_LIST_FOREACH_SAFE(active, prev, &pmix_pmdl_globals.actives, pmix_pmdl_base_active_module_t) { + pmix_list_remove_item(&pmix_pmdl_globals.actives, &active->super); + if (NULL != active->module->finalize) { + active->module->finalize(); + } + PMIX_RELEASE(active); + } + PMIX_DESTRUCT(&pmix_pmdl_globals.actives); + + PMIX_DESTRUCT_LOCK(&pmix_pmdl_globals.lock); + return pmix_mca_base_framework_components_close(&pmix_pmdl_base_framework, NULL); +} + +static pmix_status_t pmix_pmdl_open(pmix_mca_base_open_flag_t flags) +{ + /* initialize globals */ + pmix_pmdl_globals.initialized = true; + PMIX_CONSTRUCT_LOCK(&pmix_pmdl_globals.lock); + pmix_pmdl_globals.lock.active = false; + PMIX_CONSTRUCT(&pmix_pmdl_globals.actives, pmix_list_t); + + /* Open up all available components */ + return pmix_mca_base_framework_components_open(&pmix_pmdl_base_framework, flags); +} + +PMIX_MCA_BASE_FRAMEWORK_DECLARE(pmix, pmdl, "PMIx Network Operations", + NULL, pmix_pmdl_open, pmix_pmdl_close, + mca_pmdl_base_static_components, 0); + +PMIX_CLASS_INSTANCE(pmix_pmdl_base_active_module_t, + pmix_list_item_t, + NULL, NULL); diff --git a/opal/mca/pmix/pmix4x/openpmix/src/mca/pmdl/base/pmdl_base_select.c b/opal/mca/pmix/pmix4x/openpmix/src/mca/pmdl/base/pmdl_base_select.c new file mode 100644 index 0000000000..8de348dd80 --- /dev/null +++ b/opal/mca/pmix/pmix4x/openpmix/src/mca/pmdl/base/pmdl_base_select.c @@ -0,0 +1,116 @@ +/* + * Copyright (c) 2004-2008 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2005 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, + * University of Stuttgart. All rights reserved. + * Copyright (c) 2004-2005 The Regents of the University of California. + * All rights reserved. + * Copyright (c) 2016-2019 Intel, Inc. All rights reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +#include +#include + +#include + +#include "src/mca/mca.h" +#include "src/mca/base/base.h" + +#include "src/mca/pmdl/base/base.h" + +static bool selected = false; + +/* Function for selecting a prioritized list of components + * from all those that are available. */ +int pmix_pmdl_base_select(void) +{ + pmix_mca_base_component_list_item_t *cli = NULL; + pmix_mca_base_component_t *component = NULL; + pmix_mca_base_module_t *module = NULL; + pmix_pmdl_module_t *nmodule; + pmix_pmdl_base_active_module_t *newmodule, *mod; + int rc, priority; + bool inserted; + + if (selected) { + /* ensure we don't do this twice */ + return PMIX_SUCCESS; + } + selected = true; + + /* Query all available components and ask if they have a module */ + PMIX_LIST_FOREACH(cli, &pmix_pmdl_base_framework.framework_components, pmix_mca_base_component_list_item_t) { + component = (pmix_mca_base_component_t *) cli->cli_component; + + pmix_output_verbose(5, pmix_pmdl_base_framework.framework_output, + "mca:pmdl:select: checking available component %s", component->pmix_mca_component_name); + + /* If there's no query function, skip it */ + if (NULL == component->pmix_mca_query_component) { + pmix_output_verbose(5, pmix_pmdl_base_framework.framework_output, + "mca:pmdl:select: Skipping component [%s]. It does not implement a query function", + component->pmix_mca_component_name ); + continue; + } + + /* Query the component */ + pmix_output_verbose(5, pmix_pmdl_base_framework.framework_output, + "mca:pmdl:select: Querying component [%s]", + component->pmix_mca_component_name); + rc = component->pmix_mca_query_component(&module, &priority); + + /* If no module was returned, then skip component */ + if (PMIX_SUCCESS != rc || NULL == module) { + pmix_output_verbose(5, pmix_pmdl_base_framework.framework_output, + "mca:pmdl:select: Skipping component [%s]. Query failed to return a module", + component->pmix_mca_component_name ); + continue; + } + + /* If we got a module, keep it */ + nmodule = (pmix_pmdl_module_t*) module; + /* let it initialize */ + if (NULL != nmodule->init && PMIX_SUCCESS != nmodule->init()) { + continue; + } + /* add to the list of selected modules */ + newmodule = PMIX_NEW(pmix_pmdl_base_active_module_t); + newmodule->pri = priority; + newmodule->module = nmodule; + newmodule->component = (pmix_pmdl_base_component_t*)cli->cli_component; + + /* maintain priority order */ + inserted = false; + PMIX_LIST_FOREACH(mod, &pmix_pmdl_globals.actives, pmix_pmdl_base_active_module_t) { + if (priority > mod->pri) { + pmix_list_insert_pos(&pmix_pmdl_globals.actives, + (pmix_list_item_t*)mod, &newmodule->super); + inserted = true; + break; + } + } + if (!inserted) { + /* must be lowest priority - add to end */ + pmix_list_append(&pmix_pmdl_globals.actives, &newmodule->super); + } + } + + if (4 < pmix_output_get_verbosity(pmix_pmdl_base_framework.framework_output)) { + pmix_output(0, "Final pmdl priorities"); + /* show the prioritized list */ + PMIX_LIST_FOREACH(mod, &pmix_pmdl_globals.actives, pmix_pmdl_base_active_module_t) { + pmix_output(0, "\tpmdl: %s Priority: %d", mod->component->base.pmix_mca_component_name, mod->pri); + } + } + + return PMIX_SUCCESS;; +} diff --git a/opal/mca/pmix/pmix4x/openpmix/src/mca/pmdl/base/pmdl_base_stubs.c b/opal/mca/pmix/pmix4x/openpmix/src/mca/pmdl/base/pmdl_base_stubs.c new file mode 100644 index 0000000000..1383a2f44f --- /dev/null +++ b/opal/mca/pmix/pmix4x/openpmix/src/mca/pmdl/base/pmdl_base_stubs.c @@ -0,0 +1,219 @@ +/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ +/* + * Copyright (c) 2015-2019 Intel, Inc. All rights reserved. + * Copyright (c) 2016 Mellanox Technologies, Inc. + * All rights reserved. + * Copyright (c) 2018 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +#include + +#include +#include "src/include/pmix_globals.h" + +#include "src/class/pmix_list.h" +#include "src/mca/preg/preg.h" +#include "src/util/argv.h" +#include "src/util/error.h" +#include "src/util/pmix_environ.h" +#include "src/server/pmix_server_ops.h" + +#include "src/mca/pmdl/base/base.h" + + +pmix_status_t pmix_pmdl_base_harvest_envars(char *nspace, + pmix_info_t info[], size_t ninfo, + pmix_list_t *ilist) +{ + pmix_pmdl_base_active_module_t *active; + pmix_status_t rc; + pmix_namespace_t *nptr, *ns; + + if (!pmix_pmdl_globals.initialized) { + return PMIX_ERR_INIT; + } + + pmix_output_verbose(2, pmix_pmdl_base_framework.framework_output, + "pmdl:harvest envars called"); + + /* protect against bozo inputs */ + if (NULL == nspace || NULL == ilist) { + return PMIX_ERR_BAD_PARAM; + } + nptr = NULL; + /* find this nspace - note that it may not have + * been registered yet */ + PMIX_LIST_FOREACH(ns, &pmix_globals.nspaces, pmix_namespace_t) { + if (0 == strcmp(ns->nspace, nspace)) { + nptr = ns; + break; + } + } + if (NULL == nptr) { + /* add it */ + nptr = PMIX_NEW(pmix_namespace_t); + if (NULL == nptr) { + return PMIX_ERR_NOMEM; + } + nptr->nspace = strdup(nspace); + pmix_list_append(&pmix_globals.nspaces, &nptr->super); + } + + /* process the request */ + PMIX_LIST_FOREACH(active, &pmix_pmdl_globals.actives, pmix_pmdl_base_active_module_t) { + if (NULL != active->module->harvest_envars) { + if (PMIX_SUCCESS == (rc = active->module->harvest_envars(nptr, info, ninfo, ilist))) { + break; + } + if (PMIX_ERR_TAKE_NEXT_OPTION != rc) { + /* true error */ + return rc; + } + } + } + + return PMIX_SUCCESS; +} + +pmix_status_t pmix_pmdl_base_setup_nspace(pmix_namespace_t *nptr, + uint32_t appnum, + pmix_info_t *info) +{ + pmix_pmdl_base_active_module_t *active; + pmix_status_t rc; + + if (!pmix_pmdl_globals.initialized) { + return PMIX_ERR_INIT; + } + + pmix_output_verbose(2, pmix_pmdl_base_framework.framework_output, + "pmdl:setup_nspace called"); + + /* process the request */ + PMIX_LIST_FOREACH(active, &pmix_pmdl_globals.actives, pmix_pmdl_base_active_module_t) { + if (NULL != active->module->setup_nspace) { + if (PMIX_SUCCESS == (rc = active->module->setup_nspace(nptr, appnum, info))) { + break; + } + if (PMIX_ERR_TAKE_NEXT_OPTION != rc) { + /* true error */ + return rc; + } + } + } + + return PMIX_SUCCESS; +} + +pmix_status_t pmix_pmdl_base_setup_nspace_kv(pmix_namespace_t *nptr, + uint32_t appnum, + pmix_kval_t *kv) +{ + pmix_pmdl_base_active_module_t *active; + pmix_status_t rc; + + if (!pmix_pmdl_globals.initialized) { + return PMIX_ERR_INIT; + } + + pmix_output_verbose(2, pmix_pmdl_base_framework.framework_output, + "pmdl:setup_nspace called"); + + /* process the request */ + PMIX_LIST_FOREACH(active, &pmix_pmdl_globals.actives, pmix_pmdl_base_active_module_t) { + if (NULL != active->module->setup_nspace_kv) { + rc = active->module->setup_nspace_kv(nptr, appnum, kv); + if (PMIX_SUCCESS != rc && PMIX_ERR_TAKE_NEXT_OPTION != rc) { + /* true error */ + return rc; + } + } + } + + return PMIX_SUCCESS; +} + +/* can only be called by a server */ +pmix_status_t pmix_pmdl_base_setup_client(pmix_namespace_t *nptr, + pmix_rank_t rank, + uint32_t appnum) +{ + pmix_pmdl_base_active_module_t *active; + pmix_status_t rc; + + if (!pmix_pmdl_globals.initialized) { + return PMIX_ERR_INIT; + } + + pmix_output_verbose(2, pmix_pmdl_base_framework.framework_output, + "pmdl: setup_client called"); + + PMIX_LIST_FOREACH(active, &pmix_pmdl_globals.actives, pmix_pmdl_base_active_module_t) { + if (NULL != active->module->setup_client) { + rc = active->module->setup_client(nptr, rank, appnum); + if (PMIX_SUCCESS != rc && PMIX_ERR_TAKE_NEXT_OPTION != rc) { + /* true error */ + return rc; + } + } + } + + return PMIX_SUCCESS; +} + +/* can only be called by a server */ +pmix_status_t pmix_pmdl_base_setup_fork(const pmix_proc_t *proc, char ***env) +{ + pmix_pmdl_base_active_module_t *active; + pmix_status_t rc; + + if (!pmix_pmdl_globals.initialized) { + return PMIX_ERR_INIT; + } + PMIX_LIST_FOREACH(active, &pmix_pmdl_globals.actives, pmix_pmdl_base_active_module_t) { + if (NULL != active->module->setup_fork) { + rc = active->module->setup_fork(proc, env); + if (PMIX_SUCCESS != rc && PMIX_ERR_TAKE_NEXT_OPTION != rc) { + /* true error */ + return rc; + } + } + } + + return PMIX_SUCCESS; +} + +void pmix_pmdl_base_deregister_nspace(const char *ns) +{ + pmix_pmdl_base_active_module_t *active; + pmix_namespace_t *nptr, *n2; + + if (!pmix_pmdl_globals.initialized) { + return; + } + + /* search for the namespace */ + nptr = NULL; + PMIX_LIST_FOREACH(n2, &pmix_globals.nspaces, pmix_namespace_t) { + if (0 == strncmp(ns, n2->nspace, PMIX_MAX_NSLEN)) { + nptr = n2; + break; + } + } + if (NULL == nptr) { + return; + } + + PMIX_LIST_FOREACH(active, &pmix_pmdl_globals.actives, pmix_pmdl_base_active_module_t) { + if (NULL != active->module->deregister_nspace) { + active->module->deregister_nspace(nptr); + } + } +} diff --git a/opal/mca/pmix/pmix4x/openpmix/src/mca/pmdl/ompi/Makefile.am b/opal/mca/pmix/pmix4x/openpmix/src/mca/pmdl/ompi/Makefile.am new file mode 100644 index 0000000000..ec03bc15a3 --- /dev/null +++ b/opal/mca/pmix/pmix4x/openpmix/src/mca/pmdl/ompi/Makefile.am @@ -0,0 +1,55 @@ +# -*- makefile -*- +# +# Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana +# University Research and Technology +# Corporation. All rights reserved. +# Copyright (c) 2004-2005 The University of Tennessee and The University +# of Tennessee Research Foundation. All rights +# reserved. +# Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, +# University of Stuttgart. All rights reserved. +# Copyright (c) 2004-2005 The Regents of the University of California. +# All rights reserved. +# Copyright (c) 2012 Los Alamos National Security, Inc. All rights reserved. +# Copyright (c) 2013-2019 Intel, Inc. All rights reserved. +# Copyright (c) 2017 Research Organization for Information Science +# and Technology (RIST). All rights reserved. +# $COPYRIGHT$ +# +# Additional copyrights may follow +# +# $HEADER$ +# + +headers = pmdl_ompi.h +sources = \ + pmdl_ompi_component.c \ + pmdl_ompi.c + +# Make the output library in this directory, and name it either +# mca__.la (for DSO builds) or libmca__.la +# (for static builds). + +if MCA_BUILD_pmix_pmdl_ompi_DSO +lib = +lib_sources = +component = mca_pmdl_ompi.la +component_sources = $(headers) $(sources) +else +lib = libmca_pmdl_ompi.la +lib_sources = $(headers) $(sources) +component = +component_sources = +endif + +mcacomponentdir = $(pmixlibdir) +mcacomponent_LTLIBRARIES = $(component) +mca_pmdl_ompi_la_SOURCES = $(component_sources) +mca_pmdl_ompi_la_LDFLAGS = -module -avoid-version +if NEED_LIBPMIX +mca_pmdl_ompi_la_LIBADD = $(top_builddir)/src/libpmix.la +endif + +noinst_LTLIBRARIES = $(lib) +libmca_pmdl_ompi_la_SOURCES = $(lib_sources) +libmca_pmdl_ompi_la_LDFLAGS = -module -avoid-version diff --git a/opal/mca/pmix/pmix4x/openpmix/src/mca/pmdl/ompi/pmdl_ompi.c b/opal/mca/pmix/pmix4x/openpmix/src/mca/pmdl/ompi/pmdl_ompi.c new file mode 100644 index 0000000000..ac11361b42 --- /dev/null +++ b/opal/mca/pmix/pmix4x/openpmix/src/mca/pmdl/ompi/pmdl_ompi.c @@ -0,0 +1,557 @@ +/* + * Copyright (c) 2015-2019 Intel, Inc. All rights reserved. + * Copyright (c) 2016 IBM Corporation. All rights reserved. + * + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +#include + +#include +#ifdef HAVE_UNISTD_H +#include +#endif +#ifdef HAVE_SYS_TYPES_H +#include +#endif +#ifdef HAVE_SYS_STAT_H +#include +#endif +#ifdef HAVE_FCNTL_H +#include +#endif +#include + +#include + +#include "src/mca/base/pmix_mca_base_var.h" +#include "src/include/pmix_socket_errno.h" +#include "src/include/pmix_globals.h" +#include "src/class/pmix_list.h" +#include "src/class/pmix_pointer_array.h" +#include "src/util/alfg.h" +#include "src/util/argv.h" +#include "src/util/error.h" +#include "src/util/name_fns.h" +#include "src/util/output.h" +#include "src/util/pmix_environ.h" +#include "src/mca/preg/preg.h" + +#include "src/mca/pmdl/pmdl.h" +#include "src/mca/pmdl/base/base.h" +#include "pmdl_ompi.h" + +static pmix_status_t ompi_init(void); +static void ompi_finalize(void); +static pmix_status_t harvest_envars(pmix_namespace_t *nptr, + pmix_info_t info[], size_t ninfo, + pmix_list_t *ilist); +static pmix_status_t setup_nspace(pmix_namespace_t *nptr, + uint32_t appnum, + pmix_info_t *info); +static pmix_status_t setup_nspace_kv(pmix_namespace_t *nptr, + uint32_t appnum, + pmix_kval_t *kv); +static pmix_status_t setup_client(pmix_namespace_t *nptr, + pmix_rank_t rank, + uint32_t appnum); +static pmix_status_t setup_fork(const pmix_proc_t *proc, + char ***env); +static void deregister_nspace(pmix_namespace_t *nptr); +pmix_pmdl_module_t pmix_pmdl_ompi_module = { + .name = "ompi", + .init = ompi_init, + .finalize = ompi_finalize, + .harvest_envars = harvest_envars, + .setup_nspace = setup_nspace, + .setup_nspace_kv = setup_nspace_kv, + .setup_client = setup_client, + .setup_fork = setup_fork, + .deregister_nspace = deregister_nspace +}; + +/* internal structures */ +typedef struct { + pmix_list_item_t super; + bool ompi; + uint32_t appnum; + pmix_rank_t start; + pmix_rank_t end; + uint32_t num_procs; +} pmdl_app_t; +static void apcon(pmdl_app_t *p) +{ + p->ompi = false; + p->appnum = 0; + p->start = UINT32_MAX; + p->end = 0; + p->num_procs = 0; +} +static PMIX_CLASS_INSTANCE(pmdl_app_t, + pmix_list_item_t, + apcon, NULL); + +typedef struct { + pmix_list_item_t super; + pmix_nspace_t nspace; + bool ompi; + bool datacollected; + uint32_t univ_size; + uint32_t job_size; + uint32_t local_size; + uint32_t num_apps; + pmix_list_t apps; +} pmdl_nspace_t; +static void nscon(pmdl_nspace_t *p) +{ + p->ompi = false; + p->datacollected = false; + p->univ_size = 0; + p->job_size = 0; + p->local_size = 0; + p->num_apps = 0; + PMIX_CONSTRUCT(&p->apps, pmix_list_t); +} +static void nsdes(pmdl_nspace_t *p) +{ + PMIX_LIST_DESTRUCT(&p->apps); +} +static PMIX_CLASS_INSTANCE(pmdl_nspace_t, + pmix_list_item_t, + nscon, nsdes); + +/* internal variables */ +static pmix_list_t mynspaces; + +static pmix_status_t ompi_init(void) +{ + pmix_output_verbose(2, pmix_pmdl_base_framework.framework_output, + "pmdl: ompi init"); + + PMIX_CONSTRUCT(&mynspaces, pmix_list_t); + + return PMIX_SUCCESS; +} + +static void ompi_finalize(void) +{ + PMIX_LIST_DESTRUCT(&mynspaces); +} + +static pmix_status_t harvest_envars(pmix_namespace_t *nptr, + pmix_info_t info[], size_t ninfo, + pmix_list_t *ilist) +{ + char *cs_env, *string_key; + pmix_kval_t *kv; + size_t n; + pmdl_nspace_t *ns, *ns2; + + pmix_output_verbose(2, pmix_pmdl_base_framework.framework_output, + "pmdl:ompi:harvest envars"); + + /* see if we already have this nspace */ + ns = NULL; + PMIX_LIST_FOREACH(ns2, &mynspaces, pmdl_nspace_t) { + if (PMIX_CHECK_NSPACE(ns2->nspace, nptr->nspace)) { + ns = ns2; + break; + } + } + if (NULL == ns) { + ns = PMIX_NEW(pmdl_nspace_t); + PMIX_LOAD_NSPACE(ns->nspace, nptr->nspace); + pmix_list_append(&mynspaces, &ns->super); + /* check the directives */ + for (n=0; n < ninfo; n++) { + /* check the attribute */ + if (PMIX_CHECK_KEY(&info[n], PMIX_PROGRAMMING_MODEL)) { + if (0 == strcasecmp(info->value.data.string, "ompi")) { + ns->ompi = true; + break; + } + } + } + } + if (!ns->ompi) { + return PMIX_ERR_TAKE_NEXT_OPTION; + } + + /* OMPI forwards everything that starts with OMPI_ */ + for (n=0; NULL != environ[n]; n++) { + if (0 == strncmp(environ[n], "OMPI_", 5)) { + cs_env = strdup(environ[n]); + kv = PMIX_NEW(pmix_kval_t); + if (NULL == kv) { + free(cs_env); + return PMIX_ERR_OUT_OF_RESOURCE; + } + kv->key = strdup(PMIX_SET_ENVAR); + kv->value = (pmix_value_t*)malloc(sizeof(pmix_value_t)); + if (NULL == kv->value) { + PMIX_RELEASE(kv); + free(cs_env); + return PMIX_ERR_OUT_OF_RESOURCE; + } + kv->value->type = PMIX_ENVAR; + string_key = strchr(cs_env, '='); + if (NULL == string_key) { + free(cs_env); + PMIX_RELEASE(kv); + return PMIX_ERR_BAD_PARAM; + } + *string_key = '\0'; + ++string_key; + pmix_output_verbose(5, pmix_pmdl_base_framework.framework_output, + "pmdl:ompi: adding envar %s", cs_env); + PMIX_ENVAR_LOAD(&kv->value->data.envar, cs_env, string_key, ':'); + pmix_list_append(ilist, &kv->super); + free(cs_env); + } + } + + return PMIX_SUCCESS; +} + + +static pmix_status_t setup_nspace(pmix_namespace_t *nptr, + uint32_t appnum, + pmix_info_t *info) +{ + pmdl_nspace_t *ns, *ns2; + pmdl_app_t *ap, *ap2; + + pmix_output_verbose(2, pmix_pmdl_base_framework.framework_output, + "pmdl:ompi: setup nspace for app %u with %s", + appnum, info->value.data.string); + + /* see if we already have this nspace */ + ns = NULL; + PMIX_LIST_FOREACH(ns2, &mynspaces, pmdl_nspace_t) { + if (PMIX_CHECK_NSPACE(ns2->nspace, nptr->nspace)) { + ns = ns2; + break; + } + } + if (NULL == ns) { + ns = PMIX_NEW(pmdl_nspace_t); + PMIX_LOAD_NSPACE(ns->nspace, nptr->nspace); + pmix_list_append(&mynspaces, &ns->super); + } + /* see if we have this appnum yet */ + ap = NULL; + PMIX_LIST_FOREACH(ap2, &ns->apps, pmdl_app_t) { + if (ap2->appnum == appnum) { + ap = ap2; + break; + } + } + if (NULL == ap) { + ap = PMIX_NEW(pmdl_app_t); + ap->appnum = appnum; + pmix_list_append(&ns->apps, &ap->super); + } + /* check the attribute */ + if (PMIX_CHECK_KEY(info, PMIX_PROGRAMMING_MODEL)) { + if (0 == strcasecmp(info->value.data.string, "ompi")) { + ap->ompi = true; + ns->ompi = true; // flag that at least one app is ompi + } + } + /* we don't care about the rest of the possible values */ + return PMIX_SUCCESS; +} + +static pmix_status_t setup_nspace_kv(pmix_namespace_t *nptr, + uint32_t appnum, + pmix_kval_t *kv) +{ + pmdl_nspace_t *ns, *ns2; + pmdl_app_t *ap, *ap2; + + pmix_output_verbose(2, pmix_pmdl_base_framework.framework_output, + "pmdl:ompi: setup nspace_kv with %s", kv->value->data.string); + + /* see if we already have this nspace */ + ns = NULL; + PMIX_LIST_FOREACH(ns2, &mynspaces, pmdl_nspace_t) { + if (PMIX_CHECK_NSPACE(ns2->nspace, nptr->nspace)) { + ns = ns2; + break; + } + } + if (NULL == ns) { + ns = PMIX_NEW(pmdl_nspace_t); + PMIX_LOAD_NSPACE(ns->nspace, nptr->nspace); + pmix_list_append(&mynspaces, &ns->super); + } + /* see if we have this appnum yet */ + ap = NULL; + PMIX_LIST_FOREACH(ap2, &ns->apps, pmdl_app_t) { + if (ap2->appnum == appnum) { + ap = ap2; + break; + } + } + if (NULL == ap) { + ap = PMIX_NEW(pmdl_app_t); + ap->appnum = appnum; + pmix_list_append(&ns->apps, &ap->super); + } + /* check the attribute */ + if (PMIX_CHECK_KEY(kv, PMIX_PROGRAMMING_MODEL)) { + if (0 == strcasecmp(kv->value->data.string, "ompi")) { + ap->ompi = true; + ns->ompi = true; // flag that at least one app is ompi + } + } + /* we don't care about the rest of the possible values */ + return PMIX_SUCCESS; +} + +static pmix_status_t setup_client(pmix_namespace_t *nptr, + pmix_rank_t rank, + uint32_t appnum) +{ + pmdl_nspace_t *ns, *ns2; + pmdl_app_t *ap, *ap2; + + pmix_output_verbose(2, pmix_pmdl_base_framework.framework_output, + "pmdl:ompi: setup client with %s", PMIX_RANK_PRINT(rank)); + + /* see if we already have this nspace */ + ns = NULL; + PMIX_LIST_FOREACH(ns2, &mynspaces, pmdl_nspace_t) { + if (PMIX_CHECK_NSPACE(ns2->nspace, nptr->nspace)) { + ns = ns2; + break; + } + } + if (NULL == ns) { + ns = PMIX_NEW(pmdl_nspace_t); + PMIX_LOAD_NSPACE(ns->nspace, nptr->nspace); + pmix_list_append(&mynspaces, &ns->super); + } + /* see if we have this appnum yet */ + ap = NULL; + PMIX_LIST_FOREACH(ap2, &ns->apps, pmdl_app_t) { + if (ap2->appnum == appnum) { + ap = ap2; + break; + } + } + if (NULL == ap) { + ap = PMIX_NEW(pmdl_app_t); + ap->appnum = appnum; + pmix_list_append(&ns->apps, &ap->super); + } + /* adjust the ranks as necessary */ + if (rank < ap->start) { + ap->start = rank; + } + if (rank > ap->end) { + ap->end = rank; + } + return PMIX_SUCCESS; +} + +static pmix_status_t setup_fork(const pmix_proc_t *proc, + char ***env) +{ + pmdl_nspace_t *ns, *ns2; + pmdl_app_t *ap, *ap2; + char *param; + pmix_proc_t wildcard, undef; + pmix_status_t rc; + pmix_value_t *val; + pmix_info_t info[2]; + uint16_t u16; + + pmix_output_verbose(2, pmix_pmdl_base_framework.framework_output, + "pmdl:ompi: setup fork for %s", PMIX_NAME_PRINT(proc)); + + /* see if we already have this nspace */ + ns = NULL; + PMIX_LIST_FOREACH(ns2, &mynspaces, pmdl_nspace_t) { + if (PMIX_CHECK_NSPACE(ns2->nspace, proc->nspace)) { + ns = ns2; + break; + } + } + if (NULL == ns || !ns->ompi) { + /* we don't know anything about this one or + * it doesn't have any ompi-based apps */ + return PMIX_ERR_TAKE_NEXT_OPTION; + } + /* see if we have this rank */ + ap = NULL; + PMIX_LIST_FOREACH(ap2, &ns->apps, pmdl_app_t) { + if (proc->rank >= ap2->start && + proc->rank <= ap2->end) { + ap = ap2; + break; + } + } + if (NULL != ap && !ap->ompi) { + /* not an OMPI app */ + return PMIX_ERR_TAKE_NEXT_OPTION; + } + + /* do we already have the data we need here? */ + if (!ns->datacollected) { + (void)strncpy(wildcard.nspace, proc->nspace, PMIX_MAX_NSLEN); + wildcard.rank = PMIX_RANK_WILDCARD; + (void)strncpy(undef.nspace, proc->nspace, PMIX_MAX_NSLEN); + undef.rank = PMIX_RANK_UNDEF; + + /* fetch the universe size */ + if (PMIX_SUCCESS == (rc = PMIx_Get(&wildcard, PMIX_UNIV_SIZE, NULL, 0, &val))) { + PMIX_VALUE_GET_NUMBER(rc, val, ns->univ_size, uint32_t); + PMIX_VALUE_RELEASE(val); + if (PMIX_SUCCESS != rc) { + return rc; + } + } + /* fetch the job size */ + if (PMIX_SUCCESS == (rc = PMIx_Get(&wildcard, PMIX_JOB_SIZE, NULL, 0, &val))) { + PMIX_VALUE_GET_NUMBER(rc, val, ns->job_size, uint32_t); + PMIX_VALUE_RELEASE(val); + if (PMIX_SUCCESS != rc) { + return rc; + } + } + /* fetch the number of local procs */ + if (PMIX_SUCCESS == (rc = PMIx_Get(&wildcard, PMIX_LOCAL_SIZE, NULL, 0, &val))) { + PMIX_VALUE_GET_NUMBER(rc, val, ns->local_size, uint32_t); + PMIX_VALUE_RELEASE(val); + if (PMIX_SUCCESS != rc) { + return rc; + } + } + /* fetch the number of apps */ + if (PMIX_SUCCESS == (rc = PMIx_Get(&wildcard, PMIX_JOB_NUM_APPS, NULL, 0, &val))) { + PMIX_VALUE_GET_NUMBER(rc, val, ns->num_apps, uint32_t); + PMIX_VALUE_RELEASE(val); + if (PMIX_SUCCESS != rc) { + return rc; + } + } + if (NULL != ap) { + /* fetch the number of procs in this app */ + PMIX_INFO_LOAD(&info[0], PMIX_APP_INFO, NULL, PMIX_BOOL); + PMIX_INFO_LOAD(&info[1], PMIX_APPNUM, &ap->appnum, PMIX_UINT32); + if (PMIX_SUCCESS == (rc = PMIx_Get(&undef, PMIX_APP_SIZE, info, 2, &val))) { + PMIX_VALUE_GET_NUMBER(rc, val, ap->num_procs, uint32_t); + PMIX_VALUE_RELEASE(val); + if (PMIX_SUCCESS != rc) { + PMIX_INFO_DESTRUCT(&info[0]); + PMIX_INFO_DESTRUCT(&info[1]); + return rc; + } + } + PMIX_INFO_DESTRUCT(&info[0]); + PMIX_INFO_DESTRUCT(&info[1]); + } + } + + if (UINT32_MAX != ns->univ_size) { + if (0 > asprintf(¶m, "%u", ns->univ_size)) { + return PMIX_ERR_NOMEM; + } + pmix_setenv("OMPI_UNIVERSE_SIZE", param, true, env); + free(param); + } + + if (UINT32_MAX != ns->job_size) { + if (0 > asprintf(¶m, "%u", ns->job_size)) { + return PMIX_ERR_NOMEM; + } + pmix_setenv("OMPI_COMM_WORLD_SIZE", param, true, env); + free(param); + } + + if (UINT32_MAX != ns->local_size) { + if (0 > asprintf(¶m, "%u", ns->local_size)) { + return PMIX_ERR_NOMEM; + } + pmix_setenv("OMPI_COMM_WORLD_LOCAL_SIZE", param, true, env); + free(param); + } + + /* add the MPI-3 envars */ + if (UINT32_MAX != ns->num_apps) { + if (0 > asprintf(¶m, "%u", ns->num_apps)) { + return PMIX_ERR_NOMEM; + } + pmix_setenv("OMPI_NUM_APP_CTX", param, true, env); + free(param); + } + + if (NULL != ap && UINT32_MAX != ap->num_procs) { + if (0 > asprintf(¶m, "%u", ap->num_procs)) { + return PMIX_ERR_NOMEM; + } + pmix_setenv("OMPI_APP_CTX_NUM_PROCS", param, true, env); + free(param); + } + + if (0 > asprintf(¶m, "%lu", (unsigned long)proc->rank)) { + return PMIX_ERR_NOMEM; + } + pmix_setenv("OMPI_COMM_WORLD_RANK", param, true, env); + free(param); /* done with this now */ + + /* get the proc's local rank */ + if (PMIX_SUCCESS == (rc = PMIx_Get(proc, PMIX_LOCAL_RANK, NULL, 0, &val))) { + PMIX_VALUE_GET_NUMBER(rc, val, u16, uint16_t); + PMIX_VALUE_RELEASE(val); + if (PMIX_SUCCESS != rc) { + return rc; + } + if (0 > asprintf(¶m, "%lu", (unsigned long)u16)) { + return PMIX_ERR_NOMEM; + } + pmix_setenv("OMPI_COMM_WORLD_LOCAL_RANK", param, true, env); + free(param); + } + + /* get the proc's node rank */ + if (PMIX_SUCCESS == (rc = PMIx_Get(proc, PMIX_NODE_RANK, NULL, 0, &val))) { + PMIX_VALUE_GET_NUMBER(rc, val, u16, uint16_t); + PMIX_VALUE_RELEASE(val); + if (PMIX_SUCCESS != rc) { + return rc; + } + if (0 > asprintf(¶m, "%lu", (unsigned long)u16)) { + return PMIX_ERR_NOMEM; + } + pmix_setenv("OMPI_COMM_WORLD_NODE_RANK", param, true, env); + free(param); + } + + /* pass an envar so the proc can find any files it had prepositioned */ + if (PMIX_SUCCESS == (rc = PMIx_Get(proc, PMIX_PROCDIR, NULL, 0, &val))) { + pmix_setenv("OMPI_FILE_LOCATION", val->data.string, true, env); + PMIX_VALUE_RELEASE(val); + } + + return PMIX_SUCCESS; +} + +static void deregister_nspace(pmix_namespace_t *nptr) +{ + pmdl_nspace_t *ns; + + /* find our tracker for this nspace */ + PMIX_LIST_FOREACH(ns, &mynspaces, pmdl_nspace_t) { + if (PMIX_CHECK_NSPACE(ns->nspace, nptr->nspace)) { + pmix_list_remove_item(&mynspaces, &ns->super); + PMIX_RELEASE(ns); + return; + } + } +} diff --git a/opal/mca/pmix/pmix4x/openpmix/src/mca/pmdl/ompi/pmdl_ompi.h b/opal/mca/pmix/pmix4x/openpmix/src/mca/pmdl/ompi/pmdl_ompi.h new file mode 100644 index 0000000000..73af49a05e --- /dev/null +++ b/opal/mca/pmix/pmix4x/openpmix/src/mca/pmdl/ompi/pmdl_ompi.h @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2015-2019 Intel, Inc. All rights reserved. + * + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +#ifndef PMIX_PMDL_ompi_H +#define PMIX_PMDL_ompi_H + +#include + + +#include "src/mca/pmdl/pmdl.h" + +BEGIN_C_DECLS + +/* the component must be visible data for the linker to find it */ +PMIX_EXPORT extern pmix_pmdl_base_component_t mca_pmdl_ompi_component; +extern pmix_pmdl_module_t pmix_pmdl_ompi_module; + +END_C_DECLS + +#endif diff --git a/opal/mca/pmix/pmix4x/openpmix/src/mca/pmdl/ompi/pmdl_ompi_component.c b/opal/mca/pmix/pmix4x/openpmix/src/mca/pmdl/ompi/pmdl_ompi_component.c new file mode 100644 index 0000000000..f23a604e62 --- /dev/null +++ b/opal/mca/pmix/pmix4x/openpmix/src/mca/pmdl/ompi/pmdl_ompi_component.c @@ -0,0 +1,66 @@ +/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ +/* + * Copyright (c) 2004-2008 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2005 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, + * University of Stuttgart. All rights reserved. + * Copyright (c) 2004-2005 The Regents of the University of California. + * All rights reserved. + * Copyright (c) 2015 Los Alamos National Security, LLC. All rights + * reserved. + * Copyright (c) 2016-2019 Intel, Inc. All rights reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + * + * These symbols are in a file by themselves to provide nice linker + * semantics. Since linkers generally pull in symbols by object + * files, keeping these symbols as the only symbols in this file + * prevents utility programs such as "ompi_info" from having to import + * entire components just to query their version and parameters. + */ + +#include +#include "pmix_common.h" + +#include "src/mca/pmdl/pmdl.h" +#include "pmdl_ompi.h" + +static pmix_status_t component_query(pmix_mca_base_module_t **module, int *priority); + +/* + * Instantiate the public struct with all of our public information + * and pointers to our public functions in it + */ +pmix_pmdl_base_component_t mca_pmdl_ompi_component = { + .base = { + PMIX_PMDL_BASE_VERSION_1_0_0, + + /* Component name and version */ + .pmix_mca_component_name = "ompi", + PMIX_MCA_BASE_MAKE_VERSION(component, + PMIX_MAJOR_VERSION, + PMIX_MINOR_VERSION, + PMIX_RELEASE_VERSION), + + /* Component open and close functions */ + .pmix_mca_query_component = component_query, + }, + .data = { + /* The component is checkpoint ready */ + PMIX_MCA_BASE_METADATA_PARAM_CHECKPOINT + } +}; + +static pmix_status_t component_query(pmix_mca_base_module_t **module, int *priority) +{ + *priority = 50; + *module = (pmix_mca_base_module_t *)&pmix_pmdl_ompi_module; + return PMIX_SUCCESS; +} diff --git a/opal/mca/pmix/pmix4x/openpmix/src/mca/pmdl/pmdl.h b/opal/mca/pmix/pmix4x/openpmix/src/mca/pmdl/pmdl.h new file mode 100644 index 0000000000..5c480e8fc8 --- /dev/null +++ b/opal/mca/pmix/pmix4x/openpmix/src/mca/pmdl/pmdl.h @@ -0,0 +1,143 @@ +/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ +/* + * Copyright (c) 2007-2008 Cisco Systems, Inc. All rights reserved. + * + * Copyright (c) 2015-2018 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2018-2019 Intel, Inc. All rights reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +/** + * @file + * + * This interface is for use by PMIx servers to obtain network-related info + * such as security keys that need to be shared across applications, and to + * setup network support for applications prior to launch + * + * Available plugins may be defined at runtime via the typical MCA parameter + * syntax. + */ + +#ifndef PMIX_PMDL_H +#define PMIX_PMDL_H + +#include +#include + +#include "src/class/pmix_list.h" +#include "src/mca/mca.h" +#include "src/mca/base/pmix_mca_base_var.h" +#include "src/mca/base/pmix_mca_base_framework.h" +#include "src/include/pmix_globals.h" +#include "src/server/pmix_server_ops.h" + +BEGIN_C_DECLS + +/****** MODULE DEFINITION ******/ + +/** + * Initialize the module. Returns an error if the module cannot + * run, success if it can and wants to be used. + */ +typedef pmix_status_t (*pmix_pmdl_base_module_init_fn_t)(void); + +/** + * Finalize the module. Tear down any allocated storage, disconnect + * from any system support (e.g., LDAP server) + */ +typedef void (*pmix_pmdl_base_module_fini_fn_t)(void); + +/* Harvest envars for this programming model so they can be forwarded + * to backend processes */ +typedef pmix_status_t (*pmix_pmdl_base_module_harvest_envars_fn_t)(pmix_namespace_t *nptr, + pmix_info_t info[], size_t ninfo, + pmix_list_t *ilist); +/** + * Setup any programming model specific support for the given nspace + */ +typedef pmix_status_t (*pmix_pmdl_base_module_setup_ns_fn_t)(pmix_namespace_t *nptr, + uint32_t appnum, + pmix_info_t *info); +typedef pmix_status_t (*pmix_pmdl_base_module_setup_ns_kv_fn_t)(pmix_namespace_t *nptr, + uint32_t appnum, + pmix_kval_t *kv); + +/** + * Setup any programming model specific support for the given client */ +typedef pmix_status_t (*pmix_pmdl_base_module_setup_client_fn_t)(pmix_namespace_t *nptr, + pmix_rank_t rank, + uint32_t apppnum); + +/** + * Give the plugins an opportunity to add any envars to the + * environment of a local application process prior to fork/exec + */ +typedef pmix_status_t (*pmix_pmdl_base_module_setup_fork_fn_t)(const pmix_proc_t *peer, char ***env); + +/** + * Provide an opportunity for the fabric components to cleanup any + * resources they may have created to track the nspace + */ +typedef void (*pmix_pmdl_base_module_dregister_nspace_fn_t)(pmix_namespace_t *nptr); + +/** + * Base structure for a PMDL module. Each component should malloc a + * copy of the module structure for each fabric plane they support. + */ +typedef struct { + char *name; + pmix_pmdl_base_module_init_fn_t init; + pmix_pmdl_base_module_fini_fn_t finalize; + pmix_pmdl_base_module_harvest_envars_fn_t harvest_envars; + pmix_pmdl_base_module_setup_ns_fn_t setup_nspace; + pmix_pmdl_base_module_setup_ns_kv_fn_t setup_nspace_kv; + pmix_pmdl_base_module_setup_client_fn_t setup_client; + pmix_pmdl_base_module_setup_fork_fn_t setup_fork; + pmix_pmdl_base_module_dregister_nspace_fn_t deregister_nspace; +} pmix_pmdl_module_t; + +/* define a public API */ + +typedef pmix_status_t (*pmix_pmdl_base_API_harvest_envars_fn_t)(char *nspace, + pmix_info_t info[], size_t ninfo, + pmix_list_t *ilist); +typedef void (*pmix_pmdl_base_API_dregister_nspace_fn_t)(const char *nptr); +typedef struct { + char *name; + pmix_pmdl_base_module_init_fn_t init; + pmix_pmdl_base_module_fini_fn_t finalize; + pmix_pmdl_base_API_harvest_envars_fn_t harvest_envars; + pmix_pmdl_base_module_setup_ns_fn_t setup_nspace; + pmix_pmdl_base_module_setup_ns_kv_fn_t setup_nspace_kv; + pmix_pmdl_base_module_setup_client_fn_t setup_client; + pmix_pmdl_base_module_setup_fork_fn_t setup_fork; + pmix_pmdl_base_API_dregister_nspace_fn_t deregister_nspace; +} pmix_pmdl_API_module_t; + + +/* declare the global APIs */ +PMIX_EXPORT extern pmix_pmdl_API_module_t pmix_pmdl; + +/* + * the standard component data structure + */ +struct pmix_pmdl_base_component_t { + pmix_mca_base_component_t base; + pmix_mca_base_component_data_t data; +}; +typedef struct pmix_pmdl_base_component_t pmix_pmdl_base_component_t; + +/* + * Macro for use in components that are of type pmdl + */ +#define PMIX_PMDL_BASE_VERSION_1_0_0 \ + PMIX_MCA_BASE_VERSION_1_0_0("pmdl", 1, 0, 0) + +END_C_DECLS + +#endif diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/pnet/Makefile.am b/opal/mca/pmix/pmix4x/openpmix/src/mca/pnet/Makefile.am similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/pnet/Makefile.am rename to opal/mca/pmix/pmix4x/openpmix/src/mca/pnet/Makefile.am diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/pnet/base/Makefile.include b/opal/mca/pmix/pmix4x/openpmix/src/mca/pnet/base/Makefile.include similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/pnet/base/Makefile.include rename to opal/mca/pmix/pmix4x/openpmix/src/mca/pnet/base/Makefile.include diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/pnet/base/base.h b/opal/mca/pmix/pmix4x/openpmix/src/mca/pnet/base/base.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/pnet/base/base.h rename to opal/mca/pmix/pmix4x/openpmix/src/mca/pnet/base/base.h diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/pnet/base/pnet_base_fns.c b/opal/mca/pmix/pmix4x/openpmix/src/mca/pnet/base/pnet_base_fns.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/pnet/base/pnet_base_fns.c rename to opal/mca/pmix/pmix4x/openpmix/src/mca/pnet/base/pnet_base_fns.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/pnet/base/pnet_base_frame.c b/opal/mca/pmix/pmix4x/openpmix/src/mca/pnet/base/pnet_base_frame.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/pnet/base/pnet_base_frame.c rename to opal/mca/pmix/pmix4x/openpmix/src/mca/pnet/base/pnet_base_frame.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/pnet/base/pnet_base_select.c b/opal/mca/pmix/pmix4x/openpmix/src/mca/pnet/base/pnet_base_select.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/pnet/base/pnet_base_select.c rename to opal/mca/pmix/pmix4x/openpmix/src/mca/pnet/base/pnet_base_select.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/pnet/pnet.h b/opal/mca/pmix/pmix4x/openpmix/src/mca/pnet/pnet.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/pnet/pnet.h rename to opal/mca/pmix/pmix4x/openpmix/src/mca/pnet/pnet.h diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/pnet/tcp/Makefile.am b/opal/mca/pmix/pmix4x/openpmix/src/mca/pnet/tcp/Makefile.am similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/pnet/tcp/Makefile.am rename to opal/mca/pmix/pmix4x/openpmix/src/mca/pnet/tcp/Makefile.am diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/pnet/tcp/pnet_tcp.c b/opal/mca/pmix/pmix4x/openpmix/src/mca/pnet/tcp/pnet_tcp.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/pnet/tcp/pnet_tcp.c rename to opal/mca/pmix/pmix4x/openpmix/src/mca/pnet/tcp/pnet_tcp.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/pnet/tcp/pnet_tcp.h b/opal/mca/pmix/pmix4x/openpmix/src/mca/pnet/tcp/pnet_tcp.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/pnet/tcp/pnet_tcp.h rename to opal/mca/pmix/pmix4x/openpmix/src/mca/pnet/tcp/pnet_tcp.h diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/pnet/tcp/pnet_tcp_component.c b/opal/mca/pmix/pmix4x/openpmix/src/mca/pnet/tcp/pnet_tcp_component.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/pnet/tcp/pnet_tcp_component.c rename to opal/mca/pmix/pmix4x/openpmix/src/mca/pnet/tcp/pnet_tcp_component.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/pnet/test/Makefile.am b/opal/mca/pmix/pmix4x/openpmix/src/mca/pnet/test/Makefile.am similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/pnet/test/Makefile.am rename to opal/mca/pmix/pmix4x/openpmix/src/mca/pnet/test/Makefile.am diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/pnet/test/pnet_test.c b/opal/mca/pmix/pmix4x/openpmix/src/mca/pnet/test/pnet_test.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/pnet/test/pnet_test.c rename to opal/mca/pmix/pmix4x/openpmix/src/mca/pnet/test/pnet_test.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/pnet/test/pnet_test.h b/opal/mca/pmix/pmix4x/openpmix/src/mca/pnet/test/pnet_test.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/pnet/test/pnet_test.h rename to opal/mca/pmix/pmix4x/openpmix/src/mca/pnet/test/pnet_test.h diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/pnet/test/pnet_test_component.c b/opal/mca/pmix/pmix4x/openpmix/src/mca/pnet/test/pnet_test_component.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/pnet/test/pnet_test_component.c rename to opal/mca/pmix/pmix4x/openpmix/src/mca/pnet/test/pnet_test_component.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/preg/Makefile.am b/opal/mca/pmix/pmix4x/openpmix/src/mca/preg/Makefile.am similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/preg/Makefile.am rename to opal/mca/pmix/pmix4x/openpmix/src/mca/preg/Makefile.am diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/preg/base/Makefile.include b/opal/mca/pmix/pmix4x/openpmix/src/mca/preg/base/Makefile.include similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/preg/base/Makefile.include rename to opal/mca/pmix/pmix4x/openpmix/src/mca/preg/base/Makefile.include diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/preg/base/base.h b/opal/mca/pmix/pmix4x/openpmix/src/mca/preg/base/base.h similarity index 79% rename from opal/mca/pmix/pmix4x/pmix/src/mca/preg/base/base.h rename to opal/mca/pmix/pmix4x/openpmix/src/mca/preg/base/base.h index 34c790d70e..19895f6378 100644 --- a/opal/mca/pmix/pmix4x/pmix/src/mca/preg/base/base.h +++ b/opal/mca/pmix/pmix4x/openpmix/src/mca/preg/base/base.h @@ -85,25 +85,12 @@ PMIX_EXPORT pmix_status_t pmix_preg_base_parse_nodes(const char *regexp, char ***names); PMIX_EXPORT pmix_status_t pmix_preg_base_parse_procs(const char *regexp, char ***procs); -PMIX_EXPORT pmix_status_t pmix_preg_base_resolve_peers(const char *nodename, - const char *nspace, - pmix_proc_t **procs, size_t *nprocs); -PMIX_EXPORT pmix_status_t pmix_preg_base_resolve_nodes(const char *nspace, - char **nodelist); - PMIX_EXPORT pmix_status_t pmix_preg_base_copy(char **dest, size_t *len, const char *input); PMIX_EXPORT pmix_status_t pmix_preg_base_pack(pmix_buffer_t *buffer, const char *input); PMIX_EXPORT pmix_status_t pmix_preg_base_unpack(pmix_buffer_t *buffer, char **regex); -PMIX_EXPORT pmix_status_t pmix_preg_base_std_resolve_peers(const char *nodename, - const char *nspace, - pmix_proc_t **procs, size_t *nprocs); - -PMIX_EXPORT pmix_status_t pmix_preg_base_std_resolve_nodes(const char *nspace, - char **nodelist); - END_C_DECLS #endif diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/preg/base/preg_base_frame.c b/opal/mca/pmix/pmix4x/openpmix/src/mca/preg/base/preg_base_frame.c similarity index 97% rename from opal/mca/pmix/pmix4x/pmix/src/mca/preg/base/preg_base_frame.c rename to opal/mca/pmix/pmix4x/openpmix/src/mca/preg/base/preg_base_frame.c index f57bd4bb02..e701204454 100644 --- a/opal/mca/pmix/pmix4x/pmix/src/mca/preg/base/preg_base_frame.c +++ b/opal/mca/pmix/pmix4x/openpmix/src/mca/preg/base/preg_base_frame.c @@ -51,8 +51,6 @@ pmix_preg_module_t pmix_preg = { .generate_ppn = pmix_preg_base_generate_ppn, .parse_nodes = pmix_preg_base_parse_nodes, .parse_procs = pmix_preg_base_parse_procs, - .resolve_peers = pmix_preg_base_resolve_peers, - .resolve_nodes = pmix_preg_base_resolve_nodes, .copy = pmix_preg_base_copy, .pack = pmix_preg_base_pack, .unpack = pmix_preg_base_unpack diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/preg/base/preg_base_select.c b/opal/mca/pmix/pmix4x/openpmix/src/mca/preg/base/preg_base_select.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/preg/base/preg_base_select.c rename to opal/mca/pmix/pmix4x/openpmix/src/mca/preg/base/preg_base_select.c diff --git a/opal/mca/pmix/pmix4x/openpmix/src/mca/preg/base/preg_base_stubs.c b/opal/mca/pmix/pmix4x/openpmix/src/mca/preg/base/preg_base_stubs.c new file mode 100644 index 0000000000..c8eca5a2e7 --- /dev/null +++ b/opal/mca/pmix/pmix4x/openpmix/src/mca/preg/base/preg_base_stubs.c @@ -0,0 +1,159 @@ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2006 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, + * University of Stuttgart. All rights reserved. + * Copyright (c) 2004-2005 The Regents of the University of California. + * All rights reserved. + * Copyright (c) 2015-2019 Intel, Inc. All rights reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +#include + +#include +#ifdef HAVE_UNISTD_H +#include +#endif + +#include "src/util/argv.h" +#include "src/util/error.h" +#include "src/include/pmix_globals.h" +#include "src/client/pmix_client_ops.h" +#include "src/mca/bfrops/bfrops.h" +#include "src/mca/preg/base/base.h" + +pmix_status_t pmix_preg_base_generate_node_regex(const char *input, + char **regex) +{ + pmix_preg_base_active_module_t *active; + + PMIX_LIST_FOREACH(active, &pmix_preg_globals.actives, pmix_preg_base_active_module_t) { + if (NULL != active->module->generate_node_regex) { + if (PMIX_SUCCESS == active->module->generate_node_regex(input, regex)) { + return PMIX_SUCCESS; + } + } + } + + /* no regex could be generated */ + *regex = strdup(input); + return PMIX_SUCCESS; +} + +pmix_status_t pmix_preg_base_generate_ppn(const char *input, + char **ppn) +{ + pmix_preg_base_active_module_t *active; + + PMIX_LIST_FOREACH(active, &pmix_preg_globals.actives, pmix_preg_base_active_module_t) { + if (NULL != active->module->generate_ppn) { + if (PMIX_SUCCESS == active->module->generate_ppn(input, ppn)) { + return PMIX_SUCCESS; + } + } + } + + /* no regex could be generated */ + *ppn = strdup(input); + return PMIX_SUCCESS; +} + +pmix_status_t pmix_preg_base_parse_nodes(const char *regexp, + char ***names) +{ + pmix_preg_base_active_module_t *active; + + PMIX_LIST_FOREACH(active, &pmix_preg_globals.actives, pmix_preg_base_active_module_t) { + if (NULL != active->module->parse_nodes) { + if (PMIX_SUCCESS == active->module->parse_nodes(regexp, names)) { + return PMIX_SUCCESS; + } + } + } + + /* nobody could parse it, so just process it here */ + *names = pmix_argv_split(regexp, ','); + return PMIX_SUCCESS; +} + +pmix_status_t pmix_preg_base_parse_procs(const char *regexp, + char ***procs) +{ + pmix_preg_base_active_module_t *active; + + PMIX_LIST_FOREACH(active, &pmix_preg_globals.actives, pmix_preg_base_active_module_t) { + if (NULL != active->module->parse_procs) { + if (PMIX_SUCCESS == active->module->parse_procs(regexp, procs)) { + return PMIX_SUCCESS; + } + } + } + + /* nobody could parse it, so just process it here */ + *procs = pmix_argv_split(regexp, ';'); + return PMIX_SUCCESS; +} + +pmix_status_t pmix_preg_base_copy(char **dest, size_t *len, const char *input) +{ + pmix_preg_base_active_module_t *active; + + PMIX_LIST_FOREACH(active, &pmix_preg_globals.actives, pmix_preg_base_active_module_t) { + if (NULL != active->module->copy) { + if (PMIX_SUCCESS == active->module->copy(dest, len, input)) { + return PMIX_SUCCESS; + } + } + } + + /* nobody could handle it, so it must just be a string */ + *dest = strdup(input); + *len = strlen(input)+1; + return PMIX_SUCCESS; +} + +pmix_status_t pmix_preg_base_pack(pmix_buffer_t *buffer, const char *input) +{ + pmix_preg_base_active_module_t *active; + pmix_status_t rc; + + PMIX_LIST_FOREACH(active, &pmix_preg_globals.actives, pmix_preg_base_active_module_t) { + if (NULL != active->module->pack) { + if (PMIX_SUCCESS == active->module->pack(buffer, input)) { + return PMIX_SUCCESS; + } + } + } + + /* just pack it as a string */ + PMIX_BFROPS_PACK(rc, pmix_globals.mypeer, buffer, input, 1, PMIX_STRING); + return rc; +} + +pmix_status_t pmix_preg_base_unpack(pmix_buffer_t *buffer, char **regex) +{ + pmix_preg_base_active_module_t *active; + pmix_status_t rc; + int32_t cnt = 1; + + PMIX_LIST_FOREACH(active, &pmix_preg_globals.actives, pmix_preg_base_active_module_t) { + if (NULL != active->module->unpack) { + if (PMIX_SUCCESS == active->module->unpack(buffer, regex)) { + return PMIX_SUCCESS; + } + } + } + + /* must just be a string */ + PMIX_BFROPS_UNPACK(rc, pmix_globals.mypeer, buffer, regex, &cnt, PMIX_STRING); + return rc; +} diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/preg/compress/Makefile.am b/opal/mca/pmix/pmix4x/openpmix/src/mca/preg/compress/Makefile.am similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/preg/compress/Makefile.am rename to opal/mca/pmix/pmix4x/openpmix/src/mca/preg/compress/Makefile.am diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/preg/compress/preg_compress.c b/opal/mca/pmix/pmix4x/openpmix/src/mca/preg/compress/preg_compress.c similarity index 97% rename from opal/mca/pmix/pmix4x/pmix/src/mca/preg/compress/preg_compress.c rename to opal/mca/pmix/pmix4x/openpmix/src/mca/preg/compress/preg_compress.c index 16be699474..a8aabdbc92 100644 --- a/opal/mca/pmix/pmix4x/pmix/src/mca/preg/compress/preg_compress.c +++ b/opal/mca/pmix/pmix4x/openpmix/src/mca/preg/compress/preg_compress.c @@ -61,8 +61,6 @@ pmix_preg_module_t pmix_preg_compress_module = { .generate_ppn = generate_ppn, .parse_nodes = parse_nodes, .parse_procs = parse_procs, - .resolve_peers = pmix_preg_base_std_resolve_peers, - .resolve_nodes = pmix_preg_base_std_resolve_nodes, .copy = copy, .pack = pack, .unpack = unpack @@ -97,7 +95,6 @@ static pmix_status_t generate_node_regex(const char *input, memcpy(&result[6 + strlen(slen) + 1], tmp, len); free(tmp); free(slen); - *regexp = result; return PMIX_SUCCESS; } @@ -150,9 +147,6 @@ static pmix_status_t parse_nodes(const char *regexp, len = strtoul(®exp[6], &ptr, 10); ++ptr; // step over NULL - if (NULL == ptr) { - return PMIX_ERR_BAD_PARAM; - } /* malloc the space */ tmp = malloc(len); if (NULL == tmp) { diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/preg/compress/preg_compress.h b/opal/mca/pmix/pmix4x/openpmix/src/mca/preg/compress/preg_compress.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/preg/compress/preg_compress.h rename to opal/mca/pmix/pmix4x/openpmix/src/mca/preg/compress/preg_compress.h diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/preg/compress/preg_compress_component.c b/opal/mca/pmix/pmix4x/openpmix/src/mca/preg/compress/preg_compress_component.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/preg/compress/preg_compress_component.c rename to opal/mca/pmix/pmix4x/openpmix/src/mca/preg/compress/preg_compress_component.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/preg/native/Makefile.am b/opal/mca/pmix/pmix4x/openpmix/src/mca/preg/native/Makefile.am similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/preg/native/Makefile.am rename to opal/mca/pmix/pmix4x/openpmix/src/mca/preg/native/Makefile.am diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/preg/native/preg_native.c b/opal/mca/pmix/pmix4x/openpmix/src/mca/preg/native/preg_native.c similarity index 98% rename from opal/mca/pmix/pmix4x/pmix/src/mca/preg/native/preg_native.c rename to opal/mca/pmix/pmix4x/openpmix/src/mca/preg/native/preg_native.c index cfb10db278..4d49a5a32e 100644 --- a/opal/mca/pmix/pmix4x/pmix/src/mca/preg/native/preg_native.c +++ b/opal/mca/pmix/pmix4x/openpmix/src/mca/preg/native/preg_native.c @@ -60,8 +60,6 @@ pmix_preg_module_t pmix_preg_native_module = { .generate_ppn = generate_ppn, .parse_nodes = parse_nodes, .parse_procs = parse_procs, - .resolve_peers = pmix_preg_base_std_resolve_peers, - .resolve_nodes = pmix_preg_base_std_resolve_nodes, .copy = copy, .pack = pack, .unpack = unpack @@ -305,6 +303,13 @@ static pmix_status_t generate_node_regex(const char *input, /* assemble final result */ tmp = pmix_argv_join(regexargs, ','); + /* if this results in a longer answer, then don't do it */ + if (strlen(tmp) >= strlen(input)) { + free(tmp); + pmix_argv_free(regexargs); + PMIX_DESTRUCT(&vids); + return PMIX_ERR_TAKE_NEXT_OPTION; + } if (0 > asprintf(regexp, "pmix[%s]", tmp)) { return PMIX_ERR_NOMEM; } @@ -428,6 +433,13 @@ static pmix_status_t generate_ppn(const char *input, /* replace the final semi-colon */ tmp[strlen(tmp)-1] = ']'; + /* if this results in a longer answer, then don't do it */ + if (strlen(tmp) > strlen(input)) { + free(tmp); + PMIX_LIST_DESTRUCT(&nodes); + return PMIX_ERR_TAKE_NEXT_OPTION; + } + /* assemble final result */ *regexp = tmp; diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/preg/native/preg_native.h b/opal/mca/pmix/pmix4x/openpmix/src/mca/preg/native/preg_native.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/preg/native/preg_native.h rename to opal/mca/pmix/pmix4x/openpmix/src/mca/preg/native/preg_native.h diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/preg/native/preg_native_component.c b/opal/mca/pmix/pmix4x/openpmix/src/mca/preg/native/preg_native_component.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/preg/native/preg_native_component.c rename to opal/mca/pmix/pmix4x/openpmix/src/mca/preg/native/preg_native_component.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/preg/preg.h b/opal/mca/pmix/pmix4x/openpmix/src/mca/preg/preg.h similarity index 86% rename from opal/mca/pmix/pmix4x/pmix/src/mca/preg/preg.h rename to opal/mca/pmix/pmix4x/openpmix/src/mca/preg/preg.h index db14d1aea4..28817d5148 100644 --- a/opal/mca/pmix/pmix4x/pmix/src/mca/preg/preg.h +++ b/opal/mca/pmix/pmix4x/openpmix/src/mca/preg/preg.h @@ -79,13 +79,6 @@ typedef pmix_status_t (*pmix_preg_base_module_parse_nodes_fn_t)(const char *rege typedef pmix_status_t (*pmix_preg_base_module_parse_procs_fn_t)(const char *regexp, char ***procs); -typedef pmix_status_t (*pmix_preg_base_module_resolve_peers_fn_t)(const char *nodename, - const char *nspace, - pmix_proc_t **procs, size_t *nprocs); - -typedef pmix_status_t (*pmix_preg_base_module_resolve_nodes_fn_t)(const char *nspace, - char **nodelist); - typedef pmix_status_t (*pmix_preg_base_module_copy_fn_t)(char **dest, size_t *len, const char *input); typedef pmix_status_t (*pmix_preg_base_module_pack_fn_t)(pmix_buffer_t *buffer, const char *regex); @@ -101,8 +94,6 @@ typedef struct { pmix_preg_base_module_generate_ppn_fn_t generate_ppn; pmix_preg_base_module_parse_nodes_fn_t parse_nodes; pmix_preg_base_module_parse_procs_fn_t parse_procs; - pmix_preg_base_module_resolve_peers_fn_t resolve_peers; - pmix_preg_base_module_resolve_nodes_fn_t resolve_nodes; pmix_preg_base_module_copy_fn_t copy; pmix_preg_base_module_pack_fn_t pack; pmix_preg_base_module_unpack_fn_t unpack; diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/preg/preg_types.h b/opal/mca/pmix/pmix4x/openpmix/src/mca/preg/preg_types.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/preg/preg_types.h rename to opal/mca/pmix/pmix4x/openpmix/src/mca/preg/preg_types.h diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/psec/Makefile.am b/opal/mca/pmix/pmix4x/openpmix/src/mca/psec/Makefile.am similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/psec/Makefile.am rename to opal/mca/pmix/pmix4x/openpmix/src/mca/psec/Makefile.am diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/psec/base/Makefile.include b/opal/mca/pmix/pmix4x/openpmix/src/mca/psec/base/Makefile.include similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/psec/base/Makefile.include rename to opal/mca/pmix/pmix4x/openpmix/src/mca/psec/base/Makefile.include diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/psec/base/base.h b/opal/mca/pmix/pmix4x/openpmix/src/mca/psec/base/base.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/psec/base/base.h rename to opal/mca/pmix/pmix4x/openpmix/src/mca/psec/base/base.h diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/psec/base/psec_base_fns.c b/opal/mca/pmix/pmix4x/openpmix/src/mca/psec/base/psec_base_fns.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/psec/base/psec_base_fns.c rename to opal/mca/pmix/pmix4x/openpmix/src/mca/psec/base/psec_base_fns.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/psec/base/psec_base_frame.c b/opal/mca/pmix/pmix4x/openpmix/src/mca/psec/base/psec_base_frame.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/psec/base/psec_base_frame.c rename to opal/mca/pmix/pmix4x/openpmix/src/mca/psec/base/psec_base_frame.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/psec/base/psec_base_select.c b/opal/mca/pmix/pmix4x/openpmix/src/mca/psec/base/psec_base_select.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/psec/base/psec_base_select.c rename to opal/mca/pmix/pmix4x/openpmix/src/mca/psec/base/psec_base_select.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/psec/dummy_handshake/Makefile.am b/opal/mca/pmix/pmix4x/openpmix/src/mca/psec/dummy_handshake/Makefile.am similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/psec/dummy_handshake/Makefile.am rename to opal/mca/pmix/pmix4x/openpmix/src/mca/psec/dummy_handshake/Makefile.am diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/psec/dummy_handshake/psec_dummy_handshake.c b/opal/mca/pmix/pmix4x/openpmix/src/mca/psec/dummy_handshake/psec_dummy_handshake.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/psec/dummy_handshake/psec_dummy_handshake.c rename to opal/mca/pmix/pmix4x/openpmix/src/mca/psec/dummy_handshake/psec_dummy_handshake.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/psec/dummy_handshake/psec_dummy_handshake.h b/opal/mca/pmix/pmix4x/openpmix/src/mca/psec/dummy_handshake/psec_dummy_handshake.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/psec/dummy_handshake/psec_dummy_handshake.h rename to opal/mca/pmix/pmix4x/openpmix/src/mca/psec/dummy_handshake/psec_dummy_handshake.h diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/psec/dummy_handshake/psec_dummy_handshake_component.c b/opal/mca/pmix/pmix4x/openpmix/src/mca/psec/dummy_handshake/psec_dummy_handshake_component.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/psec/dummy_handshake/psec_dummy_handshake_component.c rename to opal/mca/pmix/pmix4x/openpmix/src/mca/psec/dummy_handshake/psec_dummy_handshake_component.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/psec/munge/Makefile.am b/opal/mca/pmix/pmix4x/openpmix/src/mca/psec/munge/Makefile.am similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/psec/munge/Makefile.am rename to opal/mca/pmix/pmix4x/openpmix/src/mca/psec/munge/Makefile.am diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/psec/munge/configure.m4 b/opal/mca/pmix/pmix4x/openpmix/src/mca/psec/munge/configure.m4 similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/psec/munge/configure.m4 rename to opal/mca/pmix/pmix4x/openpmix/src/mca/psec/munge/configure.m4 diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/psec/munge/psec_munge.c b/opal/mca/pmix/pmix4x/openpmix/src/mca/psec/munge/psec_munge.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/psec/munge/psec_munge.c rename to opal/mca/pmix/pmix4x/openpmix/src/mca/psec/munge/psec_munge.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/psec/munge/psec_munge.h b/opal/mca/pmix/pmix4x/openpmix/src/mca/psec/munge/psec_munge.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/psec/munge/psec_munge.h rename to opal/mca/pmix/pmix4x/openpmix/src/mca/psec/munge/psec_munge.h diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/psec/munge/psec_munge_component.c b/opal/mca/pmix/pmix4x/openpmix/src/mca/psec/munge/psec_munge_component.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/psec/munge/psec_munge_component.c rename to opal/mca/pmix/pmix4x/openpmix/src/mca/psec/munge/psec_munge_component.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/psec/native/Makefile.am b/opal/mca/pmix/pmix4x/openpmix/src/mca/psec/native/Makefile.am similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/psec/native/Makefile.am rename to opal/mca/pmix/pmix4x/openpmix/src/mca/psec/native/Makefile.am diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/psec/native/psec_native.c b/opal/mca/pmix/pmix4x/openpmix/src/mca/psec/native/psec_native.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/psec/native/psec_native.c rename to opal/mca/pmix/pmix4x/openpmix/src/mca/psec/native/psec_native.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/psec/native/psec_native.h b/opal/mca/pmix/pmix4x/openpmix/src/mca/psec/native/psec_native.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/psec/native/psec_native.h rename to opal/mca/pmix/pmix4x/openpmix/src/mca/psec/native/psec_native.h diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/psec/native/psec_native_component.c b/opal/mca/pmix/pmix4x/openpmix/src/mca/psec/native/psec_native_component.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/psec/native/psec_native_component.c rename to opal/mca/pmix/pmix4x/openpmix/src/mca/psec/native/psec_native_component.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/psec/none/Makefile.am b/opal/mca/pmix/pmix4x/openpmix/src/mca/psec/none/Makefile.am similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/psec/none/Makefile.am rename to opal/mca/pmix/pmix4x/openpmix/src/mca/psec/none/Makefile.am diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/psec/none/psec_none.c b/opal/mca/pmix/pmix4x/openpmix/src/mca/psec/none/psec_none.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/psec/none/psec_none.c rename to opal/mca/pmix/pmix4x/openpmix/src/mca/psec/none/psec_none.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/psec/none/psec_none.h b/opal/mca/pmix/pmix4x/openpmix/src/mca/psec/none/psec_none.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/psec/none/psec_none.h rename to opal/mca/pmix/pmix4x/openpmix/src/mca/psec/none/psec_none.h diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/psec/none/psec_none_component.c b/opal/mca/pmix/pmix4x/openpmix/src/mca/psec/none/psec_none_component.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/psec/none/psec_none_component.c rename to opal/mca/pmix/pmix4x/openpmix/src/mca/psec/none/psec_none_component.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/psec/psec.h b/opal/mca/pmix/pmix4x/openpmix/src/mca/psec/psec.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/psec/psec.h rename to opal/mca/pmix/pmix4x/openpmix/src/mca/psec/psec.h diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/psensor/Makefile.am b/opal/mca/pmix/pmix4x/openpmix/src/mca/psensor/Makefile.am similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/psensor/Makefile.am rename to opal/mca/pmix/pmix4x/openpmix/src/mca/psensor/Makefile.am diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/psensor/base/Makefile.am b/opal/mca/pmix/pmix4x/openpmix/src/mca/psensor/base/Makefile.am similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/psensor/base/Makefile.am rename to opal/mca/pmix/pmix4x/openpmix/src/mca/psensor/base/Makefile.am diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/psensor/base/base.h b/opal/mca/pmix/pmix4x/openpmix/src/mca/psensor/base/base.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/psensor/base/base.h rename to opal/mca/pmix/pmix4x/openpmix/src/mca/psensor/base/base.h diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/psensor/base/psensor_base_frame.c b/opal/mca/pmix/pmix4x/openpmix/src/mca/psensor/base/psensor_base_frame.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/psensor/base/psensor_base_frame.c rename to opal/mca/pmix/pmix4x/openpmix/src/mca/psensor/base/psensor_base_frame.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/psensor/base/psensor_base_select.c b/opal/mca/pmix/pmix4x/openpmix/src/mca/psensor/base/psensor_base_select.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/psensor/base/psensor_base_select.c rename to opal/mca/pmix/pmix4x/openpmix/src/mca/psensor/base/psensor_base_select.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/psensor/base/psensor_base_stubs.c b/opal/mca/pmix/pmix4x/openpmix/src/mca/psensor/base/psensor_base_stubs.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/psensor/base/psensor_base_stubs.c rename to opal/mca/pmix/pmix4x/openpmix/src/mca/psensor/base/psensor_base_stubs.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/psensor/file/Makefile.am b/opal/mca/pmix/pmix4x/openpmix/src/mca/psensor/file/Makefile.am similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/psensor/file/Makefile.am rename to opal/mca/pmix/pmix4x/openpmix/src/mca/psensor/file/Makefile.am diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/psensor/file/help-pmix-psensor-file.txt b/opal/mca/pmix/pmix4x/openpmix/src/mca/psensor/file/help-pmix-psensor-file.txt similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/psensor/file/help-pmix-psensor-file.txt rename to opal/mca/pmix/pmix4x/openpmix/src/mca/psensor/file/help-pmix-psensor-file.txt diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/psensor/file/psensor_file.c b/opal/mca/pmix/pmix4x/openpmix/src/mca/psensor/file/psensor_file.c similarity index 99% rename from opal/mca/pmix/pmix4x/pmix/src/mca/psensor/file/psensor_file.c rename to opal/mca/pmix/pmix4x/openpmix/src/mca/psensor/file/psensor_file.c index 4b4ccd913b..c0de66f116 100644 --- a/opal/mca/pmix/pmix4x/pmix/src/mca/psensor/file/psensor_file.c +++ b/opal/mca/pmix/pmix4x/openpmix/src/mca/psensor/file/psensor_file.c @@ -6,7 +6,7 @@ * Copyright (c) 2011-2012 Los Alamos National Security, LLC. * All rights reserved. * - * Copyright (c) 2017-2018 Intel, Inc. All rights reserved. + * Copyright (c) 2017-2019 Intel, Inc. All rights reserved. * Copyright (c) 2019 Research Organization for Information Science * and Technology (RIST). All rights reserved. * $COPYRIGHT$ @@ -294,6 +294,7 @@ static void file_sample(int sd, short args, void *cbdata) ft->file)); /* stat the file and get its info */ + /* coverity[toctou] */ if (0 > stat(ft->file, &buf)) { /* cannot stat file */ PMIX_OUTPUT_VERBOSE((1, pmix_psensor_base_framework.framework_output, diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/psensor/file/psensor_file.h b/opal/mca/pmix/pmix4x/openpmix/src/mca/psensor/file/psensor_file.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/psensor/file/psensor_file.h rename to opal/mca/pmix/pmix4x/openpmix/src/mca/psensor/file/psensor_file.h diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/psensor/file/psensor_file_component.c b/opal/mca/pmix/pmix4x/openpmix/src/mca/psensor/file/psensor_file_component.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/psensor/file/psensor_file_component.c rename to opal/mca/pmix/pmix4x/openpmix/src/mca/psensor/file/psensor_file_component.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/psensor/heartbeat/Makefile.am b/opal/mca/pmix/pmix4x/openpmix/src/mca/psensor/heartbeat/Makefile.am similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/psensor/heartbeat/Makefile.am rename to opal/mca/pmix/pmix4x/openpmix/src/mca/psensor/heartbeat/Makefile.am diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/psensor/heartbeat/help-pmix-psensor-heartbeat.txt b/opal/mca/pmix/pmix4x/openpmix/src/mca/psensor/heartbeat/help-pmix-psensor-heartbeat.txt similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/psensor/heartbeat/help-pmix-psensor-heartbeat.txt rename to opal/mca/pmix/pmix4x/openpmix/src/mca/psensor/heartbeat/help-pmix-psensor-heartbeat.txt diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/psensor/heartbeat/psensor_heartbeat.c b/opal/mca/pmix/pmix4x/openpmix/src/mca/psensor/heartbeat/psensor_heartbeat.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/psensor/heartbeat/psensor_heartbeat.c rename to opal/mca/pmix/pmix4x/openpmix/src/mca/psensor/heartbeat/psensor_heartbeat.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/psensor/heartbeat/psensor_heartbeat.h b/opal/mca/pmix/pmix4x/openpmix/src/mca/psensor/heartbeat/psensor_heartbeat.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/psensor/heartbeat/psensor_heartbeat.h rename to opal/mca/pmix/pmix4x/openpmix/src/mca/psensor/heartbeat/psensor_heartbeat.h diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/psensor/heartbeat/psensor_heartbeat_component.c b/opal/mca/pmix/pmix4x/openpmix/src/mca/psensor/heartbeat/psensor_heartbeat_component.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/psensor/heartbeat/psensor_heartbeat_component.c rename to opal/mca/pmix/pmix4x/openpmix/src/mca/psensor/heartbeat/psensor_heartbeat_component.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/psensor/psensor.h b/opal/mca/pmix/pmix4x/openpmix/src/mca/psensor/psensor.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/psensor/psensor.h rename to opal/mca/pmix/pmix4x/openpmix/src/mca/psensor/psensor.h diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/pshmem/Makefile.am b/opal/mca/pmix/pmix4x/openpmix/src/mca/pshmem/Makefile.am similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/pshmem/Makefile.am rename to opal/mca/pmix/pmix4x/openpmix/src/mca/pshmem/Makefile.am diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/pshmem/base/Makefile.include b/opal/mca/pmix/pmix4x/openpmix/src/mca/pshmem/base/Makefile.include similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/pshmem/base/Makefile.include rename to opal/mca/pmix/pmix4x/openpmix/src/mca/pshmem/base/Makefile.include diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/pshmem/base/base.h b/opal/mca/pmix/pmix4x/openpmix/src/mca/pshmem/base/base.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/pshmem/base/base.h rename to opal/mca/pmix/pmix4x/openpmix/src/mca/pshmem/base/base.h diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/pshmem/base/pshmem_base_frame.c b/opal/mca/pmix/pmix4x/openpmix/src/mca/pshmem/base/pshmem_base_frame.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/pshmem/base/pshmem_base_frame.c rename to opal/mca/pmix/pmix4x/openpmix/src/mca/pshmem/base/pshmem_base_frame.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/pshmem/base/pshmem_base_select.c b/opal/mca/pmix/pmix4x/openpmix/src/mca/pshmem/base/pshmem_base_select.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/pshmem/base/pshmem_base_select.c rename to opal/mca/pmix/pmix4x/openpmix/src/mca/pshmem/base/pshmem_base_select.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/pshmem/mmap/Makefile.am b/opal/mca/pmix/pmix4x/openpmix/src/mca/pshmem/mmap/Makefile.am similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/pshmem/mmap/Makefile.am rename to opal/mca/pmix/pmix4x/openpmix/src/mca/pshmem/mmap/Makefile.am diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/pshmem/mmap/pshmem_mmap.c b/opal/mca/pmix/pmix4x/openpmix/src/mca/pshmem/mmap/pshmem_mmap.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/pshmem/mmap/pshmem_mmap.c rename to opal/mca/pmix/pmix4x/openpmix/src/mca/pshmem/mmap/pshmem_mmap.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/pshmem/mmap/pshmem_mmap.h b/opal/mca/pmix/pmix4x/openpmix/src/mca/pshmem/mmap/pshmem_mmap.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/pshmem/mmap/pshmem_mmap.h rename to opal/mca/pmix/pmix4x/openpmix/src/mca/pshmem/mmap/pshmem_mmap.h diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/pshmem/mmap/pshmem_mmap_component.c b/opal/mca/pmix/pmix4x/openpmix/src/mca/pshmem/mmap/pshmem_mmap_component.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/pshmem/mmap/pshmem_mmap_component.c rename to opal/mca/pmix/pmix4x/openpmix/src/mca/pshmem/mmap/pshmem_mmap_component.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/pshmem/pshmem.h b/opal/mca/pmix/pmix4x/openpmix/src/mca/pshmem/pshmem.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/pshmem/pshmem.h rename to opal/mca/pmix/pmix4x/openpmix/src/mca/pshmem/pshmem.h diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/psquash/Makefile.am b/opal/mca/pmix/pmix4x/openpmix/src/mca/psquash/Makefile.am similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/psquash/Makefile.am rename to opal/mca/pmix/pmix4x/openpmix/src/mca/psquash/Makefile.am diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/psquash/base/Makefile.include b/opal/mca/pmix/pmix4x/openpmix/src/mca/psquash/base/Makefile.include similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/psquash/base/Makefile.include rename to opal/mca/pmix/pmix4x/openpmix/src/mca/psquash/base/Makefile.include diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/psquash/base/base.h b/opal/mca/pmix/pmix4x/openpmix/src/mca/psquash/base/base.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/psquash/base/base.h rename to opal/mca/pmix/pmix4x/openpmix/src/mca/psquash/base/base.h diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/psquash/base/psquash_base_frame.c b/opal/mca/pmix/pmix4x/openpmix/src/mca/psquash/base/psquash_base_frame.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/psquash/base/psquash_base_frame.c rename to opal/mca/pmix/pmix4x/openpmix/src/mca/psquash/base/psquash_base_frame.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/psquash/base/psquash_base_select.c b/opal/mca/pmix/pmix4x/openpmix/src/mca/psquash/base/psquash_base_select.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/psquash/base/psquash_base_select.c rename to opal/mca/pmix/pmix4x/openpmix/src/mca/psquash/base/psquash_base_select.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/psquash/flex128/Makefile.am b/opal/mca/pmix/pmix4x/openpmix/src/mca/psquash/flex128/Makefile.am similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/psquash/flex128/Makefile.am rename to opal/mca/pmix/pmix4x/openpmix/src/mca/psquash/flex128/Makefile.am diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/psquash/flex128/psquash_flex128.c b/opal/mca/pmix/pmix4x/openpmix/src/mca/psquash/flex128/psquash_flex128.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/psquash/flex128/psquash_flex128.c rename to opal/mca/pmix/pmix4x/openpmix/src/mca/psquash/flex128/psquash_flex128.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/psquash/flex128/psquash_flex128.h b/opal/mca/pmix/pmix4x/openpmix/src/mca/psquash/flex128/psquash_flex128.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/psquash/flex128/psquash_flex128.h rename to opal/mca/pmix/pmix4x/openpmix/src/mca/psquash/flex128/psquash_flex128.h diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/psquash/flex128/psquash_flex128_component.c b/opal/mca/pmix/pmix4x/openpmix/src/mca/psquash/flex128/psquash_flex128_component.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/psquash/flex128/psquash_flex128_component.c rename to opal/mca/pmix/pmix4x/openpmix/src/mca/psquash/flex128/psquash_flex128_component.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/psquash/native/Makefile.am b/opal/mca/pmix/pmix4x/openpmix/src/mca/psquash/native/Makefile.am similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/psquash/native/Makefile.am rename to opal/mca/pmix/pmix4x/openpmix/src/mca/psquash/native/Makefile.am diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/psquash/native/psquash_native.c b/opal/mca/pmix/pmix4x/openpmix/src/mca/psquash/native/psquash_native.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/psquash/native/psquash_native.c rename to opal/mca/pmix/pmix4x/openpmix/src/mca/psquash/native/psquash_native.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/psquash/native/psquash_native.h b/opal/mca/pmix/pmix4x/openpmix/src/mca/psquash/native/psquash_native.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/psquash/native/psquash_native.h rename to opal/mca/pmix/pmix4x/openpmix/src/mca/psquash/native/psquash_native.h diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/psquash/native/psquash_native_component.c b/opal/mca/pmix/pmix4x/openpmix/src/mca/psquash/native/psquash_native_component.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/psquash/native/psquash_native_component.c rename to opal/mca/pmix/pmix4x/openpmix/src/mca/psquash/native/psquash_native_component.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/psquash/psquash.h b/opal/mca/pmix/pmix4x/openpmix/src/mca/psquash/psquash.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/psquash/psquash.h rename to opal/mca/pmix/pmix4x/openpmix/src/mca/psquash/psquash.h diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/ptl/Makefile.am b/opal/mca/pmix/pmix4x/openpmix/src/mca/ptl/Makefile.am similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/ptl/Makefile.am rename to opal/mca/pmix/pmix4x/openpmix/src/mca/ptl/Makefile.am diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/ptl/base/Makefile.include b/opal/mca/pmix/pmix4x/openpmix/src/mca/ptl/base/Makefile.include similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/ptl/base/Makefile.include rename to opal/mca/pmix/pmix4x/openpmix/src/mca/ptl/base/Makefile.include diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/ptl/base/base.h b/opal/mca/pmix/pmix4x/openpmix/src/mca/ptl/base/base.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/ptl/base/base.h rename to opal/mca/pmix/pmix4x/openpmix/src/mca/ptl/base/base.h diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/ptl/base/ptl_base_connect.c b/opal/mca/pmix/pmix4x/openpmix/src/mca/ptl/base/ptl_base_connect.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/ptl/base/ptl_base_connect.c rename to opal/mca/pmix/pmix4x/openpmix/src/mca/ptl/base/ptl_base_connect.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/ptl/base/ptl_base_frame.c b/opal/mca/pmix/pmix4x/openpmix/src/mca/ptl/base/ptl_base_frame.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/ptl/base/ptl_base_frame.c rename to opal/mca/pmix/pmix4x/openpmix/src/mca/ptl/base/ptl_base_frame.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/ptl/base/ptl_base_listener.c b/opal/mca/pmix/pmix4x/openpmix/src/mca/ptl/base/ptl_base_listener.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/ptl/base/ptl_base_listener.c rename to opal/mca/pmix/pmix4x/openpmix/src/mca/ptl/base/ptl_base_listener.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/ptl/base/ptl_base_select.c b/opal/mca/pmix/pmix4x/openpmix/src/mca/ptl/base/ptl_base_select.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/ptl/base/ptl_base_select.c rename to opal/mca/pmix/pmix4x/openpmix/src/mca/ptl/base/ptl_base_select.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/ptl/base/ptl_base_sendrecv.c b/opal/mca/pmix/pmix4x/openpmix/src/mca/ptl/base/ptl_base_sendrecv.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/ptl/base/ptl_base_sendrecv.c rename to opal/mca/pmix/pmix4x/openpmix/src/mca/ptl/base/ptl_base_sendrecv.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/ptl/base/ptl_base_stubs.c b/opal/mca/pmix/pmix4x/openpmix/src/mca/ptl/base/ptl_base_stubs.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/ptl/base/ptl_base_stubs.c rename to opal/mca/pmix/pmix4x/openpmix/src/mca/ptl/base/ptl_base_stubs.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/ptl/ptl.h b/opal/mca/pmix/pmix4x/openpmix/src/mca/ptl/ptl.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/ptl/ptl.h rename to opal/mca/pmix/pmix4x/openpmix/src/mca/ptl/ptl.h diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/ptl/ptl_types.h b/opal/mca/pmix/pmix4x/openpmix/src/mca/ptl/ptl_types.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/ptl/ptl_types.h rename to opal/mca/pmix/pmix4x/openpmix/src/mca/ptl/ptl_types.h diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/ptl/tcp/Makefile.am b/opal/mca/pmix/pmix4x/openpmix/src/mca/ptl/tcp/Makefile.am similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/ptl/tcp/Makefile.am rename to opal/mca/pmix/pmix4x/openpmix/src/mca/ptl/tcp/Makefile.am diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/ptl/tcp/ptl_tcp.c b/opal/mca/pmix/pmix4x/openpmix/src/mca/ptl/tcp/ptl_tcp.c similarity index 99% rename from opal/mca/pmix/pmix4x/pmix/src/mca/ptl/tcp/ptl_tcp.c rename to opal/mca/pmix/pmix4x/openpmix/src/mca/ptl/tcp/ptl_tcp.c index 98398dff0c..1a2e28f82d 100644 --- a/opal/mca/pmix/pmix4x/pmix/src/mca/ptl/tcp/ptl_tcp.c +++ b/opal/mca/pmix/pmix4x/openpmix/src/mca/ptl/tcp/ptl_tcp.c @@ -1410,6 +1410,7 @@ static pmix_status_t df_search(char *dirname, char *prefix, continue; } newdir = pmix_os_path(false, dirname, dir_entry->d_name, NULL); + /* coverity[toctou] */ if (-1 == stat(newdir, &buf)) { free(newdir); continue; diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/ptl/tcp/ptl_tcp.h b/opal/mca/pmix/pmix4x/openpmix/src/mca/ptl/tcp/ptl_tcp.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/ptl/tcp/ptl_tcp.h rename to opal/mca/pmix/pmix4x/openpmix/src/mca/ptl/tcp/ptl_tcp.h diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/ptl/tcp/ptl_tcp_component.c b/opal/mca/pmix/pmix4x/openpmix/src/mca/ptl/tcp/ptl_tcp_component.c similarity index 99% rename from opal/mca/pmix/pmix4x/pmix/src/mca/ptl/tcp/ptl_tcp_component.c rename to opal/mca/pmix/pmix4x/openpmix/src/mca/ptl/tcp/ptl_tcp_component.c index ef7646ea7c..91de8affdc 100644 --- a/opal/mca/pmix/pmix4x/pmix/src/mca/ptl/tcp/ptl_tcp_component.c +++ b/opal/mca/pmix/pmix4x/openpmix/src/mca/ptl/tcp/ptl_tcp_component.c @@ -714,6 +714,7 @@ static pmix_status_t setup_listener(pmix_info_t info[], size_t ninfo, * server */ if (PMIX_PROC_IS_TOOL(pmix_globals.mypeer)) { struct stat buf; + /* coverity[toctou] */ if (0 == stat(mca_ptl_tcp_component.rendezvous_filename, &buf)) { goto nextstep; } diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/ptl/usock/Makefile.am b/opal/mca/pmix/pmix4x/openpmix/src/mca/ptl/usock/Makefile.am similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/ptl/usock/Makefile.am rename to opal/mca/pmix/pmix4x/openpmix/src/mca/ptl/usock/Makefile.am diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/ptl/usock/ptl_usock.c b/opal/mca/pmix/pmix4x/openpmix/src/mca/ptl/usock/ptl_usock.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/ptl/usock/ptl_usock.c rename to opal/mca/pmix/pmix4x/openpmix/src/mca/ptl/usock/ptl_usock.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/ptl/usock/ptl_usock.h b/opal/mca/pmix/pmix4x/openpmix/src/mca/ptl/usock/ptl_usock.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/ptl/usock/ptl_usock.h rename to opal/mca/pmix/pmix4x/openpmix/src/mca/ptl/usock/ptl_usock.h diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/ptl/usock/ptl_usock_component.c b/opal/mca/pmix/pmix4x/openpmix/src/mca/ptl/usock/ptl_usock_component.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/mca/ptl/usock/ptl_usock_component.c rename to opal/mca/pmix/pmix4x/openpmix/src/mca/ptl/usock/ptl_usock_component.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/runtime/Makefile.include b/opal/mca/pmix/pmix4x/openpmix/src/runtime/Makefile.include similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/runtime/Makefile.include rename to opal/mca/pmix/pmix4x/openpmix/src/runtime/Makefile.include diff --git a/opal/mca/pmix/pmix4x/pmix/src/runtime/help-pmix-runtime.txt b/opal/mca/pmix/pmix4x/openpmix/src/runtime/help-pmix-runtime.txt similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/runtime/help-pmix-runtime.txt rename to opal/mca/pmix/pmix4x/openpmix/src/runtime/help-pmix-runtime.txt diff --git a/opal/mca/pmix/pmix4x/pmix/src/runtime/pmix_finalize.c b/opal/mca/pmix/pmix4x/openpmix/src/runtime/pmix_finalize.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/runtime/pmix_finalize.c rename to opal/mca/pmix/pmix4x/openpmix/src/runtime/pmix_finalize.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/runtime/pmix_init.c b/opal/mca/pmix/pmix4x/openpmix/src/runtime/pmix_init.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/runtime/pmix_init.c rename to opal/mca/pmix/pmix4x/openpmix/src/runtime/pmix_init.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/runtime/pmix_params.c b/opal/mca/pmix/pmix4x/openpmix/src/runtime/pmix_params.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/runtime/pmix_params.c rename to opal/mca/pmix/pmix4x/openpmix/src/runtime/pmix_params.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/runtime/pmix_progress_threads.c b/opal/mca/pmix/pmix4x/openpmix/src/runtime/pmix_progress_threads.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/runtime/pmix_progress_threads.c rename to opal/mca/pmix/pmix4x/openpmix/src/runtime/pmix_progress_threads.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/runtime/pmix_progress_threads.h b/opal/mca/pmix/pmix4x/openpmix/src/runtime/pmix_progress_threads.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/runtime/pmix_progress_threads.h rename to opal/mca/pmix/pmix4x/openpmix/src/runtime/pmix_progress_threads.h diff --git a/opal/mca/pmix/pmix4x/pmix/src/runtime/pmix_rte.h b/opal/mca/pmix/pmix4x/openpmix/src/runtime/pmix_rte.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/runtime/pmix_rte.h rename to opal/mca/pmix/pmix4x/openpmix/src/runtime/pmix_rte.h diff --git a/opal/mca/pmix/pmix4x/pmix/src/server/Makefile.include b/opal/mca/pmix/pmix4x/openpmix/src/server/Makefile.include similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/server/Makefile.include rename to opal/mca/pmix/pmix4x/openpmix/src/server/Makefile.include diff --git a/opal/mca/pmix/pmix4x/pmix/src/server/help-pmix-server.txt b/opal/mca/pmix/pmix4x/openpmix/src/server/help-pmix-server.txt similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/server/help-pmix-server.txt rename to opal/mca/pmix/pmix4x/openpmix/src/server/help-pmix-server.txt diff --git a/opal/mca/pmix/pmix4x/pmix/src/server/pmix_sched.c b/opal/mca/pmix/pmix4x/openpmix/src/server/pmix_sched.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/server/pmix_sched.c rename to opal/mca/pmix/pmix4x/openpmix/src/server/pmix_sched.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/server/pmix_server.c b/opal/mca/pmix/pmix4x/openpmix/src/server/pmix_server.c similarity index 97% rename from opal/mca/pmix/pmix4x/pmix/src/server/pmix_server.c rename to opal/mca/pmix/pmix4x/openpmix/src/server/pmix_server.c index 7f399ddbcb..302efd5ec6 100644 --- a/opal/mca/pmix/pmix4x/pmix/src/server/pmix_server.c +++ b/opal/mca/pmix/pmix4x/openpmix/src/server/pmix_server.c @@ -65,6 +65,7 @@ #include "src/runtime/pmix_rte.h" #include "src/mca/bfrops/base/base.h" #include "src/mca/gds/base/base.h" +#include "src/mca/pmdl/base/base.h" #include "src/mca/preg/preg.h" #include "src/mca/psensor/base/base.h" #include "src/mca/ptl/base/base.h" @@ -385,6 +386,16 @@ PMIX_EXPORT pmix_status_t PMIx_server_init(pmix_server_module_t *module, return rc; } + /* open the pmdl framework and select the active modules for this environment */ + if (PMIX_SUCCESS != (rc = pmix_mca_base_framework_open(&pmix_pmdl_base_framework, 0))) { + PMIX_RELEASE_THREAD(&pmix_global_lock); + return rc; + } + if (PMIX_SUCCESS != (rc = pmix_pmdl_base_select())) { + PMIX_RELEASE_THREAD(&pmix_global_lock); + return rc; + } + /* if requested, setup the topology */ if (PMIX_SUCCESS != (rc = pmix_hwloc_get_topology(info, ninfo))) { PMIX_RELEASE_THREAD(&pmix_global_lock); @@ -769,6 +780,9 @@ static void _deregister_nspace(int sd, short args, void *cbdata) /* release any job-level network resources */ pmix_pnet.deregister_nspace(cd->proc.nspace); + /* release any programming model info */ + pmix_pmdl.deregister_nspace(cd->proc.nspace); + /* let our local storage clean up */ PMIX_GDS_DEL_NSPACE(rc, cd->proc.nspace); @@ -1357,6 +1371,13 @@ PMIX_EXPORT pmix_status_t PMIx_server_setup_fork(const pmix_proc_t *proc, char * return rc; } + /* get any contribution for the specific programming + * model/implementation, if known */ + if (PMIX_SUCCESS != (rc = pmix_pmdl.setup_fork(proc, env))) { + PMIX_ERROR_LOG(rc); + return rc; + } + return PMIX_SUCCESS; } @@ -1644,6 +1665,13 @@ static void _setup_app(int sd, short args, void *cbdata) goto depart; } + /* pass to the programming model libraries */ + if (PMIX_SUCCESS != (rc = pmix_pmdl.harvest_envars(cd->nspace, + cd->info, cd->ninfo, + &ilist))) { + goto depart; + } + /* setup the return callback */ fcd = PMIX_NEW(pmix_setup_caddy_t); if (NULL == fcd) { @@ -3327,6 +3355,9 @@ static pmix_status_t server_switchyard(pmix_peer_t *peer, uint32_t tag, pmix_server_caddy_t *cd; pmix_proc_t proc; pmix_buffer_t *reply; + pmix_cb_t cb; + pmix_info_t info; + pmix_kval_t *kv; /* retrieve the cmd */ cnt = 1; @@ -3350,6 +3381,74 @@ static pmix_status_t server_switchyard(pmix_peer_t *peer, uint32_t tag, PMIX_ERROR_LOG(rc); return rc; } + /* if this peer is using dstore, then we let the gds/hash + * component add node- and app-level info for the peer's + * own nspace so that functions like "resolve_peers" and + * "resolve_nodes" can properly respond */ + if (0 != strcmp("hash", peer->nptr->compat.gds->name)) { + /* get the node info */ + PMIX_CONSTRUCT(&cb, pmix_cb_t); + PMIX_LOAD_NSPACE(&proc, peer->info->pname.nspace); + proc.rank = PMIX_RANK_UNDEF; + cb.proc = &proc; + PMIX_INFO_LOAD(&info, PMIX_NODE_INFO, NULL, PMIX_BOOL); + cb.info = &info; + cb.ninfo = 1; + PMIX_GDS_FETCH_KV(rc, pmix_globals.mypeer, &cb); + if (PMIX_SUCCESS != rc) { + PMIX_ERROR_LOG(rc); + cb.proc = NULL; + cb.info = NULL; + cb.ninfo = 0; + PMIX_DESTRUCT(&cb); + return rc; + } + PMIX_LIST_FOREACH(kv, &cb.kvs, pmix_kval_t) { + PMIX_BFROPS_PACK(rc, peer, reply, kv, 1, PMIX_KVAL); + if (PMIX_SUCCESS != rc) { + PMIX_ERROR_LOG(rc); + cb.proc = NULL; + cb.info = NULL; + cb.ninfo = 0; + PMIX_DESTRUCT(&cb); + return rc; + } + } + cb.proc = NULL; + cb.info = NULL; + cb.ninfo = 0; + PMIX_DESTRUCT(&cb); + /* get the app info */ + PMIX_CONSTRUCT(&cb, pmix_cb_t); + cb.proc = &proc; + PMIX_INFO_LOAD(&info, PMIX_APP_INFO, NULL, PMIX_BOOL); + cb.info = &info; + cb.ninfo = 1; + PMIX_GDS_FETCH_KV(rc, pmix_globals.mypeer, &cb); + if (PMIX_SUCCESS != rc) { + PMIX_ERROR_LOG(rc); + cb.proc = NULL; + cb.info = NULL; + cb.ninfo = 0; + PMIX_DESTRUCT(&cb); + return rc; + } + PMIX_LIST_FOREACH(kv, &cb.kvs, pmix_kval_t) { + PMIX_BFROPS_PACK(rc, peer, reply, kv, 1, PMIX_KVAL); + if (PMIX_SUCCESS != rc) { + PMIX_ERROR_LOG(rc); + cb.proc = NULL; + cb.info = NULL; + cb.ninfo = 0; + PMIX_DESTRUCT(&cb); + return rc; + } + } + cb.proc = NULL; + cb.info = NULL; + cb.ninfo = 0; + PMIX_DESTRUCT(&cb); + } PMIX_SERVER_QUEUE_REPLY(rc, peer, tag, reply); if (PMIX_SUCCESS != rc) { PMIX_RELEASE(reply); diff --git a/opal/mca/pmix/pmix4x/pmix/src/server/pmix_server_get.c b/opal/mca/pmix/pmix4x/openpmix/src/server/pmix_server_get.c similarity index 94% rename from opal/mca/pmix/pmix4x/pmix/src/server/pmix_server_get.c rename to opal/mca/pmix/pmix4x/openpmix/src/server/pmix_server_get.c index 5ce1993857..d7f0f76cac 100644 --- a/opal/mca/pmix/pmix4x/pmix/src/server/pmix_server_get.c +++ b/opal/mca/pmix/pmix4x/openpmix/src/server/pmix_server_get.c @@ -329,6 +329,10 @@ pmix_status_t pmix_server_get(pmix_buffer_t *buf, * can retrieve the info from that GDS. Otherwise, * we need to retrieve it from our own */ PMIX_CONSTRUCT(&cb, pmix_cb_t); + pmix_output_verbose(5, pmix_server_globals.get_output, + "%s GETTING JOB-DATA FOR %s", + PMIX_NAME_PRINT(&pmix_globals.myid), + PMIX_NAME_PRINT(&proc)); /* this data is for a local client, so give the gds the * option of returning a complete copy of the data, * or returning a pointer to local storage */ @@ -340,14 +344,14 @@ pmix_status_t pmix_server_get(pmix_buffer_t *buf, PMIX_DESTRUCT(&cb); return rc; } - /* if the requested rank is not WILDCARD, then retrieve the - * job-specific data for that rank - a scope of UNDEF - * will direct the GDS to provide it. Anything found will + /* if the requested rank is not WILDCARD, then retrieve any + * posted data for that rank. Anything found will * simply be added to the cb.kvs list */ if (PMIX_RANK_WILDCARD != rank) { proc.rank = rank; + cb.scope = PMIX_LOCAL; pmix_output_verbose(5, pmix_server_globals.get_output, - "%s GETTING JOB-DATA FOR %s", + "%s GETTING DATA FOR %s", PMIX_NAME_PRINT(&pmix_globals.myid), PMIX_NAME_PRINT(&proc)); PMIX_GDS_FETCH_KV(rc, pmix_globals.mypeer, &cb); @@ -657,15 +661,16 @@ static pmix_status_t _satisfy_request(pmix_namespace_t *nptr, pmix_rank_t rank, diffnspace = true; } - /* if rank is PMIX_RANK_UNDEF, then it was stored in our GDS */ - if (PMIX_RANK_UNDEF == rank) { + /* if rank is PMIX_RANK_UNDEF or is from a different nspace, + * then it was stored in our GDS */ + if (PMIX_RANK_UNDEF == rank || diffnspace) { scope = PMIX_GLOBAL; // we have to search everywhere peer = pmix_globals.mypeer; } else if (0 < nptr->nlocalprocs) { /* if we have local clients of this nspace, then we use * the corresponding GDS to retrieve the data. Otherwise, * the data will have been stored under our GDS */ - if (local) { + if (NULL != local) { *local = true; } if (PMIX_RANK_WILDCARD != rank) { @@ -686,7 +691,7 @@ static pmix_status_t _satisfy_request(pmix_namespace_t *nptr, pmix_rank_t rank, } if (PMIX_LOCAL != scope) { /* this must be a remote rank */ - if (local) { + if (NULL != local) { *local = false; } scope = PMIX_REMOTE; @@ -694,7 +699,7 @@ static pmix_status_t _satisfy_request(pmix_namespace_t *nptr, pmix_rank_t rank, } } } else { - if (local) { + if (NULL != local) { *local = false; } peer = pmix_globals.mypeer; @@ -764,7 +769,6 @@ static pmix_status_t _satisfy_request(pmix_namespace_t *nptr, pmix_rank_t rank, /* retrieve the data for the specific rank they are asking about */ if (PMIX_RANK_WILDCARD != rank) { if (!PMIX_PROC_IS_SERVER(peer) && 0 == peer->commit_cnt) { - PMIX_ERROR_LOG(PMIX_ERR_NOT_FOUND); /* this condition works only for local requests, server does * count commits for local ranks, and check this count when * local request. @@ -946,7 +950,7 @@ static void _process_dmdx_reply(int fd, short args, void *cbdata) /* find the nspace object for the proc whose data is being received */ nptr = NULL; PMIX_LIST_FOREACH(ns, &pmix_globals.nspaces, pmix_namespace_t) { - if (0 == strcmp(caddy->lcd->proc.nspace, ns->nspace)) { + if (PMIX_CHECK_NSPACE(caddy->lcd->proc.nspace, ns->nspace)) { nptr = ns; break; } @@ -984,7 +988,7 @@ static void _process_dmdx_reply(int fd, short args, void *cbdata) cd = (pmix_server_caddy_t*)dm->cbdata; found = false; PMIX_LIST_FOREACH(nm, &nspaces, pmix_nspace_caddy_t) { - if (0 == strcmp(nm->ns->nspace, cd->peer->nptr->nspace)) { + if (PMIX_CHECK_NSPACE(nm->ns->nspace, cd->peer->nptr->nspace)) { found = true; break; } @@ -998,9 +1002,12 @@ static void _process_dmdx_reply(int fd, short args, void *cbdata) } } /* now go thru each unique nspace and store the data using its - * assigned GDS component */ + * assigned GDS component - note that if the nspace of the requesting + * proc is different from the nspace of the proc whose data is being + * returned, then we have to store it into our hash tables */ PMIX_LIST_FOREACH(nm, &nspaces, pmix_nspace_caddy_t) { - if (NULL == nm->ns->compat.gds || 0 == nm->ns->nlocalprocs) { + if (NULL == nm->ns->compat.gds || 0 == nm->ns->nlocalprocs || + !PMIX_CHECK_NSPACE(nptr->nspace, nm->ns->nspace)) { peer = pmix_globals.mypeer; } else { /* there must be at least one local proc */ @@ -1009,35 +1016,36 @@ static void _process_dmdx_reply(int fd, short args, void *cbdata) } PMIX_CONSTRUCT(&pbkt, pmix_buffer_t); if (NULL == caddy->data) { - /* we assume that the data was provided via a call to - * register_nspace, so what we need to do now is simply - * transfer it across to the individual nspace storage - * components */ - PMIX_CONSTRUCT(&cb, pmix_cb_t); - PMIX_PROC_CREATE(cb.proc, 1); - if (NULL == cb.proc) { - PMIX_ERROR_LOG(PMIX_ERR_NOMEM); - PMIX_DESTRUCT(&cb); - goto complete; - } - pmix_strncpy(cb.proc->nspace, nm->ns->nspace, PMIX_MAX_NSLEN); - cb.proc->rank = PMIX_RANK_WILDCARD; - cb.scope = PMIX_INTERNAL; - cb.copy = false; - PMIX_GDS_FETCH_KV(rc, pmix_globals.mypeer, &cb); - if (PMIX_SUCCESS != rc) { - PMIX_ERROR_LOG(rc); - PMIX_DESTRUCT(&cb); - goto complete; - } - PMIX_LIST_FOREACH(kv, &cb.kvs, pmix_kval_t) { - PMIX_GDS_STORE_KV(rc, peer, &caddy->lcd->proc, PMIX_INTERNAL, kv); + if (peer != pmix_globals.mypeer) { + /* we assume that the data was provided via a call to + * register_nspace, so what we need to do now is simply + * transfer it across to the individual nspace storage + * components */ + PMIX_CONSTRUCT(&cb, pmix_cb_t); + PMIX_PROC_CREATE(cb.proc, 1); + if (NULL == cb.proc) { + PMIX_ERROR_LOG(PMIX_ERR_NOMEM); + PMIX_DESTRUCT(&cb); + goto complete; + } + PMIX_LOAD_PROCID(cb.proc, nm->ns->nspace, PMIX_RANK_WILDCARD); + cb.scope = PMIX_INTERNAL; + cb.copy = false; + PMIX_GDS_FETCH_KV(rc, pmix_globals.mypeer, &cb); if (PMIX_SUCCESS != rc) { PMIX_ERROR_LOG(rc); - break; + PMIX_DESTRUCT(&cb); + goto complete; } + PMIX_LIST_FOREACH(kv, &cb.kvs, pmix_kval_t) { + PMIX_GDS_STORE_KV(rc, peer, &caddy->lcd->proc, PMIX_INTERNAL, kv); + if (PMIX_SUCCESS != rc) { + PMIX_ERROR_LOG(rc); + break; + } + } + PMIX_DESTRUCT(&cb); } - PMIX_DESTRUCT(&cb); } else { PMIX_LOAD_BUFFER(pmix_globals.mypeer, &pbkt, caddy->data, caddy->ndata); /* unpack and store it*/ diff --git a/opal/mca/pmix/pmix4x/pmix/src/server/pmix_server_ops.c b/opal/mca/pmix/pmix4x/openpmix/src/server/pmix_server_ops.c similarity index 99% rename from opal/mca/pmix/pmix4x/pmix/src/server/pmix_server_ops.c rename to opal/mca/pmix/pmix4x/openpmix/src/server/pmix_server_ops.c index 86efa4c6de..359c4f78ab 100644 --- a/opal/mca/pmix/pmix4x/pmix/src/server/pmix_server_ops.c +++ b/opal/mca/pmix/pmix4x/openpmix/src/server/pmix_server_ops.c @@ -448,7 +448,7 @@ static pmix_server_trkr_t* new_tracker(char *id, pmix_proc_t *procs, break; } } - if (NULL == nptr) { + if (NULL == nptr || nptr->nlocalprocs <= 0) { /* cannot be a local proc */ pmix_output_verbose(5, pmix_server_globals.base_output, "new_tracker: unknown nspace %s", diff --git a/opal/mca/pmix/pmix4x/pmix/src/server/pmix_server_ops.h b/opal/mca/pmix/pmix4x/openpmix/src/server/pmix_server_ops.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/server/pmix_server_ops.h rename to opal/mca/pmix/pmix4x/openpmix/src/server/pmix_server_ops.h diff --git a/opal/mca/pmix/pmix4x/pmix/src/threads/Makefile.include b/opal/mca/pmix/pmix4x/openpmix/src/threads/Makefile.include similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/threads/Makefile.include rename to opal/mca/pmix/pmix4x/openpmix/src/threads/Makefile.include diff --git a/opal/mca/pmix/pmix4x/pmix/src/threads/mutex.c b/opal/mca/pmix/pmix4x/openpmix/src/threads/mutex.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/threads/mutex.c rename to opal/mca/pmix/pmix4x/openpmix/src/threads/mutex.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/threads/mutex.h b/opal/mca/pmix/pmix4x/openpmix/src/threads/mutex.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/threads/mutex.h rename to opal/mca/pmix/pmix4x/openpmix/src/threads/mutex.h diff --git a/opal/mca/pmix/pmix4x/pmix/src/threads/mutex_unix.h b/opal/mca/pmix/pmix4x/openpmix/src/threads/mutex_unix.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/threads/mutex_unix.h rename to opal/mca/pmix/pmix4x/openpmix/src/threads/mutex_unix.h diff --git a/opal/mca/pmix/pmix4x/pmix/src/threads/thread.c b/opal/mca/pmix/pmix4x/openpmix/src/threads/thread.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/threads/thread.c rename to opal/mca/pmix/pmix4x/openpmix/src/threads/thread.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/threads/thread_usage.h b/opal/mca/pmix/pmix4x/openpmix/src/threads/thread_usage.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/threads/thread_usage.h rename to opal/mca/pmix/pmix4x/openpmix/src/threads/thread_usage.h diff --git a/opal/mca/pmix/pmix4x/pmix/src/threads/threads.h b/opal/mca/pmix/pmix4x/openpmix/src/threads/threads.h similarity index 98% rename from opal/mca/pmix/pmix4x/pmix/src/threads/threads.h rename to opal/mca/pmix/pmix4x/openpmix/src/threads/threads.h index 84c8c15150..b9785a7fa6 100644 --- a/opal/mca/pmix/pmix4x/pmix/src/threads/threads.h +++ b/opal/mca/pmix/pmix4x/openpmix/src/threads/threads.h @@ -13,7 +13,7 @@ * Copyright (c) 2010 Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2015-2017 Research Organization for Information Science * and Technology (RIST). All rights reserved. - * Copyright (c) 2017-2018 Intel, Inc. All rights reserved. + * Copyright (c) 2017-2019 Intel, Inc. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -75,6 +75,7 @@ typedef struct { do { \ PMIX_CONSTRUCT(&(l)->mutex, pmix_mutex_t); \ pthread_cond_init(&(l)->cond, NULL); \ + /* coverity[missing_lock : FALSE] */ \ (l)->active = true; \ } while(0) diff --git a/opal/mca/pmix/pmix4x/pmix/src/threads/tsd.h b/opal/mca/pmix/pmix4x/openpmix/src/threads/tsd.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/threads/tsd.h rename to opal/mca/pmix/pmix4x/openpmix/src/threads/tsd.h diff --git a/opal/mca/pmix/pmix4x/pmix/src/threads/wait_sync.c b/opal/mca/pmix/pmix4x/openpmix/src/threads/wait_sync.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/threads/wait_sync.c rename to opal/mca/pmix/pmix4x/openpmix/src/threads/wait_sync.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/threads/wait_sync.h b/opal/mca/pmix/pmix4x/openpmix/src/threads/wait_sync.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/threads/wait_sync.h rename to opal/mca/pmix/pmix4x/openpmix/src/threads/wait_sync.h diff --git a/opal/mca/pmix/pmix4x/pmix/src/tool/Makefile.include b/opal/mca/pmix/pmix4x/openpmix/src/tool/Makefile.include similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/tool/Makefile.include rename to opal/mca/pmix/pmix4x/openpmix/src/tool/Makefile.include diff --git a/opal/mca/pmix/pmix4x/pmix/src/tool/pmix_tool.c b/opal/mca/pmix/pmix4x/openpmix/src/tool/pmix_tool.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/tool/pmix_tool.c rename to opal/mca/pmix/pmix4x/openpmix/src/tool/pmix_tool.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/tools/Makefile.include b/opal/mca/pmix/pmix4x/openpmix/src/tools/Makefile.include similarity index 94% rename from opal/mca/pmix/pmix4x/pmix/src/tools/Makefile.include rename to opal/mca/pmix/pmix4x/openpmix/src/tools/Makefile.include index 0dbfe6e1d9..215d702301 100644 --- a/opal/mca/pmix/pmix4x/pmix/src/tools/Makefile.include +++ b/opal/mca/pmix/pmix4x/openpmix/src/tools/Makefile.include @@ -29,11 +29,13 @@ SUBDIRS += \ tools/pmix_info \ tools/plookup \ tools/pps \ - tools/pattrs + tools/pattrs \ + tools/wrapper DIST_SUBDIRS += \ tools/pevent \ tools/pmix_info \ tools/plookup \ tools/pps \ - tools/pattrs + tools/pattrs \ + tools/wrapper diff --git a/opal/mca/pmix/pmix4x/pmix/src/tools/pattrs/Makefile.am b/opal/mca/pmix/pmix4x/openpmix/src/tools/pattrs/Makefile.am similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/tools/pattrs/Makefile.am rename to opal/mca/pmix/pmix4x/openpmix/src/tools/pattrs/Makefile.am diff --git a/opal/mca/pmix/pmix4x/pmix/src/tools/pattrs/help-pattrs.txt b/opal/mca/pmix/pmix4x/openpmix/src/tools/pattrs/help-pattrs.txt similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/tools/pattrs/help-pattrs.txt rename to opal/mca/pmix/pmix4x/openpmix/src/tools/pattrs/help-pattrs.txt diff --git a/opal/mca/pmix/pmix4x/pmix/src/tools/pattrs/pattrs.c b/opal/mca/pmix/pmix4x/openpmix/src/tools/pattrs/pattrs.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/tools/pattrs/pattrs.c rename to opal/mca/pmix/pmix4x/openpmix/src/tools/pattrs/pattrs.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/tools/pevent/Makefile.am b/opal/mca/pmix/pmix4x/openpmix/src/tools/pevent/Makefile.am similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/tools/pevent/Makefile.am rename to opal/mca/pmix/pmix4x/openpmix/src/tools/pevent/Makefile.am diff --git a/opal/mca/pmix/pmix4x/pmix/src/tools/pevent/help-pevent.txt b/opal/mca/pmix/pmix4x/openpmix/src/tools/pevent/help-pevent.txt similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/tools/pevent/help-pevent.txt rename to opal/mca/pmix/pmix4x/openpmix/src/tools/pevent/help-pevent.txt diff --git a/opal/mca/pmix/pmix4x/pmix/src/tools/pevent/pevent.c b/opal/mca/pmix/pmix4x/openpmix/src/tools/pevent/pevent.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/tools/pevent/pevent.c rename to opal/mca/pmix/pmix4x/openpmix/src/tools/pevent/pevent.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/tools/plookup/Makefile.am b/opal/mca/pmix/pmix4x/openpmix/src/tools/plookup/Makefile.am similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/tools/plookup/Makefile.am rename to opal/mca/pmix/pmix4x/openpmix/src/tools/plookup/Makefile.am diff --git a/opal/mca/pmix/pmix4x/pmix/src/tools/plookup/help-plookup.txt b/opal/mca/pmix/pmix4x/openpmix/src/tools/plookup/help-plookup.txt similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/tools/plookup/help-plookup.txt rename to opal/mca/pmix/pmix4x/openpmix/src/tools/plookup/help-plookup.txt diff --git a/opal/mca/pmix/pmix4x/pmix/src/tools/plookup/plookup.c b/opal/mca/pmix/pmix4x/openpmix/src/tools/plookup/plookup.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/tools/plookup/plookup.c rename to opal/mca/pmix/pmix4x/openpmix/src/tools/plookup/plookup.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/tools/pmix_info/Makefile.am b/opal/mca/pmix/pmix4x/openpmix/src/tools/pmix_info/Makefile.am similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/tools/pmix_info/Makefile.am rename to opal/mca/pmix/pmix4x/openpmix/src/tools/pmix_info/Makefile.am diff --git a/opal/mca/pmix/pmix4x/pmix/src/tools/pmix_info/help-pmix-info.txt b/opal/mca/pmix/pmix4x/openpmix/src/tools/pmix_info/help-pmix-info.txt similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/tools/pmix_info/help-pmix-info.txt rename to opal/mca/pmix/pmix4x/openpmix/src/tools/pmix_info/help-pmix-info.txt diff --git a/opal/mca/pmix/pmix4x/pmix/src/tools/pmix_info/pinfo.h b/opal/mca/pmix/pmix4x/openpmix/src/tools/pmix_info/pinfo.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/tools/pmix_info/pinfo.h rename to opal/mca/pmix/pmix4x/openpmix/src/tools/pmix_info/pinfo.h diff --git a/opal/mca/pmix/pmix4x/pmix/src/tools/pmix_info/pmix_info.c b/opal/mca/pmix/pmix4x/openpmix/src/tools/pmix_info/pmix_info.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/tools/pmix_info/pmix_info.c rename to opal/mca/pmix/pmix4x/openpmix/src/tools/pmix_info/pmix_info.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/tools/pmix_info/support.c b/opal/mca/pmix/pmix4x/openpmix/src/tools/pmix_info/support.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/tools/pmix_info/support.c rename to opal/mca/pmix/pmix4x/openpmix/src/tools/pmix_info/support.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/tools/pmix_info/support.h b/opal/mca/pmix/pmix4x/openpmix/src/tools/pmix_info/support.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/tools/pmix_info/support.h rename to opal/mca/pmix/pmix4x/openpmix/src/tools/pmix_info/support.h diff --git a/opal/mca/pmix/pmix4x/pmix/src/tools/pps/Makefile.am b/opal/mca/pmix/pmix4x/openpmix/src/tools/pps/Makefile.am similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/tools/pps/Makefile.am rename to opal/mca/pmix/pmix4x/openpmix/src/tools/pps/Makefile.am diff --git a/opal/mca/pmix/pmix4x/pmix/src/tools/pps/help-pps.txt b/opal/mca/pmix/pmix4x/openpmix/src/tools/pps/help-pps.txt similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/tools/pps/help-pps.txt rename to opal/mca/pmix/pmix4x/openpmix/src/tools/pps/help-pps.txt diff --git a/opal/mca/pmix/pmix4x/pmix/src/tools/pps/pps.c b/opal/mca/pmix/pmix4x/openpmix/src/tools/pps/pps.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/tools/pps/pps.c rename to opal/mca/pmix/pmix4x/openpmix/src/tools/pps/pps.c diff --git a/opal/mca/pmix/pmix4x/openpmix/src/tools/wrapper/Makefile.am b/opal/mca/pmix/pmix4x/openpmix/src/tools/wrapper/Makefile.am new file mode 100644 index 0000000000..6fe2779ab0 --- /dev/null +++ b/opal/mca/pmix/pmix4x/openpmix/src/tools/wrapper/Makefile.am @@ -0,0 +1,73 @@ +# +# Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana +# University Research and Technology +# Corporation. All rights reserved. +# Copyright (c) 2004-2006 The University of Tennessee and The University +# of Tennessee Research Foundation. All rights +# reserved. +# Copyright (c) 2004-2009 High Performance Computing Center Stuttgart, +# University of Stuttgart. All rights reserved. +# Copyright (c) 2004-2005 The Regents of the University of California. +# All rights reserved. +# Copyright (c) 2006-2014 Cisco Systems, Inc. All rights reserved. +# Copyright (c) 2008 Sun Microsystems, Inc. All rights reserved. +# Copyright (c) 2014 Research Organization for Information Science +# and Technology (RIST). All rights reserved. +# Copyright (c) 2019 Intel, Inc. All rights reserved. +# $COPYRIGHT$ +# +# Additional copyrights may follow +# +# $HEADER$ +# + +DEFS="-DEXEEXT=\"$(EXEEXT)\"" + +real_man_pages = generic_wrapper.1 pmix_wrapper.1 +EXTRA_DIST = $(real_man_pages:.1=.1in) + +include $(top_srcdir)/Makefile.pmix-rules + +if PMIX_INSTALL_BINARIES + +bin_PROGRAMS = pmix_wrapper + +nodist_man_MANS = pmix_wrapper.1 + +dist_pmixdata_DATA = help-pmix-wrapper.txt + +# Only install the following for developer-level installs +if WANT_INSTALL_HEADERS + +nodist_pmixdata_DATA = \ + pmixcc-wrapper-data.txt + +nodist_man_MANS += pmixcc.1 + +pkgconfigdir = $(libdir)/pkgconfig +pkgconfig_DATA = pmix.pc + +install-exec-hook: + (cd $(DESTDIR)$(bindir); rm -f pmixcc$(EXEEXT); $(LN_S) pmix_wrapper$(EXEECT) pmixcc$(EXEEXT)) + +uninstall-local: + rm -f $(DESTDIR)$(bindir)/pmixcc$(EXEEXT) + +endif # WANT_INSTALL_HEADERS + +endif # PMIX_INSTALL_BINARIES + +pmix_wrapper_SOURCES = pmix_wrapper.c +pmix_wrapper_LDADD = $(top_builddir)/src/libpmix.la + +# Ensure that the man pages are rebuilt if the pmix_config.h file +# changes; a "good enough" way to know if configure was run again (and +# therefore the release date or version may have changed) +$(real_man_pages): $(top_builddir)/src/include/pmix_config.h + +pmixcc.1: generic_wrapper.1 + rm -f pmixcc.1 + sed -e 's/#COMMAND#/pmixcc/g' -e 's/#PROJECT#/PMIx/g' -e 's/#PROJECT_SHORT#/PMIx/g' -e 's/#LANGUAGE#/C/g' < $(top_builddir)/src/tools/wrapper/generic_wrapper.1 > pmixcc.1 + +distclean-local: + rm -f $(real_man_pages) pmixcc.1 diff --git a/opal/mca/pmix/pmix4x/openpmix/src/tools/wrapper/generic_wrapper.1in b/opal/mca/pmix/pmix4x/openpmix/src/tools/wrapper/generic_wrapper.1in new file mode 100644 index 0000000000..65b6f222ee --- /dev/null +++ b/opal/mca/pmix/pmix4x/openpmix/src/tools/wrapper/generic_wrapper.1in @@ -0,0 +1,265 @@ +.\" Copyright (c) 2008 Sun Microsystems, Inc. All rights reserved. +.\" Copyright (c) 2011-2012 Cisco Systems, Inc. All rights reserved. +.TH #COMMAND# 1 "#PMIX_DATE#" "#PACKAGE_VERSION#" "#PACKAGE_NAME#" +. +.SH NAME +#COMMAND# -- #PROJECT# #LANGUAGE# wrapper compiler +. +.SH SYNTAX +#COMMAND# [-showme|-showme:compile|-showme:link] ... +. +.SH OPTIONS +.TP +--showme +This option comes in several different variants (see below). None of +the variants invokes the underlying compiler; they all provide +information on how the underlying compiler would have been invoked had +.I --showme +not been used. +The basic +.I --showme +option outputs the command line that would be executed to compile the +program. \fBNOTE:\fR If a non-filename argument is passed on the +command line, the \fI-showme\fR option will \fInot\fR display any +additional flags. For example, both "#COMMAND# --showme" and +"#COMMAND# --showme my_source.c" will show all the wrapper-supplied +flags. But "#COMMAND# --showme -v" will only show the underlying +compiler name and "-v". +.TP +--showme:compile +Output the compiler flags that would have been supplied to the +#LANGUAGE# compiler. +.TP +--showme:link +Output the linker flags that would have been supplied to the +#LANGUAGE# compiler. +.TP +--showme:command +Outputs the underlying #LANGUAGE# compiler command (which may be one +or more tokens). +.TP +--showme:incdirs +Outputs a space-delimited (but otherwise undecorated) list of +directories that the wrapper compiler would have provided to the +underlying #LANGUAGE# compiler to indicate where relevant header files +are located. +.TP +--showme:libdirs +Outputs a space-delimited (but otherwise undecorated) list of +directories that the wrapper compiler would have provided to the +underlying linker to indicate where relevant libraries are located. +.TP +--showme:libs +Outputs a space-delimited (but otherwise undecorated) list of library +names that the wrapper compiler would have used to link an +application. For example: "mpi open-rte open-pal util". +.TP +--showme:version +Outputs the version number of Open MPI. +.TP +--showme:help +Output a brief usage help message. +.PP +See the man page for your underlying #LANGUAGE# compiler for other +options that can be passed through #COMMAND#. +. +. +.SH DESCRIPTION +.PP +Conceptually, the role of these commands is quite simple: +transparently add relevant compiler and linker flags to the user's +command line that are necessary to compile / link #PROJECT# +programs, and then invoke the underlying compiler to actually perform +the command. +. +.PP +As such, these commands are frequently referred to as "wrapper" +compilers because they do not actually compile or link applications +themselves; they only add in command line flags and invoke the +back-end compiler. +. +. +.SS Background +Open MPI is comprised of three software layers: PMIX (Open Portable +Access Layer), ORTE (Open Run-Time Environment), and OMPI (Open MPI). +There are wrapper compilers for each layer; each layer's wrapper only +links in the libraries relevant for that layer. Specifically, each +layer provides the following wrapper compilers: +. +.TP 4 +PMIX +\fIpmixcc\fR and \fIpmixc++\fR +. +.TP +ORTE +\fIortecc\fR and \fIortec++\fR +. +.TP +OMPI +\fImpicc\fR, \fImpic++\fR, \fImpicxx\fR, \fImpiCC\fR (only on systems with +case-senstive file systems), and \fImpifort\fR (and its legacy/deprecated +names \fImpif77\fR and \fImpif90\fR). Note +that \fImpic++\fR, \fImpicxx\fR, and \fImpiCC\fR all invoke the same +underlying C++ compiler with the same options. All are provided as +compatibility with other MPI implementations. +. +. +.SS Fortran Notes +.PP +The Fortran wrapper compiler for MPI (\fImpifort\fR, and its +legacy/deprecated names \fImpif77\fR and \fImpif90\fR) can compile and +link MPI applications that use any/all of the MPI Fortran bindings: +.IR mpif.h , +the +.I mpi +module, and the +.I mpi_f08 +module (assuming Open MPI was installed with support for each of these +Fortran bindings). Specifically: it is no longer necessary to use +different wrapper compilers for applications that use +.I mpif.h +vs. applications that use the +.I mpi +module -- just use +.I mpifort +for all Fortran MPI applications. +. +.PP +Note, however, that the Fortran compiler may require additional +command-line options to enforce a specific Fortran dialect. For +example, in some versions of the IBM XLF compiler, if xlf90 is the +underlying Fortran compiler, +.IR -qfixed +may be necessary to compile fixed-format Fortran source files. +. +.PP +Finally, note that +.I mpifort +will be inoperative and will return an error on use if Fortran support +was not built into the MP Ilayer. +. +. +.SS Overview +\fI#COMMAND#\fR is a convenience wrappers for the underlying +#LANGUAGE# compiler. Translation of an #PROJECT# program requires the +linkage of the #PROJECT#-specific libraries which may not reside in +one of the standard search directories of ld(1). It also often +requires the inclusion of header files what may also not be found in a +standard location. +. +.PP +\fI#COMMAND#\fR passes its arguments to the underlying #LANGUAGE# +compiler along with the -I, -L and -l options required by #PROJECT# +programs. +. +.PP +The #PROJECT# Team \fIstrongly\fR encourages using the wrapper +compilers instead of attempting to link to the #PROJECT# libraries +manually. This allows the specific implementation of #PROJECT# to +change without forcing changes to linker directives in users' +Makefiles. Indeed, the specific set of flags and libraries used by +the wrapper compilers depends on how #PROJECT# was configured and +built; the values can change between different installations of the +same version of #PROJECT#. +. +.PP +Indeed, since the wrappers are simply thin shells on top of an +underlying compiler, there are very, very few compelling reasons +\fInot\fR to use \fI#COMMAND#\fR. When it is not possible to use the +wrappers directly, the \fI-showme:compile\fR and \fI-showme:link\fR +options should be used to determine what flags the wrappers would have +used. For example: +. +.PP +shell$ cc -c file1.c `mpicc -showme:compile` +. +.PP +shell$ cc -c file2.c `mpicc -showme:compile` +. +.PP +shell$ cc file1.o file2.o `mpicc -showme:link` -o my_mpi_program +. +. +.SH NOTES +.PP +It is possible to make the wrapper compilers multi-lib aware. That +is, the libraries and includes specified may differ based on the +compiler flags specified (for example, with the GNU compilers on +Linux, a different library path may be used if -m32 is seen versus +-m64 being seen). This is not the default behavior in a standard +build, but can be activated (for example, in a binary package +providing both 32 and 64 bit support). More information can be found +at: +.PP + https://github.com/open-mpi/ompi/wiki/compilerwrapper3264 +. +. +.SH FILES +.PP +The string that the wrapper compilers insert into the command line +before invoking the underlying compiler are stored in a text file +created by #PROJECT# and installed to +\fI$pkgdata/#COMMAND#-wrapper-data.txt\fR, where \fI$pkgdata\fR +is typically \fI$prefix/share/openmpi\fR, and \fI$prefix\fR is the top +installation directory of #PROJECT#. +. +.PP +It is rarely necessary to edit this file, but it can be examined to +gain insight into what flags the wrappers are placing on the command +line. +. +. +.SH ENVIRONMENT VARIABLES +.PP +By default, the wrappers use the compilers that were selected when +#PROJECT# was configured. These compilers were either found +automatically by Open MPI's "configure" script, or were selected by +the user in the CC, CXX, F77, and/or FC environment variables +before "configure" was invoked. Additionally, other arguments +specific to the compiler may have been selected by configure. +. +.PP +These values can be selectively overridden by either editing the text +files containing this configuration information (see the \fBFILES\fR +section), or by setting selected environment variables of the +form "#PROJECT_SHORT#_value". +. +.PP +Valid value names are: +. +.TP +CPPFLAGS +Flags added when invoking the preprocessor (C or C++) +. +.TP +LDFLAGS +Flags added when invoking the linker (C, C++, or Fortran) +. +.TP +LIBS +Libraries added when invoking the linker (C, C++, or Fortran) +. +.TP +CC +C compiler +. +.TP +CFLAGS +C compiler flags +. +.TP +CXX +C++ compiler +. +.TP +CXXFLAGS +C++ compiler flags +. +. +.TP +FC +Fortran compiler +. +.TP +FCFLAGS +Fortran compiler flags diff --git a/opal/mca/pmix/pmix4x/openpmix/src/tools/wrapper/help-pmix-wrapper.txt b/opal/mca/pmix/pmix4x/openpmix/src/tools/wrapper/help-pmix-wrapper.txt new file mode 100644 index 0000000000..6067db1377 --- /dev/null +++ b/opal/mca/pmix/pmix4x/openpmix/src/tools/wrapper/help-pmix-wrapper.txt @@ -0,0 +1,68 @@ +# -*- text -*- +# +# Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana +# University Research and Technology +# Corporation. All rights reserved. +# Copyright (c) 2004-2005 The University of Tennessee and The University +# of Tennessee Research Foundation. All rights +# reserved. +# Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, +# University of Stuttgart. All rights reserved. +# Copyright (c) 2004-2005 The Regents of the University of California. +# All rights reserved. +# Copyright (c) 2006-2010 Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2012-2014 Cisco Systems, Inc. All rights reserved. +# Copyright (c) 2019 Intel, Inc. All rights reserved. +# $COPYRIGHT$ +# +# Additional copyrights may follow +# +# $HEADER$ +# +# This is the US/English help file for Open MPI wrapper compiler error +# messages. +# +[no-compiler-found] +The Open MPI wrapper compiler was unable to find the specified compiler +%s in your PATH. + +Note that this compiler was either specified at configure time or in +one of several possible environment variables. +# +[version] +%s: %s %s (Language: %s) +# +[usage] +%s [-showme[:]] args + + -showme:command Show command used to invoke real compiler + -showme:compile Show flags added when compiling + -showme:link Show flags added when linking + -showme:incdirs Show list of include dirs added when compiling + -showme:libdirs Show list of library dirs added when linking + -showme:libs Show list of libraries added when linking + -showme:version Show version of %s + -showme:help This help message +# +[file-not-found] +%s could not find the file %s, needed for %s support. +This may indicate an incomplete install and linking will likely fail. +# +[spawn-failed] +Unable to call the compiler (%s). The failure return the error +%s. +The failed command was [%s]. +# +[compiler-failed] +The child process (%s) exit with error %d. +The failed command was [%s]. +# +[no-options-support] +The %s wrapper compiler was unable to find a block of options in its +configuration to support your compiler mode. Your application was not +compiled. or linked. + +The wrapper compiler command line was: + + %s diff --git a/opal/mca/pmix/pmix4x/openpmix/src/tools/wrapper/pmix.pc.in b/opal/mca/pmix/pmix4x/openpmix/src/tools/wrapper/pmix.pc.in new file mode 100644 index 0000000000..f19c0fcb37 --- /dev/null +++ b/opal/mca/pmix/pmix4x/openpmix/src/tools/wrapper/pmix.pc.in @@ -0,0 +1,25 @@ +# Copyright (c) 2010 Cisco Systems, Inc. All rights reserved. +# +Name: Open Portability Access Layer (PMIX) +Description: Lowest layer abstractions for the Open MPI software package +Version: @PMIX_VERSION@ +URL: http://www.open-mpi.org/ +# +prefix=@prefix@ +exec_prefix=@exec_prefix@ +includedir=@includedir@ +libdir=@libdir@ +pkgincludedir=@pmixincludedir@ +# +# Note that the EXTRA_LIBS are only necessary when static linking +# (they're pulled in via libopen-pal.so's implicit dependencies), so +# list them in Libs.private. +# +Libs: -L${libdir} @PMIX_PKG_CONFIG_LDFLAGS@ -lopen-pal +Libs.private: @PMIX_WRAPPER_EXTRA_LIBS@ +# +# It is safe to hard-wire the -I before the EXTRA_INCLUDES because we +# will not be installing this .pc file unless --enable-devel-headers is +# selected, meaning that there will definitely be a value in EXTRA_INCLUDES. +# +Cflags: -I${includedir} @PMIX_WRAPPER_EXTRA_CPPFLAGS@ @PMIX_WRAPPER_EXTRA_CFLAGS@ diff --git a/opal/mca/pmix/pmix4x/openpmix/src/tools/wrapper/pmix_wrapper.1in b/opal/mca/pmix/pmix4x/openpmix/src/tools/wrapper/pmix_wrapper.1in new file mode 100644 index 0000000000..8e52978d96 --- /dev/null +++ b/opal/mca/pmix/pmix4x/openpmix/src/tools/wrapper/pmix_wrapper.1in @@ -0,0 +1,43 @@ +.\" Copyright (c) 2008 Sun Microsystems, Inc. All rights reserved. +.\" Man page contributed by Dirk Eddelbuettel +.\" and released under the BSD license +.TH PMIX_WRAPPER 1 "#PMIX_DATE#" "#PACKAGE_VERSION#" "#PACKAGE_NAME#" +.SH NAME +pmix_wrapper - Back-end PMIx wrapper command +.SH SYNOPSIS +.B pmix_wrapper [options] +.SH DESCRIPTION +.PP +.B pmix_wrapper +is not meant to be called directly by end users. It is automatically +invoked as the back-end by the PMIx wrapper command +.BR mpicc. +.PP +Some PMIx installations may have additional wrapper commands, +and/or have renamed the wrapper compilers listed above to avoid +executable name conflicts with other PMIx implementations. +. +. +.\" ************************** +.\" See Also Section +.\" ************************** +.SH SEE ALSO +The following may exist depending on your particular PMIx +installation: +.BR pmixcc (1) +and the website at +.IR http://pmix.org/ . +. +. +.\" ************************** +.\" Authors Section +.\" ************************** +.SH AUTHORS +The PMIx maintainers -- see +.I http://pmix.org/ +or the file +.IR AUTHORS . +.PP +This manual page was originally contributed by Dirk Eddelbuettel +, one of the Debian GNU/Linux maintainers for Open +MPI, and may be used by others. diff --git a/opal/mca/pmix/pmix4x/openpmix/src/tools/wrapper/pmix_wrapper.c b/opal/mca/pmix/pmix4x/openpmix/src/tools/wrapper/pmix_wrapper.c new file mode 100644 index 0000000000..f5432a48a7 --- /dev/null +++ b/opal/mca/pmix/pmix4x/openpmix/src/tools/wrapper/pmix_wrapper.c @@ -0,0 +1,993 @@ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2005 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, + * University of Stuttgart. All rights reserved. + * Copyright (c) 2004-2005 The Regents of the University of California. + * All rights reserved. + * Copyright (c) 2007-2015 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2007-2013 Los Alamos National Security, LLC. All rights + * reserved. + * Copyright (c) 2010 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * Copyright (c) 2018 Amazon.com, Inc. or its affiliates. All Rights reserved. + * Copyright (c) 2018-2019 Intel, Inc. All rights reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +#include "pmix_config.h" + +#include +#include +#include +#ifdef HAVE_SYS_STAT_H +#include +#endif /* HAVE_SYS_STAT_H */ +#ifdef HAVE_SYS_TYPES_H +#include +#endif /* HAVE_SYS_TYPES_H */ +#ifdef HAVE_REGEX_H +#include +#endif +#ifdef HAVE_SYS_WAIT_H +#include +#endif /* HAVE_SYS_WAIT_H */ +#include + +#include "src/mca/pinstalldirs/pinstalldirs.h" +#include "src/mca/pinstalldirs/base/base.h" +#include "src/runtime/pmix_rte.h" +#include "pmix_common.h" +#include "src/util/argv.h" +#include "src/util/error.h" +#include "src/util/keyval_parse.h" +#include "src/util/pmix_environ.h" +#include "src/util/show_help.h" +#include "src/util/path.h" +#include "src/util/few.h" +#include "src/util/basename.h" +#include "src/util/os_path.h" +#include "src/util/printf.h" + +#define PMIX_INCLUDE_FLAG "-I" +#define PMIX_LIBDIR_FLAG "-L" + +struct options_data_t { + char **compiler_args; + char *language; + char *project; + char *project_short; + char *version; + char *compiler_env; + char *compiler_flags_env; + char *compiler; + char **preproc_flags; + char **comp_flags; + char **comp_flags_prefix; + char **link_flags; + char **libs; + char **libs_static; + char *dyn_lib_file; + char *static_lib_file; + char *req_file; + char *path_includedir; + char *path_libdir; + char *path_pmixincludedir; + char *path_pmixlibdir; +}; + +static struct options_data_t *options_data = NULL; +/* index used by parser */ +static int parse_options_idx = -1; +/* index of options specified by user */ +static int user_data_idx = -1; +/* index of options to use by default */ +static int default_data_idx = -1; + +#define COMP_DRY_RUN 0x001 +#define COMP_SHOW_ERROR 0x002 +#define COMP_WANT_COMMAND 0x004 +#define COMP_WANT_PREPROC 0x008 +#define COMP_WANT_COMPILE 0x010 +#define COMP_WANT_LINK 0x020 +#define COMP_WANT_PMPI 0x040 +#define COMP_WANT_STATIC 0x080 +#define COMP_WANT_LINKALL 0x100 + +static void +options_data_init(struct options_data_t *data) +{ + data->compiler_args = (char **) malloc(sizeof(char*)); + data->compiler_args[0] = NULL; + data->language = NULL; + data->compiler = NULL; + data->project = NULL; + data->project_short = NULL; + data->version = NULL; + data->compiler_env = NULL; + data->compiler_flags_env = NULL; + data->preproc_flags = (char **) malloc(sizeof(char*)); + data->preproc_flags[0] = NULL; + data->comp_flags = (char **) malloc(sizeof(char*)); + data->comp_flags[0] = NULL; + data->comp_flags_prefix = (char **) malloc(sizeof(char*)); + data->comp_flags_prefix[0] = NULL; + data->link_flags = (char **) malloc(sizeof(char*)); + data->link_flags[0] = NULL; + data->libs = (char **) malloc(sizeof(char*)); + data->libs[0] = NULL; + data->libs_static = (char **) malloc(sizeof(char*)); + data->libs_static[0] = NULL; + data->dyn_lib_file = NULL; + data->static_lib_file = NULL; + data->req_file = NULL; + data->path_includedir = NULL; + data->path_libdir = NULL; + data->path_pmixincludedir = NULL; + data->path_pmixlibdir = NULL; +} + +static void +options_data_free(struct options_data_t *data) +{ + if (NULL != data->compiler_args) { + pmix_argv_free(data->compiler_args); + } + if (NULL != data->language) free(data->language); + if (NULL != data->compiler) free(data->compiler); + if (NULL != data->project) free(data->project); + if (NULL != data->project_short) free(data->project_short); + if (NULL != data->version) free(data->version); + if (NULL != data->compiler_env) free(data->compiler_env); + if (NULL != data->compiler_flags_env) free(data->compiler_flags_env); + pmix_argv_free(data->preproc_flags); + pmix_argv_free(data->comp_flags); + pmix_argv_free(data->comp_flags_prefix); + pmix_argv_free(data->link_flags); + pmix_argv_free(data->libs); + pmix_argv_free(data->libs_static); + if (NULL != data->dyn_lib_file) free(data->dyn_lib_file); + if (NULL != data->static_lib_file) free(data->static_lib_file); + if (NULL != data->req_file) free(data->req_file); + if (NULL != data->path_includedir) free(data->path_includedir); + if (NULL != data->path_libdir) free(data->path_libdir); + if (NULL != data->path_pmixincludedir) free(data->path_pmixincludedir); + if (NULL != data->path_pmixlibdir) free(data->path_pmixlibdir); +} + +static void +options_data_expand(const char *value) +{ + /* make space for the new set of args */ + parse_options_idx++; + options_data = (struct options_data_t *) realloc(options_data, sizeof(struct options_data_t) * (parse_options_idx + 1)); + options_data_init(&(options_data[parse_options_idx])); + + /* if there are values, this is not the default case. + Otherwise, it's the default case... */ + if (NULL != value && 0 != strcmp(value, "")) { + char **values = pmix_argv_split(value, ';'); + pmix_argv_insert(&(options_data[parse_options_idx].compiler_args), + pmix_argv_count(options_data[parse_options_idx].compiler_args), + values); + pmix_argv_free(values); + } else { + free(options_data[parse_options_idx].compiler_args); + options_data[parse_options_idx].compiler_args = NULL; + /* this is a default */ + default_data_idx = parse_options_idx; + } +} + + +static int +find_options_index(const char *arg) +{ + int i, j; +#ifdef HAVE_REGEXEC + int args_count; + regex_t res; +#endif + + for (i = 0 ; i <= parse_options_idx ; ++i) { + if (NULL == options_data[i].compiler_args) { + continue; + } + +#ifdef HAVE_REGEXEC + args_count = pmix_argv_count(options_data[i].compiler_args); + for (j = 0 ; j < args_count ; ++j) { + if (0 != regcomp(&res, options_data[i].compiler_args[j], REG_NOSUB)) { + return -1; + } + + if (0 == regexec(&res, arg, (size_t) 0, NULL, 0)) { + regfree(&res); + return i; + } + + regfree(&res); + } +#else + for (j = 0 ; j < pmix_argv_count(options_data[i].compiler_args) ; ++j) { + if (0 == strcmp(arg, options_data[i].compiler_args[j])) { + return i; + } + } +#endif + } + + return -1; +} + + +static void +expand_flags(char **argv) +{ + int i; + char *tmp; + + for (i = 0 ; argv[i] != NULL ; ++i) { + tmp = pmix_pinstall_dirs_expand(argv[i]); + if (tmp != argv[i]) { + free(argv[i]); + argv[i] = tmp; + } + } +} + + +static void +data_callback(const char *key, const char *value) +{ + /* handle case where text file does not contain any special + compiler options field */ + if (parse_options_idx < 0 && 0 != strcmp(key, "compiler_args")) { + options_data_expand(NULL); + } + + if (0 == strcmp(key, "compiler_args")) { + options_data_expand(value); + } else if (0 == strcmp(key, "language")) { + if (NULL != value) options_data[parse_options_idx].language = strdup(value); + } else if (0 == strcmp(key, "compiler")) { + if (NULL != value) options_data[parse_options_idx].compiler = strdup(value); + } else if (0 == strcmp(key, "project")) { + if (NULL != value) options_data[parse_options_idx].project = strdup(value); + } else if (0 == strcmp(key, "version")) { + if (NULL != value) options_data[parse_options_idx].version = strdup(value); + } else if (0 == strcmp(key, "preprocessor_flags")) { + char **values = pmix_argv_split(value, ' '); + pmix_argv_insert(&options_data[parse_options_idx].preproc_flags, + pmix_argv_count(options_data[parse_options_idx].preproc_flags), + values); + expand_flags(options_data[parse_options_idx].preproc_flags); + pmix_argv_free(values); + } else if (0 == strcmp(key, "compiler_flags")) { + char **values = pmix_argv_split(value, ' '); + pmix_argv_insert(&options_data[parse_options_idx].comp_flags, + pmix_argv_count(options_data[parse_options_idx].comp_flags), + values); + expand_flags(options_data[parse_options_idx].comp_flags); + pmix_argv_free(values); + } else if (0 == strcmp(key, "compiler_flags_prefix")) { + char **values = pmix_argv_split(value, ' '); + pmix_argv_insert(&options_data[parse_options_idx].comp_flags_prefix, + pmix_argv_count(options_data[parse_options_idx].comp_flags_prefix), + values); + expand_flags(options_data[parse_options_idx].comp_flags_prefix); + pmix_argv_free(values); + } else if (0 == strcmp(key, "linker_flags")) { + char **values = pmix_argv_split(value, ' '); + pmix_argv_insert(&options_data[parse_options_idx].link_flags, + pmix_argv_count(options_data[parse_options_idx].link_flags), + values); + expand_flags(options_data[parse_options_idx].link_flags); + pmix_argv_free(values); + } else if (0 == strcmp(key, "libs")) { + char **values = pmix_argv_split(value, ' '); + pmix_argv_insert(&options_data[parse_options_idx].libs, + pmix_argv_count(options_data[parse_options_idx].libs), + values); + pmix_argv_free(values); + } else if (0 == strcmp(key, "libs_static")) { + char **values = pmix_argv_split(value, ' '); + pmix_argv_insert(&options_data[parse_options_idx].libs_static, + pmix_argv_count(options_data[parse_options_idx].libs_static), + values); + pmix_argv_free(values); + } else if (0 == strcmp(key, "dyn_lib_file")) { + if (NULL != value) options_data[parse_options_idx].dyn_lib_file = strdup(value); + } else if (0 == strcmp(key, "static_lib_file")) { + if (NULL != value) options_data[parse_options_idx].static_lib_file = strdup(value); + } else if (0 == strcmp(key, "required_file")) { + if (NULL != value) options_data[parse_options_idx].req_file = strdup(value); + } else if (0 == strcmp(key, "project_short")) { + if (NULL != value) options_data[parse_options_idx].project_short = strdup(value); + } else if (0 == strcmp(key, "compiler_env")) { + if (NULL != value) options_data[parse_options_idx].compiler_env = strdup(value); + } else if (0 == strcmp(key, "compiler_flags_env")) { + if (NULL != value) options_data[parse_options_idx].compiler_flags_env = strdup(value); + } else if (0 == strcmp(key, "includedir")) { + if (NULL != value) { + options_data[parse_options_idx].path_includedir = + pmix_pinstall_dirs_expand(value); + if (0 != strcmp(options_data[parse_options_idx].path_includedir, "/usr/include") || + 0 == strncmp(options_data[parse_options_idx].language, "Fortran", strlen("Fortran"))) { + char *line; + pmix_asprintf(&line, PMIX_INCLUDE_FLAG"%s", + options_data[parse_options_idx].path_includedir); + pmix_argv_append_unique_nosize(&options_data[parse_options_idx].preproc_flags, line); + free(line); + } + } + } else if (0 == strcmp(key, "libdir")) { + if (NULL != value) options_data[parse_options_idx].path_libdir = + pmix_pinstall_dirs_expand(value); + if (0 != strcmp(options_data[parse_options_idx].path_libdir, "/usr/lib")) { + char *line; + pmix_asprintf(&line, PMIX_LIBDIR_FLAG"%s", + options_data[parse_options_idx].path_libdir); + pmix_argv_append_unique_nosize(&options_data[parse_options_idx].link_flags, line); + free(line); + } + } else if (0 == strcmp(key, "pmixincludedir")) { + printf("EXPANDING!\n"); + if (NULL != value) { + options_data[parse_options_idx].path_pmixincludedir = + pmix_pinstall_dirs_expand(value); + if (0 != strcmp(options_data[parse_options_idx].path_pmixincludedir, "/usr/include") || + 0 == strncmp(options_data[parse_options_idx].language, "Fortran", strlen("Fortran"))) { + char *line; + pmix_asprintf(&line, PMIX_INCLUDE_FLAG"%s", + options_data[parse_options_idx].path_pmixincludedir); + pmix_argv_append_unique_nosize(&options_data[parse_options_idx].preproc_flags, line); + free(line); + } + } + } else if (0 == strcmp(key, "pmixlibdir")) { + if (NULL != value) options_data[parse_options_idx].path_pmixlibdir = + pmix_pinstall_dirs_expand(value); + if (0 != strcmp(options_data[parse_options_idx].path_pmixlibdir, "/usr/lib")) { + char *line; + pmix_asprintf(&line, PMIX_LIBDIR_FLAG"%s", + options_data[parse_options_idx].path_pmixlibdir); + pmix_argv_append_unique_nosize(&options_data[parse_options_idx].link_flags, line); + free(line); + } + } +} + + +static int +data_init(const char *appname) +{ + int ret; + char *datafile; + + /* now load the data */ + pmix_asprintf(&datafile, "%s%s%s-wrapper-data.txt", + pmix_pinstall_dirs.pmixdatadir, PMIX_PATH_SEP, appname); + if (NULL == datafile) return PMIX_ERR_OUT_OF_RESOURCE; + + ret = pmix_util_keyval_parse(datafile, data_callback); + if( PMIX_SUCCESS != ret ) { + fprintf(stderr, "Cannot open configuration file %s\n", datafile ); + } + free(datafile); + + return ret; +} + + +static int +data_finalize(void) +{ + int i; + + for (i = 0 ; i <= parse_options_idx ; ++i) { + options_data_free(&(options_data[i])); + } + free(options_data); + + return PMIX_SUCCESS; +} + + +static void +print_flags(char **args, char *pattern) +{ + int i; + bool found = false; + + for (i = 0 ; args[i] != NULL ; ++i) { + if (0 == strncmp(args[i], pattern, strlen(pattern))) { + if (found) printf(" "); + printf("%s", args[i] + strlen(pattern)); + found = true; + } + } + + if (found) printf("\n"); +} + + +static void +load_env_data(const char *project, const char *flag, char **data) +{ + char *envname; + char *envvalue; + + if (NULL == project || NULL == flag) return; + + pmix_asprintf(&envname, "%s_MPI%s", project, flag); + if (NULL == (envvalue = getenv(envname))) { + free(envname); + pmix_asprintf(&envname, "%s_%s", project, flag); + if (NULL == (envvalue = getenv(envname))) { + free(envname); + return; + } + } + free(envname); + + if (NULL != *data) free(*data); + *data = strdup(envvalue); +} + + +static void +load_env_data_argv(const char *project, const char *flag, char ***data) +{ + char *envname; + char *envvalue; + + if (NULL == project || NULL == flag) return; + + pmix_asprintf(&envname, "%s_MPI%s", project, flag); + if (NULL == (envvalue = getenv(envname))) { + free(envname); + pmix_asprintf(&envname, "%s_%s", project, flag); + if (NULL == (envvalue = getenv(envname))) { + free(envname); + return; + } + } + free(envname); + + if (NULL != *data) pmix_argv_free(*data); + + *data = pmix_argv_split(envvalue, ' '); +} + + +int +main(int argc, char *argv[]) +{ + int exit_status = 0, ret, flags = 0, i; + int exec_argc = 0, user_argc = 0; + char **exec_argv = NULL, **user_argv = NULL; + char *exec_command, *base_argv0 = NULL; + bool disable_flags = true; + bool real_flag = false; + + /* initialize the output system */ + if (!pmix_output_init()) { + return PMIX_ERROR; + } + + /* initialize install dirs code */ + if (PMIX_SUCCESS != (ret = pmix_mca_base_framework_open(&pmix_pinstalldirs_base_framework, 0))) { + fprintf(stderr, "pmix_pinstalldirs_base_open() failed -- process will likely abort (%s:%d, returned %d instead of PMIX_SUCCESS)\n", + __FILE__, __LINE__, ret); + return ret; + } + + /* initialize the help system */ + pmix_show_help_init(); + + /* keyval lex-based parser */ + if (PMIX_SUCCESS != (ret = pmix_util_keyval_parse_init())) { + pmix_show_help( "help-pmix-runtime.txt", + "pmix_init:startup:internal-failure", true, + "pmix_util_keyval_parse_init", ret ); + return ret; + } + + /* initialize the mca */ + if (PMIX_SUCCESS != (ret = pmix_mca_base_open())) { + pmix_show_help( "help-pmix-runtime.txt", + "pmix_init:startup:internal-failure", true, + "pmix_mca_base_open", ret ); + return ret; + } + + /**************************************************** + * + * Setup compiler information + * + ****************************************************/ + + base_argv0 = pmix_basename(argv[0]); +#if defined(EXEEXT) + if( 0 != strlen(EXEEXT) ) { + char extension[] = EXEEXT; + char* temp = strstr( base_argv0, extension ); + char* old_match = temp; + while( NULL != temp ) { + old_match = temp; + temp = strstr( temp + 1, extension ); + } + /* Only if there was a match of .exe, erase the last occurence of .exe */ + if ( NULL != old_match ) { + *old_match = '\0'; + } + } +#endif /* defined(EXEEXT) */ + + if (PMIX_SUCCESS != (ret = data_init(base_argv0))) { + fprintf(stderr, "Error parsing data file %s: %s\n", base_argv0, PMIx_Error_string(ret)); + return ret; + } + + for (i = 1 ; i < argc && user_data_idx < 0 ; ++i) { + user_data_idx = find_options_index(argv[i]); + } + /* if we didn't find a match, look for the NULL (base case) options */ + if (user_data_idx < 0) { + user_data_idx = default_data_idx; + } + /* if we still didn't find a match, abort */ + if (user_data_idx < 0) { + char *flat = pmix_argv_join(argv, ' '); + pmix_show_help("help-pmix-wrapper.txt", "no-options-support", true, + base_argv0, flat, NULL); + free(flat); + exit(1); + } + + /* compiler */ + load_env_data(options_data[user_data_idx].project_short, options_data[user_data_idx].compiler_env, &options_data[user_data_idx].compiler); + + /* preprocessor flags */ + load_env_data_argv(options_data[user_data_idx].project_short, "CPPFLAGS", &options_data[user_data_idx].preproc_flags); + + /* compiler flags */ + load_env_data_argv(options_data[user_data_idx].project_short, options_data[user_data_idx].compiler_flags_env, + &options_data[user_data_idx].comp_flags); + + /* linker flags */ + load_env_data_argv(options_data[user_data_idx].project_short, "LDFLAGS", &options_data[user_data_idx].link_flags); + + /* libs */ + load_env_data_argv(options_data[user_data_idx].project_short, "LIBS", &options_data[user_data_idx].libs); + + + /**************************************************** + * + * Sanity Checks + * + ****************************************************/ + + if (NULL != options_data[user_data_idx].req_file) { + /* make sure the language is supported */ + if (0 == strcmp(options_data[user_data_idx].req_file, "not supported")) { + pmix_show_help("help-pmix-wrapper.txt", "no-language-support", true, + options_data[user_data_idx].language, base_argv0, NULL); + exit_status = 1; + goto cleanup; + } + + if (options_data[user_data_idx].req_file[0] != '\0') { + char *filename; + struct stat buf; + filename = pmix_os_path( false, options_data[user_data_idx].path_libdir, options_data[user_data_idx].req_file, NULL ); + if (0 != stat(filename, &buf)) { + pmix_show_help("help-pmix-wrapper.txt", "file-not-found", true, + base_argv0, options_data[user_data_idx].req_file, options_data[user_data_idx].language, NULL); + } + } + } + + /**************************************************** + * + * Parse user flags + * + ****************************************************/ + flags = COMP_WANT_COMMAND|COMP_WANT_PREPROC| + COMP_WANT_COMPILE|COMP_WANT_LINK; + + user_argv = pmix_argv_copy(argv + 1); + user_argc = pmix_argv_count(user_argv); + + for (i = 0 ; i < user_argc ; ++i) { + if (0 == strncmp(user_argv[i], "-showme", strlen("-showme")) || + 0 == strncmp(user_argv[i], "--showme", strlen("--showme")) || + 0 == strncmp(user_argv[i], "-show", strlen("-show")) || + 0 == strncmp(user_argv[i], "--show", strlen("--show"))) { + bool done_now = false; + + /* check for specific things we want to see. First three + still invoke all the building routines. Last set want + to parse out certain flags, so we don't go through the + normal build routine - skip to cleanup. */ + if (0 == strncmp(user_argv[i], "-showme:command", strlen("-showme:command")) || + 0 == strncmp(user_argv[i], "--showme:command", strlen("--showme:command"))) { + flags = COMP_WANT_COMMAND; + /* we know what we want, so don't process any more args */ + done_now = true; + } else if (0 == strncmp(user_argv[i], "-showme:compile", strlen("-showme:compile")) || + 0 == strncmp(user_argv[i], "--showme:compile", strlen("--showme:compile"))) { + flags = COMP_WANT_PREPROC|COMP_WANT_COMPILE; + /* we know what we want, so don't process any more args */ + done_now = true; + } else if (0 == strncmp(user_argv[i], "-showme:link", strlen("-showme:link")) || + 0 == strncmp(user_argv[i], "--showme:link", strlen("--showme:link"))) { + flags = COMP_WANT_COMPILE|COMP_WANT_LINK; + /* we know what we want, so don't process any more args */ + done_now = true; + } else if (0 == strncmp(user_argv[i], "-showme:incdirs", strlen("-showme:incdirs")) || + 0 == strncmp(user_argv[i], "--showme:incdirs", strlen("--showme:incdirs"))) { + print_flags(options_data[user_data_idx].preproc_flags, PMIX_INCLUDE_FLAG); + goto cleanup; + } else if (0 == strncmp(user_argv[i], "-showme:libdirs", strlen("-showme:libdirs")) || + 0 == strncmp(user_argv[i], "--showme:libdirs", strlen("--showme:libdirs"))) { + print_flags(options_data[user_data_idx].link_flags, PMIX_LIBDIR_FLAG); + goto cleanup; + } else if (0 == strncmp(user_argv[i], "-showme:libs", strlen("-showme:libs")) || + 0 == strncmp(user_argv[i], "--showme:libs", strlen("--showme:libs"))) { + print_flags(options_data[user_data_idx].libs, "-l"); + goto cleanup; + } else if (0 == strncmp(user_argv[i], "-showme:version", strlen("-showme:version")) || + 0 == strncmp(user_argv[i], "--showme:version", strlen("--showme:version"))) { + char * str; + str = pmix_show_help_string("help-pmix-wrapper.txt", + "version", false, + argv[0], options_data[user_data_idx].project, options_data[user_data_idx].version, options_data[user_data_idx].language, NULL); + if (NULL != str) { + printf("%s", str); + free(str); + } + goto cleanup; + } else if (0 == strncmp(user_argv[i], "-showme:help", strlen("-showme:help")) || + 0 == strncmp(user_argv[i], "--showme:help", strlen("--showme:help"))) { + char *str; + str = pmix_show_help_string("help-pmix-wrapper.txt", "usage", + false, argv[0], + options_data[user_data_idx].project, + NULL); + if (NULL != str) { + printf("%s", str); + free(str); + } + + exit_status = 0; + goto cleanup; + } else if (0 == strncmp(user_argv[i], "-showme:", strlen("-showme:")) || + 0 == strncmp(user_argv[i], "--showme:", strlen("--showme:"))) { + fprintf(stderr, "%s: unrecognized option: %s\n", argv[0], + user_argv[i]); + fprintf(stderr, "Type '%s --showme:help' for usage.\n", + argv[0]); + exit_status = 1; + goto cleanup; + } + + flags |= (COMP_DRY_RUN|COMP_SHOW_ERROR); + /* remove element from user_argv */ + pmix_argv_delete(&user_argc, &user_argv, i, 1); + --i; + + if (done_now) { + disable_flags = false; + break; + } + + } else if (0 == strcmp(user_argv[i], "-c")) { + flags &= ~COMP_WANT_LINK; + real_flag = true; + } else if (0 == strcmp(user_argv[i], "-E") || + 0 == strcmp(user_argv[i], "-M")) { + flags &= ~(COMP_WANT_COMPILE | COMP_WANT_LINK); + real_flag = true; + } else if (0 == strcmp(user_argv[i], "-S")) { + flags &= ~COMP_WANT_LINK; + real_flag = true; + } else if (0 == strcmp(user_argv[i], "-lpmpi")) { + flags |= COMP_WANT_PMPI; + + /* remove element from user_argv */ + pmix_argv_delete(&user_argc, &user_argv, i, 1); + --i; + } else if (0 == strcmp(user_argv[i], "-static") || + 0 == strcmp(user_argv[i], "--static") || + 0 == strcmp(user_argv[i], "-Bstatic") || + 0 == strcmp(user_argv[i], "-Wl,-static") || + 0 == strcmp(user_argv[i], "-Wl,--static") || + 0 == strcmp(user_argv[i], "-Wl,-Bstatic")) { + flags |= COMP_WANT_STATIC; + } else if (0 == strcmp(user_argv[i], "-dynamic") || + 0 == strcmp(user_argv[i], "--dynamic") || + 0 == strcmp(user_argv[i], "-Bdynamic") || + 0 == strcmp(user_argv[i], "-Wl,-dynamic") || + 0 == strcmp(user_argv[i], "-Wl,--dynamic") || + 0 == strcmp(user_argv[i], "-Wl,-Bdynamic")) { + flags &= ~COMP_WANT_STATIC; + } else if (0 == strcmp(user_argv[i], "--openmpi:linkall")) { + /* This is an intentionally undocummented wrapper compiler + switch. It should only be used by Open MPI developers + -- not end users. It will cause mpicc to use the + static library list, even if we're compiling + dynamically (i.e., it'll specifically -lopen-rte and + -lopen-pal (and all their dependent libs)). We provide + this flag for test MPI applications that also invoke + ORTE and/or PMIX function calls. + + On some systems (e.g., OS X), if the top-level + application calls ORTE/PMIX functions and you don't -l + ORTE and PMIX, then the functions won't be resolved at + link time (i.e., the implicit library dependencies of + libmpi won't be pulled in at link time), and therefore + the link will fail. This flag will cause the wrapper + to explicitly list the ORTE and PMIX libs on the + underlying compiler command line, so the application + will therefore link properly. */ + flags |= COMP_WANT_LINKALL; + + /* remove element from user_argv */ + pmix_argv_delete(&user_argc, &user_argv, i, 1); + } else if ('-' != user_argv[i][0]) { + disable_flags = false; + flags |= COMP_SHOW_ERROR; + real_flag = true; + } else { + /* if the option flag is one that we use to determine + which set of compiler data to use, don't count it as a + real option */ + if (find_options_index(user_argv[i]) < 0) { + real_flag = true; + } + } + } + + /* clear out the want_flags if we got no arguments not starting + with a - (dash) and -showme wasn't given OR -showme was given + and we had at least one more non-showme argument that started + with a - (dash) and no other non-dash arguments. Some examples: + + pmix_wrapper : clear our flags + pmix_wrapper -v : clear our flags + pmix_wrapper -E a.c : don't clear our flags + pmix_wrapper a.c : don't clear our flags + pmix_wrapper -showme : don't clear our flags + pmix_wrapper -showme -v : clear our flags + pmix_wrapper -showme -E a.c : don't clear our flags + pmix_wrapper -showme a.c : don't clear our flags + */ + if (disable_flags && !((flags & COMP_DRY_RUN) && !real_flag)) { + flags &= ~(COMP_WANT_PREPROC|COMP_WANT_COMPILE|COMP_WANT_LINK); + } + + /**************************************************** + * + * Assemble the command line + * + ****************************************************/ + + /* compiler (may be multiple arguments, so split) */ + if (flags & COMP_WANT_COMMAND) { + exec_argv = pmix_argv_split(options_data[user_data_idx].compiler, ' '); + exec_argc = pmix_argv_count(exec_argv); + } else { + exec_argv = (char **) malloc(sizeof(char*)); + exec_argv[0] = NULL; + exec_argc = 0; + } + + /* This error would normally not happen unless the user edits the + wrapper data files manually */ + if (NULL == exec_argv) { + pmix_show_help("help-pmix-wrapper.txt", "no-compiler-specified", true); + return 1; + } + + if (flags & COMP_WANT_COMPILE) { + pmix_argv_insert(&exec_argv, exec_argc, + options_data[user_data_idx].comp_flags_prefix); + exec_argc = pmix_argv_count(exec_argv); + } + + /* Per https://svn.open-mpi.org/trac/ompi/ticket/2201, add all the + user arguments before anything else. */ + pmix_argv_insert(&exec_argv, exec_argc, user_argv); + exec_argc = pmix_argv_count(exec_argv); + + /* preproc flags */ + if (flags & COMP_WANT_PREPROC) { + pmix_argv_insert(&exec_argv, exec_argc, options_data[user_data_idx].preproc_flags); + exec_argc = pmix_argv_count(exec_argv); + } + + /* compiler flags */ + if (flags & COMP_WANT_COMPILE) { + pmix_argv_insert(&exec_argv, exec_argc, options_data[user_data_idx].comp_flags); + exec_argc = pmix_argv_count(exec_argv); + } + + /* link flags and libs */ + if (flags & COMP_WANT_LINK) { + bool have_static_lib; + bool have_dyn_lib; + bool use_static_libs; + char *filename1, *filename2; + struct stat buf; + + pmix_argv_insert(&exec_argv, exec_argc, options_data[user_data_idx].link_flags); + exec_argc = pmix_argv_count(exec_argv); + + /* Are we linking statically? If so, decide what libraries to + list. It depends on two factors: + + 1. Was --static (etc.) specified? + 2. Does OMPI have static, dynamic, or both libraries installed? + + Here's a matrix showing what we'll do in all 6 cases: + + What's installed --static no --static + ---------------- ---------- ----------- + ompi .so libs -lmpi -lmpi + ompi .a libs all all + ompi both libs all -lmpi + + */ + + filename1 = pmix_os_path( false, options_data[user_data_idx].path_libdir, options_data[user_data_idx].static_lib_file, NULL ); + if (0 == stat(filename1, &buf)) { + have_static_lib = true; + } else { + have_static_lib = false; + } + + filename2 = pmix_os_path( false, options_data[user_data_idx].path_libdir, options_data[user_data_idx].dyn_lib_file, NULL ); + if (0 == stat(filename2, &buf)) { + have_dyn_lib = true; + } else { + have_dyn_lib = false; + } + + /* Determine which set of libs to use: dynamic or static. Be + pedantic to make the code easy to read. */ + if (flags & COMP_WANT_LINKALL) { + /* If --openmpi:linkall was specified, list all the libs + (i.e., the static libs) if they're available, either in + static or dynamic form. */ + if (have_static_lib || have_dyn_lib) { + use_static_libs = true; + } else { + fprintf(stderr, "The linkall option has failed as we were unable to find either static or dynamic libs\n" + "Files looked for:\n Static: %s\n Dynamic: %s\n", + filename1, filename2); + free(filename1); + free(filename2); + exit(1); + } + } else if (flags & COMP_WANT_STATIC) { + /* If --static (or something like it) was specified, if we + have the static libs, then use them. Otherwise, use + the dynamic libs. */ + if (have_static_lib) { + use_static_libs = true; + } else { + use_static_libs = false; + } + } else { + /* If --static (or something like it) was NOT specified + (or if --dyanic, or something like it, was specified), + if we have the dynamic libs, then use them. Otherwise, + use the static libs. */ + if (have_dyn_lib) { + use_static_libs = false; + } else { + use_static_libs = true; + } + } + free(filename1); + free(filename2); + + if (use_static_libs) { + pmix_argv_insert(&exec_argv, exec_argc, options_data[user_data_idx].libs_static); + } else { + pmix_argv_insert(&exec_argv, exec_argc, options_data[user_data_idx].libs); + } + exec_argc = pmix_argv_count(exec_argv); + } + + + /**************************************************** + * + * Execute the command + * + ****************************************************/ + + if (flags & COMP_DRY_RUN) { + exec_command = pmix_argv_join(exec_argv, ' '); + printf("%s\n", exec_command); + } else { + char *tmp; + +#if 0 + exec_command = pmix_argv_join(exec_argv, ' '); + printf("command: %s\n", exec_command); +#endif + + tmp = pmix_path_findv(exec_argv[0], 0, environ, NULL); + if (NULL == tmp) { + pmix_show_help("help-pmix-wrapper.txt", "no-compiler-found", true, + exec_argv[0], NULL); + errno = 0; + exit_status = 1; + } else { + int status; + + free(exec_argv[0]); + exec_argv[0] = tmp; + ret = pmix_few(exec_argv, &status); + exit_status = WIFEXITED(status) ? WEXITSTATUS(status) : + (WIFSIGNALED(status) ? WTERMSIG(status) : + (WIFSTOPPED(status) ? WSTOPSIG(status) : 255)); + if( (PMIX_SUCCESS != ret) || ((0 != exit_status) && (flags & COMP_SHOW_ERROR)) ) { + char* exec_command = pmix_argv_join(exec_argv, ' '); + if( PMIX_SUCCESS != ret ) { + pmix_show_help("help-pmix-wrapper.txt", "spawn-failed", true, + exec_argv[0], strerror(status), exec_command, NULL); + } else { +#if 0 + pmix_show_help("help-pmix-wrapper.txt", "compiler-failed", true, + exec_argv[0], exit_status, exec_command, NULL); +#endif + } + free(exec_command); + } + } + } + + /**************************************************** + * + * Cleanup + * + ****************************************************/ + cleanup: + + pmix_argv_free(exec_argv); + pmix_argv_free(user_argv); + if (NULL != base_argv0) free(base_argv0); + + if (PMIX_SUCCESS != (ret = data_finalize())) { + return ret; + } + + /* keyval lex-based parser */ + pmix_util_keyval_parse_finalize(); + + (void)pmix_mca_base_framework_close(&pmix_pinstalldirs_base_framework); + pmix_mca_base_close(); + /* finalize the show_help system */ + pmix_show_help_finalize(); + + /* finalize the output system. This has to come *after* the + malloc code, as the malloc code needs to call into this, but + the malloc code turning off doesn't affect pmix_output that + much */ + pmix_output_finalize(); + + return exit_status; +} diff --git a/opal/mca/pmix/pmix4x/openpmix/src/tools/wrapper/pmixcc-wrapper-data.txt.in b/opal/mca/pmix/pmix4x/openpmix/src/tools/wrapper/pmixcc-wrapper-data.txt.in new file mode 100644 index 0000000000..06d78b43b7 --- /dev/null +++ b/opal/mca/pmix/pmix4x/openpmix/src/tools/wrapper/pmixcc-wrapper-data.txt.in @@ -0,0 +1,25 @@ +# There can be multiple blocks of configuration data, chosen by +# compiler flags (using the compiler_args key to chose which block +# should be activated. This can be useful for multilib builds. See the +# multilib page at: +# https://github.com/open-mpi/ompi/wiki/compilerwrapper3264 +# for more information. + +project=PMI-Exascale (PMIx) +project_short=PMIx +version=@PMIX_VERSION@ +language=C +compiler_env=CC +compiler_flags_env=CFLAGS +compiler=@WRAPPER_CC@ +preprocessor_flags=@PMIX_WRAPPER_EXTRA_CPPFLAGS@ +compiler_flags_prefix=@PMIX_WRAPPER_EXTRA_CFLAGS_PREFIX@ +compiler_flags=@PMIX_WRAPPER_EXTRA_CFLAGS@ +linker_flags=@PMIX_WRAPPER_EXTRA_LDFLAGS@ +libs=-lpmix +libs_static=-lpmix @PMIX_WRAPPER_EXTRA_LIBS@ +dyn_lib_file=libpmix.@PMIX_DYN_LIB_SUFFIX@ +static_lib_file=libpmix.a +required_file= +includedir=${includedir} +libdir=${libdir} diff --git a/opal/mca/pmix/pmix4x/pmix/src/util/Makefile.include b/opal/mca/pmix/pmix4x/openpmix/src/util/Makefile.include similarity index 96% rename from opal/mca/pmix/pmix4x/pmix/src/util/Makefile.include rename to opal/mca/pmix/pmix4x/openpmix/src/util/Makefile.include index 02831df901..b50eb803d6 100644 --- a/opal/mca/pmix/pmix4x/pmix/src/util/Makefile.include +++ b/opal/mca/pmix/pmix4x/openpmix/src/util/Makefile.include @@ -53,7 +53,8 @@ headers += \ util/pif.h \ util/parse_options.h \ util/context_fns.h \ - util/pmix_pty.h + util/pmix_pty.h \ + util/few.h sources += \ util/alfg.c \ @@ -80,7 +81,8 @@ sources += \ util/pif.c \ util/parse_options.c \ util/context_fns.c \ - util/pmix_pty.c + util/pmix_pty.c \ + util/few.c libpmix_la_LIBADD += \ util/keyval/libpmixutilkeyval.la diff --git a/opal/mca/pmix/pmix4x/pmix/src/util/alfg.c b/opal/mca/pmix/pmix4x/openpmix/src/util/alfg.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/util/alfg.c rename to opal/mca/pmix/pmix4x/openpmix/src/util/alfg.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/util/alfg.h b/opal/mca/pmix/pmix4x/openpmix/src/util/alfg.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/util/alfg.h rename to opal/mca/pmix/pmix4x/openpmix/src/util/alfg.h diff --git a/opal/mca/pmix/pmix4x/pmix/src/util/argv.c b/opal/mca/pmix/pmix4x/openpmix/src/util/argv.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/util/argv.c rename to opal/mca/pmix/pmix4x/openpmix/src/util/argv.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/util/argv.h b/opal/mca/pmix/pmix4x/openpmix/src/util/argv.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/util/argv.h rename to opal/mca/pmix/pmix4x/openpmix/src/util/argv.h diff --git a/opal/mca/pmix/pmix4x/pmix/src/util/basename.c b/opal/mca/pmix/pmix4x/openpmix/src/util/basename.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/util/basename.c rename to opal/mca/pmix/pmix4x/openpmix/src/util/basename.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/util/basename.h b/opal/mca/pmix/pmix4x/openpmix/src/util/basename.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/util/basename.h rename to opal/mca/pmix/pmix4x/openpmix/src/util/basename.h diff --git a/opal/mca/pmix/pmix4x/pmix/src/util/cmd_line.c b/opal/mca/pmix/pmix4x/openpmix/src/util/cmd_line.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/util/cmd_line.c rename to opal/mca/pmix/pmix4x/openpmix/src/util/cmd_line.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/util/cmd_line.h b/opal/mca/pmix/pmix4x/openpmix/src/util/cmd_line.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/util/cmd_line.h rename to opal/mca/pmix/pmix4x/openpmix/src/util/cmd_line.h diff --git a/opal/mca/pmix/pmix4x/pmix/src/util/context_fns.c b/opal/mca/pmix/pmix4x/openpmix/src/util/context_fns.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/util/context_fns.c rename to opal/mca/pmix/pmix4x/openpmix/src/util/context_fns.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/util/context_fns.h b/opal/mca/pmix/pmix4x/openpmix/src/util/context_fns.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/util/context_fns.h rename to opal/mca/pmix/pmix4x/openpmix/src/util/context_fns.h diff --git a/opal/mca/pmix/pmix4x/pmix/src/util/crc.c b/opal/mca/pmix/pmix4x/openpmix/src/util/crc.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/util/crc.c rename to opal/mca/pmix/pmix4x/openpmix/src/util/crc.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/util/crc.h b/opal/mca/pmix/pmix4x/openpmix/src/util/crc.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/util/crc.h rename to opal/mca/pmix/pmix4x/openpmix/src/util/crc.h diff --git a/opal/mca/pmix/pmix4x/pmix/src/util/error.c b/opal/mca/pmix/pmix4x/openpmix/src/util/error.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/util/error.c rename to opal/mca/pmix/pmix4x/openpmix/src/util/error.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/util/error.h b/opal/mca/pmix/pmix4x/openpmix/src/util/error.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/util/error.h rename to opal/mca/pmix/pmix4x/openpmix/src/util/error.h diff --git a/opal/mca/pmix/pmix4x/pmix/src/util/fd.c b/opal/mca/pmix/pmix4x/openpmix/src/util/fd.c similarity index 94% rename from opal/mca/pmix/pmix4x/pmix/src/util/fd.c rename to opal/mca/pmix/pmix4x/openpmix/src/util/fd.c index c4f033f9da..f45a13a94e 100644 --- a/opal/mca/pmix/pmix4x/pmix/src/util/fd.c +++ b/opal/mca/pmix/pmix4x/openpmix/src/util/fd.c @@ -1,7 +1,7 @@ /* * Copyright (c) 2008-2014 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2009 Sandia National Laboratories. All rights reserved. - * Copyright (c) 2014-2018 Intel, Inc. All rights reserved. + * Copyright (c) 2014-2019 Intel, Inc. All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. * $COPYRIGHT$ @@ -104,6 +104,7 @@ pmix_status_t pmix_fd_set_cloexec(int fd) bool pmix_fd_is_regular(int fd) { struct stat buf; + /* coverity[toctou] */ if (fstat(fd, &buf)) { return false; } @@ -113,6 +114,7 @@ bool pmix_fd_is_regular(int fd) bool pmix_fd_is_chardev(int fd) { struct stat buf; + /* coverity[toctou] */ if (fstat(fd, &buf)) { return false; } @@ -122,6 +124,7 @@ bool pmix_fd_is_chardev(int fd) bool pmix_fd_is_blkdev(int fd) { struct stat buf; + /* coverity[toctou] */ if (fstat(fd, &buf)) { return false; } diff --git a/opal/mca/pmix/pmix4x/pmix/src/util/fd.h b/opal/mca/pmix/pmix4x/openpmix/src/util/fd.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/util/fd.h rename to opal/mca/pmix/pmix4x/openpmix/src/util/fd.h diff --git a/opal/mca/pmix/pmix4x/openpmix/src/util/few.c b/opal/mca/pmix/pmix4x/openpmix/src/util/few.c new file mode 100644 index 0000000000..c41b49c493 --- /dev/null +++ b/opal/mca/pmix/pmix4x/openpmix/src/util/few.c @@ -0,0 +1,84 @@ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2005 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, + * University of Stuttgart. All rights reserved. + * Copyright (c) 2004-2005 The Regents of the University of California. + * All rights reserved. + * Copyright (c) 2019 Intel, Inc. All rights reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + + +#include "pmix_config.h" + +#include +#include +#ifdef HAVE_SYS_WAIT_H +#include +#endif +#include +#ifdef HAVE_UNISTD_H +#include +#endif + +#include "src/util/few.h" +#include "src/util/basename.h" +#include "src/util/argv.h" +#include "pmix_common.h" + +int pmix_few(char *argv[], int *status) +{ +#if defined(HAVE_FORK) && defined(HAVE_EXECVE) && defined(HAVE_WAITPID) + pid_t pid, ret; + + if ((pid = fork()) < 0) { + return PMIX_ERROR; + } + + /* Child execs. If it fails to exec, exit. */ + + else if (0 == pid) { + execvp(argv[0], argv); + exit(errno); + } + + /* Parent loops waiting for the child to die. */ + + else { + do { + /* If the child exited, return */ + + if (pid == (ret = waitpid(pid, status, 0))) { + break; + } + + /* If waitpid was interrupted, loop around again */ + + else if (ret < 0) { + if (EINTR == errno) { + continue; + } + + /* Otherwise, some bad juju happened -- need to quit */ + + return PMIX_ERROR; + } + } while (true); + } + + /* Return the status to the caller */ + + return PMIX_SUCCESS; +#else + return PMIX_ERR_NOT_SUPPORTED; +#endif +} diff --git a/opal/mca/pmix/pmix4x/openpmix/src/util/few.h b/opal/mca/pmix/pmix4x/openpmix/src/util/few.h new file mode 100644 index 0000000000..ec73cedbd3 --- /dev/null +++ b/opal/mca/pmix/pmix4x/openpmix/src/util/few.h @@ -0,0 +1,62 @@ +/* + * Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2005 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, + * University of Stuttgart. All rights reserved. + * Copyright (c) 2004-2005 The Regents of the University of California. + * All rights reserved. + * Copyright (c) 2019 Intel, Inc. All rights reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +#ifndef PMIX_FEW_H +#define PMIX_FEW_H + +#include "pmix_config.h" + +#include "pmix_common.h" + +BEGIN_C_DECLS + +/** + * Forks, execs, and waits for a subordinate program + * + * @param argv Null-terminated argument vector; argv[0] is the program + * (same as arguments to execvp()) + * + * @param status Upon success, will be filled with the return status + * from waitpid(2). The WIF* macros can be used to examine the value + * (see waitpid(2)). + * + * @retval PMIX_SUCCESS If the child launched and exited. + * @retval PMIX_ERROR If a failure occurred, errno should be + * examined for the specific error. + * + * This function forks, execs, and waits for an executable to + * complete. The input argv must be a NULL-terminated array (perhaps + * built with the pmix_arr_*() interface). Upon success, PMIX_SUCCESS + * is returned. This function will wait either until the child + * process has exited or waitpid() returns an error other than EINTR. + * + * Note that a return of PMIX_SUCCESS does \em not imply that the child + * process exited successfully -- it simply indicates that the child + * process exited. The WIF* macros (see waitpid(2)) should be used to + * examine the status to see hold the child exited. + * + * \warning This function should not be called if \c orte_init() + * or \c MPI_Init() have been called. This function is not + * safe in a multi-threaded environment in which a handler + * for \c SIGCHLD has been registered. + */ +PMIX_EXPORT pmix_status_t pmix_few(char *argv[], int *status); + +END_C_DECLS +#endif /* PMIX_FEW_H */ diff --git a/opal/mca/pmix/pmix4x/pmix/src/util/getid.c b/opal/mca/pmix/pmix4x/openpmix/src/util/getid.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/util/getid.c rename to opal/mca/pmix/pmix4x/openpmix/src/util/getid.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/util/getid.h b/opal/mca/pmix/pmix4x/openpmix/src/util/getid.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/util/getid.h rename to opal/mca/pmix/pmix4x/openpmix/src/util/getid.h diff --git a/opal/mca/pmix/pmix4x/pmix/src/util/hash.c b/opal/mca/pmix/pmix4x/openpmix/src/util/hash.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/util/hash.c rename to opal/mca/pmix/pmix4x/openpmix/src/util/hash.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/util/hash.h b/opal/mca/pmix/pmix4x/openpmix/src/util/hash.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/util/hash.h rename to opal/mca/pmix/pmix4x/openpmix/src/util/hash.h diff --git a/opal/mca/pmix/pmix4x/pmix/src/util/keyval/Makefile.am b/opal/mca/pmix/pmix4x/openpmix/src/util/keyval/Makefile.am similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/util/keyval/Makefile.am rename to opal/mca/pmix/pmix4x/openpmix/src/util/keyval/Makefile.am diff --git a/opal/mca/pmix/pmix4x/pmix/src/util/keyval/keyval_lex.h b/opal/mca/pmix/pmix4x/openpmix/src/util/keyval/keyval_lex.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/util/keyval/keyval_lex.h rename to opal/mca/pmix/pmix4x/openpmix/src/util/keyval/keyval_lex.h diff --git a/opal/mca/pmix/pmix4x/pmix/src/util/keyval/keyval_lex.l b/opal/mca/pmix/pmix4x/openpmix/src/util/keyval/keyval_lex.l similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/util/keyval/keyval_lex.l rename to opal/mca/pmix/pmix4x/openpmix/src/util/keyval/keyval_lex.l diff --git a/opal/mca/pmix/pmix4x/pmix/src/util/keyval_parse.c b/opal/mca/pmix/pmix4x/openpmix/src/util/keyval_parse.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/util/keyval_parse.c rename to opal/mca/pmix/pmix4x/openpmix/src/util/keyval_parse.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/util/keyval_parse.h b/opal/mca/pmix/pmix4x/openpmix/src/util/keyval_parse.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/util/keyval_parse.h rename to opal/mca/pmix/pmix4x/openpmix/src/util/keyval_parse.h diff --git a/opal/mca/pmix/pmix4x/pmix/src/util/name_fns.c b/opal/mca/pmix/pmix4x/openpmix/src/util/name_fns.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/util/name_fns.c rename to opal/mca/pmix/pmix4x/openpmix/src/util/name_fns.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/util/name_fns.h b/opal/mca/pmix/pmix4x/openpmix/src/util/name_fns.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/util/name_fns.h rename to opal/mca/pmix/pmix4x/openpmix/src/util/name_fns.h diff --git a/opal/mca/pmix/pmix4x/pmix/src/util/net.c b/opal/mca/pmix/pmix4x/openpmix/src/util/net.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/util/net.c rename to opal/mca/pmix/pmix4x/openpmix/src/util/net.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/util/net.h b/opal/mca/pmix/pmix4x/openpmix/src/util/net.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/util/net.h rename to opal/mca/pmix/pmix4x/openpmix/src/util/net.h diff --git a/opal/mca/pmix/pmix4x/pmix/src/util/os_dirpath.c b/opal/mca/pmix/pmix4x/openpmix/src/util/os_dirpath.c similarity index 98% rename from opal/mca/pmix/pmix4x/pmix/src/util/os_dirpath.c rename to opal/mca/pmix/pmix4x/openpmix/src/util/os_dirpath.c index c77bc5bb92..e31a3242c0 100644 --- a/opal/mca/pmix/pmix4x/pmix/src/util/os_dirpath.c +++ b/opal/mca/pmix/pmix4x/openpmix/src/util/os_dirpath.c @@ -59,6 +59,7 @@ int pmix_os_dirpath_create(const char *path, const mode_t mode) return(PMIX_ERR_BAD_PARAM); } + /* coverity[toctou] */ if (0 == (ret = stat(path, &buf))) { /* already exists */ if (mode == (mode & buf.st_mode)) { /* has correct mode */ return(PMIX_SUCCESS); @@ -116,6 +117,7 @@ int pmix_os_dirpath_create(const char *path, const mode_t mode) /* Now that we have the name, try to create it */ mkdir(tmp, mode); ret = errno; // save the errno for an error msg, if needed + /* coverity[toctou] */ if (0 != stat(tmp, &buf)) { pmix_show_help("help-pmix-util.txt", "mkdir-failed", true, tmp, strerror(ret)); @@ -193,6 +195,7 @@ int pmix_os_dirpath_destroy(const char *path, */ filenm = pmix_os_path(false, path, ep->d_name, NULL); + /* coverity[toctou] */ rc = stat(filenm, &buf); if (0 > rc) { /* Handle a race condition. filenm might have been deleted by an @@ -298,6 +301,7 @@ int pmix_os_dirpath_access(const char *path, const mode_t in_mode ) { loc_mode = in_mode; } + /* coverity[toctou] */ if (0 == stat(path, &buf)) { /* exists - check access */ if ((buf.st_mode & loc_mode) == loc_mode) { /* okay, I can work here */ return(PMIX_SUCCESS); diff --git a/opal/mca/pmix/pmix4x/pmix/src/util/os_dirpath.h b/opal/mca/pmix/pmix4x/openpmix/src/util/os_dirpath.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/util/os_dirpath.h rename to opal/mca/pmix/pmix4x/openpmix/src/util/os_dirpath.h diff --git a/opal/mca/pmix/pmix4x/pmix/src/util/os_path.c b/opal/mca/pmix/pmix4x/openpmix/src/util/os_path.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/util/os_path.c rename to opal/mca/pmix/pmix4x/openpmix/src/util/os_path.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/util/os_path.h b/opal/mca/pmix/pmix4x/openpmix/src/util/os_path.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/util/os_path.h rename to opal/mca/pmix/pmix4x/openpmix/src/util/os_path.h diff --git a/opal/mca/pmix/pmix4x/pmix/src/util/output.c b/opal/mca/pmix/pmix4x/openpmix/src/util/output.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/util/output.c rename to opal/mca/pmix/pmix4x/openpmix/src/util/output.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/util/output.h b/opal/mca/pmix/pmix4x/openpmix/src/util/output.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/util/output.h rename to opal/mca/pmix/pmix4x/openpmix/src/util/output.h diff --git a/opal/mca/pmix/pmix4x/pmix/src/util/parse_options.c b/opal/mca/pmix/pmix4x/openpmix/src/util/parse_options.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/util/parse_options.c rename to opal/mca/pmix/pmix4x/openpmix/src/util/parse_options.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/util/parse_options.h b/opal/mca/pmix/pmix4x/openpmix/src/util/parse_options.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/util/parse_options.h rename to opal/mca/pmix/pmix4x/openpmix/src/util/parse_options.h diff --git a/opal/mca/pmix/pmix4x/pmix/src/util/path.c b/opal/mca/pmix/pmix4x/openpmix/src/util/path.c similarity index 99% rename from opal/mca/pmix/pmix4x/pmix/src/util/path.c rename to opal/mca/pmix/pmix4x/openpmix/src/util/path.c index 8705759c3b..27565e695f 100644 --- a/opal/mca/pmix/pmix4x/pmix/src/util/path.c +++ b/opal/mca/pmix/pmix4x/openpmix/src/util/path.c @@ -13,7 +13,7 @@ * Copyright (c) 2010 IBM Corporation. All rights reserved. * Copyright (c) 2012-2013 Los Alamos National Security, LLC. * All rights reserved. - * Copyright (c) 2014-2017 Intel, Inc. All rights reserved. + * Copyright (c) 2014-2019 Intel, Inc. All rights reserved. * Copyright (c) 2016 University of Houston. All rights reserved. * Copyright (c) 2018 Research Organization for Information Science * and Technology (RIST). All rights reserved. @@ -245,6 +245,7 @@ char *pmix_path_access(char *fname, char *path, int mode) /* first check to see - is this a file or a directory? We * only want files */ + /* coverity[toctou] */ if (0 != stat(fullpath, &buf)) { /* couldn't stat the path - obviously, this also meets the * existence check, if that was requested diff --git a/opal/mca/pmix/pmix4x/pmix/src/util/path.h b/opal/mca/pmix/pmix4x/openpmix/src/util/path.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/util/path.h rename to opal/mca/pmix/pmix4x/openpmix/src/util/path.h diff --git a/opal/mca/pmix/pmix4x/pmix/src/util/pif.c b/opal/mca/pmix/pmix4x/openpmix/src/util/pif.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/util/pif.c rename to opal/mca/pmix/pmix4x/openpmix/src/util/pif.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/util/pif.h b/opal/mca/pmix/pmix4x/openpmix/src/util/pif.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/util/pif.h rename to opal/mca/pmix/pmix4x/openpmix/src/util/pif.h diff --git a/opal/mca/pmix/pmix4x/pmix/src/util/pmix_environ.c b/opal/mca/pmix/pmix4x/openpmix/src/util/pmix_environ.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/util/pmix_environ.c rename to opal/mca/pmix/pmix4x/openpmix/src/util/pmix_environ.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/util/pmix_environ.h b/opal/mca/pmix/pmix4x/openpmix/src/util/pmix_environ.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/util/pmix_environ.h rename to opal/mca/pmix/pmix4x/openpmix/src/util/pmix_environ.h diff --git a/opal/mca/pmix/pmix4x/pmix/src/util/pmix_pty.c b/opal/mca/pmix/pmix4x/openpmix/src/util/pmix_pty.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/util/pmix_pty.c rename to opal/mca/pmix/pmix4x/openpmix/src/util/pmix_pty.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/util/pmix_pty.h b/opal/mca/pmix/pmix4x/openpmix/src/util/pmix_pty.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/util/pmix_pty.h rename to opal/mca/pmix/pmix4x/openpmix/src/util/pmix_pty.h diff --git a/opal/mca/pmix/pmix4x/pmix/src/util/printf.c b/opal/mca/pmix/pmix4x/openpmix/src/util/printf.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/util/printf.c rename to opal/mca/pmix/pmix4x/openpmix/src/util/printf.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/util/printf.h b/opal/mca/pmix/pmix4x/openpmix/src/util/printf.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/util/printf.h rename to opal/mca/pmix/pmix4x/openpmix/src/util/printf.h diff --git a/opal/mca/pmix/pmix4x/pmix/src/util/show_help.c b/opal/mca/pmix/pmix4x/openpmix/src/util/show_help.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/util/show_help.c rename to opal/mca/pmix/pmix4x/openpmix/src/util/show_help.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/util/show_help.h b/opal/mca/pmix/pmix4x/openpmix/src/util/show_help.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/util/show_help.h rename to opal/mca/pmix/pmix4x/openpmix/src/util/show_help.h diff --git a/opal/mca/pmix/pmix4x/pmix/src/util/show_help_lex.h b/opal/mca/pmix/pmix4x/openpmix/src/util/show_help_lex.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/util/show_help_lex.h rename to opal/mca/pmix/pmix4x/openpmix/src/util/show_help_lex.h diff --git a/opal/mca/pmix/pmix4x/pmix/src/util/show_help_lex.l b/opal/mca/pmix/pmix4x/openpmix/src/util/show_help_lex.l similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/util/show_help_lex.l rename to opal/mca/pmix/pmix4x/openpmix/src/util/show_help_lex.l diff --git a/opal/mca/pmix/pmix4x/pmix/src/util/strnlen.h b/opal/mca/pmix/pmix4x/openpmix/src/util/strnlen.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/util/strnlen.h rename to opal/mca/pmix/pmix4x/openpmix/src/util/strnlen.h diff --git a/opal/mca/pmix/pmix4x/pmix/src/util/timings.c b/opal/mca/pmix/pmix4x/openpmix/src/util/timings.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/util/timings.c rename to opal/mca/pmix/pmix4x/openpmix/src/util/timings.c diff --git a/opal/mca/pmix/pmix4x/pmix/src/util/timings.h b/opal/mca/pmix/pmix4x/openpmix/src/util/timings.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/src/util/timings.h rename to opal/mca/pmix/pmix4x/openpmix/src/util/timings.h diff --git a/opal/mca/pmix/pmix4x/pmix/test/Makefile.am b/opal/mca/pmix/pmix4x/openpmix/test/Makefile.am similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/test/Makefile.am rename to opal/mca/pmix/pmix4x/openpmix/test/Makefile.am diff --git a/opal/mca/pmix/pmix4x/pmix/test/README b/opal/mca/pmix/pmix4x/openpmix/test/README similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/test/README rename to opal/mca/pmix/pmix4x/openpmix/test/README diff --git a/opal/mca/pmix/pmix4x/pmix/test/cli_stages.c b/opal/mca/pmix/pmix4x/openpmix/test/cli_stages.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/test/cli_stages.c rename to opal/mca/pmix/pmix4x/openpmix/test/cli_stages.c diff --git a/opal/mca/pmix/pmix4x/pmix/test/cli_stages.h b/opal/mca/pmix/pmix4x/openpmix/test/cli_stages.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/test/cli_stages.h rename to opal/mca/pmix/pmix4x/openpmix/test/cli_stages.h diff --git a/opal/mca/pmix/pmix4x/pmix/test/pmi2_client.c b/opal/mca/pmix/pmix4x/openpmix/test/pmi2_client.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/test/pmi2_client.c rename to opal/mca/pmix/pmix4x/openpmix/test/pmi2_client.c diff --git a/opal/mca/pmix/pmix4x/pmix/test/pmi_client.c b/opal/mca/pmix/pmix4x/openpmix/test/pmi_client.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/test/pmi_client.c rename to opal/mca/pmix/pmix4x/openpmix/test/pmi_client.c diff --git a/opal/mca/pmix/pmix4x/pmix/test/pmix_client.c b/opal/mca/pmix/pmix4x/openpmix/test/pmix_client.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/test/pmix_client.c rename to opal/mca/pmix/pmix4x/openpmix/test/pmix_client.c diff --git a/opal/mca/pmix/pmix4x/pmix/test/pmix_client_otheruser.sh b/opal/mca/pmix/pmix4x/openpmix/test/pmix_client_otheruser.sh similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/test/pmix_client_otheruser.sh rename to opal/mca/pmix/pmix4x/openpmix/test/pmix_client_otheruser.sh diff --git a/opal/mca/pmix/pmix4x/pmix/test/pmix_regex.c b/opal/mca/pmix/pmix4x/openpmix/test/pmix_regex.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/test/pmix_regex.c rename to opal/mca/pmix/pmix4x/openpmix/test/pmix_regex.c diff --git a/opal/mca/pmix/pmix4x/pmix/test/pmix_test.c b/opal/mca/pmix/pmix4x/openpmix/test/pmix_test.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/test/pmix_test.c rename to opal/mca/pmix/pmix4x/openpmix/test/pmix_test.c diff --git a/opal/mca/pmix/pmix4x/pmix/test/python/Makefile.am b/opal/mca/pmix/pmix4x/openpmix/test/python/Makefile.am similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/test/python/Makefile.am rename to opal/mca/pmix/pmix4x/openpmix/test/python/Makefile.am diff --git a/opal/mca/pmix/pmix4x/pmix/test/python/run_sched.sh.in b/opal/mca/pmix/pmix4x/openpmix/test/python/run_sched.sh.in similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/test/python/run_sched.sh.in rename to opal/mca/pmix/pmix4x/openpmix/test/python/run_sched.sh.in diff --git a/opal/mca/pmix/pmix4x/pmix/test/python/run_server.sh.in b/opal/mca/pmix/pmix4x/openpmix/test/python/run_server.sh.in similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/test/python/run_server.sh.in rename to opal/mca/pmix/pmix4x/openpmix/test/python/run_server.sh.in diff --git a/opal/mca/pmix/pmix4x/pmix/test/run_tests00.pl.in b/opal/mca/pmix/pmix4x/openpmix/test/run_tests00.pl.in similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/test/run_tests00.pl.in rename to opal/mca/pmix/pmix4x/openpmix/test/run_tests00.pl.in diff --git a/opal/mca/pmix/pmix4x/pmix/test/run_tests01.pl.in b/opal/mca/pmix/pmix4x/openpmix/test/run_tests01.pl.in similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/test/run_tests01.pl.in rename to opal/mca/pmix/pmix4x/openpmix/test/run_tests01.pl.in diff --git a/opal/mca/pmix/pmix4x/pmix/test/run_tests02.pl.in b/opal/mca/pmix/pmix4x/openpmix/test/run_tests02.pl.in similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/test/run_tests02.pl.in rename to opal/mca/pmix/pmix4x/openpmix/test/run_tests02.pl.in diff --git a/opal/mca/pmix/pmix4x/pmix/test/run_tests03.pl.in b/opal/mca/pmix/pmix4x/openpmix/test/run_tests03.pl.in similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/test/run_tests03.pl.in rename to opal/mca/pmix/pmix4x/openpmix/test/run_tests03.pl.in diff --git a/opal/mca/pmix/pmix4x/pmix/test/run_tests04.pl.in b/opal/mca/pmix/pmix4x/openpmix/test/run_tests04.pl.in similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/test/run_tests04.pl.in rename to opal/mca/pmix/pmix4x/openpmix/test/run_tests04.pl.in diff --git a/opal/mca/pmix/pmix4x/pmix/test/run_tests05.pl.in b/opal/mca/pmix/pmix4x/openpmix/test/run_tests05.pl.in similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/test/run_tests05.pl.in rename to opal/mca/pmix/pmix4x/openpmix/test/run_tests05.pl.in diff --git a/opal/mca/pmix/pmix4x/pmix/test/run_tests06.pl.in b/opal/mca/pmix/pmix4x/openpmix/test/run_tests06.pl.in similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/test/run_tests06.pl.in rename to opal/mca/pmix/pmix4x/openpmix/test/run_tests06.pl.in diff --git a/opal/mca/pmix/pmix4x/pmix/test/run_tests07.pl.in b/opal/mca/pmix/pmix4x/openpmix/test/run_tests07.pl.in similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/test/run_tests07.pl.in rename to opal/mca/pmix/pmix4x/openpmix/test/run_tests07.pl.in diff --git a/opal/mca/pmix/pmix4x/pmix/test/run_tests08.pl.in b/opal/mca/pmix/pmix4x/openpmix/test/run_tests08.pl.in similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/test/run_tests08.pl.in rename to opal/mca/pmix/pmix4x/openpmix/test/run_tests08.pl.in diff --git a/opal/mca/pmix/pmix4x/pmix/test/run_tests09.pl.in b/opal/mca/pmix/pmix4x/openpmix/test/run_tests09.pl.in similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/test/run_tests09.pl.in rename to opal/mca/pmix/pmix4x/openpmix/test/run_tests09.pl.in diff --git a/opal/mca/pmix/pmix4x/pmix/test/run_tests10.pl.in b/opal/mca/pmix/pmix4x/openpmix/test/run_tests10.pl.in similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/test/run_tests10.pl.in rename to opal/mca/pmix/pmix4x/openpmix/test/run_tests10.pl.in diff --git a/opal/mca/pmix/pmix4x/pmix/test/run_tests11.pl.in b/opal/mca/pmix/pmix4x/openpmix/test/run_tests11.pl.in similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/test/run_tests11.pl.in rename to opal/mca/pmix/pmix4x/openpmix/test/run_tests11.pl.in diff --git a/opal/mca/pmix/pmix4x/pmix/test/run_tests12.pl.in b/opal/mca/pmix/pmix4x/openpmix/test/run_tests12.pl.in similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/test/run_tests12.pl.in rename to opal/mca/pmix/pmix4x/openpmix/test/run_tests12.pl.in diff --git a/opal/mca/pmix/pmix4x/pmix/test/run_tests13.pl.in b/opal/mca/pmix/pmix4x/openpmix/test/run_tests13.pl.in similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/test/run_tests13.pl.in rename to opal/mca/pmix/pmix4x/openpmix/test/run_tests13.pl.in diff --git a/opal/mca/pmix/pmix4x/pmix/test/run_tests14.pl.in b/opal/mca/pmix/pmix4x/openpmix/test/run_tests14.pl.in similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/test/run_tests14.pl.in rename to opal/mca/pmix/pmix4x/openpmix/test/run_tests14.pl.in diff --git a/opal/mca/pmix/pmix4x/pmix/test/run_tests15.pl.in b/opal/mca/pmix/pmix4x/openpmix/test/run_tests15.pl.in similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/test/run_tests15.pl.in rename to opal/mca/pmix/pmix4x/openpmix/test/run_tests15.pl.in diff --git a/opal/mca/pmix/pmix4x/pmix/test/server_callbacks.c b/opal/mca/pmix/pmix4x/openpmix/test/server_callbacks.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/test/server_callbacks.c rename to opal/mca/pmix/pmix4x/openpmix/test/server_callbacks.c diff --git a/opal/mca/pmix/pmix4x/pmix/test/server_callbacks.h b/opal/mca/pmix/pmix4x/openpmix/test/server_callbacks.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/test/server_callbacks.h rename to opal/mca/pmix/pmix4x/openpmix/test/server_callbacks.h diff --git a/opal/mca/pmix/pmix4x/pmix/test/simple/Makefile.am b/opal/mca/pmix/pmix4x/openpmix/test/simple/Makefile.am similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/test/simple/Makefile.am rename to opal/mca/pmix/pmix4x/openpmix/test/simple/Makefile.am diff --git a/opal/mca/pmix/pmix4x/pmix/test/simple/gwclient.c b/opal/mca/pmix/pmix4x/openpmix/test/simple/gwclient.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/test/simple/gwclient.c rename to opal/mca/pmix/pmix4x/openpmix/test/simple/gwclient.c diff --git a/opal/mca/pmix/pmix4x/pmix/test/simple/gwtest.c b/opal/mca/pmix/pmix4x/openpmix/test/simple/gwtest.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/test/simple/gwtest.c rename to opal/mca/pmix/pmix4x/openpmix/test/simple/gwtest.c diff --git a/opal/mca/pmix/pmix4x/pmix/test/simple/quietclient.c b/opal/mca/pmix/pmix4x/openpmix/test/simple/quietclient.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/test/simple/quietclient.c rename to opal/mca/pmix/pmix4x/openpmix/test/simple/quietclient.c diff --git a/opal/mca/pmix/pmix4x/pmix/test/simple/simpclient.c b/opal/mca/pmix/pmix4x/openpmix/test/simple/simpclient.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/test/simple/simpclient.c rename to opal/mca/pmix/pmix4x/openpmix/test/simple/simpclient.c diff --git a/opal/mca/pmix/pmix4x/pmix/test/simple/simpcoord.c b/opal/mca/pmix/pmix4x/openpmix/test/simple/simpcoord.c similarity index 96% rename from opal/mca/pmix/pmix4x/pmix/test/simple/simpcoord.c rename to opal/mca/pmix/pmix4x/openpmix/test/simple/simpcoord.c index 448fb47a5c..96d0b25148 100644 --- a/opal/mca/pmix/pmix4x/pmix/test/simple/simpcoord.c +++ b/opal/mca/pmix/pmix4x/openpmix/test/simple/simpcoord.c @@ -101,6 +101,8 @@ int main(int argc, char **argv) u32 = (uint32_t*)val->data.darray->array; ninfo = val->data.darray->size; + /* print them out for diagnostics - someday we can figure + * out an automated way of testing the answer */ { char **foo = NULL; for (n=0; n < ninfo; n++) { @@ -122,6 +124,8 @@ int main(int argc, char **argv) } coords = (pmix_coord_t*)val->data.darray->array; ninfo = val->data.darray->size; + /* print them out for diagnostics - someday we can figure + * out an automated way of testing the answer */ for (m=0; m < ninfo; m++) { char **foo = NULL; char *view; diff --git a/opal/mca/pmix/pmix4x/pmix/test/simple/simpdie.c b/opal/mca/pmix/pmix4x/openpmix/test/simple/simpdie.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/test/simple/simpdie.c rename to opal/mca/pmix/pmix4x/openpmix/test/simple/simpdie.c diff --git a/opal/mca/pmix/pmix4x/pmix/test/simple/simpdmodex.c b/opal/mca/pmix/pmix4x/openpmix/test/simple/simpdmodex.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/test/simple/simpdmodex.c rename to opal/mca/pmix/pmix4x/openpmix/test/simple/simpdmodex.c diff --git a/opal/mca/pmix/pmix4x/pmix/test/simple/simpdyn.c b/opal/mca/pmix/pmix4x/openpmix/test/simple/simpdyn.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/test/simple/simpdyn.c rename to opal/mca/pmix/pmix4x/openpmix/test/simple/simpdyn.c diff --git a/opal/mca/pmix/pmix4x/pmix/test/simple/simpft.c b/opal/mca/pmix/pmix4x/openpmix/test/simple/simpft.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/test/simple/simpft.c rename to opal/mca/pmix/pmix4x/openpmix/test/simple/simpft.c diff --git a/opal/mca/pmix/pmix4x/pmix/test/simple/simpio.c b/opal/mca/pmix/pmix4x/openpmix/test/simple/simpio.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/test/simple/simpio.c rename to opal/mca/pmix/pmix4x/openpmix/test/simple/simpio.c diff --git a/opal/mca/pmix/pmix4x/pmix/test/simple/simpjctrl.c b/opal/mca/pmix/pmix4x/openpmix/test/simple/simpjctrl.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/test/simple/simpjctrl.c rename to opal/mca/pmix/pmix4x/openpmix/test/simple/simpjctrl.c diff --git a/opal/mca/pmix/pmix4x/pmix/test/simple/simplegacy.c b/opal/mca/pmix/pmix4x/openpmix/test/simple/simplegacy.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/test/simple/simplegacy.c rename to opal/mca/pmix/pmix4x/openpmix/test/simple/simplegacy.c diff --git a/opal/mca/pmix/pmix4x/pmix/test/simple/simppub.c b/opal/mca/pmix/pmix4x/openpmix/test/simple/simppub.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/test/simple/simppub.c rename to opal/mca/pmix/pmix4x/openpmix/test/simple/simppub.c diff --git a/opal/mca/pmix/pmix4x/pmix/test/simple/simpsched.c b/opal/mca/pmix/pmix4x/openpmix/test/simple/simpsched.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/test/simple/simpsched.c rename to opal/mca/pmix/pmix4x/openpmix/test/simple/simpsched.c diff --git a/opal/mca/pmix/pmix4x/pmix/test/simple/simptest.c b/opal/mca/pmix/pmix4x/openpmix/test/simple/simptest.c similarity index 99% rename from opal/mca/pmix/pmix4x/pmix/test/simple/simptest.c rename to opal/mca/pmix/pmix4x/openpmix/test/simple/simptest.c index 10785bfa41..c9378b8643 100644 --- a/opal/mca/pmix/pmix4x/pmix/test/simple/simptest.c +++ b/opal/mca/pmix/pmix4x/openpmix/test/simple/simptest.c @@ -200,6 +200,7 @@ static bool istimeouttest = false; static mylock_t globallock; static bool nettest = false; static bool arrays = false; +static bool model = false; static void set_namespace(int nprocs, char *ranks, char *nspace, pmix_op_cbfunc_t cbfunc, myxfer_t *x); @@ -442,6 +443,10 @@ int main(int argc, char **argv) 0 == strcmp("--arrays", argv[n])) { /* test network support */ arrays = true; + } else if (0 == strcmp("-model", argv[n]) || + 0 == strcmp("--model", argv[n])) { + /* test network support */ + model = true; } } if (NULL == executable) { @@ -580,6 +585,11 @@ int main(int argc, char **argv) pmix_argv_free(atmp); x = PMIX_NEW(myxfer_t); set_namespace(nprocs, tmp, "foobar", opcbfunc, x); + /* if the nspace registration hasn't completed yet, + * wait for it here */ + DEBUG_WAIT_THREAD(&x->lock); + free(tmp); + PMIX_RELEASE(x); /* set common argv and env */ client_env = pmix_argv_copy(environ); @@ -604,11 +614,6 @@ int main(int argc, char **argv) } DEBUG_DESTRUCT_LOCK(&mylock); - /* if the nspace registration hasn't completed yet, - * wait for it here */ - DEBUG_WAIT_THREAD(&x->lock); - free(tmp); - PMIX_RELEASE(x); /* fork/exec the test */ (void)strncpy(proc.nspace, "foobar", PMIX_MAX_NSLEN); @@ -773,6 +778,9 @@ static void set_namespace(int nprocs, char *ranks, char *nspace, } else { x->ninfo = 16 + nprocs; } + if (model) { + x->ninfo++; + } PMIX_INFO_CREATE(x->info, x->ninfo); @@ -928,6 +936,13 @@ static void set_namespace(int nprocs, char *ranks, char *nspace, x->info[n].value.data.uint32 = 0; ++n; + if (model) { + (void)strncpy(x->info[n].key, PMIX_PROGRAMMING_MODEL, PMIX_MAX_KEYLEN); + x->info[n].value.type = PMIX_STRING; + x->info[n].value.data.string = strdup("ompi"); + ++n; + } + /* add the proc-specific data */ for (m=0; m < nprocs; m++) { (void)strncpy(x->info[n].key, PMIX_PROC_DATA, PMIX_MAX_KEYLEN); diff --git a/opal/mca/pmix/pmix4x/pmix/test/simple/simptimeout.c b/opal/mca/pmix/pmix4x/openpmix/test/simple/simptimeout.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/test/simple/simptimeout.c rename to opal/mca/pmix/pmix4x/openpmix/test/simple/simptimeout.c diff --git a/opal/mca/pmix/pmix4x/pmix/test/simple/simptool.c b/opal/mca/pmix/pmix4x/openpmix/test/simple/simptool.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/test/simple/simptool.c rename to opal/mca/pmix/pmix4x/openpmix/test/simple/simptool.c diff --git a/opal/mca/pmix/pmix4x/pmix/test/simple/stability.c b/opal/mca/pmix/pmix4x/openpmix/test/simple/stability.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/test/simple/stability.c rename to opal/mca/pmix/pmix4x/openpmix/test/simple/stability.c diff --git a/opal/mca/pmix/pmix4x/pmix/test/simple/test_pmix.c b/opal/mca/pmix/pmix4x/openpmix/test/simple/test_pmix.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/test/simple/test_pmix.c rename to opal/mca/pmix/pmix4x/openpmix/test/simple/test_pmix.c diff --git a/opal/mca/pmix/pmix4x/pmix/test/test_cd.c b/opal/mca/pmix/pmix4x/openpmix/test/test_cd.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/test/test_cd.c rename to opal/mca/pmix/pmix4x/openpmix/test/test_cd.c diff --git a/opal/mca/pmix/pmix4x/pmix/test/test_cd.h b/opal/mca/pmix/pmix4x/openpmix/test/test_cd.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/test/test_cd.h rename to opal/mca/pmix/pmix4x/openpmix/test/test_cd.h diff --git a/opal/mca/pmix/pmix4x/pmix/test/test_common.c b/opal/mca/pmix/pmix4x/openpmix/test/test_common.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/test/test_common.c rename to opal/mca/pmix/pmix4x/openpmix/test/test_common.c diff --git a/opal/mca/pmix/pmix4x/pmix/test/test_common.h b/opal/mca/pmix/pmix4x/openpmix/test/test_common.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/test/test_common.h rename to opal/mca/pmix/pmix4x/openpmix/test/test_common.h diff --git a/opal/mca/pmix/pmix4x/pmix/test/test_error.c b/opal/mca/pmix/pmix4x/openpmix/test/test_error.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/test/test_error.c rename to opal/mca/pmix/pmix4x/openpmix/test/test_error.c diff --git a/opal/mca/pmix/pmix4x/pmix/test/test_error.h b/opal/mca/pmix/pmix4x/openpmix/test/test_error.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/test/test_error.h rename to opal/mca/pmix/pmix4x/openpmix/test/test_error.h diff --git a/opal/mca/pmix/pmix4x/pmix/test/test_fence.c b/opal/mca/pmix/pmix4x/openpmix/test/test_fence.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/test/test_fence.c rename to opal/mca/pmix/pmix4x/openpmix/test/test_fence.c diff --git a/opal/mca/pmix/pmix4x/pmix/test/test_fence.h b/opal/mca/pmix/pmix4x/openpmix/test/test_fence.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/test/test_fence.h rename to opal/mca/pmix/pmix4x/openpmix/test/test_fence.h diff --git a/opal/mca/pmix/pmix4x/pmix/test/test_internal.c b/opal/mca/pmix/pmix4x/openpmix/test/test_internal.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/test/test_internal.c rename to opal/mca/pmix/pmix4x/openpmix/test/test_internal.c diff --git a/opal/mca/pmix/pmix4x/pmix/test/test_internal.h b/opal/mca/pmix/pmix4x/openpmix/test/test_internal.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/test/test_internal.h rename to opal/mca/pmix/pmix4x/openpmix/test/test_internal.h diff --git a/opal/mca/pmix/pmix4x/pmix/test/test_publish.c b/opal/mca/pmix/pmix4x/openpmix/test/test_publish.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/test/test_publish.c rename to opal/mca/pmix/pmix4x/openpmix/test/test_publish.c diff --git a/opal/mca/pmix/pmix4x/pmix/test/test_publish.h b/opal/mca/pmix/pmix4x/openpmix/test/test_publish.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/test/test_publish.h rename to opal/mca/pmix/pmix4x/openpmix/test/test_publish.h diff --git a/opal/mca/pmix/pmix4x/pmix/test/test_replace.c b/opal/mca/pmix/pmix4x/openpmix/test/test_replace.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/test/test_replace.c rename to opal/mca/pmix/pmix4x/openpmix/test/test_replace.c diff --git a/opal/mca/pmix/pmix4x/pmix/test/test_replace.h b/opal/mca/pmix/pmix4x/openpmix/test/test_replace.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/test/test_replace.h rename to opal/mca/pmix/pmix4x/openpmix/test/test_replace.h diff --git a/opal/mca/pmix/pmix4x/pmix/test/test_resolve_peers.c b/opal/mca/pmix/pmix4x/openpmix/test/test_resolve_peers.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/test/test_resolve_peers.c rename to opal/mca/pmix/pmix4x/openpmix/test/test_resolve_peers.c diff --git a/opal/mca/pmix/pmix4x/pmix/test/test_resolve_peers.h b/opal/mca/pmix/pmix4x/openpmix/test/test_resolve_peers.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/test/test_resolve_peers.h rename to opal/mca/pmix/pmix4x/openpmix/test/test_resolve_peers.h diff --git a/opal/mca/pmix/pmix4x/pmix/test/test_server.c b/opal/mca/pmix/pmix4x/openpmix/test/test_server.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/test/test_server.c rename to opal/mca/pmix/pmix4x/openpmix/test/test_server.c diff --git a/opal/mca/pmix/pmix4x/pmix/test/test_server.h b/opal/mca/pmix/pmix4x/openpmix/test/test_server.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/test/test_server.h rename to opal/mca/pmix/pmix4x/openpmix/test/test_server.h diff --git a/opal/mca/pmix/pmix4x/pmix/test/test_spawn.c b/opal/mca/pmix/pmix4x/openpmix/test/test_spawn.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/test/test_spawn.c rename to opal/mca/pmix/pmix4x/openpmix/test/test_spawn.c diff --git a/opal/mca/pmix/pmix4x/pmix/test/test_spawn.h b/opal/mca/pmix/pmix4x/openpmix/test/test_spawn.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/test/test_spawn.h rename to opal/mca/pmix/pmix4x/openpmix/test/test_spawn.h diff --git a/opal/mca/pmix/pmix4x/pmix/test/utils.c b/opal/mca/pmix/pmix4x/openpmix/test/utils.c similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/test/utils.c rename to opal/mca/pmix/pmix4x/openpmix/test/utils.c diff --git a/opal/mca/pmix/pmix4x/pmix/test/utils.h b/opal/mca/pmix/pmix4x/openpmix/test/utils.h similarity index 100% rename from opal/mca/pmix/pmix4x/pmix/test/utils.h rename to opal/mca/pmix/pmix4x/openpmix/test/utils.h diff --git a/opal/mca/pmix/pmix4x/pmix/examples/dmodex.c b/opal/mca/pmix/pmix4x/pmix/examples/dmodex.c deleted file mode 100644 index c7b906b158..0000000000 --- a/opal/mca/pmix/pmix4x/pmix/examples/dmodex.c +++ /dev/null @@ -1,228 +0,0 @@ -/* - * Copyright (c) 2004-2010 The Trustees of Indiana University and Indiana - * University Research and Technology - * Corporation. All rights reserved. - * Copyright (c) 2004-2011 The University of Tennessee and The University - * of Tennessee Research Foundation. All rights - * reserved. - * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, - * University of Stuttgart. All rights reserved. - * Copyright (c) 2004-2005 The Regents of the University of California. - * All rights reserved. - * Copyright (c) 2006-2013 Los Alamos National Security, LLC. - * All rights reserved. - * Copyright (c) 2009-2012 Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2011 Oak Ridge National Labs. All rights reserved. - * Copyright (c) 2013-2019 Intel, Inc. All rights reserved. - * Copyright (c) 2015 Mellanox Technologies, Inc. All rights reserved. - * $COPYRIGHT$ - * - * Additional copyrights may follow - * - * $HEADER$ - * - */ - -#include - -#define _GNU_SOURCE -#include - -#include -#include -#include - -#include -#include "examples.h" - -static uint32_t nprocs; -static pmix_proc_t myproc; -static uint32_t getcount = 0; - -static void opcbfunc(pmix_status_t status, void *cbdata) -{ - mylock_t *lock = (mylock_t*)cbdata; - - fprintf(stderr, "%s:%d completed fence_nb\n", myproc.nspace, myproc.rank); - lock->status = status; - DEBUG_WAKEUP_THREAD(lock); -} - -static void valcbfunc(pmix_status_t status, - pmix_value_t *val, void *cbdata) -{ - char *key = (char*)cbdata; - - if (PMIX_SUCCESS == status) { - if (NULL != strstr(key, "local")) { - if (PMIX_UINT64 != val->type) { - fprintf(stderr, "%s:%d: PMIx_Get_nb Key %s returned wrong type: %d\n", myproc.nspace, myproc.rank, key, val->type); - goto done; - } - if (1234 != val->data.uint64) { - fprintf(stderr, "%s:%d: PMIx_Get_nb Key %s returned wrong value: %d\n", myproc.nspace, myproc.rank, key, (int)val->data.uint64); - goto done; - } - } else if (NULL != strstr(key, "remote")) { - if (PMIX_STRING != val->type) { - fprintf(stderr, "%s:%d: PMIx_Get_nb Key %s returned wrong type: %d\n", myproc.nspace, myproc.rank, key, val->type); - goto done; - } - if (0 != strcmp(val->data.string, "1234")) { - fprintf(stderr, "%s:%d: PMIx_Get_nb Key %s returned wrong value: %s\n", myproc.nspace, myproc.rank, key, val->data.string); - goto done; - } - } else { - fprintf(stderr, "%s:%d PMIx_Get_nb returned wrong key: %s\n", myproc.nspace, myproc.rank, key); - goto done; - } - fprintf(stderr, "%s:%d PMIx_Get_nb Key %s returned correctly\n", myproc.nspace, myproc.rank, key); - } else { - fprintf(stderr, "%s:%d PMIx_Get_nb Key %s failed\n", myproc.nspace, myproc.rank, key); - } - done: - free(key); - getcount++; -} - -int main(int argc, char **argv) -{ - int rc; - pmix_value_t value; - pmix_value_t *val = &value; - char *tmp; - pmix_proc_t proc; - uint32_t n, num_gets; - mylock_t mylock; - - /* init us */ - if (PMIX_SUCCESS != (rc = PMIx_Init(&myproc, NULL, 0))) { - fprintf(stderr, "Client ns %s rank %d: PMIx_Init failed: %d\n", myproc.nspace, myproc.rank, rc); - exit(0); - } - fprintf(stderr, "Client ns %s rank %d: Running\n", myproc.nspace, myproc.rank); - - /* get our universe size */ - PMIX_PROC_CONSTRUCT(&proc); - (void)strncpy(proc.nspace, myproc.nspace, PMIX_MAX_NSLEN); - proc.rank = PMIX_RANK_WILDCARD; - if (PMIX_SUCCESS != (rc = PMIx_Get(&proc, PMIX_UNIV_SIZE, NULL, 0, &val))) { - fprintf(stderr, "Client ns %s rank %d: PMIx_Get universe size failed: %d\n", myproc.nspace, myproc.rank, rc); - goto done; - } - nprocs = val->data.uint32; - PMIX_VALUE_RELEASE(val); - fprintf(stderr, "Client %s:%d universe size %d\n", myproc.nspace, myproc.rank, nprocs); - - /* put a few values */ - if (0 > asprintf(&tmp, "%s-%d-internal", myproc.nspace, myproc.rank)) { - exit(1); - } - value.type = PMIX_UINT32; - value.data.uint32 = 1234; - if (PMIX_SUCCESS != (rc = PMIx_Store_internal(&myproc, tmp, &value))) { - fprintf(stderr, "Client ns %s rank %d: PMIx_Store_internal failed: %d\n", myproc.nspace, myproc.rank, rc); - goto done; - } - free(tmp); - - if (0 > asprintf(&tmp, "%s-%d-local", myproc.nspace, myproc.rank)) { - exit(1); - } - value.type = PMIX_UINT64; - value.data.uint64 = 1234; - if (PMIX_SUCCESS != (rc = PMIx_Put(PMIX_LOCAL, tmp, &value))) { - fprintf(stderr, "Client ns %s rank %d: PMIx_Put internal failed: %d\n", myproc.nspace, myproc.rank, rc); - goto done; - } - free(tmp); - - if (0 > asprintf(&tmp, "%s-%d-remote", myproc.nspace, myproc.rank)) { - exit(1); - } - value.type = PMIX_STRING; - value.data.string = "1234"; - if (PMIX_SUCCESS != (rc = PMIx_Put(PMIX_REMOTE, tmp, &value))) { - fprintf(stderr, "Client ns %s rank %d: PMIx_Put internal failed: %d\n", myproc.nspace, myproc.rank, rc); - goto done; - } - free(tmp); - - /* introduce a delay by one rank so we can check what happens - * if a "get" is received prior to data being provided */ - - if (0 == myproc.rank) { - sleep(2); - } - - /* commit the data to the server */ - if (PMIX_SUCCESS != (rc = PMIx_Commit())) { - fprintf(stderr, "Client ns %s rank %d: PMIx_Commit failed: %d\n", myproc.nspace, myproc.rank, rc); - goto done; - } - - /* call fence_nb, but don't return any data */ - PMIX_PROC_CONSTRUCT(&proc); - (void)strncpy(proc.nspace, myproc.nspace, PMIX_MAX_NSLEN); - proc.rank = PMIX_RANK_WILDCARD; - DEBUG_CONSTRUCT_LOCK(&mylock); - if (PMIX_SUCCESS != (rc = PMIx_Fence_nb(&proc, 1, NULL, 0, opcbfunc, &mylock))) { - fprintf(stderr, "Client ns %s rank %d: PMIx_Fence failed: %d\n", myproc.nspace, myproc.rank, rc); - DEBUG_DESTRUCT_LOCK(&mylock); - goto done; - } - - /* get the committed data - ask for someone who doesn't exist as well */ - num_gets = 0; - for (n=0; n <= nprocs; n++) { - if (0 > asprintf(&tmp, "%s-%d-local", myproc.nspace, n)) { - exit(1); - } - proc.rank = n; - if (PMIX_SUCCESS != (rc = PMIx_Get_nb(&proc, tmp, - NULL, 0, valcbfunc, tmp))) { - fprintf(stderr, "Client ns %s rank %d: PMIx_Get %s failed: %d\n", myproc.nspace, n, tmp, rc); - goto done; - } - ++num_gets; - if (0 > asprintf(&tmp, "%s-%d-remote", myproc.nspace, n)) { - exit(1); - } - if (PMIX_SUCCESS != (rc = PMIx_Get_nb(&proc, tmp, - NULL, 0, valcbfunc, tmp))) { - fprintf(stderr, "Client ns %s rank %d: PMIx_Get %s failed: %d\n", myproc.nspace, n, tmp, rc); - goto done; - } - ++num_gets; - } - - /* wait for the first fence to finish */ - DEBUG_WAIT_THREAD(&mylock); - - /* wait for all my "get" calls to complete */ - while (getcount < num_gets) { - struct timespec ts; - ts.tv_sec = 0; - ts.tv_nsec = 100000; - nanosleep(&ts, NULL); - } - - /* call fence again so everyone waits before leaving */ - (void)strncpy(proc.nspace, myproc.nspace, PMIX_MAX_NSLEN); - proc.rank = PMIX_RANK_WILDCARD; - if (PMIX_SUCCESS != (rc = PMIx_Fence(&proc, 1, NULL, 0))) { - fprintf(stderr, "Client ns %s rank %d: PMIx_Fence failed: %d\n", myproc.nspace, myproc.rank, rc); - goto done; - } - - done: - /* finalize us */ - fprintf(stderr, "Client ns %s rank %d: Finalizing", myproc.nspace, myproc.rank); - if (PMIX_SUCCESS != (rc = PMIx_Finalize(NULL, 0))) { - fprintf(stderr, "Client ns %s rank %d:PMIx_Finalize failed: %d\n", myproc.nspace, myproc.rank, rc); - } else { - fprintf(stderr, "Client ns %s rank %d:PMIx_Finalize successfully completed\n", myproc.nspace, myproc.rank); - } - fflush(stderr); - return(0); -} diff --git a/opal/mca/pmix/pmix4x/pmix/src/mca/preg/base/preg_base_stubs.c b/opal/mca/pmix/pmix4x/pmix/src/mca/preg/base/preg_base_stubs.c deleted file mode 100644 index b40ab6d12b..0000000000 --- a/opal/mca/pmix/pmix4x/pmix/src/mca/preg/base/preg_base_stubs.c +++ /dev/null @@ -1,329 +0,0 @@ -/* - * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana - * University Research and Technology - * Corporation. All rights reserved. - * Copyright (c) 2004-2006 The University of Tennessee and The University - * of Tennessee Research Foundation. All rights - * reserved. - * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, - * University of Stuttgart. All rights reserved. - * Copyright (c) 2004-2005 The Regents of the University of California. - * All rights reserved. - * Copyright (c) 2015-2019 Intel, Inc. All rights reserved. - * $COPYRIGHT$ - * - * Additional copyrights may follow - * - * $HEADER$ - */ - -#include - -#include -#ifdef HAVE_UNISTD_H -#include -#endif - -#include "src/util/argv.h" -#include "src/util/error.h" -#include "src/include/pmix_globals.h" -#include "src/client/pmix_client_ops.h" -#include "src/mca/preg/base/base.h" - -pmix_status_t pmix_preg_base_generate_node_regex(const char *input, - char **regex) -{ - pmix_preg_base_active_module_t *active; - - PMIX_LIST_FOREACH(active, &pmix_preg_globals.actives, pmix_preg_base_active_module_t) { - if (NULL != active->module->generate_node_regex) { - if (PMIX_SUCCESS == active->module->generate_node_regex(input, regex)) { - return PMIX_SUCCESS; - } - } - } - - return PMIX_ERR_NOT_SUPPORTED; -} - -pmix_status_t pmix_preg_base_generate_ppn(const char *input, - char **ppn) -{ - pmix_preg_base_active_module_t *active; - - PMIX_LIST_FOREACH(active, &pmix_preg_globals.actives, pmix_preg_base_active_module_t) { - if (NULL != active->module->generate_ppn) { - if (PMIX_SUCCESS == active->module->generate_ppn(input, ppn)) { - return PMIX_SUCCESS; - } - } - } - - return PMIX_ERR_NOT_SUPPORTED; -} - -pmix_status_t pmix_preg_base_parse_nodes(const char *regexp, - char ***names) -{ - pmix_preg_base_active_module_t *active; - - PMIX_LIST_FOREACH(active, &pmix_preg_globals.actives, pmix_preg_base_active_module_t) { - if (NULL != active->module->parse_nodes) { - if (PMIX_SUCCESS == active->module->parse_nodes(regexp, names)) { - return PMIX_SUCCESS; - } - } - } - - return PMIX_ERR_NOT_SUPPORTED; -} - -pmix_status_t pmix_preg_base_parse_procs(const char *regexp, - char ***procs) -{ - pmix_preg_base_active_module_t *active; - - PMIX_LIST_FOREACH(active, &pmix_preg_globals.actives, pmix_preg_base_active_module_t) { - if (NULL != active->module->parse_procs) { - if (PMIX_SUCCESS == active->module->parse_procs(regexp, procs)) { - return PMIX_SUCCESS; - } - } - } - - return PMIX_ERR_NOT_SUPPORTED; -} - -pmix_status_t pmix_preg_base_resolve_peers(const char *nodename, - const char *nspace, - pmix_proc_t **procs, size_t *nprocs) -{ - pmix_preg_base_active_module_t *active; - - PMIX_LIST_FOREACH(active, &pmix_preg_globals.actives, pmix_preg_base_active_module_t) { - if (NULL != active->module->resolve_peers) { - if (PMIX_SUCCESS == active->module->resolve_peers(nodename, nspace, procs, nprocs)) { - return PMIX_SUCCESS; - } - } - } - - return PMIX_ERR_NOT_SUPPORTED; -} - -pmix_status_t pmix_preg_base_resolve_nodes(const char *nspace, - char **nodelist) -{ - pmix_preg_base_active_module_t *active; - - PMIX_LIST_FOREACH(active, &pmix_preg_globals.actives, pmix_preg_base_active_module_t) { - if (NULL != active->module->resolve_nodes) { - if (PMIX_SUCCESS == active->module->resolve_nodes(nspace, nodelist)) { - return PMIX_SUCCESS; - } - } - } - - return PMIX_ERR_NOT_SUPPORTED; -} - -pmix_status_t pmix_preg_base_copy(char **dest, size_t *len, const char *input) -{ - pmix_preg_base_active_module_t *active; - - PMIX_LIST_FOREACH(active, &pmix_preg_globals.actives, pmix_preg_base_active_module_t) { - if (NULL != active->module->copy) { - if (PMIX_SUCCESS == active->module->copy(dest, len, input)) { - return PMIX_SUCCESS; - } - } - } - - return PMIX_ERR_NOT_SUPPORTED; -} - -pmix_status_t pmix_preg_base_pack(pmix_buffer_t *buffer, const char *input) -{ - pmix_preg_base_active_module_t *active; - - PMIX_LIST_FOREACH(active, &pmix_preg_globals.actives, pmix_preg_base_active_module_t) { - if (NULL != active->module->pack) { - if (PMIX_SUCCESS == active->module->pack(buffer, input)) { - return PMIX_SUCCESS; - } - } - } - - return PMIX_ERR_NOT_SUPPORTED; -} - -pmix_status_t pmix_preg_base_unpack(pmix_buffer_t *buffer, char **regex) -{ - pmix_preg_base_active_module_t *active; - - PMIX_LIST_FOREACH(active, &pmix_preg_globals.actives, pmix_preg_base_active_module_t) { - if (NULL != active->module->unpack) { - if (PMIX_SUCCESS == active->module->unpack(buffer, regex)) { - return PMIX_SUCCESS; - } - } - } - - return PMIX_ERR_NOT_SUPPORTED; -} - -pmix_status_t pmix_preg_base_std_resolve_peers(const char *nodename, - const char *nspace, - pmix_proc_t **procs, size_t *nprocs) -{ - pmix_cb_t cb; - pmix_status_t rc; - pmix_kval_t *kv; - pmix_proc_t proc; - char **ptr; - pmix_info_t *info; - pmix_proc_t *p=NULL; - size_t ninfo, np=0, n, j; - - PMIX_CONSTRUCT(&cb, pmix_cb_t); - - cb.key = strdup(nodename); - /* this data isn't going anywhere, so we don't require a copy */ - cb.copy = false; - /* scope is irrelevant as the info we seek must be local */ - cb.scope = PMIX_SCOPE_UNDEF; - /* let the proc point to the nspace */ - pmix_strncpy(proc.nspace, nspace, PMIX_MAX_NSLEN); - proc.rank = PMIX_RANK_WILDCARD; - cb.proc = &proc; - - PMIX_GDS_FETCH_KV(rc, pmix_client_globals.myserver, &cb); - if (PMIX_SUCCESS != rc) { - if (PMIX_ERR_INVALID_NAMESPACE != rc) { - PMIX_ERROR_LOG(rc); - } - goto complete; - } - /* should just be the one value on the list */ - if (1 != pmix_list_get_size(&cb.kvs)) { - PMIX_ERROR_LOG(PMIX_ERR_BAD_PARAM); - rc = PMIX_ERR_BAD_PARAM; - goto complete; - } - kv = (pmix_kval_t*)pmix_list_get_first(&cb.kvs); - /* the hostname used as a key with wildcard rank will return - * a pmix_data_array_t of pmix_info_t structs */ - if (NULL == kv->value || - PMIX_DATA_ARRAY != kv->value->type || - NULL == kv->value->data.darray || - PMIX_INFO != kv->value->data.darray->type) { - PMIX_ERROR_LOG(PMIX_ERR_DATA_VALUE_NOT_FOUND); - rc = PMIX_ERR_DATA_VALUE_NOT_FOUND; - goto complete; - } - info = (pmix_info_t*)kv->value->data.darray->array; - ninfo = kv->value->data.darray->size; - /* find the PMIX_LOCAL_PEERS key */ - for (n=0; n < ninfo; n++) { - if (0 == strncmp(info[n].key, PMIX_LOCAL_PEERS, PMIX_MAX_KEYLEN)) { - /* split the string */ - ptr = pmix_argv_split(info[n].value.data.string, ','); - np = pmix_argv_count(ptr); - PMIX_PROC_CREATE(p, np); - if (NULL == p) { - rc = PMIX_ERR_NOMEM; - pmix_argv_free(ptr); - goto complete; - } - for (j=0; j < np; j++) { - pmix_strncpy(p[j].nspace, nspace, PMIX_MAX_NSLEN); - p[j].rank = strtoul(ptr[j], NULL, 10); - } - rc = PMIX_SUCCESS; - pmix_argv_free(ptr); - break; - } - } - - complete: - if (NULL != cb.info) { - PMIX_INFO_FREE(cb.info, cb.ninfo); - } - if (NULL != cb.key) { - free(cb.key); - cb.key = NULL; - } - PMIX_DESTRUCT(&cb); - *procs = p; - *nprocs = np; - - return rc; -} - -pmix_status_t pmix_preg_base_std_resolve_nodes(const char *nspace, - char **nodelist) -{ - pmix_cb_t cb; - pmix_status_t rc; - pmix_kval_t *kv; - pmix_proc_t proc; - - PMIX_CONSTRUCT(&cb, pmix_cb_t); - - /* setup default answer */ - *nodelist = NULL; - - /* create a pmix_info_t so we can pass the nspace - * into the fetch as a qualifier */ - PMIX_INFO_CREATE(cb.info, 1); - if (NULL == cb.info) { - PMIX_DESTRUCT(&cb); - return PMIX_ERR_NOMEM; - } - cb.ninfo = 1; - PMIX_INFO_LOAD(&cb.info[0], PMIX_NSPACE, nspace, PMIX_STRING); - - /* tell the GDS what we want */ - cb.key = PMIX_NODE_MAP; - /* this data isn't going anywhere, so we don't require a copy */ - cb.copy = false; - /* scope is irrelevant as the info we seek must be local */ - cb.scope = PMIX_SCOPE_UNDEF; - /* put the nspace in the proc field */ - pmix_strncpy(proc.nspace, nspace, PMIX_MAX_NSLEN); - /* the info will be associated with PMIX_RANK_WILDCARD */ - proc.rank = PMIX_RANK_WILDCARD; - cb.proc = &proc; - - PMIX_GDS_FETCH_KV(rc, pmix_client_globals.myserver, &cb); - if (PMIX_SUCCESS != rc) { - PMIX_ERROR_LOG(rc); - goto complete; - } - /* should just be the one value on the list */ - if (1 != pmix_list_get_size(&cb.kvs)) { - PMIX_ERROR_LOG(PMIX_ERR_BAD_PARAM); - rc = PMIX_ERR_BAD_PARAM; - goto complete; - } - kv = (pmix_kval_t*)pmix_list_get_first(&cb.kvs); - /* the PMIX_NODE_MAP key is supposed to return - * a regex string - check that it did */ - if (NULL == kv->value || - PMIX_STRING != kv->value->type) { - PMIX_ERROR_LOG(PMIX_ERR_DATA_VALUE_NOT_FOUND); - rc = PMIX_ERR_DATA_VALUE_NOT_FOUND; - goto complete; - } - /* return the string */ - if (NULL != kv->value->data.string) { - *nodelist = strdup(kv->value->data.string); - } - - complete: - if (NULL != cb.info) { - PMIX_INFO_FREE(cb.info, cb.ninfo); - } - return rc; -} -