From 174e967dbc6062ddec51a0f7995686659f5c20b4 Mon Sep 17 00:00:00 2001 From: Gilles Gouaillardet Date: Thu, 12 Dec 2019 11:52:28 +0900 Subject: [PATCH] Remove ORTE project Will be replaced by PRRTE. Ensure that OMPI and OPAL layers build without reference to ORTE. Setup opal/pmix framework to be static. Remove support for all PMI-1 and PMI-2 libraries. Add support for "external" pmix component as well as internal v4 one. remove orte: misc fixes - UCX fixes - VPATH issue - oshmem fixes - remove useless definition - Add PRRTE submodule - Get autogen.pl to traverse PRRTE submodule - Remove stale orcm reference - Configure embedded PRRTE - Correctly pass the prefix to PRRTE - Correctly set the OMPI_WANT_PRRTE am_conditional - Move prrte configuration to the end of OMPI's configure.ac - Make mpirun a symlink to prun, when available - Fix makedist with --no-orte/--no-prrte option - Add a `--no-prrte` option which is the same as the legacy `--no-orte` option. - Remove embedded PMIx tarball. Replace it with new submodule pointing to OpenPMIx master repo's master branch - Some cleanup in PRRTE integration and add config summary entry - Correctly set the hostname - Fix locality - Fix singleton operations - Fix support for "tune" and "am" options Signed-off-by: Ralph Castain Signed-off-by: Gilles Gouaillardet Signed-off-by: Joshua Hursey --- .gitmodules | 8 + Makefile.am | 10 +- VERSION | 4 - autogen.pl | 47 +- autogen.subdirs | 1 + config/ompi_config_files.m4 | 1 + config/ompi_setup_prrte.m4 | 103 + config/opal_check_pmi.m4 | 332 +- config/orte_check_lsf.m4 | 144 - config/orte_check_moab.m4 | 91 - config/orte_check_sge.m4 | 59 - config/orte_check_slurm.m4 | 87 - config/orte_check_tm.m4 | 173 - config/orte_config_files.m4 | 32 - config/orte_configure_options.m4 | 57 - config/orte_setup_debugger_flags.m4 | 96 - configure.ac | 91 +- contrib/scaling/mpi_memprobe.c | 2 +- ompi/Makefile.am | 6 +- ompi/communicator/comm.c | 8 +- ompi/communicator/comm_cid.c | 36 +- ompi/communicator/comm_init.c | 6 +- ompi/debuggers/ompi_debuggers.c | 3 +- ompi/dpm/dpm.c | 304 +- ompi/errhandler/errhandler.c | 17 +- ompi/errhandler/errhandler.h | 13 +- ompi/errhandler/errhandler_predefined.c | 4 +- ompi/include/ompi/constants.h | 7 +- ompi/interlib/interlib.c | 124 +- ompi/mca/bml/r2/bml_r2_ft.c | 7 +- ompi/mca/coll/base/coll_base_find_available.c | 3 +- ompi/mca/coll/cuda/coll_cuda_module.c | 2 +- ompi/mca/coll/hcoll/coll_hcoll.h | 7 +- ompi/mca/coll/hcoll/coll_hcoll_rte.c | 6 +- ompi/mca/coll/sm/coll_sm_module.c | 4 +- ompi/mca/coll/sync/coll_sync_module.c | 4 +- ompi/mca/crcp/bkmrk/crcp_bkmrk_pml.c | 14 +- ompi/mca/io/romio321/src/Makefile.extra | 10 +- ompi/mca/mtl/ofi/mtl_ofi_compat.h | 7 +- ompi/mca/mtl/portals4/mtl_portals4.c | 4 +- .../mca/mtl/portals4/mtl_portals4_component.c | 6 +- ompi/mca/mtl/psm2/mtl_psm2.c | 6 +- ompi/mca/pml/base/pml_base_select.c | 6 +- ompi/mca/pml/ob1/pml_ob1.c | 19 +- ompi/mca/pml/ucx/pml_ucx.c | 13 +- ompi/mca/rte/Makefile.am | 27 - ompi/mca/rte/base/Makefile.am | 15 - ompi/mca/rte/base/base.h | 32 - ompi/mca/rte/base/rte_base_frame.c | 57 - ompi/mca/rte/configure.m4 | 34 - ompi/mca/rte/orte/Makefile.am | 76 - ompi/mca/rte/orte/configure.m4 | 52 - ompi/mca/rte/orte/rte_orte.h | 103 - ompi/mca/rte/orte/rte_orte_component.c | 80 - ompi/mca/rte/orte/rte_orte_module.c | 247 - ompi/mca/rte/pmix/Makefile.am | 29 - ompi/mca/rte/pmix/configure.m4 | 48 - ompi/mca/rte/pmix/rte_pmix.h | 147 - ompi/mca/rte/pmix/rte_pmix_component.c | 77 - .../topo_treematch_dist_graph_create.c | 8 +- .../pessimist/vprotocol_pessimist_eventlog.c | 32 +- ompi/mpi/c/lookup_name.c | 62 +- ompi/mpi/c/publish_name.c | 90 +- ompi/mpi/c/unpublish_name.c | 59 +- ompi/mpiext/affinity/c/mpiext_affinity_str.c | 4 +- ompi/patterns/net/allreduce.c | 3 +- ompi/patterns/net/netpatterns.h | 3 +- ompi/patterns/net/netpatterns_knomial_tree.c | 3 +- ompi/proc/proc.c | 23 +- ompi/proc/proc.h | 4 +- ompi/runtime/Makefile.am | 8 +- ompi/runtime/help-mpi-runtime.txt | 11 +- ompi/runtime/ompi_info_support.c | 22 +- ompi/runtime/ompi_mpi_finalize.c | 77 +- ompi/runtime/ompi_mpi_init.c | 140 +- ompi/runtime/ompi_mpi_params.c | 4 +- .../rte_pmix_module.c => runtime/ompi_rte.c} | 315 +- ompi/{mca/rte/rte.h => runtime/ompi_rte.h} | 153 +- ompi/tools/Makefile.am | 3 + ompi/tools/mpirun/Makefile.am | 21 + ompi/tools/mpisync/Makefile.am | 4 +- ompi/tools/ompi_info/Makefile.am | 4 +- ompi/tools/ompi_info/ompi_info.c | 11 +- ompi/tools/ompi_info/param.c | 17 +- opal/dss/dss_open_close.c | 8 +- opal/dss/dss_types.h | 3 +- opal/mca/btl/ofi/btl_ofi.h | 4 +- opal/mca/btl/ofi/btl_ofi_component.c | 4 +- opal/mca/btl/portals4/btl_portals4.c | 4 +- .../mca/btl/portals4/btl_portals4_component.c | 6 +- opal/mca/btl/smcuda/btl_smcuda.c | 6 +- opal/mca/btl/tcp/btl_tcp_component.c | 8 +- opal/mca/btl/tcp/btl_tcp_proc.c | 4 +- opal/mca/btl/uct/btl_uct.h | 3 +- opal/mca/btl/uct/btl_uct_component.c | 3 +- opal/mca/btl/ugni/btl_ugni_add_procs.c | 6 +- opal/mca/btl/ugni/btl_ugni_endpoint.c | 4 +- opal/mca/btl/ugni/btl_ugni_init.c | 6 +- opal/mca/btl/usnic/btl_usnic_compat.c | 4 +- opal/mca/btl/usnic/btl_usnic_compat.h | 4 +- opal/mca/btl/vader/btl_vader.h | 3 +- opal/mca/btl/vader/btl_vader_component.c | 8 +- opal/mca/btl/vader/btl_vader_module.c | 4 +- opal/mca/common/ucx/common_ucx.c | 9 +- opal/mca/common/ucx/common_ucx_wpool.c | 2 +- opal/mca/hwloc/base/hwloc_base_util.c | 112 +- opal/mca/pmix/Makefile.am | 10 +- opal/mca/pmix/autogen.options | 14 + opal/mca/pmix/base/Makefile.am | 10 +- opal/mca/pmix/base/base.h | 149 +- opal/mca/pmix/base/pmix_base_fns.c | 1313 ++--- opal/mca/pmix/base/pmix_base_fns.h | 40 - opal/mca/pmix/base/pmix_base_frame.c | 88 +- opal/mca/pmix/base/pmix_base_hash.c | 298 - opal/mca/pmix/base/pmix_base_hash.h | 37 - opal/mca/pmix/base/pmix_base_select.c | 61 - opal/mca/pmix/configure.m4 | 109 + opal/mca/pmix/cray/Makefile.am | 46 - opal/mca/pmix/cray/configure.m4 | 40 - opal/mca/pmix/cray/help-pmix-cray.txt | 17 - opal/mca/pmix/cray/owner.txt | 7 - opal/mca/pmix/cray/pmix_cray.c | 1065 ---- opal/mca/pmix/cray/pmix_cray.h | 55 - opal/mca/pmix/cray/pmix_cray_component.c | 144 - opal/mca/pmix/cray/pmix_cray_pmap_parser.c | 243 - opal/mca/pmix/cray/pmix_cray_pmap_parser.h | 18 - opal/mca/pmix/ext1x/Makefile.am | 50 - opal/mca/pmix/ext1x/configure.m4 | 68 - opal/mca/pmix/ext1x/pmix1x.c | 586 -- opal/mca/pmix/ext1x/pmix1x.h | 180 - opal/mca/pmix/ext1x/pmix1x_client.c | 1346 ----- opal/mca/pmix/ext1x/pmix1x_component.c | 141 - opal/mca/pmix/ext1x/pmix1x_server_north.c | 783 --- opal/mca/pmix/ext1x/pmix1x_server_south.c | 454 -- opal/mca/pmix/ext2x/Makefile.am | 53 - opal/mca/pmix/ext2x/common_sym_whitelist.txt | 6 - opal/mca/pmix/ext2x/configure.m4 | 63 - opal/mca/pmix/ext2x/ext2x.c | 1555 ------ opal/mca/pmix/ext2x/ext2x.h | 341 -- opal/mca/pmix/ext2x/ext2x_client.c | 1673 ------ opal/mca/pmix/ext2x/ext2x_component.c | 158 - opal/mca/pmix/ext2x/ext2x_local.c | 27 - opal/mca/pmix/ext2x/ext2x_server_north.c | 1264 ----- opal/mca/pmix/ext2x/ext2x_server_south.c | 572 -- opal/mca/pmix/ext2x/help-pmix-ext2x.txt | 32 - opal/mca/pmix/ext3x/Makefile.am | 51 - opal/mca/pmix/ext3x/common_sym_whitelist.txt | 6 - opal/mca/pmix/ext3x/configure.m4 | 63 - opal/mca/pmix/ext3x/ext3x.c | 1874 ------- opal/mca/pmix/ext3x/ext3x.h | 351 -- opal/mca/pmix/ext3x/ext3x_client.c | 1673 ------ opal/mca/pmix/ext3x/ext3x_component.c | 157 - opal/mca/pmix/ext3x/ext3x_local.c | 27 - opal/mca/pmix/ext3x/ext3x_server_north.c | 1339 ----- opal/mca/pmix/ext3x/ext3x_server_south.c | 799 --- opal/mca/pmix/ext3x/help-pmix-ext3x.txt | 32 - opal/mca/pmix/ext4x/Makefile.am | 73 - opal/mca/pmix/ext4x/common_sym_whitelist.txt | 6 - opal/mca/pmix/ext4x/configure.m4 | 63 - opal/mca/pmix/ext4x/ext4x_local.c | 27 - opal/mca/pmix/ext4x/help-pmix-ext4x.txt | 32 - opal/mca/pmix/external/Makefile.am | 29 + opal/mca/pmix/external/configure.m4 | 57 + opal/mca/pmix/external/external.h | 46 + .../alps => opal/mca/pmix/external}/owner.txt | 2 +- .../pmix/external/pmix_external_component.c | 65 + opal/mca/pmix/flux/Makefile.am | 40 - opal/mca/pmix/flux/configure.m4 | 63 - opal/mca/pmix/flux/owner.txt | 7 - opal/mca/pmix/flux/pmix_flux.c | 788 --- opal/mca/pmix/flux/pmix_flux.h | 31 - opal/mca/pmix/flux/pmix_flux_component.c | 104 - opal/mca/pmix/isolated/Makefile.am | 36 - opal/mca/pmix/isolated/pmix_isolated.c | 506 -- opal/mca/pmix/isolated/pmix_isolated.h | 28 - .../pmix/isolated/pmix_isolated_component.c | 87 - opal/mca/pmix/pmix-internal.h | 550 ++ opal/mca/pmix/pmix.h | 989 ---- opal/mca/pmix/pmix4x/Makefile.am | 41 +- opal/mca/pmix/pmix4x/configure.m4 | 46 +- opal/mca/pmix/pmix4x/help-pmix-pmix4x.txt | 32 - opal/mca/pmix/pmix4x/openpmix | 1 + opal/mca/pmix/pmix4x/openpmix/AUTHORS | 39 - opal/mca/pmix/pmix4x/openpmix/HACKING | 259 - opal/mca/pmix/pmix4x/openpmix/INSTALL | 105 - opal/mca/pmix/pmix4x/openpmix/LICENSE | 95 - opal/mca/pmix/pmix4x/openpmix/Makefile.am | 62 - .../pmix/pmix4x/openpmix/Makefile.pmix-rules | 37 - opal/mca/pmix/pmix4x/openpmix/NEWS | 655 --- opal/mca/pmix/pmix4x/openpmix/README | 341 -- opal/mca/pmix/pmix4x/openpmix/VERSION | 87 - opal/mca/pmix/pmix4x/openpmix/autogen.pl | 754 --- .../pmix/pmix4x/openpmix/bindings/Makefile.am | 22 - opal/mca/pmix/pmix4x/openpmix/bindings/README | 21 - .../openpmix/bindings/python/Makefile.am | 44 - .../pmix4x/openpmix/bindings/python/README | 49 - .../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/pmix4x/openpmix/config/Makefile.am | 51 - .../pmix4x/openpmix/config/c_get_alignment.m4 | 74 - .../pmix/pmix4x/openpmix/config/distscript.sh | 67 - opal/mca/pmix/pmix4x/openpmix/config/pmix.m4 | 1353 ----- .../openpmix/config/pmix_check_attributes.m4 | 560 -- .../config/pmix_check_broken_qsort.m4 | 55 - .../config/pmix_check_compiler_version.m4 | 131 - .../pmix4x/openpmix/config/pmix_check_icc.m4 | 63 - .../openpmix/config/pmix_check_ident.m4 | 103 - .../pmix4x/openpmix/config/pmix_check_lock.m4 | 62 - .../openpmix/config/pmix_check_os_flavors.m4 | 76 - .../openpmix/config/pmix_check_package.m4 | 215 - .../config/pmix_check_pthread_pids.m4 | 109 - .../openpmix/config/pmix_check_vendor.m4 | 252 - .../openpmix/config/pmix_check_visibility.m4 | 93 - .../openpmix/config/pmix_check_withdir.m4 | 39 - .../pmix4x/openpmix/config/pmix_config_asm.m4 | 1430 ----- .../openpmix/config/pmix_config_pthreads.m4 | 322 -- .../openpmix/config/pmix_config_subdir.m4 | 147 - .../config/pmix_config_subdir_args.m4 | 84 - .../openpmix/config/pmix_config_threads.m4 | 68 - .../config/pmix_ensure_contains_optflags.m4 | 67 - .../pmix4x/openpmix/config/pmix_functions.m4 | 670 --- .../openpmix/config/pmix_get_version.sh | 161 - .../openpmix/config/pmix_load_platform.m4 | 81 - .../pmix/pmix4x/openpmix/config/pmix_mca.m4 | 873 --- .../openpmix/config/pmix_mca_priority_sort.pl | 31 - .../openpmix/config/pmix_search_libs.m4 | 69 - .../openpmix/config/pmix_set_mca_prefix.m4 | 41 - .../pmix4x/openpmix/config/pmix_setup_cc.m4 | 512 -- .../pmix4x/openpmix/config/pmix_setup_cli.m4 | 40 - .../openpmix/config/pmix_setup_hwloc.m4 | 155 - .../openpmix/config/pmix_setup_libev.m4 | 99 - .../openpmix/config/pmix_setup_libevent.m4 | 172 - .../openpmix/config/pmix_setup_wrappers.m4 | 311 -- .../pmix4x/openpmix/config/pmix_summary.m4 | 79 - .../openpmix/config/pmix_try_assemble.m4 | 52 - opal/mca/pmix/pmix4x/openpmix/configure.ac | 298 - .../pmix/pmix4x/openpmix/contrib/Makefile.am | 38 - .../pmix/pmix4x/openpmix/contrib/buildrpm.sh | 288 - .../pmix4x/openpmix/contrib/make_dist_tarball | 422 -- .../pmix4x/openpmix/contrib/make_manpage.pl | 56 - .../openpmix/contrib/perf_tools/Makefile | 29 - .../contrib/perf_tools/Makefile.include | 36 - .../pmix4x/openpmix/contrib/perf_tools/README | 35 - .../pmix4x/openpmix/contrib/perf_tools/pmi.h | 29 - .../pmix4x/openpmix/contrib/perf_tools/pmi2.c | 191 - .../contrib/perf_tools/pmi2_pmap_parser.c | 244 - .../contrib/perf_tools/pmi2_pmap_parser.h | 24 - .../openpmix/contrib/perf_tools/pmi2_utils.c | 132 - .../openpmix/contrib/perf_tools/pmi2_utils.h | 11 - .../contrib/perf_tools/pmi_intra_perf.c | 540 -- .../pmix4x/openpmix/contrib/perf_tools/pmix.c | 331 -- .../pmix4x/openpmix/contrib/perf_tools/run.sh | 13 - .../openpmix/contrib/platform/optimized | 3 - .../pmix4x/openpmix/contrib/pmix-release.sh | 52 - .../openpmix/contrib/pmix-valgrind.supp | 46 - .../pmix/pmix4x/openpmix/contrib/pmix.spec | 701 --- .../pmix4x/openpmix/contrib/pmix_jenkins.sh | 391 -- .../openpmix/contrib/update-my-copyright.pl | 347 -- .../openpmix/contrib/whitespace-purge.sh | 25 - opal/mca/pmix/pmix4x/openpmix/etc/Makefile.am | 70 - .../pmix4x/openpmix/etc/pmix-mca-params.conf | 59 - .../pmix/pmix4x/openpmix/examples/Makefile.am | 95 - .../mca/pmix/pmix4x/openpmix/examples/alloc.c | 258 - .../pmix4x/openpmix/examples/asyncgroup.c | 312 -- .../pmix/pmix4x/openpmix/examples/client.c | 331 -- .../pmix/pmix4x/openpmix/examples/client2.c | 227 - .../pmix/pmix4x/openpmix/examples/debugger.c | 541 -- .../pmix/pmix4x/openpmix/examples/debuggerd.c | 232 - .../pmix/pmix4x/openpmix/examples/dmodex.c | 215 - .../pmix/pmix4x/openpmix/examples/dynamic.c | 158 - .../pmix/pmix4x/openpmix/examples/examples.h | 124 - .../mca/pmix/pmix4x/openpmix/examples/fault.c | 198 - .../mca/pmix/pmix4x/openpmix/examples/group.c | 214 - .../mca/pmix/pmix4x/openpmix/examples/jctrl.c | 232 - opal/mca/pmix/pmix4x/openpmix/examples/pub.c | 168 - opal/mca/pmix/pmix4x/openpmix/examples/pubi.c | 173 - .../pmix/pmix4x/openpmix/examples/server.c | 899 ---- opal/mca/pmix/pmix4x/openpmix/examples/tool.c | 369 -- .../pmix/pmix4x/openpmix/include/Makefile.am | 32 - opal/mca/pmix/pmix4x/openpmix/include/pmi.h | 832 --- opal/mca/pmix/pmix4x/openpmix/include/pmi2.h | 565 -- opal/mca/pmix/pmix4x/openpmix/include/pmix.h | 985 ---- .../pmix4x/openpmix/include/pmix_common.h.in | 2975 ---------- .../pmix4x/openpmix/include/pmix_extend.h | 114 - .../pmix4x/openpmix/include/pmix_rename.h.in | 618 --- .../pmix/pmix4x/openpmix/include/pmix_sched.h | 166 - .../pmix4x/openpmix/include/pmix_server.h | 815 --- .../pmix/pmix4x/openpmix/include/pmix_tool.h | 136 - .../pmix4x/openpmix/include/pmix_version.h.in | 25 - opal/mca/pmix/pmix4x/openpmix/src/Makefile.am | 117 - .../openpmix/src/atomics/sys/Makefile.include | 43 - .../openpmix/src/atomics/sys/architecture.h | 58 - .../src/atomics/sys/arm/Makefile.include | 24 - .../openpmix/src/atomics/sys/arm/atomic.h | 255 - .../openpmix/src/atomics/sys/arm/timer.h | 33 - .../src/atomics/sys/arm64/Makefile.include | 24 - .../openpmix/src/atomics/sys/arm64/atomic.h | 332 -- .../openpmix/src/atomics/sys/arm64/timer.h | 45 - .../pmix4x/openpmix/src/atomics/sys/atomic.h | 659 --- .../openpmix/src/atomics/sys/atomic_impl.h | 522 -- .../openpmix/src/atomics/sys/atomic_stdc.h | 270 - .../pmix4x/openpmix/src/atomics/sys/cma.h | 125 - .../atomics/sys/gcc_builtin/Makefile.include | 26 - .../src/atomics/sys/gcc_builtin/atomic.h | 263 - .../src/atomics/sys/ia32/Makefile.include | 24 - .../openpmix/src/atomics/sys/ia32/atomic.h | 168 - .../openpmix/src/atomics/sys/ia32/timer.h | 58 - .../src/atomics/sys/powerpc/Makefile.include | 24 - .../openpmix/src/atomics/sys/powerpc/atomic.h | 409 -- .../openpmix/src/atomics/sys/powerpc/timer.h | 52 - .../src/atomics/sys/sparcv9/Makefile.include | 24 - .../openpmix/src/atomics/sys/sparcv9/atomic.h | 203 - .../openpmix/src/atomics/sys/sparcv9/timer.h | 67 - .../atomics/sys/sync_builtin/Makefile.include | 24 - .../src/atomics/sys/sync_builtin/atomic.h | 166 - .../pmix4x/openpmix/src/atomics/sys/timer.h | 117 - .../src/atomics/sys/x86_64/Makefile.include | 26 - .../openpmix/src/atomics/sys/x86_64/atomic.h | 277 - .../openpmix/src/atomics/sys/x86_64/timer.h | 75 - .../openpmix/src/class/Makefile.include | 44 - .../pmix4x/openpmix/src/class/pmix_bitmap.c | 412 -- .../pmix4x/openpmix/src/class/pmix_bitmap.h | 259 - .../openpmix/src/class/pmix_hash_table.c | 796 --- .../openpmix/src/class/pmix_hash_table.h | 399 -- .../pmix4x/openpmix/src/class/pmix_hotel.c | 138 - .../pmix4x/openpmix/src/class/pmix_hotel.h | 369 -- .../pmix4x/openpmix/src/class/pmix_list.c | 259 - .../pmix4x/openpmix/src/class/pmix_list.h | 926 ---- .../pmix4x/openpmix/src/class/pmix_object.c | 226 - .../pmix4x/openpmix/src/class/pmix_object.h | 506 -- .../openpmix/src/class/pmix_pointer_array.c | 439 -- .../openpmix/src/class/pmix_pointer_array.h | 205 - .../openpmix/src/class/pmix_ring_buffer.c | 154 - .../openpmix/src/class/pmix_ring_buffer.h | 102 - .../openpmix/src/class/pmix_value_array.c | 66 - .../openpmix/src/class/pmix_value_array.h | 280 - .../openpmix/src/client/Makefile.include | 31 - .../pmix/pmix4x/openpmix/src/client/pmi1.c | 928 ---- .../pmix/pmix4x/openpmix/src/client/pmi2.c | 882 --- .../pmix4x/openpmix/src/client/pmix_client.c | 1472 ----- .../openpmix/src/client/pmix_client_connect.c | 427 -- .../openpmix/src/client/pmix_client_fence.c | 285 - .../openpmix/src/client/pmix_client_get.c | 790 --- .../openpmix/src/client/pmix_client_group.c | 1129 ---- .../openpmix/src/client/pmix_client_ops.h | 61 - .../openpmix/src/client/pmix_client_pub.c | 674 --- .../openpmix/src/client/pmix_client_spawn.c | 370 -- .../openpmix/src/common/Makefile.include | 24 - .../openpmix/src/common/pmix_attributes.c | 1148 ---- .../openpmix/src/common/pmix_attributes.h | 72 - .../pmix4x/openpmix/src/common/pmix_control.c | 466 -- .../pmix4x/openpmix/src/common/pmix_data.c | 282 - .../pmix4x/openpmix/src/common/pmix_iof.c | 1133 ---- .../pmix4x/openpmix/src/common/pmix_iof.h | 248 - .../pmix4x/openpmix/src/common/pmix_log.c | 278 - .../pmix4x/openpmix/src/common/pmix_query.c | 613 --- .../openpmix/src/common/pmix_security.c | 504 -- .../pmix4x/openpmix/src/common/pmix_strings.c | 276 - .../openpmix/src/event/Makefile.include | 16 - .../pmix4x/openpmix/src/event/pmix_event.h | 258 - .../src/event/pmix_event_notification.c | 1459 ----- .../src/event/pmix_event_registration.c | 1164 ---- .../openpmix/src/hwloc/Makefile.include | 15 - .../openpmix/src/hwloc/hwloc-internal.h | 60 - .../pmix/pmix4x/openpmix/src/hwloc/hwloc.c | 754 --- .../openpmix/src/include/Makefile.include | 52 - .../pmix/pmix4x/openpmix/src/include/align.h | 29 - .../pmix4x/openpmix/src/include/hash_string.h | 69 - .../openpmix/src/include/pmix_config_bottom.h | 577 -- .../openpmix/src/include/pmix_config_top.h | 40 - .../openpmix/src/include/pmix_globals.c | 615 --- .../openpmix/src/include/pmix_globals.h | 516 -- .../src/include/pmix_portable_platform.h | 401 -- .../openpmix/src/include/pmix_socket_errno.h | 26 - .../openpmix/src/include/pmix_stdatomic.h | 67 - .../pmix4x/openpmix/src/include/pmix_stdint.h | 130 - .../pmix4x/openpmix/src/include/prefetch.h | 39 - .../pmix/pmix4x/openpmix/src/include/types.h | 304 -- .../pmix4x/openpmix/src/mca/Makefile.include | 26 - .../pmix4x/openpmix/src/mca/base/Makefile.am | 68 - .../pmix/pmix4x/openpmix/src/mca/base/base.h | 256 - .../src/mca/base/help-pmix-mca-base.txt | 71 - .../src/mca/base/help-pmix-mca-var.txt | 140 - .../src/mca/base/pmix_mca_base_close.c | 68 - .../src/mca/base/pmix_mca_base_cmd_line.c | 241 - .../base/pmix_mca_base_component_compare.c | 151 - .../mca/base/pmix_mca_base_component_find.c | 389 -- .../base/pmix_mca_base_component_repository.c | 610 --- .../base/pmix_mca_base_component_repository.h | 144 - .../mca/base/pmix_mca_base_components_close.c | 94 - .../mca/base/pmix_mca_base_components_open.c | 164 - .../base/pmix_mca_base_components_register.c | 163 - .../base/pmix_mca_base_components_select.c | 147 - .../src/mca/base/pmix_mca_base_framework.c | 248 - .../src/mca/base/pmix_mca_base_framework.h | 246 - .../src/mca/base/pmix_mca_base_list.c | 65 - .../src/mca/base/pmix_mca_base_open.c | 287 - .../mca/base/pmix_mca_base_parse_paramfile.c | 85 - .../openpmix/src/mca/base/pmix_mca_base_var.c | 2335 -------- .../openpmix/src/mca/base/pmix_mca_base_var.h | 740 --- .../src/mca/base/pmix_mca_base_var_enum.c | 630 --- .../src/mca/base/pmix_mca_base_var_enum.h | 246 - .../src/mca/base/pmix_mca_base_var_group.c | 477 -- .../src/mca/base/pmix_mca_base_var_group.h | 173 - .../src/mca/base/pmix_mca_base_vari.h | 165 - .../openpmix/src/mca/bfrops/Makefile.am | 44 - .../src/mca/bfrops/base/Makefile.include | 37 - .../openpmix/src/mca/bfrops/base/base.h | 839 --- .../src/mca/bfrops/base/bfrop_base_copy.c | 1015 ---- .../src/mca/bfrops/base/bfrop_base_fns.c | 849 --- .../src/mca/bfrops/base/bfrop_base_frame.c | 204 - .../src/mca/bfrops/base/bfrop_base_pack.c | 1365 ----- .../src/mca/bfrops/base/bfrop_base_print.c | 1956 ------- .../src/mca/bfrops/base/bfrop_base_select.c | 128 - .../src/mca/bfrops/base/bfrop_base_stubs.c | 208 - .../src/mca/bfrops/base/bfrop_base_unpack.c | 1626 ------ .../pmix4x/openpmix/src/mca/bfrops/bfrops.h | 489 -- .../openpmix/src/mca/bfrops/bfrops_types.h | 153 - .../openpmix/src/mca/bfrops/v12/Makefile.am | 60 - .../openpmix/src/mca/bfrops/v12/bfrop_v12.c | 721 --- .../openpmix/src/mca/bfrops/v12/bfrop_v12.h | 35 - .../src/mca/bfrops/v12/bfrop_v12_component.c | 95 - .../pmix4x/openpmix/src/mca/bfrops/v12/copy.c | 492 -- .../openpmix/src/mca/bfrops/v12/internal.h | 500 -- .../pmix4x/openpmix/src/mca/bfrops/v12/pack.c | 1019 ---- .../openpmix/src/mca/bfrops/v12/print.c | 1082 ---- .../openpmix/src/mca/bfrops/v12/unpack.c | 1198 ----- .../openpmix/src/mca/bfrops/v20/Makefile.am | 60 - .../src/mca/bfrops/v20/bfrop_pmix20.c | 746 --- .../src/mca/bfrops/v20/bfrop_pmix20.h | 34 - .../mca/bfrops/v20/bfrop_pmix20_component.c | 99 - .../pmix4x/openpmix/src/mca/bfrops/v20/copy.c | 1524 ------ .../openpmix/src/mca/bfrops/v20/internal.h | 507 -- .../pmix4x/openpmix/src/mca/bfrops/v20/pack.c | 1100 ---- .../openpmix/src/mca/bfrops/v20/print.c | 1489 ----- .../openpmix/src/mca/bfrops/v20/unpack.c | 1476 ----- .../openpmix/src/mca/bfrops/v21/Makefile.am | 53 - .../src/mca/bfrops/v21/bfrop_pmix21.c | 686 --- .../src/mca/bfrops/v21/bfrop_pmix21.h | 34 - .../mca/bfrops/v21/bfrop_pmix21_component.c | 99 - .../openpmix/src/mca/bfrops/v3/Makefile.am | 53 - .../openpmix/src/mca/bfrops/v3/bfrop_pmix3.c | 703 --- .../openpmix/src/mca/bfrops/v3/bfrop_pmix3.h | 34 - .../src/mca/bfrops/v3/bfrop_pmix3_component.c | 99 - .../openpmix/src/mca/bfrops/v4/Makefile.am | 53 - .../openpmix/src/mca/bfrops/v4/bfrop_pmix4.c | 747 --- .../openpmix/src/mca/bfrops/v4/bfrop_pmix4.h | 34 - .../src/mca/bfrops/v4/bfrop_pmix4_component.c | 99 - .../openpmix/src/mca/common/Makefile.am | 25 - .../src/mca/common/dstore/Makefile.am | 59 - .../src/mca/common/dstore/configure.m4 | 17 - .../src/mca/common/dstore/dstore_base.c | 2849 ---------- .../src/mca/common/dstore/dstore_base.h | 139 - .../src/mca/common/dstore/dstore_common.h | 80 - .../src/mca/common/dstore/dstore_file.h | 161 - .../src/mca/common/dstore/dstore_segment.c | 307 -- .../src/mca/common/dstore/dstore_segment.h | 70 - .../pmix4x/openpmix/src/mca/gds/Makefile.am | 44 - .../src/mca/gds/base/Makefile.include | 32 - .../pmix4x/openpmix/src/mca/gds/base/base.h | 145 - .../openpmix/src/mca/gds/base/gds_base_fns.c | 391 -- .../src/mca/gds/base/gds_base_frame.c | 97 - .../src/mca/gds/base/gds_base_select.c | 133 - .../openpmix/src/mca/gds/ds12/Makefile.am | 73 - .../openpmix/src/mca/gds/ds12/gds_ds12_base.c | 170 - .../openpmix/src/mca/gds/ds12/gds_ds12_base.h | 21 - .../src/mca/gds/ds12/gds_ds12_component.c | 93 - .../openpmix/src/mca/gds/ds12/gds_ds12_file.c | 176 - .../openpmix/src/mca/gds/ds12/gds_ds12_file.h | 20 - .../openpmix/src/mca/gds/ds12/gds_ds12_lock.c | 25 - .../openpmix/src/mca/gds/ds12/gds_ds12_lock.h | 29 - .../src/mca/gds/ds12/gds_ds12_lock_fcntl.c | 233 - .../src/mca/gds/ds12/gds_ds12_lock_pthread.c | 274 - .../openpmix/src/mca/gds/ds12/gds_ds20_file.c | 166 - .../openpmix/src/mca/gds/ds21/Makefile.am | 65 - .../openpmix/src/mca/gds/ds21/gds_ds21_base.c | 176 - .../openpmix/src/mca/gds/ds21/gds_ds21_base.h | 21 - .../src/mca/gds/ds21/gds_ds21_component.c | 93 - .../openpmix/src/mca/gds/ds21/gds_ds21_file.c | 188 - .../openpmix/src/mca/gds/ds21/gds_ds21_file.h | 19 - .../openpmix/src/mca/gds/ds21/gds_ds21_lock.c | 25 - .../openpmix/src/mca/gds/ds21/gds_ds21_lock.h | 30 - .../src/mca/gds/ds21/gds_ds21_lock_pthread.c | 439 -- .../pmix/pmix4x/openpmix/src/mca/gds/gds.h | 455 -- .../openpmix/src/mca/gds/hash/Makefile.am | 59 - .../openpmix/src/mca/gds/hash/gds_hash.c | 2823 ---------- .../openpmix/src/mca/gds/hash/gds_hash.h | 27 - .../src/mca/gds/hash/gds_hash_component.c | 84 - opal/mca/pmix/pmix4x/openpmix/src/mca/mca.h | 324 -- .../openpmix/src/mca/pcompress/Makefile.am | 37 - .../src/mca/pcompress/base/Makefile.am | 19 - .../openpmix/src/mca/pcompress/base/base.h | 82 - .../mca/pcompress/base/pcompress_base_frame.c | 96 - .../pcompress/base/pcompress_base_select.c | 58 - .../openpmix/src/mca/pcompress/pcompress.h | 155 - .../src/mca/pcompress/zlib/Makefile.am | 45 - .../src/mca/pcompress/zlib/compress_zlib.c | 165 - .../src/mca/pcompress/zlib/compress_zlib.h | 55 - .../pcompress/zlib/compress_zlib_component.c | 88 - .../src/mca/pcompress/zlib/configure.m4 | 102 - .../pmix4x/openpmix/src/mca/pdl/Makefile.am | 36 - .../openpmix/src/mca/pdl/base/Makefile.am | 17 - .../pmix4x/openpmix/src/mca/pdl/base/base.h | 105 - .../src/mca/pdl/base/pdl_base_close.c | 26 - .../openpmix/src/mca/pdl/base/pdl_base_fns.c | 70 - .../openpmix/src/mca/pdl/base/pdl_base_open.c | 55 - .../src/mca/pdl/base/pdl_base_select.c | 55 - .../pmix4x/openpmix/src/mca/pdl/configure.m4 | 80 - .../pmix/pmix4x/openpmix/src/mca/pdl/pdl.h | 186 - .../openpmix/src/mca/pdl/pdlopen/Makefile.am | 23 - .../openpmix/src/mca/pdl/pdlopen/configure.m4 | 71 - .../src/mca/pdl/pdlopen/pdl_pdlopen.h | 41 - .../mca/pdl/pdlopen/pdl_pdlopen_component.c | 127 - .../src/mca/pdl/pdlopen/pdl_pdlopen_module.c | 286 - .../openpmix/src/mca/pdl/plibltdl/Makefile.am | 27 - .../src/mca/pdl/plibltdl/configure.m4 | 124 - .../src/mca/pdl/plibltdl/pdl_libltdl.h | 51 - .../mca/pdl/plibltdl/pdl_libltdl_component.c | 158 - .../src/mca/pdl/plibltdl/pdl_libltdl_module.c | 134 - .../openpmix/src/mca/pfexec/Makefile.am | 41 - .../openpmix/src/mca/pfexec/base/Makefile.am | 30 - .../openpmix/src/mca/pfexec/base/base.h | 205 - .../src/mca/pfexec/base/help-pfexec-base.txt | 103 - .../mca/pfexec/base/pfexec_base_default_fns.c | 523 -- .../src/mca/pfexec/base/pfexec_base_frame.c | 259 - .../src/mca/pfexec/base/pfexec_base_select.c | 57 - .../openpmix/src/mca/pfexec/linux/Makefile.am | 48 - .../src/mca/pfexec/linux/configure.m4 | 34 - .../mca/pfexec/linux/help-pfexec-linux.txt | 147 - .../src/mca/pfexec/linux/pfexec_linux.c | 608 --- .../src/mca/pfexec/linux/pfexec_linux.h | 42 - .../mca/pfexec/linux/pfexec_linux_component.c | 98 - .../pmix4x/openpmix/src/mca/pfexec/pfexec.h | 92 - .../pmix4x/openpmix/src/mca/pif/Makefile.am | 28 - .../openpmix/src/mca/pif/base/Makefile.am | 15 - .../pmix4x/openpmix/src/mca/pif/base/base.h | 30 - .../src/mca/pif/base/pif_base_components.c | 106 - .../src/mca/pif/bsdx_ipv4/Makefile.am | 13 - .../src/mca/pif/bsdx_ipv4/configure.m4 | 46 - .../openpmix/src/mca/pif/bsdx_ipv4/pif_bsdx.c | 177 - .../src/mca/pif/bsdx_ipv6/Makefile.am | 13 - .../src/mca/pif/bsdx_ipv6/configure.m4 | 48 - .../src/mca/pif/bsdx_ipv6/pif_bsdx_ipv6.c | 213 - .../src/mca/pif/linux_ipv6/Makefile.am | 13 - .../src/mca/pif/linux_ipv6/configure.m4 | 36 - .../src/mca/pif/linux_ipv6/pif_linux_ipv6.c | 162 - .../pmix/pmix4x/openpmix/src/mca/pif/pif.h | 121 - .../src/mca/pif/posix_ipv4/Makefile.am | 13 - .../src/mca/pif/posix_ipv4/configure.m4 | 55 - .../src/mca/pif/posix_ipv4/pif_posix.c | 328 -- .../src/mca/pif/solaris_ipv6/Makefile.am | 13 - .../src/mca/pif/solaris_ipv6/configure.m4 | 32 - .../mca/pif/solaris_ipv6/pif_solaris_ipv6.c | 212 - .../openpmix/src/mca/pinstalldirs/Makefile.am | 30 - .../src/mca/pinstalldirs/base/Makefile.am | 16 - .../openpmix/src/mca/pinstalldirs/base/base.h | 40 - .../base/pinstalldirs_base_components.c | 177 - .../base/pinstalldirs_base_expand.c | 178 - .../src/mca/pinstalldirs/config/Makefile.am | 22 - .../src/mca/pinstalldirs/config/configure.m4 | 31 - .../pinstalldirs/config/pinstall_dirs.h.in | 129 - .../config/pmix_pinstalldirs_config.c | 57 - .../src/mca/pinstalldirs/configure.m4 | 12 - .../src/mca/pinstalldirs/env/Makefile.am | 16 - .../src/mca/pinstalldirs/env/configure.m4 | 29 - .../pinstalldirs/env/pmix_pinstalldirs_env.c | 84 - .../src/mca/pinstalldirs/pinstalldirs.h | 89 - .../pmix4x/openpmix/src/mca/plog/Makefile.am | 44 - .../src/mca/plog/base/Makefile.include | 34 - .../pmix4x/openpmix/src/mca/plog/base/base.h | 93 - .../src/mca/plog/base/help-pmix-plog.txt | 56 - .../src/mca/plog/base/plog_base_frame.c | 106 - .../src/mca/plog/base/plog_base_select.c | 199 - .../src/mca/plog/base/plog_base_stubs.c | 249 - .../openpmix/src/mca/plog/default/Makefile.am | 49 - .../src/mca/plog/default/plog_default.c | 150 - .../src/mca/plog/default/plog_default.h | 40 - .../mca/plog/default/plog_default_component.c | 47 - .../pmix/pmix4x/openpmix/src/mca/plog/plog.h | 102 - .../openpmix/src/mca/plog/stdfd/Makefile.am | 49 - .../openpmix/src/mca/plog/stdfd/plog_stdfd.c | 124 - .../openpmix/src/mca/plog/stdfd/plog_stdfd.h | 40 - .../src/mca/plog/stdfd/plog_stdfd_component.c | 47 - .../openpmix/src/mca/plog/syslog/Makefile.am | 49 - .../openpmix/src/mca/plog/syslog/configure.m4 | 30 - .../src/mca/plog/syslog/plog_syslog.c | 227 - .../src/mca/plog/syslog/plog_syslog.h | 47 - .../mca/plog/syslog/plog_syslog_component.c | 124 - .../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 - .../pmix4x/openpmix/src/mca/pnet/Makefile.am | 44 - .../src/mca/pnet/base/Makefile.include | 32 - .../pmix4x/openpmix/src/mca/pnet/base/base.h | 147 - .../src/mca/pnet/base/pnet_base_fns.c | 701 --- .../src/mca/pnet/base/pnet_base_frame.c | 192 - .../src/mca/pnet/base/pnet_base_select.c | 116 - .../pmix/pmix4x/openpmix/src/mca/pnet/pnet.h | 262 - .../openpmix/src/mca/pnet/tcp/Makefile.am | 59 - .../openpmix/src/mca/pnet/tcp/pnet_tcp.c | 1207 ----- .../openpmix/src/mca/pnet/tcp/pnet_tcp.h | 39 - .../src/mca/pnet/tcp/pnet_tcp_component.c | 130 - .../openpmix/src/mca/pnet/test/Makefile.am | 55 - .../openpmix/src/mca/pnet/test/pnet_test.c | 1182 ---- .../openpmix/src/mca/pnet/test/pnet_test.h | 36 - .../src/mca/pnet/test/pnet_test_component.c | 124 - .../pmix4x/openpmix/src/mca/preg/Makefile.am | 44 - .../src/mca/preg/base/Makefile.include | 32 - .../pmix4x/openpmix/src/mca/preg/base/base.h | 96 - .../src/mca/preg/base/preg_base_frame.c | 118 - .../src/mca/preg/base/preg_base_select.c | 120 - .../src/mca/preg/base/preg_base_stubs.c | 159 - .../src/mca/preg/compress/Makefile.am | 53 - .../src/mca/preg/compress/preg_compress.c | 275 - .../src/mca/preg/compress/preg_compress.h | 27 - .../preg/compress/preg_compress_component.c | 82 - .../openpmix/src/mca/preg/native/Makefile.am | 53 - .../src/mca/preg/native/preg_native.c | 934 ---- .../src/mca/preg/native/preg_native.h | 27 - .../mca/preg/native/preg_native_component.c | 78 - .../pmix/pmix4x/openpmix/src/mca/preg/preg.h | 114 - .../pmix4x/openpmix/src/mca/preg/preg_types.h | 61 - .../pmix4x/openpmix/src/mca/psec/Makefile.am | 44 - .../src/mca/psec/base/Makefile.include | 32 - .../pmix4x/openpmix/src/mca/psec/base/base.h | 86 - .../src/mca/psec/base/psec_base_fns.c | 84 - .../src/mca/psec/base/psec_base_frame.c | 86 - .../src/mca/psec/base/psec_base_select.c | 129 - .../src/mca/psec/dummy_handshake/Makefile.am | 59 - .../dummy_handshake/psec_dummy_handshake.c | 169 - .../dummy_handshake/psec_dummy_handshake.h | 28 - .../psec_dummy_handshake_component.c | 72 - .../openpmix/src/mca/psec/munge/Makefile.am | 57 - .../openpmix/src/mca/psec/munge/configure.m4 | 88 - .../openpmix/src/mca/psec/munge/psec_munge.c | 253 - .../openpmix/src/mca/psec/munge/psec_munge.h | 25 - .../src/mca/psec/munge/psec_munge_component.c | 91 - .../openpmix/src/mca/psec/native/Makefile.am | 53 - .../src/mca/psec/native/psec_native.c | 288 - .../src/mca/psec/native/psec_native.h | 27 - .../mca/psec/native/psec_native_component.c | 91 - .../openpmix/src/mca/psec/none/Makefile.am | 53 - .../openpmix/src/mca/psec/none/psec_none.c | 121 - .../openpmix/src/mca/psec/none/psec_none.h | 27 - .../src/mca/psec/none/psec_none_component.c | 105 - .../pmix/pmix4x/openpmix/src/mca/psec/psec.h | 219 - .../openpmix/src/mca/psensor/Makefile.am | 32 - .../openpmix/src/mca/psensor/base/Makefile.am | 19 - .../openpmix/src/mca/psensor/base/base.h | 59 - .../src/mca/psensor/base/psensor_base_frame.c | 104 - .../mca/psensor/base/psensor_base_select.c | 94 - .../src/mca/psensor/base/psensor_base_stubs.c | 79 - .../openpmix/src/mca/psensor/file/Makefile.am | 40 - .../psensor/file/help-pmix-psensor-file.txt | 19 - .../src/mca/psensor/file/psensor_file.c | 362 -- .../src/mca/psensor/file/psensor_file.h | 38 - .../mca/psensor/file/psensor_file_component.c | 69 - .../src/mca/psensor/heartbeat/Makefile.am | 41 - .../heartbeat/help-pmix-psensor-heartbeat.txt | 20 - .../mca/psensor/heartbeat/psensor_heartbeat.c | 361 -- .../mca/psensor/heartbeat/psensor_heartbeat.h | 44 - .../heartbeat/psensor_heartbeat_component.c | 75 - .../pmix4x/openpmix/src/mca/psensor/psensor.h | 86 - .../openpmix/src/mca/pshmem/Makefile.am | 44 - .../src/mca/pshmem/base/Makefile.include | 31 - .../openpmix/src/mca/pshmem/base/base.h | 60 - .../src/mca/pshmem/base/pshmem_base_frame.c | 75 - .../src/mca/pshmem/base/pshmem_base_select.c | 100 - .../openpmix/src/mca/pshmem/mmap/Makefile.am | 46 - .../src/mca/pshmem/mmap/pshmem_mmap.c | 207 - .../src/mca/pshmem/mmap/pshmem_mmap.h | 25 - .../mca/pshmem/mmap/pshmem_mmap_component.c | 86 - .../pmix4x/openpmix/src/mca/pshmem/pshmem.h | 145 - .../openpmix/src/mca/psquash/Makefile.am | 45 - .../src/mca/psquash/base/Makefile.include | 19 - .../openpmix/src/mca/psquash/base/base.h | 73 - .../src/mca/psquash/base/psquash_base_frame.c | 75 - .../mca/psquash/base/psquash_base_select.c | 104 - .../src/mca/psquash/flex128/Makefile.am | 43 - .../src/mca/psquash/flex128/psquash_flex128.c | 383 -- .../src/mca/psquash/flex128/psquash_flex128.h | 26 - .../flex128/psquash_flex128_component.c | 66 - .../src/mca/psquash/native/Makefile.am | 46 - .../src/mca/psquash/native/psquash_native.c | 187 - .../src/mca/psquash/native/psquash_native.h | 29 - .../psquash/native/psquash_native_component.c | 69 - .../pmix4x/openpmix/src/mca/psquash/psquash.h | 120 - .../pmix4x/openpmix/src/mca/ptl/Makefile.am | 44 - .../src/mca/ptl/base/Makefile.include | 35 - .../pmix4x/openpmix/src/mca/ptl/base/base.h | 125 - .../src/mca/ptl/base/ptl_base_connect.c | 249 - .../src/mca/ptl/base/ptl_base_frame.c | 275 - .../src/mca/ptl/base/ptl_base_listener.c | 298 - .../src/mca/ptl/base/ptl_base_select.c | 102 - .../src/mca/ptl/base/ptl_base_sendrecv.c | 840 --- .../src/mca/ptl/base/ptl_base_stubs.c | 218 - .../pmix/pmix4x/openpmix/src/mca/ptl/ptl.h | 213 - .../pmix4x/openpmix/src/mca/ptl/ptl_types.h | 319 -- .../openpmix/src/mca/ptl/tcp/Makefile.am | 53 - .../pmix4x/openpmix/src/mca/ptl/tcp/ptl_tcp.c | 1456 ----- .../pmix4x/openpmix/src/mca/ptl/tcp/ptl_tcp.h | 68 - .../src/mca/ptl/tcp/ptl_tcp_component.c | 2030 ------- .../openpmix/src/mca/ptl/usock/Makefile.am | 53 - .../openpmix/src/mca/ptl/usock/ptl_usock.c | 946 ---- .../openpmix/src/mca/ptl/usock/ptl_usock.h | 51 - .../src/mca/ptl/usock/ptl_usock_component.c | 791 --- .../openpmix/src/runtime/Makefile.include | 36 - .../src/runtime/help-pmix-runtime.txt | 89 - .../openpmix/src/runtime/pmix_finalize.c | 135 - .../pmix4x/openpmix/src/runtime/pmix_init.c | 405 -- .../pmix4x/openpmix/src/runtime/pmix_params.c | 276 - .../src/runtime/pmix_progress_threads.c | 470 -- .../src/runtime/pmix_progress_threads.h | 84 - .../pmix4x/openpmix/src/runtime/pmix_rte.h | 80 - .../openpmix/src/server/Makefile.include | 23 - .../openpmix/src/server/help-pmix-server.txt | 38 - .../pmix4x/openpmix/src/server/pmix_sched.c | 159 - .../pmix4x/openpmix/src/server/pmix_server.c | 3755 ------------- .../openpmix/src/server/pmix_server_get.c | 1138 ---- .../openpmix/src/server/pmix_server_ops.c | 4771 ----------------- .../openpmix/src/server/pmix_server_ops.h | 368 -- .../openpmix/src/threads/Makefile.include | 38 - .../pmix/pmix4x/openpmix/src/threads/mutex.c | 94 - .../pmix/pmix4x/openpmix/src/threads/mutex.h | 103 - .../pmix4x/openpmix/src/threads/mutex_unix.h | 215 - .../pmix/pmix4x/openpmix/src/threads/thread.c | 134 - .../openpmix/src/threads/thread_usage.h | 180 - .../pmix4x/openpmix/src/threads/threads.h | 206 - .../pmix/pmix4x/openpmix/src/threads/tsd.h | 109 - .../pmix4x/openpmix/src/threads/wait_sync.c | 102 - .../pmix4x/openpmix/src/threads/wait_sync.h | 120 - .../pmix4x/openpmix/src/tool/Makefile.include | 11 - .../pmix/pmix4x/openpmix/src/tool/pmix_tool.c | 1344 ----- .../openpmix/src/tools/Makefile.include | 41 - .../openpmix/src/tools/pattrs/Makefile.am | 33 - .../openpmix/src/tools/pattrs/help-pattrs.txt | 27 - .../pmix4x/openpmix/src/tools/pattrs/pattrs.c | 496 -- .../openpmix/src/tools/pevent/Makefile.am | 33 - .../openpmix/src/tools/pevent/help-pevent.txt | 47 - .../pmix4x/openpmix/src/tools/pevent/pevent.c | 272 - .../openpmix/src/tools/plookup/Makefile.am | 33 - .../src/tools/plookup/help-plookup.txt | 47 - .../openpmix/src/tools/plookup/plookup.c | 291 - .../openpmix/src/tools/pmix_info/Makefile.am | 54 - .../src/tools/pmix_info/help-pmix-info.txt | 59 - .../openpmix/src/tools/pmix_info/pinfo.h | 76 - .../openpmix/src/tools/pmix_info/pmix_info.c | 208 - .../openpmix/src/tools/pmix_info/support.c | 1376 ----- .../openpmix/src/tools/pmix_info/support.h | 120 - .../pmix4x/openpmix/src/tools/pps/Makefile.am | 33 - .../openpmix/src/tools/pps/help-pps.txt | 47 - .../pmix/pmix4x/openpmix/src/tools/pps/pps.c | 864 --- .../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 - .../pmix4x/openpmix/src/util/Makefile.include | 90 - opal/mca/pmix/pmix4x/openpmix/src/util/alfg.c | 136 - opal/mca/pmix/pmix4x/openpmix/src/util/alfg.h | 38 - opal/mca/pmix/pmix4x/openpmix/src/util/argv.c | 612 --- opal/mca/pmix/pmix4x/openpmix/src/util/argv.h | 322 -- .../pmix/pmix4x/openpmix/src/util/basename.c | 135 - .../pmix/pmix4x/openpmix/src/util/basename.h | 114 - .../pmix/pmix4x/openpmix/src/util/cmd_line.c | 1401 ----- .../pmix/pmix4x/openpmix/src/util/cmd_line.h | 622 --- .../pmix4x/openpmix/src/util/context_fns.c | 104 - .../pmix4x/openpmix/src/util/context_fns.h | 38 - opal/mca/pmix/pmix4x/openpmix/src/util/crc.c | 1205 ----- opal/mca/pmix/pmix4x/openpmix/src/util/crc.h | 185 - .../mca/pmix/pmix4x/openpmix/src/util/error.c | 288 - .../mca/pmix/pmix4x/openpmix/src/util/error.h | 52 - opal/mca/pmix/pmix4x/openpmix/src/util/fd.c | 132 - opal/mca/pmix/pmix4x/openpmix/src/util/fd.h | 103 - opal/mca/pmix/pmix4x/openpmix/src/util/few.c | 84 - opal/mca/pmix/pmix4x/openpmix/src/util/few.h | 62 - .../mca/pmix/pmix4x/openpmix/src/util/getid.c | 86 - .../mca/pmix/pmix4x/openpmix/src/util/getid.h | 30 - opal/mca/pmix/pmix4x/openpmix/src/util/hash.c | 376 -- opal/mca/pmix/pmix4x/openpmix/src/util/hash.h | 55 - .../openpmix/src/util/keyval/Makefile.am | 32 - .../openpmix/src/util/keyval/keyval_lex.h | 74 - .../openpmix/src/util/keyval/keyval_lex.l | 137 - .../pmix4x/openpmix/src/util/keyval_parse.c | 363 -- .../pmix4x/openpmix/src/util/keyval_parse.h | 60 - .../pmix/pmix4x/openpmix/src/util/name_fns.c | 181 - .../pmix/pmix4x/openpmix/src/util/name_fns.h | 52 - opal/mca/pmix/pmix4x/openpmix/src/util/net.c | 470 -- opal/mca/pmix/pmix4x/openpmix/src/util/net.h | 150 - .../pmix4x/openpmix/src/util/os_dirpath.c | 316 -- .../pmix4x/openpmix/src/util/os_dirpath.h | 119 - .../pmix/pmix4x/openpmix/src/util/os_path.c | 106 - .../pmix/pmix4x/openpmix/src/util/os_path.h | 83 - .../pmix/pmix4x/openpmix/src/util/output.c | 953 ---- .../pmix/pmix4x/openpmix/src/util/output.h | 547 -- .../pmix4x/openpmix/src/util/parse_options.c | 143 - .../pmix4x/openpmix/src/util/parse_options.h | 37 - opal/mca/pmix/pmix4x/openpmix/src/util/path.c | 723 --- opal/mca/pmix/pmix4x/openpmix/src/util/path.h | 161 - opal/mca/pmix/pmix4x/openpmix/src/util/pif.c | 820 --- opal/mca/pmix/pmix4x/openpmix/src/util/pif.h | 229 - .../pmix4x/openpmix/src/util/pmix_environ.c | 279 - .../pmix4x/openpmix/src/util/pmix_environ.h | 151 - .../pmix/pmix4x/openpmix/src/util/pmix_pty.c | 262 - .../pmix/pmix4x/openpmix/src/util/pmix_pty.h | 56 - .../pmix/pmix4x/openpmix/src/util/printf.c | 323 -- .../pmix/pmix4x/openpmix/src/util/printf.h | 131 - .../pmix/pmix4x/openpmix/src/util/show_help.c | 374 -- .../pmix/pmix4x/openpmix/src/util/show_help.h | 181 - .../pmix4x/openpmix/src/util/show_help_lex.h | 67 - .../pmix4x/openpmix/src/util/show_help_lex.l | 114 - .../pmix/pmix4x/openpmix/src/util/strnlen.h | 37 - .../pmix/pmix4x/openpmix/src/util/timings.c | 645 --- .../pmix/pmix4x/openpmix/src/util/timings.h | 421 -- .../mca/pmix/pmix4x/openpmix/test/Makefile.am | 135 - opal/mca/pmix/pmix4x/openpmix/test/README | 32 - .../pmix/pmix4x/openpmix/test/cli_stages.c | 291 - .../pmix/pmix4x/openpmix/test/cli_stages.h | 83 - .../pmix/pmix4x/openpmix/test/pmi2_client.c | 572 -- .../pmix/pmix4x/openpmix/test/pmi_client.c | 445 -- .../pmix/pmix4x/openpmix/test/pmix_client.c | 244 - .../openpmix/test/pmix_client_otheruser.sh | 19 - .../pmix/pmix4x/openpmix/test/pmix_regex.c | 112 - .../mca/pmix/pmix4x/openpmix/test/pmix_test.c | 189 - .../pmix4x/openpmix/test/python/Makefile.am | 26 - .../openpmix/test/python/run_sched.sh.in | 5 - .../openpmix/test/python/run_server.sh.in | 5 - .../pmix4x/openpmix/test/run_tests00.pl.in | 73 - .../pmix4x/openpmix/test/run_tests01.pl.in | 73 - .../pmix4x/openpmix/test/run_tests02.pl.in | 73 - .../pmix4x/openpmix/test/run_tests03.pl.in | 73 - .../pmix4x/openpmix/test/run_tests04.pl.in | 73 - .../pmix4x/openpmix/test/run_tests05.pl.in | 73 - .../pmix4x/openpmix/test/run_tests06.pl.in | 73 - .../pmix4x/openpmix/test/run_tests07.pl.in | 73 - .../pmix4x/openpmix/test/run_tests08.pl.in | 73 - .../pmix4x/openpmix/test/run_tests09.pl.in | 73 - .../pmix4x/openpmix/test/run_tests10.pl.in | 73 - .../pmix4x/openpmix/test/run_tests11.pl.in | 73 - .../pmix4x/openpmix/test/run_tests12.pl.in | 73 - .../pmix4x/openpmix/test/run_tests13.pl.in | 73 - .../pmix4x/openpmix/test/run_tests14.pl.in | 73 - .../pmix4x/openpmix/test/run_tests15.pl.in | 73 - .../pmix4x/openpmix/test/server_callbacks.c | 343 -- .../pmix4x/openpmix/test/server_callbacks.h | 60 - .../pmix4x/openpmix/test/simple/Makefile.am | 143 - .../pmix4x/openpmix/test/simple/gwclient.c | 99 - .../pmix/pmix4x/openpmix/test/simple/gwtest.c | 1052 ---- .../pmix4x/openpmix/test/simple/quietclient.c | 349 -- .../pmix4x/openpmix/test/simple/simpclient.c | 422 -- .../pmix4x/openpmix/test/simple/simpcoord.c | 159 - .../pmix4x/openpmix/test/simple/simpdie.c | 161 - .../pmix4x/openpmix/test/simple/simpdmodex.c | 267 - .../pmix4x/openpmix/test/simple/simpdyn.c | 185 - .../pmix/pmix4x/openpmix/test/simple/simpft.c | 139 - .../pmix/pmix4x/openpmix/test/simple/simpio.c | 123 - .../pmix4x/openpmix/test/simple/simpjctrl.c | 234 - .../pmix4x/openpmix/test/simple/simplegacy.c | 114 - .../pmix4x/openpmix/test/simple/simppub.c | 169 - .../pmix4x/openpmix/test/simple/simpsched.c | 236 - .../pmix4x/openpmix/test/simple/simptest.c | 1482 ----- .../pmix4x/openpmix/test/simple/simptimeout.c | 168 - .../pmix4x/openpmix/test/simple/simptool.c | 117 - .../pmix4x/openpmix/test/simple/stability.c | 1137 ---- .../pmix4x/openpmix/test/simple/test_pmix.c | 67 - opal/mca/pmix/pmix4x/openpmix/test/test_cd.c | 83 - opal/mca/pmix/pmix4x/openpmix/test/test_cd.h | 16 - .../pmix/pmix4x/openpmix/test/test_common.c | 645 --- .../pmix/pmix4x/openpmix/test/test_common.h | 424 -- .../pmix/pmix4x/openpmix/test/test_error.c | 115 - .../pmix/pmix4x/openpmix/test/test_error.h | 16 - .../pmix/pmix4x/openpmix/test/test_fence.c | 438 -- .../pmix/pmix4x/openpmix/test/test_fence.h | 20 - .../pmix/pmix4x/openpmix/test/test_internal.c | 86 - .../pmix/pmix4x/openpmix/test/test_internal.h | 17 - .../pmix/pmix4x/openpmix/test/test_publish.c | 195 - .../pmix/pmix4x/openpmix/test/test_publish.h | 18 - .../pmix/pmix4x/openpmix/test/test_replace.c | 135 - .../pmix/pmix4x/openpmix/test/test_replace.h | 17 - .../pmix4x/openpmix/test/test_resolve_peers.c | 131 - .../pmix4x/openpmix/test/test_resolve_peers.h | 18 - .../pmix/pmix4x/openpmix/test/test_server.c | 981 ---- .../pmix/pmix4x/openpmix/test/test_server.h | 79 - .../pmix/pmix4x/openpmix/test/test_spawn.c | 79 - .../pmix/pmix4x/openpmix/test/test_spawn.h | 18 - opal/mca/pmix/pmix4x/openpmix/test/utils.c | 96 - opal/mca/pmix/pmix4x/openpmix/test/utils.h | 21 - opal/mca/pmix/pmix4x/pmix4x.c | 1861 ------- opal/mca/pmix/pmix4x/pmix4x.h | 344 +- opal/mca/pmix/pmix4x/pmix4x_client.c | 1672 ------ opal/mca/pmix/pmix4x/pmix4x_component.c | 145 +- opal/mca/pmix/pmix4x/pmix4x_local.c | 155 - opal/mca/pmix/pmix4x/pmix4x_server_north.c | 1338 ----- opal/mca/pmix/pmix4x/pmix4x_server_south.c | 802 --- opal/mca/pmix/pmix_server.h | 286 - opal/mca/pmix/pmix_types.h | 789 --- opal/mca/pmix/s1/Makefile.am | 40 - opal/mca/pmix/s1/configure.m4 | 26 - opal/mca/pmix/s1/owner.txt | 7 - opal/mca/pmix/s1/pmix_s1.c | 756 --- opal/mca/pmix/s1/pmix_s1.h | 31 - opal/mca/pmix/s1/pmix_s1_component.c | 105 - opal/mca/pmix/s2/Makefile.am | 42 - opal/mca/pmix/s2/configure.m4 | 26 - opal/mca/pmix/s2/owner.txt | 7 - opal/mca/pmix/s2/pmi2_pmap_parser.c | 241 - opal/mca/pmix/s2/pmi2_pmap_parser.h | 18 - opal/mca/pmix/s2/pmix_s2.c | 771 --- opal/mca/pmix/s2/pmix_s2.h | 31 - opal/mca/pmix/s2/pmix_s2_component.c | 105 - opal/util/output.c | 8 +- opal/util/proc.c | 9 +- opal/util/proc.h | 3 +- orte/Doxyfile | 1099 ---- orte/Makefile.am | 68 - orte/bindings/README | 21 - orte/bindings/python/README | 49 - orte/bindings/python/examples/submit.py | 68 - orte/bindings/python/setup.py | 16 - orte/bindings/python/src/orte-cffi/build.py | 144 - orte/common_sym_whitelist.txt | 4 - orte/etc/Makefile.am | 62 - orte/etc/openmpi-default-hostfile | 36 - orte/include/Makefile.am | 33 - orte/include/orte/Makefile.am | 28 - orte/include/orte/constants.h | 158 - orte/include/orte/types.h | 192 - orte/include/orte/version.h.in | 40 - orte/include/orte_config.h | 39 - orte/mca/Makefile.am | 23 - orte/mca/common/Makefile.am | 25 - orte/mca/common/alps/Makefile.am | 66 - orte/mca/common/alps/common_alps.c | 73 - orte/mca/common/alps/common_alps.h | 32 - orte/mca/common/alps/configure.m4 | 40 - orte/mca/common/alps/owner.txt | 7 - orte/mca/errmgr/Makefile.am | 40 - orte/mca/errmgr/base/Makefile.am | 30 - orte/mca/errmgr/base/base.h | 98 - orte/mca/errmgr/base/errmgr_base_fns.c | 456 -- orte/mca/errmgr/base/errmgr_base_frame.c | 105 - orte/mca/errmgr/base/errmgr_base_select.c | 67 - orte/mca/errmgr/base/errmgr_private.h | 72 - orte/mca/errmgr/base/help-errmgr-base.txt | 112 - orte/mca/errmgr/base/owner.txt | 7 - orte/mca/errmgr/default_app/Makefile.am | 36 - .../errmgr/default_app/errmgr_default_app.c | 205 - .../errmgr/default_app/errmgr_default_app.h | 35 - .../errmgr_default_app_component.c | 100 - orte/mca/errmgr/default_app/owner.txt | 7 - orte/mca/errmgr/default_hnp/Makefile.am | 36 - .../errmgr/default_hnp/errmgr_default_hnp.c | 858 --- .../errmgr/default_hnp/errmgr_default_hnp.h | 38 - .../errmgr_default_hnp_component.c | 101 - orte/mca/errmgr/default_hnp/owner.txt | 7 - orte/mca/errmgr/default_orted/Makefile.am | 36 - .../default_orted/errmgr_default_orted.c | 824 --- .../default_orted/errmgr_default_orted.h | 35 - .../errmgr_default_orted_component.c | 102 - orte/mca/errmgr/default_orted/owner.txt | 7 - orte/mca/errmgr/default_tool/Makefile.am | 36 - .../errmgr/default_tool/errmgr_default_tool.c | 128 - .../errmgr/default_tool/errmgr_default_tool.h | 35 - .../errmgr_default_tool_component.c | 97 - orte/mca/errmgr/default_tool/owner.txt | 7 - orte/mca/errmgr/errmgr.h | 166 - orte/mca/ess/Makefile.am | 46 - orte/mca/ess/alps/Makefile.am | 53 - orte/mca/ess/alps/configure.m4 | 37 - orte/mca/ess/alps/ess_alps.h | 56 - orte/mca/ess/alps/ess_alps_component.c | 107 - orte/mca/ess/alps/ess_alps_module.c | 202 - orte/mca/ess/alps/ess_alps_utils.c | 240 - orte/mca/ess/base/Makefile.am | 33 - orte/mca/ess/base/base.h | 91 - orte/mca/ess/base/ess_base_fns.c | 339 -- orte/mca/ess/base/ess_base_frame.c | 327 -- orte/mca/ess/base/ess_base_get.c | 48 - orte/mca/ess/base/ess_base_select.c | 53 - orte/mca/ess/base/ess_base_std_orted.c | 679 --- orte/mca/ess/base/ess_base_std_prolog.c | 68 - orte/mca/ess/base/ess_base_std_tool.c | 327 -- orte/mca/ess/base/help-ess-base.txt | 97 - orte/mca/ess/base/owner.txt | 7 - orte/mca/ess/env/Makefile.am | 47 - orte/mca/ess/env/ess_env.h | 36 - orte/mca/ess/env/ess_env_component.c | 92 - orte/mca/ess/env/ess_env_module.c | 165 - orte/mca/ess/env/owner.txt | 7 - orte/mca/ess/ess.h | 112 - orte/mca/ess/hnp/Makefile.am | 49 - orte/mca/ess/hnp/ess_hnp.h | 36 - orte/mca/ess/hnp/ess_hnp_component.c | 101 - orte/mca/ess/hnp/ess_hnp_module.c | 995 ---- orte/mca/ess/hnp/owner.txt | 7 - orte/mca/ess/lsf/Makefile.am | 51 - orte/mca/ess/lsf/configure.m4 | 40 - orte/mca/ess/lsf/ess_lsf.h | 36 - orte/mca/ess/lsf/ess_lsf_component.c | 93 - orte/mca/ess/lsf/ess_lsf_module.c | 175 - orte/mca/ess/lsf/owner.txt | 7 - orte/mca/ess/pmi/Makefile.am | 49 - orte/mca/ess/pmi/ess_pmi.h | 19 - orte/mca/ess/pmi/ess_pmi_component.c | 98 - orte/mca/ess/pmi/ess_pmi_module.c | 688 --- orte/mca/ess/pmi/owner.txt | 7 - orte/mca/ess/singleton/Makefile.am | 46 - orte/mca/ess/singleton/ess_singleton.h | 35 - .../ess/singleton/ess_singleton_component.c | 171 - orte/mca/ess/singleton/ess_singleton_module.c | 792 --- orte/mca/ess/singleton/owner.txt | 7 - orte/mca/ess/slurm/Makefile.am | 46 - orte/mca/ess/slurm/configure.m4 | 40 - orte/mca/ess/slurm/ess_slurm.h | 35 - orte/mca/ess/slurm/ess_slurm_component.c | 98 - orte/mca/ess/slurm/ess_slurm_module.c | 193 - orte/mca/ess/slurm/owner.txt | 7 - orte/mca/ess/tm/Makefile.am | 46 - orte/mca/ess/tm/configure.m4 | 40 - orte/mca/ess/tm/ess_tm.h | 35 - orte/mca/ess/tm/ess_tm_component.c | 98 - orte/mca/ess/tm/ess_tm_module.c | 176 - orte/mca/ess/tm/owner.txt | 7 - orte/mca/ess/tool/Makefile.am | 47 - orte/mca/ess/tool/ess_tool.h | 47 - orte/mca/ess/tool/ess_tool_component.c | 159 - orte/mca/ess/tool/ess_tool_module.c | 184 - orte/mca/ess/tool/owner.txt | 7 - orte/mca/filem/Makefile.am | 50 - orte/mca/filem/base/Makefile.am | 27 - orte/mca/filem/base/base.h | 91 - orte/mca/filem/base/filem_base_fns.c | 215 - orte/mca/filem/base/filem_base_frame.c | 72 - orte/mca/filem/base/filem_base_receive.c | 320 -- orte/mca/filem/base/filem_base_select.c | 64 - orte/mca/filem/base/owner.txt | 7 - orte/mca/filem/filem.h | 402 -- orte/mca/filem/orte_filem.7in | 92 - orte/mca/filem/raw/Makefile.am | 48 - orte/mca/filem/raw/filem_raw.h | 80 - orte/mca/filem/raw/filem_raw_component.c | 96 - orte/mca/filem/raw/filem_raw_module.c | 1333 ----- orte/mca/filem/raw/help-orte-filem-raw.txt | 46 - orte/mca/filem/raw/owner.txt | 7 - orte/mca/grpcomm/Makefile.am | 38 - orte/mca/grpcomm/base/Makefile.am | 27 - orte/mca/grpcomm/base/base.h | 93 - orte/mca/grpcomm/base/grpcomm_base_frame.c | 151 - orte/mca/grpcomm/base/grpcomm_base_select.c | 121 - orte/mca/grpcomm/base/grpcomm_base_stubs.c | 560 -- orte/mca/grpcomm/base/owner.txt | 7 - orte/mca/grpcomm/direct/Makefile.am | 41 - orte/mca/grpcomm/direct/grpcomm_direct.c | 640 --- orte/mca/grpcomm/direct/grpcomm_direct.h | 31 - .../grpcomm/direct/grpcomm_direct_component.c | 85 - orte/mca/grpcomm/direct/owner.txt | 7 - orte/mca/grpcomm/grpcomm.h | 193 - orte/mca/iof/Makefile.am | 40 - orte/mca/iof/README.txt | 177 - orte/mca/iof/base/Makefile.am | 31 - orte/mca/iof/base/base.h | 286 - orte/mca/iof/base/help-iof-base.txt | 31 - orte/mca/iof/base/iof_base_frame.c | 310 -- orte/mca/iof/base/iof_base_output.c | 377 -- orte/mca/iof/base/iof_base_select.c | 68 - orte/mca/iof/base/iof_base_setup.c | 466 -- orte/mca/iof/base/iof_base_setup.h | 64 - orte/mca/iof/base/owner.txt | 7 - orte/mca/iof/hnp/Makefile.am | 51 - orte/mca/iof/hnp/iof_hnp.c | 655 --- orte/mca/iof/hnp/iof_hnp.h | 88 - orte/mca/iof/hnp/iof_hnp_component.c | 104 - orte/mca/iof/hnp/iof_hnp_read.c | 342 -- orte/mca/iof/hnp/iof_hnp_receive.c | 285 - orte/mca/iof/hnp/iof_hnp_send.c | 119 - orte/mca/iof/hnp/owner.txt | 7 - orte/mca/iof/iof.h | 241 - orte/mca/iof/iof_types.h | 55 - orte/mca/iof/orted/Makefile.am | 50 - orte/mca/iof/orted/iof_orted.c | 520 -- orte/mca/iof/orted/iof_orted.h | 82 - orte/mca/iof/orted/iof_orted_component.c | 96 - orte/mca/iof/orted/iof_orted_read.c | 187 - orte/mca/iof/orted/iof_orted_receive.c | 163 - orte/mca/iof/orted/owner.txt | 7 - orte/mca/iof/tool/Makefile.am | 49 - orte/mca/iof/tool/iof_tool.c | 302 -- orte/mca/iof/tool/iof_tool.h | 58 - orte/mca/iof/tool/iof_tool_component.c | 100 - orte/mca/iof/tool/iof_tool_receive.c | 110 - orte/mca/iof/tool/owner.txt | 7 - orte/mca/mca.h | 39 - orte/mca/odls/Makefile.am | 40 - orte/mca/odls/alps/Makefile.am | 57 - orte/mca/odls/alps/configure.m4 | 37 - orte/mca/odls/alps/help-orte-odls-alps.txt | 152 - orte/mca/odls/alps/odls_alps.h | 58 - orte/mca/odls/alps/odls_alps_component.c | 114 - orte/mca/odls/alps/odls_alps_module.c | 730 --- orte/mca/odls/alps/odls_alps_utils.c | 252 - orte/mca/odls/alps/owner.txt | 7 - orte/mca/odls/base/Makefile.am | 30 - orte/mca/odls/base/base.h | 53 - orte/mca/odls/base/help-orte-odls-base.txt | 103 - orte/mca/odls/base/odls_base_default_fns.c | 2177 -------- orte/mca/odls/base/odls_base_frame.c | 356 -- orte/mca/odls/base/odls_base_select.c | 57 - orte/mca/odls/base/odls_private.h | 169 - orte/mca/odls/base/owner.txt | 7 - orte/mca/odls/default/Makefile.am | 48 - orte/mca/odls/default/configure.m4 | 33 - .../odls/default/help-orte-odls-default.txt | 140 - orte/mca/odls/default/odls_default.h | 48 - .../mca/odls/default/odls_default_component.c | 98 - orte/mca/odls/default/odls_default_module.c | 750 --- orte/mca/odls/default/owner.txt | 7 - orte/mca/odls/odls.h | 126 - orte/mca/odls/odls_types.h | 125 - orte/mca/odls/pspawn/Makefile.am | 49 - orte/mca/odls/pspawn/configure.m4 | 33 - .../mca/odls/pspawn/help-orte-odls-pspawn.txt | 140 - orte/mca/odls/pspawn/odls_pspawn.c | 474 -- orte/mca/odls/pspawn/odls_pspawn.h | 42 - orte/mca/odls/pspawn/odls_pspawn_component.c | 103 - orte/mca/odls/pspawn/owner.txt | 7 - orte/mca/oob/Makefile.am | 40 - orte/mca/oob/alps/Makefile.am | 47 - orte/mca/oob/alps/configure.m4 | 37 - orte/mca/oob/alps/oob_alps_component.c | 242 - orte/mca/oob/alps/owner.txt | 7 - orte/mca/oob/base/Makefile.am | 30 - orte/mca/oob/base/base.h | 150 - orte/mca/oob/base/help-oob-base.txt | 23 - orte/mca/oob/base/oob_base_frame.c | 145 - orte/mca/oob/base/oob_base_select.c | 157 - orte/mca/oob/base/oob_base_stubs.c | 418 -- orte/mca/oob/base/owner.txt | 7 - orte/mca/oob/oob.h | 90 - orte/mca/oob/tcp/Makefile.am | 62 - orte/mca/oob/tcp/configure.m4 | 38 - orte/mca/oob/tcp/help-oob-tcp.txt | 138 - orte/mca/oob/tcp/oob_tcp.c | 363 -- orte/mca/oob/tcp/oob_tcp.h | 94 - orte/mca/oob/tcp/oob_tcp_common.c | 223 - orte/mca/oob/tcp/oob_tcp_common.h | 34 - orte/mca/oob/tcp/oob_tcp_component.c | 1385 ----- orte/mca/oob/tcp/oob_tcp_component.h | 96 - orte/mca/oob/tcp/oob_tcp_connection.c | 1257 ----- orte/mca/oob/tcp/oob_tcp_connection.h | 102 - orte/mca/oob/tcp/oob_tcp_hdr.h | 88 - orte/mca/oob/tcp/oob_tcp_listener.c | 971 ---- orte/mca/oob/tcp/oob_tcp_listener.h | 61 - orte/mca/oob/tcp/oob_tcp_peer.h | 88 - orte/mca/oob/tcp/oob_tcp_sendrecv.c | 670 --- orte/mca/oob/tcp/oob_tcp_sendrecv.h | 299 -- orte/mca/oob/tcp/owner.txt | 7 - orte/mca/plm/Makefile.am | 40 - orte/mca/plm/alps/Makefile.am | 55 - orte/mca/plm/alps/configure.m4 | 37 - orte/mca/plm/alps/help-plm-alps.txt | 42 - orte/mca/plm/alps/owner.txt | 7 - orte/mca/plm/alps/plm_alps.h | 53 - orte/mca/plm/alps/plm_alps_component.c | 182 - orte/mca/plm/alps/plm_alps_module.c | 673 --- orte/mca/plm/base/Makefile.am | 33 - orte/mca/plm/base/base.h | 73 - orte/mca/plm/base/help-plm-base.txt | 175 - orte/mca/plm/base/owner.txt | 7 - orte/mca/plm/base/plm_base_frame.c | 105 - orte/mca/plm/base/plm_base_jobid.c | 98 - orte/mca/plm/base/plm_base_launch_support.c | 2333 -------- orte/mca/plm/base/plm_base_orted_cmds.c | 249 - orte/mca/plm/base/plm_base_receive.c | 417 -- orte/mca/plm/base/plm_base_select.c | 59 - orte/mca/plm/base/plm_private.h | 132 - orte/mca/plm/isolated/Makefile.am | 47 - orte/mca/plm/isolated/configure.m4 | 32 - orte/mca/plm/isolated/owner.txt | 7 - orte/mca/plm/isolated/plm_isolated.c | 150 - orte/mca/plm/isolated/plm_isolated.h | 42 - .../mca/plm/isolated/plm_isolated_component.c | 107 - orte/mca/plm/lsf/Makefile.am | 54 - orte/mca/plm/lsf/configure.m4 | 40 - orte/mca/plm/lsf/help-plm-lsf.txt | 38 - orte/mca/plm/lsf/owner.txt | 7 - orte/mca/plm/lsf/plm_lsf.h | 43 - orte/mca/plm/lsf/plm_lsf_component.c | 119 - orte/mca/plm/lsf/plm_lsf_module.c | 425 -- orte/mca/plm/plm.h | 150 - orte/mca/plm/plm_types.h | 231 - orte/mca/plm/rsh/Makefile.am | 48 - orte/mca/plm/rsh/configure.m4 | 32 - orte/mca/plm/rsh/help-plm-rsh.txt | 96 - orte/mca/plm/rsh/owner.txt | 7 - orte/mca/plm/rsh/plm_rsh.h | 80 - orte/mca/plm/rsh/plm_rsh_component.c | 476 -- orte/mca/plm/rsh/plm_rsh_module.c | 1679 ------ orte/mca/plm/slurm/Makefile.am | 48 - orte/mca/plm/slurm/configure.m4 | 42 - orte/mca/plm/slurm/help-plm-slurm.txt | 55 - orte/mca/plm/slurm/owner.txt | 7 - orte/mca/plm/slurm/plm_slurm.h | 46 - orte/mca/plm/slurm/plm_slurm_component.c | 144 - orte/mca/plm/slurm/plm_slurm_module.c | 715 --- orte/mca/plm/tm/Makefile.am | 56 - orte/mca/plm/tm/configure.m4 | 40 - orte/mca/plm/tm/help-plm-tm.txt | 62 - orte/mca/plm/tm/owner.txt | 7 - orte/mca/plm/tm/plm_tm.h | 43 - orte/mca/plm/tm/plm_tm_component.c | 137 - orte/mca/plm/tm/plm_tm_module.c | 530 -- orte/mca/ras/Makefile.am | 42 - orte/mca/ras/alps/Makefile.am | 64 - orte/mca/ras/alps/configure.m4 | 46 - orte/mca/ras/alps/help-ras-alps.txt | 41 - orte/mca/ras/alps/owner.txt | 7 - orte/mca/ras/alps/ras-alps-command.sh | 73 - orte/mca/ras/alps/ras_alps.h | 42 - orte/mca/ras/alps/ras_alps_component.c | 233 - orte/mca/ras/alps/ras_alps_module.c | 598 --- orte/mca/ras/base/Makefile.am | 29 - orte/mca/ras/base/base.h | 69 - orte/mca/ras/base/help-ras-base.txt | 38 - orte/mca/ras/base/owner.txt | 7 - orte/mca/ras/base/ras_base_allocate.c | 596 -- orte/mca/ras/base/ras_base_close.c | 54 - orte/mca/ras/base/ras_base_frame.c | 117 - orte/mca/ras/base/ras_base_node.c | 240 - orte/mca/ras/base/ras_base_select.c | 63 - orte/mca/ras/base/ras_private.h | 51 - orte/mca/ras/gridengine/Makefile.am | 50 - orte/mca/ras/gridengine/configure.m4 | 33 - .../ras/gridengine/help-ras-gridengine.txt | 44 - orte/mca/ras/gridengine/owner.txt | 7 - orte/mca/ras/gridengine/ras_gridengine.h | 51 - .../ras/gridengine/ras_gridengine_component.c | 135 - .../ras/gridengine/ras_gridengine_module.c | 207 - orte/mca/ras/lsf/Makefile.am | 52 - orte/mca/ras/lsf/configure.m4 | 40 - orte/mca/ras/lsf/help-ras-lsf.txt | 36 - orte/mca/ras/lsf/owner.txt | 7 - orte/mca/ras/lsf/ras_lsf.h | 39 - orte/mca/ras/lsf/ras_lsf_component.c | 94 - orte/mca/ras/lsf/ras_lsf_module.c | 180 - orte/mca/ras/ras.h | 142 - orte/mca/ras/simulator/Makefile.am | 42 - orte/mca/ras/simulator/help-ras-simulator.txt | 33 - orte/mca/ras/simulator/owner.txt | 7 - orte/mca/ras/simulator/ras_sim.h | 37 - orte/mca/ras/simulator/ras_sim_component.c | 138 - orte/mca/ras/simulator/ras_sim_module.c | 313 -- orte/mca/ras/slurm/Makefile.am | 57 - orte/mca/ras/slurm/configure.m4 | 40 - orte/mca/ras/slurm/help-ras-slurm.txt | 78 - orte/mca/ras/slurm/owner.txt | 7 - orte/mca/ras/slurm/ras_slurm.h | 49 - orte/mca/ras/slurm/ras_slurm_component.c | 155 - orte/mca/ras/slurm/ras_slurm_module.c | 1223 ----- orte/mca/ras/tm/Makefile.am | 60 - orte/mca/ras/tm/configure.m4 | 40 - orte/mca/ras/tm/help-ras-tm.txt | 39 - orte/mca/ras/tm/owner.txt | 7 - orte/mca/ras/tm/ras_tm.h | 45 - orte/mca/ras/tm/ras_tm_component.c | 141 - orte/mca/ras/tm/ras_tm_module.c | 253 - orte/mca/rmaps/Makefile.am | 37 - orte/mca/rmaps/base/Makefile.am | 38 - orte/mca/rmaps/base/base.h | 138 - orte/mca/rmaps/base/help-orte-rmaps-base.txt | 457 -- orte/mca/rmaps/base/owner.txt | 7 - .../rmaps/base/rmaps_base_assign_locations.c | 80 - orte/mca/rmaps/base/rmaps_base_binding.c | 865 --- orte/mca/rmaps/base/rmaps_base_frame.c | 876 --- orte/mca/rmaps/base/rmaps_base_map_job.c | 595 -- orte/mca/rmaps/base/rmaps_base_print_fns.c | 225 - orte/mca/rmaps/base/rmaps_base_ranking.c | 896 ---- orte/mca/rmaps/base/rmaps_base_select.c | 113 - orte/mca/rmaps/base/rmaps_base_support_fns.c | 646 --- orte/mca/rmaps/base/rmaps_private.h | 72 - orte/mca/rmaps/mindist/Makefile.am | 49 - orte/mca/rmaps/mindist/help-orte-rmaps-md.txt | 53 - orte/mca/rmaps/mindist/owner.txt | 7 - orte/mca/rmaps/mindist/rmaps_mindist.h | 42 - .../rmaps/mindist/rmaps_mindist_component.c | 99 - orte/mca/rmaps/mindist/rmaps_mindist_module.c | 534 -- orte/mca/rmaps/ppr/Makefile.am | 38 - orte/mca/rmaps/ppr/help-orte-rmaps-ppr.txt | 66 - orte/mca/rmaps/ppr/owner.txt | 7 - orte/mca/rmaps/ppr/rmaps_ppr.c | 739 --- orte/mca/rmaps/ppr/rmaps_ppr.h | 27 - orte/mca/rmaps/ppr/rmaps_ppr_component.c | 85 - orte/mca/rmaps/rank_file/Makefile.am | 59 - .../rmaps/rank_file/common_sym_whitelist.txt | 4 - .../rmaps/rank_file/help-rmaps_rank_file.txt | 123 - orte/mca/rmaps/rank_file/owner.txt | 7 - orte/mca/rmaps/rank_file/rmaps_rank_file.c | 598 --- orte/mca/rmaps/rank_file/rmaps_rank_file.h | 65 - .../rank_file/rmaps_rank_file_component.c | 167 - .../mca/rmaps/rank_file/rmaps_rank_file_lex.h | 81 - .../mca/rmaps/rank_file/rmaps_rank_file_lex.l | 151 - orte/mca/rmaps/resilient/Makefile.am | 39 - .../resilient/help-orte-rmaps-resilient.txt | 28 - orte/mca/rmaps/resilient/owner.txt | 7 - orte/mca/rmaps/resilient/rmaps_resilient.c | 889 --- orte/mca/rmaps/resilient/rmaps_resilient.h | 48 - .../resilient/rmaps_resilient_component.c | 160 - orte/mca/rmaps/rmaps.h | 115 - orte/mca/rmaps/rmaps_types.h | 176 - orte/mca/rmaps/round_robin/Makefile.am | 51 - .../rmaps/round_robin/help-orte-rmaps-rr.txt | 56 - orte/mca/rmaps/round_robin/owner.txt | 7 - orte/mca/rmaps/round_robin/rmaps_rr.c | 393 -- orte/mca/rmaps/round_robin/rmaps_rr.h | 66 - orte/mca/rmaps/round_robin/rmaps_rr_assign.c | 171 - .../rmaps/round_robin/rmaps_rr_component.c | 101 - orte/mca/rmaps/round_robin/rmaps_rr_mappers.c | 794 --- orte/mca/rmaps/seq/Makefile.am | 48 - orte/mca/rmaps/seq/help-orte-rmaps-seq.txt | 26 - orte/mca/rmaps/seq/owner.txt | 7 - orte/mca/rmaps/seq/rmaps_seq.c | 544 -- orte/mca/rmaps/seq/rmaps_seq.h | 41 - orte/mca/rmaps/seq/rmaps_seq_component.c | 97 - orte/mca/rml/Makefile.am | 39 - orte/mca/rml/base/Makefile.am | 29 - orte/mca/rml/base/base.h | 231 - orte/mca/rml/base/owner.txt | 7 - orte/mca/rml/base/rml_base_contact.c | 68 - orte/mca/rml/base/rml_base_frame.c | 243 - orte/mca/rml/base/rml_base_msg_handlers.c | 264 - orte/mca/rml/base/rml_contact.h | 53 - orte/mca/rml/oob/Makefile.am | 48 - orte/mca/rml/oob/owner.txt | 7 - orte/mca/rml/oob/rml_oob.h | 66 - orte/mca/rml/oob/rml_oob_component.c | 194 - orte/mca/rml/oob/rml_oob_send.c | 264 - orte/mca/rml/rml.h | 350 -- orte/mca/rml/rml_types.h | 224 - orte/mca/routed/Makefile.am | 31 - orte/mca/routed/base/Makefile.am | 16 - orte/mca/routed/base/base.h | 50 - orte/mca/routed/base/owner.txt | 7 - orte/mca/routed/base/routed_base_fns.c | 144 - orte/mca/routed/base/routed_base_frame.c | 103 - orte/mca/routed/binomial/Makefile.am | 41 - orte/mca/routed/binomial/owner.txt | 7 - orte/mca/routed/binomial/routed_binomial.c | 556 -- orte/mca/routed/binomial/routed_binomial.h | 26 - .../binomial/routed_binomial_component.c | 54 - orte/mca/routed/debruijn/Makefile.am | 41 - orte/mca/routed/debruijn/owner.txt | 7 - orte/mca/routed/debruijn/routed_debruijn.c | 481 -- orte/mca/routed/debruijn/routed_debruijn.h | 27 - .../debruijn/routed_debruijn_component.c | 55 - orte/mca/routed/direct/Makefile.am | 39 - orte/mca/routed/direct/owner.txt | 7 - orte/mca/routed/direct/routed_direct.c | 363 -- orte/mca/routed/direct/routed_direct.h | 26 - .../routed/direct/routed_direct_component.c | 67 - orte/mca/routed/radix/Makefile.am | 39 - orte/mca/routed/radix/routed_radix.c | 545 -- orte/mca/routed/radix/routed_radix.h | 31 - .../mca/routed/radix/routed_radix_component.c | 75 - orte/mca/routed/routed.h | 262 - orte/mca/routed/routed_types.h | 50 - orte/mca/rtc/Makefile.am | 27 - orte/mca/rtc/base/Makefile.am | 18 - orte/mca/rtc/base/base.h | 84 - orte/mca/rtc/base/help-orte-rtc-base.txt | 288 - orte/mca/rtc/base/owner.txt | 7 - orte/mca/rtc/base/rtc_base_frame.c | 98 - orte/mca/rtc/base/rtc_base_select.c | 113 - orte/mca/rtc/base/rtc_base_stubs.c | 139 - orte/mca/rtc/hwloc/Makefile.am | 38 - orte/mca/rtc/hwloc/help-orte-rtc-hwloc.txt | 30 - orte/mca/rtc/hwloc/owner.txt | 7 - orte/mca/rtc/hwloc/rtc_hwloc.c | 737 --- orte/mca/rtc/hwloc/rtc_hwloc.h | 52 - orte/mca/rtc/hwloc/rtc_hwloc_component.c | 103 - orte/mca/rtc/rtc.h | 116 - orte/mca/schizo/Makefile.am | 30 - orte/mca/schizo/alps/Makefile.am | 36 - orte/mca/schizo/alps/configure.m4 | 47 - orte/mca/schizo/alps/owner.txt | 7 - orte/mca/schizo/alps/schizo_alps.c | 128 - orte/mca/schizo/alps/schizo_alps.h | 29 - orte/mca/schizo/alps/schizo_alps_component.c | 53 - orte/mca/schizo/base/Makefile.am | 16 - orte/mca/schizo/base/base.h | 85 - orte/mca/schizo/base/owner.txt | 7 - orte/mca/schizo/base/schizo_base_frame.c | 106 - orte/mca/schizo/base/schizo_base_select.c | 108 - orte/mca/schizo/base/schizo_base_stubs.c | 190 - orte/mca/schizo/flux/Makefile.am | 36 - orte/mca/schizo/flux/owner.txt | 7 - orte/mca/schizo/flux/schizo_flux.c | 100 - orte/mca/schizo/flux/schizo_flux.h | 28 - orte/mca/schizo/flux/schizo_flux_component.c | 51 - orte/mca/schizo/jsm/Makefile.am | 37 - orte/mca/schizo/jsm/configure.m4 | 31 - orte/mca/schizo/jsm/owner.txt | 7 - orte/mca/schizo/jsm/schizo_jsm.c | 104 - orte/mca/schizo/jsm/schizo_jsm.h | 30 - orte/mca/schizo/jsm/schizo_jsm_component.c | 52 - orte/mca/schizo/moab/Makefile.am | 40 - orte/mca/schizo/moab/configure.m4 | 41 - orte/mca/schizo/moab/owner.txt | 7 - orte/mca/schizo/moab/schizo_moab.c | 110 - orte/mca/schizo/moab/schizo_moab.h | 28 - orte/mca/schizo/moab/schizo_moab_component.c | 51 - orte/mca/schizo/ompi/Makefile.am | 37 - orte/mca/schizo/ompi/owner.txt | 7 - orte/mca/schizo/ompi/schizo_ompi.c | 1354 ----- orte/mca/schizo/ompi/schizo_ompi.h | 29 - orte/mca/schizo/ompi/schizo_ompi_component.c | 55 - orte/mca/schizo/orte/Makefile.am | 37 - orte/mca/schizo/orte/schizo_orte.c | 95 - orte/mca/schizo/orte/schizo_orte.h | 29 - orte/mca/schizo/orte/schizo_orte_component.c | 52 - orte/mca/schizo/schizo.h | 164 - orte/mca/schizo/slurm/Makefile.am | 37 - orte/mca/schizo/slurm/configure.m4 | 41 - orte/mca/schizo/slurm/owner.txt | 7 - orte/mca/schizo/slurm/schizo_slurm.c | 200 - orte/mca/schizo/slurm/schizo_slurm.h | 29 - .../mca/schizo/slurm/schizo_slurm_component.c | 51 - orte/mca/snapc/Makefile.am | 50 - orte/mca/snapc/base/Makefile.am | 28 - orte/mca/snapc/base/base.h | 140 - orte/mca/snapc/base/help-orte-snapc-base.txt | 25 - orte/mca/snapc/base/owner.txt | 7 - orte/mca/snapc/base/snapc_base_fns.c | 843 --- orte/mca/snapc/base/snapc_base_frame.c | 106 - orte/mca/snapc/base/snapc_base_select.c | 105 - orte/mca/snapc/full/Makefile.am | 49 - orte/mca/snapc/full/configure.m4 | 30 - orte/mca/snapc/full/help-orte-snapc-full.txt | 37 - orte/mca/snapc/full/owner.txt | 7 - orte/mca/snapc/full/snapc_full.h | 169 - orte/mca/snapc/full/snapc_full_app.c | 1647 ------ orte/mca/snapc/full/snapc_full_component.c | 181 - orte/mca/snapc/full/snapc_full_global.c | 2706 ---------- orte/mca/snapc/full/snapc_full_local.c | 2084 ------- orte/mca/snapc/full/snapc_full_module.c | 367 -- orte/mca/snapc/orte_snapc.7in | 105 - orte/mca/snapc/snapc.h | 405 -- orte/mca/sstore/Makefile.am | 42 - orte/mca/sstore/base/Makefile.am | 19 - orte/mca/sstore/base/base.h | 118 - orte/mca/sstore/base/owner.txt | 7 - orte/mca/sstore/base/sstore_base_fns.c | 974 ---- orte/mca/sstore/base/sstore_base_frame.c | 186 - orte/mca/sstore/base/sstore_base_select.c | 59 - orte/mca/sstore/central/Makefile.am | 42 - orte/mca/sstore/central/configure.m4 | 24 - .../central/help-orte-sstore-central.txt | 19 - orte/mca/sstore/central/owner.txt | 7 - orte/mca/sstore/central/sstore_central.h | 125 - orte/mca/sstore/central/sstore_central_app.c | 763 --- .../sstore/central/sstore_central_component.c | 123 - .../sstore/central/sstore_central_global.c | 1217 ----- .../mca/sstore/central/sstore_central_local.c | 983 ---- .../sstore/central/sstore_central_module.c | 356 -- orte/mca/sstore/orte_sstore.7in | 66 - orte/mca/sstore/sstore.h | 412 -- orte/mca/sstore/stage/Makefile.am | 42 - orte/mca/sstore/stage/configure.m4 | 24 - .../sstore/stage/help-orte-sstore-stage.txt | 26 - orte/mca/sstore/stage/owner.txt | 7 - orte/mca/sstore/stage/sstore_stage.h | 145 - orte/mca/sstore/stage/sstore_stage_app.c | 743 --- .../mca/sstore/stage/sstore_stage_component.c | 290 - orte/mca/sstore/stage/sstore_stage_global.c | 1756 ------ orte/mca/sstore/stage/sstore_stage_local.c | 2106 -------- orte/mca/sstore/stage/sstore_stage_module.c | 369 -- orte/mca/state/Makefile.am | 31 - orte/mca/state/app/Makefile.am | 37 - orte/mca/state/app/owner.txt | 7 - orte/mca/state/app/state_app.c | 99 - orte/mca/state/app/state_app.h | 36 - orte/mca/state/app/state_app_component.c | 84 - orte/mca/state/base/Makefile.am | 22 - orte/mca/state/base/base.h | 42 - orte/mca/state/base/help-state-base.txt | 13 - orte/mca/state/base/owner.txt | 7 - orte/mca/state/base/state_base_fns.c | 1126 ---- orte/mca/state/base/state_base_frame.c | 113 - orte/mca/state/base/state_base_select.c | 56 - orte/mca/state/base/state_private.h | 84 - orte/mca/state/hnp/Makefile.am | 37 - orte/mca/state/hnp/owner.txt | 7 - orte/mca/state/hnp/state_hnp.c | 363 -- orte/mca/state/hnp/state_hnp.h | 36 - orte/mca/state/hnp/state_hnp_component.c | 84 - orte/mca/state/novm/Makefile.am | 37 - orte/mca/state/novm/owner.txt | 7 - orte/mca/state/novm/state_novm.c | 289 - orte/mca/state/novm/state_novm.h | 36 - orte/mca/state/novm/state_novm_component.c | 84 - orte/mca/state/orted/Makefile.am | 37 - orte/mca/state/orted/owner.txt | 7 - orte/mca/state/orted/state_orted.c | 583 -- orte/mca/state/orted/state_orted.h | 36 - orte/mca/state/orted/state_orted_component.c | 84 - orte/mca/state/state.h | 278 - orte/mca/state/state_types.h | 77 - orte/mca/state/tool/Makefile.am | 36 - orte/mca/state/tool/owner.txt | 7 - orte/mca/state/tool/state_tool.c | 100 - orte/mca/state/tool/state_tool.h | 37 - orte/mca/state/tool/state_tool_component.c | 85 - orte/orted/Makefile.am | 46 - orte/orted/ft_tester.c | 121 - orte/orted/help-orted.txt | 118 - orte/orted/orted.h | 52 - orte/orted/orted_comm.c | 1455 ----- orte/orted/orted_main.c | 1186 ---- orte/orted/orted_submit.c | 3452 ------------ orte/orted/orted_submit.h | 111 - orte/orted/pmix/Makefile.am | 21 - orte/orted/pmix/pmix_server.c | 725 --- orte/orted/pmix/pmix_server.h | 42 - orte/orted/pmix/pmix_server_dyn.c | 813 --- orte/orted/pmix/pmix_server_fence.c | 292 - orte/orted/pmix/pmix_server_gen.c | 1189 ---- orte/orted/pmix/pmix_server_internal.h | 276 - orte/orted/pmix/pmix_server_pub.c | 601 --- orte/orted/pmix/pmix_server_register_fns.c | 595 -- orte/runtime/Makefile.am | 62 - .../data_type_support/orte_dt_compare_fns.c | 215 - .../data_type_support/orte_dt_copy_fns.c | 329 -- .../data_type_support/orte_dt_packing_fns.c | 883 --- .../data_type_support/orte_dt_print_fns.c | 872 --- .../data_type_support/orte_dt_support.h | 173 - .../data_type_support/orte_dt_unpacking_fns.c | 976 ---- orte/runtime/help-orte-runtime.txt | 63 - orte/runtime/orte_cr.c | 400 -- orte/runtime/orte_cr.h | 57 - orte/runtime/orte_data_server.c | 723 --- orte/runtime/orte_data_server.h | 54 - orte/runtime/orte_finalize.c | 102 - orte/runtime/orte_globals.c | 911 ---- orte/runtime/orte_globals.h | 586 -- orte/runtime/orte_info_support.c | 117 - orte/runtime/orte_info_support.h | 44 - orte/runtime/orte_init.c | 312 -- orte/runtime/orte_locks.c | 46 - orte/runtime/orte_locks.h | 48 - orte/runtime/orte_mca_params.c | 767 --- orte/runtime/orte_quit.c | 395 -- orte/runtime/orte_quit.h | 37 - orte/runtime/orte_wait.c | 276 - orte/runtime/orte_wait.h | 200 - orte/runtime/runtime.h | 81 - orte/runtime/runtime_internals.h | 40 - orte/test/mpi/Makefile | 35 - orte/test/mpi/Makefile.include | 60 - orte/test/mpi/abort.c | 44 - orte/test/mpi/accept.c | 44 - orte/test/mpi/add_host.c | 85 - orte/test/mpi/attach.c | 30 - orte/test/mpi/bad_exit.c | 25 - orte/test/mpi/badcoll.c | 28 - orte/test/mpi/bcast_loop.c | 36 - orte/test/mpi/binding.c | 63 - orte/test/mpi/client.c | 37 - orte/test/mpi/concurrent_spawn.c | 84 - orte/test/mpi/connect.c | 35 - orte/test/mpi/crisscross.c | 273 - orte/test/mpi/debugger.c | 31 - orte/test/mpi/delayed_abort.c | 41 - orte/test/mpi/early_abort.c | 46 - orte/test/mpi/hello.c | 40 - orte/test/mpi/hello_barrier.c | 24 - orte/test/mpi/hello_nodename.c | 54 - orte/test/mpi/hello_output.c | 37 - orte/test/mpi/hello_show_help.c | 53 - orte/test/mpi/hellocycle.pl | 33 - orte/test/mpi/info_spawn.c | 84 - orte/test/mpi/init-exit77.c | 13 - orte/test/mpi/intercomm_create.c | 172 - orte/test/mpi/interlib.c | 293 - orte/test/mpi/iof.c | 65 - orte/test/mpi/loop_child.c | 30 - orte/test/mpi/loop_spawn.c | 48 - orte/test/mpi/makedata.pl | 46 - orte/test/mpi/mpi_barrier.c | 17 - orte/test/mpi/mpi_info.c | 43 - orte/test/mpi/mpi_no_op.c | 17 - orte/test/mpi/mpi_spin.c | 91 - orte/test/mpi/multi_abort.c | 25 - orte/test/mpi/myhello.spec | 3 - orte/test/mpi/myring.spec | 3 - orte/test/mpi/no-disconnect.c | 210 - orte/test/mpi/nonzero.c | 23 - orte/test/mpi/parallel_r64.c | 222 - orte/test/mpi/parallel_r8.c | 222 - orte/test/mpi/parallel_w64.c | 228 - orte/test/mpi/parallel_w8.c | 227 - orte/test/mpi/pinterlib.c | 301 -- orte/test/mpi/pmix.c | 130 - orte/test/mpi/pubsub.c | 64 - orte/test/mpi/read_write.c | 56 - orte/test/mpi/reduce-hang.c | 37 - orte/test/mpi/ring.c | 63 - orte/test/mpi/segv.c | 30 - orte/test/mpi/sendrecv_blaster.c | 189 - orte/test/mpi/server.c | 55 - orte/test/mpi/shell_hello | 3 - orte/test/mpi/simple_spawn.c | 67 - orte/test/mpi/singleton_client_server.c | 212 - orte/test/mpi/sio.c | 23 - orte/test/mpi/slave.c | 33 - orte/test/mpi/spawn-problem/Makefile | 16 - orte/test/mpi/spawn-problem/ch_rec.c | 52 - orte/test/mpi/spawn-problem/start.c | 28 - orte/test/mpi/spawn_multiple.c | 66 - orte/test/mpi/spawn_tree.c | 73 - orte/test/mpi/thread_init.c | 11 - orte/test/mpi/xlib.c | 217 - orte/test/mpi/ziaprobe.c | 198 - orte/test/mpi/ziatest.README | 21 - orte/test/mpi/ziatest.c | 53 - orte/test/system/Makefile | 24 - orte/test/system/Makefile.include | 47 - orte/test/system/binom.c | 139 - orte/test/system/event-threads.c | 152 - orte/test/system/evpri-test.c | 108 - orte/test/system/evpri-test2.c | 101 - orte/test/system/evthread-test.c | 154 - orte/test/system/get_limits.c | 39 - orte/test/system/getenv_pmi.c | 98 - orte/test/system/iof_delay.c | 64 - orte/test/system/iof_stress.c | 71 - orte/test/system/mapper.c | 75 - orte/test/system/mapr.py | 18 - orte/test/system/no_op.c | 13 - orte/test/system/ofi_big_msg.c | 119 - orte/test/system/ofi_conduit_stress.c | 143 - orte/test/system/ofi_query_test.c | 137 - orte/test/system/ofi_stress.c | 121 - orte/test/system/oob_stress.c | 118 - orte/test/system/oob_stress_channel.c | 232 - orte/test/system/opal-evpri-test.c | 107 - orte/test/system/opal_hotel.c | 106 - orte/test/system/opal_hwloc.c | 133 - orte/test/system/opal_interface.c | 82 - orte/test/system/orte_abort.c | 60 - orte/test/system/orte_dfs.c | 311 -- orte/test/system/orte_errors.c | 33 - orte/test/system/orte_exit.c | 55 - orte/test/system/orte_loop_child.c | 22 - orte/test/system/orte_loop_spawn.c | 55 - orte/test/system/orte_no_op.c | 24 - orte/test/system/orte_nodename.c | 53 - orte/test/system/orte_notify.c | 91 - orte/test/system/orte_spawn.c | 91 - orte/test/system/orte_spin.c | 41 - orte/test/system/orte_tool.c | 104 - orte/test/system/pmixtool.c | 80 - orte/test/system/psm_keygen.c | 50 - orte/test/system/pspawn.c | 45 - orte/test/system/radix.c | 137 - orte/test/system/red.py | 38 - orte/test/system/reducer.c | 82 - orte/test/system/regex.c | 117 - orte/test/system/segfault.c | 18 - orte/test/system/sigusr_trap.c | 115 - orte/test/system/spin.c | 31 - orte/test/system/test-time.c | 88 - orte/test/system/threads.c | 335 -- orte/test/system/ulfm.c | 54 - orte/tools/Makefile.am | 41 - orte/tools/orte-clean/Makefile.am | 47 - orte/tools/orte-clean/help-orte-clean.txt | 26 - orte/tools/orte-clean/orte-clean.1in | 120 - orte/tools/orte-clean/orte-clean.c | 437 -- orte/tools/orte-info/Makefile.am | 77 - orte/tools/orte-info/components.c | 110 - orte/tools/orte-info/help-orte-info.txt | 58 - orte/tools/orte-info/orte-info.1in | 162 - orte/tools/orte-info/orte-info.c | 280 - orte/tools/orte-info/orte-info.h | 129 - orte/tools/orte-info/output.c | 200 - orte/tools/orte-info/param.c | 439 -- orte/tools/orte-info/version.c | 360 -- orte/tools/orte-server/Makefile.am | 47 - orte/tools/orte-server/help-orte-server.txt | 27 - orte/tools/orte-server/orte-server.1in | 72 - orte/tools/orte-server/orte-server.c | 306 -- orte/tools/orted/Makefile.am | 52 - orte/tools/orted/orted.1in | 46 - orte/tools/orted/orted.c | 61 - orte/tools/orterun/Makefile.am | 53 - orte/tools/orterun/help-orterun.txt | 694 --- orte/tools/orterun/main.c | 32 - orte/tools/orterun/orterun.1in | 1780 ------ orte/tools/orterun/orterun.c | 211 - orte/tools/orterun/orterun.h | 37 - orte/tools/wrappers/Makefile.am | 40 - orte/tools/wrappers/orte.pc.in | 25 - orte/tools/wrappers/orte_wrapper_script.in | 172 - .../tools/wrappers/ortecc-wrapper-data.txt.in | 29 - orte/util/Makefile.am | 87 - orte/util/attr.c | 733 --- orte/util/attr.h | 269 - orte/util/comm/comm.c | 818 --- orte/util/comm/comm.h | 64 - orte/util/context_fns.c | 153 - orte/util/context_fns.h | 40 - orte/util/dash_host/dash_host.c | 670 --- orte/util/dash_host/dash_host.h | 49 - orte/util/dash_host/help-dash-host.txt | 68 - orte/util/error_strings.c | 443 -- orte/util/error_strings.h | 49 - orte/util/help-regex.txt | 86 - orte/util/hnp_contact.c | 254 - orte/util/hnp_contact.h | 61 - orte/util/hostfile/help-hostfile.txt | 146 - orte/util/hostfile/hostfile.c | 1034 ---- orte/util/hostfile/hostfile.h | 45 - orte/util/hostfile/hostfile_lex.h | 86 - orte/util/hostfile/hostfile_lex.l | 188 - orte/util/hostfile/orte_hosts.7in | 197 - orte/util/listener.c | 381 -- orte/util/listener.h | 66 - orte/util/name_fns.c | 679 --- orte/util/name_fns.h | 144 - orte/util/nidmap.c | 1261 ----- orte/util/nidmap.h | 52 - orte/util/parse_options.c | 145 - orte/util/parse_options.h | 36 - orte/util/pre_condition_transports.c | 192 - orte/util/pre_condition_transports.h | 42 - orte/util/proc_info.c | 366 -- orte/util/proc_info.h | 166 - orte/util/session_dir.c | 610 --- orte/util/session_dir.h | 150 - orte/util/show_help.c | 802 --- orte/util/show_help.h | 109 - orte/util/threads.h | 159 - oshmem/info/info.c | 2 +- oshmem/proc/proc.c | 4 +- oshmem/tools/oshmem_info/Makefile.am | 4 +- oshmem/tools/oshmem_info/oshmem_info.c | 11 +- oshmem/tools/oshmem_info/param.c | 24 +- oshmem/tools/wrappers/Makefile.am | 24 +- prrte | 1 + 1759 files changed, 2860 insertions(+), 368094 deletions(-) create mode 100644 autogen.subdirs create mode 100644 config/ompi_setup_prrte.m4 delete mode 100644 config/orte_check_lsf.m4 delete mode 100644 config/orte_check_moab.m4 delete mode 100644 config/orte_check_sge.m4 delete mode 100644 config/orte_check_slurm.m4 delete mode 100644 config/orte_check_tm.m4 delete mode 100644 config/orte_config_files.m4 delete mode 100644 config/orte_configure_options.m4 delete mode 100644 config/orte_setup_debugger_flags.m4 delete mode 100644 ompi/mca/rte/Makefile.am delete mode 100644 ompi/mca/rte/base/Makefile.am delete mode 100644 ompi/mca/rte/base/base.h delete mode 100644 ompi/mca/rte/base/rte_base_frame.c delete mode 100644 ompi/mca/rte/configure.m4 delete mode 100644 ompi/mca/rte/orte/Makefile.am delete mode 100644 ompi/mca/rte/orte/configure.m4 delete mode 100644 ompi/mca/rte/orte/rte_orte.h delete mode 100644 ompi/mca/rte/orte/rte_orte_component.c delete mode 100644 ompi/mca/rte/orte/rte_orte_module.c delete mode 100644 ompi/mca/rte/pmix/Makefile.am delete mode 100644 ompi/mca/rte/pmix/configure.m4 delete mode 100644 ompi/mca/rte/pmix/rte_pmix.h delete mode 100644 ompi/mca/rte/pmix/rte_pmix_component.c rename ompi/{mca/rte/pmix/rte_pmix_module.c => runtime/ompi_rte.c} (80%) rename ompi/{mca/rte/rte.h => runtime/ompi_rte.h} (71%) create mode 100644 ompi/tools/mpirun/Makefile.am create mode 100644 opal/mca/pmix/autogen.options delete mode 100644 opal/mca/pmix/base/pmix_base_fns.h delete mode 100644 opal/mca/pmix/base/pmix_base_hash.c delete mode 100644 opal/mca/pmix/base/pmix_base_hash.h delete mode 100644 opal/mca/pmix/base/pmix_base_select.c create mode 100644 opal/mca/pmix/configure.m4 delete mode 100644 opal/mca/pmix/cray/Makefile.am delete mode 100644 opal/mca/pmix/cray/configure.m4 delete mode 100644 opal/mca/pmix/cray/help-pmix-cray.txt delete mode 100644 opal/mca/pmix/cray/owner.txt delete mode 100644 opal/mca/pmix/cray/pmix_cray.c delete mode 100644 opal/mca/pmix/cray/pmix_cray.h delete mode 100644 opal/mca/pmix/cray/pmix_cray_component.c delete mode 100644 opal/mca/pmix/cray/pmix_cray_pmap_parser.c delete mode 100644 opal/mca/pmix/cray/pmix_cray_pmap_parser.h delete mode 100644 opal/mca/pmix/ext1x/Makefile.am delete mode 100644 opal/mca/pmix/ext1x/configure.m4 delete mode 100644 opal/mca/pmix/ext1x/pmix1x.c delete mode 100644 opal/mca/pmix/ext1x/pmix1x.h delete mode 100644 opal/mca/pmix/ext1x/pmix1x_client.c delete mode 100644 opal/mca/pmix/ext1x/pmix1x_component.c delete mode 100644 opal/mca/pmix/ext1x/pmix1x_server_north.c delete mode 100644 opal/mca/pmix/ext1x/pmix1x_server_south.c delete mode 100644 opal/mca/pmix/ext2x/Makefile.am delete mode 100644 opal/mca/pmix/ext2x/common_sym_whitelist.txt delete mode 100644 opal/mca/pmix/ext2x/configure.m4 delete mode 100644 opal/mca/pmix/ext2x/ext2x.c delete mode 100644 opal/mca/pmix/ext2x/ext2x.h delete mode 100644 opal/mca/pmix/ext2x/ext2x_client.c delete mode 100644 opal/mca/pmix/ext2x/ext2x_component.c delete mode 100644 opal/mca/pmix/ext2x/ext2x_local.c delete mode 100644 opal/mca/pmix/ext2x/ext2x_server_north.c delete mode 100644 opal/mca/pmix/ext2x/ext2x_server_south.c delete mode 100644 opal/mca/pmix/ext2x/help-pmix-ext2x.txt delete mode 100644 opal/mca/pmix/ext3x/Makefile.am delete mode 100644 opal/mca/pmix/ext3x/common_sym_whitelist.txt delete mode 100644 opal/mca/pmix/ext3x/configure.m4 delete mode 100644 opal/mca/pmix/ext3x/ext3x.c delete mode 100644 opal/mca/pmix/ext3x/ext3x.h delete mode 100644 opal/mca/pmix/ext3x/ext3x_client.c delete mode 100644 opal/mca/pmix/ext3x/ext3x_component.c delete mode 100644 opal/mca/pmix/ext3x/ext3x_local.c delete mode 100644 opal/mca/pmix/ext3x/ext3x_server_north.c delete mode 100644 opal/mca/pmix/ext3x/ext3x_server_south.c delete mode 100644 opal/mca/pmix/ext3x/help-pmix-ext3x.txt delete mode 100644 opal/mca/pmix/ext4x/Makefile.am delete mode 100644 opal/mca/pmix/ext4x/common_sym_whitelist.txt delete mode 100644 opal/mca/pmix/ext4x/configure.m4 delete mode 100644 opal/mca/pmix/ext4x/ext4x_local.c delete mode 100644 opal/mca/pmix/ext4x/help-pmix-ext4x.txt create mode 100644 opal/mca/pmix/external/Makefile.am create mode 100644 opal/mca/pmix/external/configure.m4 create mode 100644 opal/mca/pmix/external/external.h rename {orte/mca/ess/alps => opal/mca/pmix/external}/owner.txt (92%) create mode 100644 opal/mca/pmix/external/pmix_external_component.c delete mode 100644 opal/mca/pmix/flux/Makefile.am delete mode 100644 opal/mca/pmix/flux/configure.m4 delete mode 100644 opal/mca/pmix/flux/owner.txt delete mode 100644 opal/mca/pmix/flux/pmix_flux.c delete mode 100644 opal/mca/pmix/flux/pmix_flux.h delete mode 100644 opal/mca/pmix/flux/pmix_flux_component.c delete mode 100644 opal/mca/pmix/isolated/Makefile.am delete mode 100644 opal/mca/pmix/isolated/pmix_isolated.c delete mode 100644 opal/mca/pmix/isolated/pmix_isolated.h delete mode 100644 opal/mca/pmix/isolated/pmix_isolated_component.c create mode 100644 opal/mca/pmix/pmix-internal.h delete mode 100644 opal/mca/pmix/pmix.h delete mode 100644 opal/mca/pmix/pmix4x/help-pmix-pmix4x.txt create mode 160000 opal/mca/pmix/pmix4x/openpmix delete mode 100644 opal/mca/pmix/pmix4x/openpmix/AUTHORS delete mode 100644 opal/mca/pmix/pmix4x/openpmix/HACKING delete mode 100644 opal/mca/pmix/pmix4x/openpmix/INSTALL delete mode 100644 opal/mca/pmix/pmix4x/openpmix/LICENSE delete mode 100644 opal/mca/pmix/pmix4x/openpmix/Makefile.am delete mode 100644 opal/mca/pmix/pmix4x/openpmix/Makefile.pmix-rules delete mode 100644 opal/mca/pmix/pmix4x/openpmix/NEWS delete mode 100644 opal/mca/pmix/pmix4x/openpmix/README delete mode 100644 opal/mca/pmix/pmix4x/openpmix/VERSION delete mode 100755 opal/mca/pmix/pmix4x/openpmix/autogen.pl delete mode 100644 opal/mca/pmix/pmix4x/openpmix/bindings/Makefile.am delete mode 100644 opal/mca/pmix/pmix4x/openpmix/bindings/README delete mode 100644 opal/mca/pmix/pmix4x/openpmix/bindings/python/Makefile.am delete mode 100644 opal/mca/pmix/pmix4x/openpmix/bindings/python/README delete mode 100755 opal/mca/pmix/pmix4x/openpmix/bindings/python/construct.py delete mode 100644 opal/mca/pmix/pmix4x/openpmix/bindings/python/pmix.pxi delete mode 100644 opal/mca/pmix/pmix4x/openpmix/bindings/python/pmix.pyx delete mode 100755 opal/mca/pmix/pmix4x/openpmix/bindings/python/setup.py delete mode 100644 opal/mca/pmix/pmix4x/openpmix/config/Makefile.am delete mode 100644 opal/mca/pmix/pmix4x/openpmix/config/c_get_alignment.m4 delete mode 100755 opal/mca/pmix/pmix4x/openpmix/config/distscript.sh delete mode 100644 opal/mca/pmix/pmix4x/openpmix/config/pmix.m4 delete mode 100644 opal/mca/pmix/pmix4x/openpmix/config/pmix_check_attributes.m4 delete mode 100644 opal/mca/pmix/pmix4x/openpmix/config/pmix_check_broken_qsort.m4 delete mode 100644 opal/mca/pmix/pmix4x/openpmix/config/pmix_check_compiler_version.m4 delete mode 100644 opal/mca/pmix/pmix4x/openpmix/config/pmix_check_icc.m4 delete mode 100644 opal/mca/pmix/pmix4x/openpmix/config/pmix_check_ident.m4 delete mode 100644 opal/mca/pmix/pmix4x/openpmix/config/pmix_check_lock.m4 delete mode 100644 opal/mca/pmix/pmix4x/openpmix/config/pmix_check_os_flavors.m4 delete mode 100644 opal/mca/pmix/pmix4x/openpmix/config/pmix_check_package.m4 delete mode 100644 opal/mca/pmix/pmix4x/openpmix/config/pmix_check_pthread_pids.m4 delete mode 100644 opal/mca/pmix/pmix4x/openpmix/config/pmix_check_vendor.m4 delete mode 100644 opal/mca/pmix/pmix4x/openpmix/config/pmix_check_visibility.m4 delete mode 100644 opal/mca/pmix/pmix4x/openpmix/config/pmix_check_withdir.m4 delete mode 100644 opal/mca/pmix/pmix4x/openpmix/config/pmix_config_asm.m4 delete mode 100644 opal/mca/pmix/pmix4x/openpmix/config/pmix_config_pthreads.m4 delete mode 100644 opal/mca/pmix/pmix4x/openpmix/config/pmix_config_subdir.m4 delete mode 100644 opal/mca/pmix/pmix4x/openpmix/config/pmix_config_subdir_args.m4 delete mode 100644 opal/mca/pmix/pmix4x/openpmix/config/pmix_config_threads.m4 delete mode 100644 opal/mca/pmix/pmix4x/openpmix/config/pmix_ensure_contains_optflags.m4 delete mode 100644 opal/mca/pmix/pmix4x/openpmix/config/pmix_functions.m4 delete mode 100755 opal/mca/pmix/pmix4x/openpmix/config/pmix_get_version.sh delete mode 100644 opal/mca/pmix/pmix4x/openpmix/config/pmix_load_platform.m4 delete mode 100644 opal/mca/pmix/pmix4x/openpmix/config/pmix_mca.m4 delete mode 100755 opal/mca/pmix/pmix4x/openpmix/config/pmix_mca_priority_sort.pl delete mode 100644 opal/mca/pmix/pmix4x/openpmix/config/pmix_search_libs.m4 delete mode 100644 opal/mca/pmix/pmix4x/openpmix/config/pmix_set_mca_prefix.m4 delete mode 100644 opal/mca/pmix/pmix4x/openpmix/config/pmix_setup_cc.m4 delete mode 100644 opal/mca/pmix/pmix4x/openpmix/config/pmix_setup_cli.m4 delete mode 100644 opal/mca/pmix/pmix4x/openpmix/config/pmix_setup_hwloc.m4 delete mode 100644 opal/mca/pmix/pmix4x/openpmix/config/pmix_setup_libev.m4 delete mode 100644 opal/mca/pmix/pmix4x/openpmix/config/pmix_setup_libevent.m4 delete mode 100644 opal/mca/pmix/pmix4x/openpmix/config/pmix_setup_wrappers.m4 delete mode 100644 opal/mca/pmix/pmix4x/openpmix/config/pmix_summary.m4 delete mode 100644 opal/mca/pmix/pmix4x/openpmix/config/pmix_try_assemble.m4 delete mode 100644 opal/mca/pmix/pmix4x/openpmix/configure.ac delete mode 100644 opal/mca/pmix/pmix4x/openpmix/contrib/Makefile.am delete mode 100755 opal/mca/pmix/pmix4x/openpmix/contrib/buildrpm.sh delete mode 100755 opal/mca/pmix/pmix4x/openpmix/contrib/make_dist_tarball delete mode 100755 opal/mca/pmix/pmix4x/openpmix/contrib/make_manpage.pl delete mode 100644 opal/mca/pmix/pmix4x/openpmix/contrib/perf_tools/Makefile delete mode 100644 opal/mca/pmix/pmix4x/openpmix/contrib/perf_tools/Makefile.include delete mode 100644 opal/mca/pmix/pmix4x/openpmix/contrib/perf_tools/README delete mode 100644 opal/mca/pmix/pmix4x/openpmix/contrib/perf_tools/pmi.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/contrib/perf_tools/pmi2.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/contrib/perf_tools/pmi2_pmap_parser.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/contrib/perf_tools/pmi2_pmap_parser.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/contrib/perf_tools/pmi2_utils.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/contrib/perf_tools/pmi2_utils.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/contrib/perf_tools/pmi_intra_perf.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/contrib/perf_tools/pmix.c delete mode 100755 opal/mca/pmix/pmix4x/openpmix/contrib/perf_tools/run.sh delete mode 100644 opal/mca/pmix/pmix4x/openpmix/contrib/platform/optimized delete mode 100755 opal/mca/pmix/pmix4x/openpmix/contrib/pmix-release.sh delete mode 100644 opal/mca/pmix/pmix4x/openpmix/contrib/pmix-valgrind.supp delete mode 100644 opal/mca/pmix/pmix4x/openpmix/contrib/pmix.spec delete mode 100644 opal/mca/pmix/pmix4x/openpmix/contrib/pmix_jenkins.sh delete mode 100755 opal/mca/pmix/pmix4x/openpmix/contrib/update-my-copyright.pl delete mode 100755 opal/mca/pmix/pmix4x/openpmix/contrib/whitespace-purge.sh delete mode 100644 opal/mca/pmix/pmix4x/openpmix/etc/Makefile.am delete mode 100644 opal/mca/pmix/pmix4x/openpmix/etc/pmix-mca-params.conf delete mode 100644 opal/mca/pmix/pmix4x/openpmix/examples/Makefile.am delete mode 100644 opal/mca/pmix/pmix4x/openpmix/examples/alloc.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/examples/asyncgroup.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/examples/client.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/examples/client2.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/examples/debugger.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/examples/debuggerd.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/examples/dmodex.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/examples/dynamic.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/examples/examples.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/examples/fault.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/examples/group.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/examples/jctrl.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/examples/pub.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/examples/pubi.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/examples/server.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/examples/tool.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/include/Makefile.am delete mode 100644 opal/mca/pmix/pmix4x/openpmix/include/pmi.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/include/pmi2.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/include/pmix.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/include/pmix_common.h.in delete mode 100644 opal/mca/pmix/pmix4x/openpmix/include/pmix_extend.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/include/pmix_rename.h.in delete mode 100644 opal/mca/pmix/pmix4x/openpmix/include/pmix_sched.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/include/pmix_server.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/include/pmix_tool.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/include/pmix_version.h.in delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/Makefile.am delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/atomics/sys/Makefile.include delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/atomics/sys/architecture.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/atomics/sys/arm/Makefile.include delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/atomics/sys/arm/atomic.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/atomics/sys/arm/timer.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/atomics/sys/arm64/Makefile.include delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/atomics/sys/arm64/atomic.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/atomics/sys/arm64/timer.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/atomics/sys/atomic.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/atomics/sys/atomic_impl.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/atomics/sys/atomic_stdc.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/atomics/sys/cma.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/atomics/sys/gcc_builtin/Makefile.include delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/atomics/sys/gcc_builtin/atomic.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/atomics/sys/ia32/Makefile.include delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/atomics/sys/ia32/atomic.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/atomics/sys/ia32/timer.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/atomics/sys/powerpc/Makefile.include delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/atomics/sys/powerpc/atomic.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/atomics/sys/powerpc/timer.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/atomics/sys/sparcv9/Makefile.include delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/atomics/sys/sparcv9/atomic.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/atomics/sys/sparcv9/timer.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/atomics/sys/sync_builtin/Makefile.include delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/atomics/sys/sync_builtin/atomic.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/atomics/sys/timer.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/atomics/sys/x86_64/Makefile.include delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/atomics/sys/x86_64/atomic.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/atomics/sys/x86_64/timer.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/class/Makefile.include delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/class/pmix_bitmap.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/class/pmix_bitmap.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/class/pmix_hash_table.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/class/pmix_hash_table.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/class/pmix_hotel.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/class/pmix_hotel.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/class/pmix_list.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/class/pmix_list.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/class/pmix_object.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/class/pmix_object.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/class/pmix_pointer_array.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/class/pmix_pointer_array.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/class/pmix_ring_buffer.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/class/pmix_ring_buffer.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/class/pmix_value_array.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/class/pmix_value_array.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/client/Makefile.include delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/client/pmi1.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/client/pmi2.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/client/pmix_client.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/client/pmix_client_connect.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/client/pmix_client_fence.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/client/pmix_client_get.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/client/pmix_client_group.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/client/pmix_client_ops.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/client/pmix_client_pub.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/client/pmix_client_spawn.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/common/Makefile.include delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/common/pmix_attributes.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/common/pmix_attributes.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/common/pmix_control.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/common/pmix_data.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/common/pmix_iof.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/common/pmix_iof.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/common/pmix_log.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/common/pmix_query.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/common/pmix_security.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/common/pmix_strings.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/event/Makefile.include delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/event/pmix_event.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/event/pmix_event_notification.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/event/pmix_event_registration.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/hwloc/Makefile.include delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/hwloc/hwloc-internal.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/hwloc/hwloc.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/include/Makefile.include delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/include/align.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/include/hash_string.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/include/pmix_config_bottom.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/include/pmix_config_top.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/include/pmix_globals.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/include/pmix_globals.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/include/pmix_portable_platform.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/include/pmix_socket_errno.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/include/pmix_stdatomic.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/include/pmix_stdint.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/include/prefetch.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/include/types.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/Makefile.include delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/base/Makefile.am delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/base/base.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/base/help-pmix-mca-base.txt delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/base/help-pmix-mca-var.txt delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/base/pmix_mca_base_close.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/base/pmix_mca_base_cmd_line.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/base/pmix_mca_base_component_compare.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/base/pmix_mca_base_component_find.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/base/pmix_mca_base_component_repository.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/base/pmix_mca_base_component_repository.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/base/pmix_mca_base_components_close.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/base/pmix_mca_base_components_open.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/base/pmix_mca_base_components_register.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/base/pmix_mca_base_components_select.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/base/pmix_mca_base_framework.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/base/pmix_mca_base_framework.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/base/pmix_mca_base_list.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/base/pmix_mca_base_open.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/base/pmix_mca_base_parse_paramfile.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/base/pmix_mca_base_var.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/base/pmix_mca_base_var.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/base/pmix_mca_base_var_enum.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/base/pmix_mca_base_var_enum.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/base/pmix_mca_base_var_group.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/base/pmix_mca_base_var_group.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/base/pmix_mca_base_vari.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/bfrops/Makefile.am delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/bfrops/base/Makefile.include delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/bfrops/base/base.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/bfrops/base/bfrop_base_copy.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/bfrops/base/bfrop_base_fns.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/bfrops/base/bfrop_base_frame.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/bfrops/base/bfrop_base_pack.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/bfrops/base/bfrop_base_print.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/bfrops/base/bfrop_base_select.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/bfrops/base/bfrop_base_stubs.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/bfrops/base/bfrop_base_unpack.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/bfrops/bfrops.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/bfrops/bfrops_types.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/bfrops/v12/Makefile.am delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/bfrops/v12/bfrop_v12.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/bfrops/v12/bfrop_v12.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/bfrops/v12/bfrop_v12_component.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/bfrops/v12/copy.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/bfrops/v12/internal.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/bfrops/v12/pack.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/bfrops/v12/print.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/bfrops/v12/unpack.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/bfrops/v20/Makefile.am delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/bfrops/v20/bfrop_pmix20.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/bfrops/v20/bfrop_pmix20.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/bfrops/v20/bfrop_pmix20_component.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/bfrops/v20/copy.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/bfrops/v20/internal.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/bfrops/v20/pack.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/bfrops/v20/print.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/bfrops/v20/unpack.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/bfrops/v21/Makefile.am delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/bfrops/v21/bfrop_pmix21.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/bfrops/v21/bfrop_pmix21.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/bfrops/v21/bfrop_pmix21_component.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/bfrops/v3/Makefile.am delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/bfrops/v3/bfrop_pmix3.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/bfrops/v3/bfrop_pmix3.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/bfrops/v3/bfrop_pmix3_component.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/bfrops/v4/Makefile.am delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/bfrops/v4/bfrop_pmix4.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/bfrops/v4/bfrop_pmix4.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/bfrops/v4/bfrop_pmix4_component.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/common/Makefile.am delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/common/dstore/Makefile.am delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/common/dstore/configure.m4 delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/common/dstore/dstore_base.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/common/dstore/dstore_base.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/common/dstore/dstore_common.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/common/dstore/dstore_file.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/common/dstore/dstore_segment.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/common/dstore/dstore_segment.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/gds/Makefile.am delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/gds/base/Makefile.include delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/gds/base/base.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/gds/base/gds_base_fns.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/gds/base/gds_base_frame.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/gds/base/gds_base_select.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/gds/ds12/Makefile.am delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/gds/ds12/gds_ds12_base.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/gds/ds12/gds_ds12_base.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/gds/ds12/gds_ds12_component.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/gds/ds12/gds_ds12_file.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/gds/ds12/gds_ds12_file.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/gds/ds12/gds_ds12_lock.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/gds/ds12/gds_ds12_lock.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/gds/ds12/gds_ds12_lock_fcntl.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/gds/ds12/gds_ds12_lock_pthread.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/gds/ds12/gds_ds20_file.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/gds/ds21/Makefile.am delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/gds/ds21/gds_ds21_base.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/gds/ds21/gds_ds21_base.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/gds/ds21/gds_ds21_component.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/gds/ds21/gds_ds21_file.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/gds/ds21/gds_ds21_file.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/gds/ds21/gds_ds21_lock.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/gds/ds21/gds_ds21_lock.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/gds/ds21/gds_ds21_lock_pthread.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/gds/gds.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/gds/hash/Makefile.am delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/gds/hash/gds_hash.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/gds/hash/gds_hash.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/gds/hash/gds_hash_component.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/mca.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/pcompress/Makefile.am delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/pcompress/base/Makefile.am delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/pcompress/base/base.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/pcompress/base/pcompress_base_frame.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/pcompress/base/pcompress_base_select.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/pcompress/pcompress.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/pcompress/zlib/Makefile.am delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/pcompress/zlib/compress_zlib.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/pcompress/zlib/compress_zlib.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/pcompress/zlib/compress_zlib_component.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/pcompress/zlib/configure.m4 delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/pdl/Makefile.am delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/pdl/base/Makefile.am delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/pdl/base/base.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/pdl/base/pdl_base_close.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/pdl/base/pdl_base_fns.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/pdl/base/pdl_base_open.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/pdl/base/pdl_base_select.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/pdl/configure.m4 delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/pdl/pdl.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/pdl/pdlopen/Makefile.am delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/pdl/pdlopen/configure.m4 delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/pdl/pdlopen/pdl_pdlopen.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/pdl/pdlopen/pdl_pdlopen_component.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/pdl/pdlopen/pdl_pdlopen_module.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/pdl/plibltdl/Makefile.am delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/pdl/plibltdl/configure.m4 delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/pdl/plibltdl/pdl_libltdl.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/pdl/plibltdl/pdl_libltdl_component.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/pdl/plibltdl/pdl_libltdl_module.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/pfexec/Makefile.am delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/pfexec/base/Makefile.am delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/pfexec/base/base.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/pfexec/base/help-pfexec-base.txt delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/pfexec/base/pfexec_base_default_fns.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/pfexec/base/pfexec_base_frame.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/pfexec/base/pfexec_base_select.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/pfexec/linux/Makefile.am delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/pfexec/linux/configure.m4 delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/pfexec/linux/help-pfexec-linux.txt delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/pfexec/linux/pfexec_linux.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/pfexec/linux/pfexec_linux.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/pfexec/linux/pfexec_linux_component.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/pfexec/pfexec.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/pif/Makefile.am delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/pif/base/Makefile.am delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/pif/base/base.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/pif/base/pif_base_components.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/pif/bsdx_ipv4/Makefile.am delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/pif/bsdx_ipv4/configure.m4 delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/pif/bsdx_ipv4/pif_bsdx.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/pif/bsdx_ipv6/Makefile.am delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/pif/bsdx_ipv6/configure.m4 delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/pif/bsdx_ipv6/pif_bsdx_ipv6.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/pif/linux_ipv6/Makefile.am delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/pif/linux_ipv6/configure.m4 delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/pif/linux_ipv6/pif_linux_ipv6.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/pif/pif.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/pif/posix_ipv4/Makefile.am delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/pif/posix_ipv4/configure.m4 delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/pif/posix_ipv4/pif_posix.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/pif/solaris_ipv6/Makefile.am delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/pif/solaris_ipv6/configure.m4 delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/pif/solaris_ipv6/pif_solaris_ipv6.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/pinstalldirs/Makefile.am delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/pinstalldirs/base/Makefile.am delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/pinstalldirs/base/base.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/pinstalldirs/base/pinstalldirs_base_components.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/pinstalldirs/base/pinstalldirs_base_expand.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/pinstalldirs/config/Makefile.am delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/pinstalldirs/config/configure.m4 delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/pinstalldirs/config/pinstall_dirs.h.in delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/pinstalldirs/config/pmix_pinstalldirs_config.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/pinstalldirs/configure.m4 delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/pinstalldirs/env/Makefile.am delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/pinstalldirs/env/configure.m4 delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/pinstalldirs/env/pmix_pinstalldirs_env.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/pinstalldirs/pinstalldirs.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/plog/Makefile.am delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/plog/base/Makefile.include delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/plog/base/base.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/plog/base/help-pmix-plog.txt delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/plog/base/plog_base_frame.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/plog/base/plog_base_select.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/plog/base/plog_base_stubs.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/plog/default/Makefile.am delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/plog/default/plog_default.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/plog/default/plog_default.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/plog/default/plog_default_component.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/plog/plog.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/plog/stdfd/Makefile.am delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/plog/stdfd/plog_stdfd.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/plog/stdfd/plog_stdfd.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/plog/stdfd/plog_stdfd_component.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/plog/syslog/Makefile.am delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/plog/syslog/configure.m4 delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/plog/syslog/plog_syslog.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/plog/syslog/plog_syslog.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/plog/syslog/plog_syslog_component.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/pmdl/Makefile.am delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/pmdl/base/Makefile.include delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/pmdl/base/base.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/pmdl/base/pmdl_base_frame.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/pmdl/base/pmdl_base_select.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/pmdl/base/pmdl_base_stubs.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/pmdl/ompi/Makefile.am delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/pmdl/ompi/pmdl_ompi.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/pmdl/ompi/pmdl_ompi.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/pmdl/ompi/pmdl_ompi_component.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/pmdl/pmdl.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/pnet/Makefile.am delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/pnet/base/Makefile.include delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/pnet/base/base.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/pnet/base/pnet_base_fns.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/pnet/base/pnet_base_frame.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/pnet/base/pnet_base_select.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/pnet/pnet.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/pnet/tcp/Makefile.am delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/pnet/tcp/pnet_tcp.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/pnet/tcp/pnet_tcp.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/pnet/tcp/pnet_tcp_component.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/pnet/test/Makefile.am delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/pnet/test/pnet_test.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/pnet/test/pnet_test.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/pnet/test/pnet_test_component.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/preg/Makefile.am delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/preg/base/Makefile.include delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/preg/base/base.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/preg/base/preg_base_frame.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/preg/base/preg_base_select.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/preg/base/preg_base_stubs.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/preg/compress/Makefile.am delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/preg/compress/preg_compress.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/preg/compress/preg_compress.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/preg/compress/preg_compress_component.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/preg/native/Makefile.am delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/preg/native/preg_native.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/preg/native/preg_native.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/preg/native/preg_native_component.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/preg/preg.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/preg/preg_types.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/psec/Makefile.am delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/psec/base/Makefile.include delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/psec/base/base.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/psec/base/psec_base_fns.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/psec/base/psec_base_frame.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/psec/base/psec_base_select.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/psec/dummy_handshake/Makefile.am delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/psec/dummy_handshake/psec_dummy_handshake.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/psec/dummy_handshake/psec_dummy_handshake.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/psec/dummy_handshake/psec_dummy_handshake_component.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/psec/munge/Makefile.am delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/psec/munge/configure.m4 delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/psec/munge/psec_munge.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/psec/munge/psec_munge.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/psec/munge/psec_munge_component.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/psec/native/Makefile.am delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/psec/native/psec_native.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/psec/native/psec_native.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/psec/native/psec_native_component.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/psec/none/Makefile.am delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/psec/none/psec_none.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/psec/none/psec_none.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/psec/none/psec_none_component.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/psec/psec.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/psensor/Makefile.am delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/psensor/base/Makefile.am delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/psensor/base/base.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/psensor/base/psensor_base_frame.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/psensor/base/psensor_base_select.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/psensor/base/psensor_base_stubs.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/psensor/file/Makefile.am delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/psensor/file/help-pmix-psensor-file.txt delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/psensor/file/psensor_file.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/psensor/file/psensor_file.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/psensor/file/psensor_file_component.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/psensor/heartbeat/Makefile.am delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/psensor/heartbeat/help-pmix-psensor-heartbeat.txt delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/psensor/heartbeat/psensor_heartbeat.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/psensor/heartbeat/psensor_heartbeat.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/psensor/heartbeat/psensor_heartbeat_component.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/psensor/psensor.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/pshmem/Makefile.am delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/pshmem/base/Makefile.include delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/pshmem/base/base.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/pshmem/base/pshmem_base_frame.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/pshmem/base/pshmem_base_select.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/pshmem/mmap/Makefile.am delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/pshmem/mmap/pshmem_mmap.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/pshmem/mmap/pshmem_mmap.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/pshmem/mmap/pshmem_mmap_component.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/pshmem/pshmem.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/psquash/Makefile.am delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/psquash/base/Makefile.include delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/psquash/base/base.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/psquash/base/psquash_base_frame.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/psquash/base/psquash_base_select.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/psquash/flex128/Makefile.am delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/psquash/flex128/psquash_flex128.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/psquash/flex128/psquash_flex128.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/psquash/flex128/psquash_flex128_component.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/psquash/native/Makefile.am delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/psquash/native/psquash_native.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/psquash/native/psquash_native.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/psquash/native/psquash_native_component.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/psquash/psquash.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/ptl/Makefile.am delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/ptl/base/Makefile.include delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/ptl/base/base.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/ptl/base/ptl_base_connect.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/ptl/base/ptl_base_frame.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/ptl/base/ptl_base_listener.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/ptl/base/ptl_base_select.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/ptl/base/ptl_base_sendrecv.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/ptl/base/ptl_base_stubs.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/ptl/ptl.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/ptl/ptl_types.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/ptl/tcp/Makefile.am delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/ptl/tcp/ptl_tcp.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/ptl/tcp/ptl_tcp.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/ptl/tcp/ptl_tcp_component.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/ptl/usock/Makefile.am delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/ptl/usock/ptl_usock.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/ptl/usock/ptl_usock.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/mca/ptl/usock/ptl_usock_component.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/runtime/Makefile.include delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/runtime/help-pmix-runtime.txt delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/runtime/pmix_finalize.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/runtime/pmix_init.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/runtime/pmix_params.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/runtime/pmix_progress_threads.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/runtime/pmix_progress_threads.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/runtime/pmix_rte.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/server/Makefile.include delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/server/help-pmix-server.txt delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/server/pmix_sched.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/server/pmix_server.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/server/pmix_server_get.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/server/pmix_server_ops.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/server/pmix_server_ops.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/threads/Makefile.include delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/threads/mutex.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/threads/mutex.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/threads/mutex_unix.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/threads/thread.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/threads/thread_usage.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/threads/threads.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/threads/tsd.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/threads/wait_sync.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/threads/wait_sync.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/tool/Makefile.include delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/tool/pmix_tool.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/tools/Makefile.include delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/tools/pattrs/Makefile.am delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/tools/pattrs/help-pattrs.txt delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/tools/pattrs/pattrs.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/tools/pevent/Makefile.am delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/tools/pevent/help-pevent.txt delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/tools/pevent/pevent.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/tools/plookup/Makefile.am delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/tools/plookup/help-plookup.txt delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/tools/plookup/plookup.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/tools/pmix_info/Makefile.am delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/tools/pmix_info/help-pmix-info.txt delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/tools/pmix_info/pinfo.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/tools/pmix_info/pmix_info.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/tools/pmix_info/support.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/tools/pmix_info/support.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/tools/pps/Makefile.am delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/tools/pps/help-pps.txt delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/tools/pps/pps.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/tools/wrapper/Makefile.am delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/tools/wrapper/generic_wrapper.1in delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/tools/wrapper/help-pmix-wrapper.txt delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/tools/wrapper/pmix.pc.in delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/tools/wrapper/pmix_wrapper.1in delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/tools/wrapper/pmix_wrapper.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/tools/wrapper/pmixcc-wrapper-data.txt.in delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/util/Makefile.include delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/util/alfg.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/util/alfg.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/util/argv.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/util/argv.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/util/basename.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/util/basename.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/util/cmd_line.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/util/cmd_line.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/util/context_fns.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/util/context_fns.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/util/crc.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/util/crc.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/util/error.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/util/error.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/util/fd.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/util/fd.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/util/few.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/util/few.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/util/getid.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/util/getid.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/util/hash.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/util/hash.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/util/keyval/Makefile.am delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/util/keyval/keyval_lex.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/util/keyval/keyval_lex.l delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/util/keyval_parse.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/util/keyval_parse.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/util/name_fns.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/util/name_fns.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/util/net.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/util/net.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/util/os_dirpath.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/util/os_dirpath.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/util/os_path.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/util/os_path.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/util/output.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/util/output.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/util/parse_options.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/util/parse_options.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/util/path.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/util/path.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/util/pif.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/util/pif.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/util/pmix_environ.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/util/pmix_environ.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/util/pmix_pty.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/util/pmix_pty.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/util/printf.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/util/printf.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/util/show_help.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/util/show_help.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/util/show_help_lex.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/util/show_help_lex.l delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/util/strnlen.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/util/timings.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/src/util/timings.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/test/Makefile.am delete mode 100644 opal/mca/pmix/pmix4x/openpmix/test/README delete mode 100644 opal/mca/pmix/pmix4x/openpmix/test/cli_stages.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/test/cli_stages.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/test/pmi2_client.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/test/pmi_client.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/test/pmix_client.c delete mode 100755 opal/mca/pmix/pmix4x/openpmix/test/pmix_client_otheruser.sh delete mode 100644 opal/mca/pmix/pmix4x/openpmix/test/pmix_regex.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/test/pmix_test.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/test/python/Makefile.am delete mode 100755 opal/mca/pmix/pmix4x/openpmix/test/python/run_sched.sh.in delete mode 100755 opal/mca/pmix/pmix4x/openpmix/test/python/run_server.sh.in delete mode 100755 opal/mca/pmix/pmix4x/openpmix/test/run_tests00.pl.in delete mode 100755 opal/mca/pmix/pmix4x/openpmix/test/run_tests01.pl.in delete mode 100755 opal/mca/pmix/pmix4x/openpmix/test/run_tests02.pl.in delete mode 100755 opal/mca/pmix/pmix4x/openpmix/test/run_tests03.pl.in delete mode 100755 opal/mca/pmix/pmix4x/openpmix/test/run_tests04.pl.in delete mode 100755 opal/mca/pmix/pmix4x/openpmix/test/run_tests05.pl.in delete mode 100755 opal/mca/pmix/pmix4x/openpmix/test/run_tests06.pl.in delete mode 100755 opal/mca/pmix/pmix4x/openpmix/test/run_tests07.pl.in delete mode 100755 opal/mca/pmix/pmix4x/openpmix/test/run_tests08.pl.in delete mode 100755 opal/mca/pmix/pmix4x/openpmix/test/run_tests09.pl.in delete mode 100755 opal/mca/pmix/pmix4x/openpmix/test/run_tests10.pl.in delete mode 100755 opal/mca/pmix/pmix4x/openpmix/test/run_tests11.pl.in delete mode 100755 opal/mca/pmix/pmix4x/openpmix/test/run_tests12.pl.in delete mode 100755 opal/mca/pmix/pmix4x/openpmix/test/run_tests13.pl.in delete mode 100755 opal/mca/pmix/pmix4x/openpmix/test/run_tests14.pl.in delete mode 100755 opal/mca/pmix/pmix4x/openpmix/test/run_tests15.pl.in delete mode 100644 opal/mca/pmix/pmix4x/openpmix/test/server_callbacks.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/test/server_callbacks.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/test/simple/Makefile.am delete mode 100644 opal/mca/pmix/pmix4x/openpmix/test/simple/gwclient.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/test/simple/gwtest.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/test/simple/quietclient.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/test/simple/simpclient.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/test/simple/simpcoord.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/test/simple/simpdie.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/test/simple/simpdmodex.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/test/simple/simpdyn.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/test/simple/simpft.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/test/simple/simpio.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/test/simple/simpjctrl.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/test/simple/simplegacy.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/test/simple/simppub.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/test/simple/simpsched.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/test/simple/simptest.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/test/simple/simptimeout.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/test/simple/simptool.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/test/simple/stability.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/test/simple/test_pmix.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/test/test_cd.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/test/test_cd.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/test/test_common.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/test/test_common.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/test/test_error.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/test/test_error.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/test/test_fence.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/test/test_fence.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/test/test_internal.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/test/test_internal.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/test/test_publish.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/test/test_publish.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/test/test_replace.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/test/test_replace.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/test/test_resolve_peers.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/test/test_resolve_peers.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/test/test_server.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/test/test_server.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/test/test_spawn.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/test/test_spawn.h delete mode 100644 opal/mca/pmix/pmix4x/openpmix/test/utils.c delete mode 100644 opal/mca/pmix/pmix4x/openpmix/test/utils.h delete mode 100644 opal/mca/pmix/pmix4x/pmix4x.c delete mode 100644 opal/mca/pmix/pmix4x/pmix4x_client.c delete mode 100644 opal/mca/pmix/pmix4x/pmix4x_local.c delete mode 100644 opal/mca/pmix/pmix4x/pmix4x_server_north.c delete mode 100644 opal/mca/pmix/pmix4x/pmix4x_server_south.c delete mode 100644 opal/mca/pmix/pmix_server.h delete mode 100644 opal/mca/pmix/pmix_types.h delete mode 100644 opal/mca/pmix/s1/Makefile.am delete mode 100644 opal/mca/pmix/s1/configure.m4 delete mode 100644 opal/mca/pmix/s1/owner.txt delete mode 100644 opal/mca/pmix/s1/pmix_s1.c delete mode 100644 opal/mca/pmix/s1/pmix_s1.h delete mode 100644 opal/mca/pmix/s1/pmix_s1_component.c delete mode 100644 opal/mca/pmix/s2/Makefile.am delete mode 100644 opal/mca/pmix/s2/configure.m4 delete mode 100644 opal/mca/pmix/s2/owner.txt delete mode 100644 opal/mca/pmix/s2/pmi2_pmap_parser.c delete mode 100644 opal/mca/pmix/s2/pmi2_pmap_parser.h delete mode 100644 opal/mca/pmix/s2/pmix_s2.c delete mode 100644 opal/mca/pmix/s2/pmix_s2.h delete mode 100644 opal/mca/pmix/s2/pmix_s2_component.c delete mode 100644 orte/Doxyfile delete mode 100644 orte/Makefile.am delete mode 100644 orte/bindings/README delete mode 100644 orte/bindings/python/README delete mode 100755 orte/bindings/python/examples/submit.py delete mode 100644 orte/bindings/python/setup.py delete mode 100644 orte/bindings/python/src/orte-cffi/build.py delete mode 100644 orte/common_sym_whitelist.txt delete mode 100644 orte/etc/Makefile.am delete mode 100644 orte/etc/openmpi-default-hostfile delete mode 100644 orte/include/Makefile.am delete mode 100644 orte/include/orte/Makefile.am delete mode 100644 orte/include/orte/constants.h delete mode 100644 orte/include/orte/types.h delete mode 100644 orte/include/orte/version.h.in delete mode 100644 orte/include/orte_config.h delete mode 100644 orte/mca/Makefile.am delete mode 100644 orte/mca/common/Makefile.am delete mode 100644 orte/mca/common/alps/Makefile.am delete mode 100644 orte/mca/common/alps/common_alps.c delete mode 100644 orte/mca/common/alps/common_alps.h delete mode 100644 orte/mca/common/alps/configure.m4 delete mode 100644 orte/mca/common/alps/owner.txt delete mode 100644 orte/mca/errmgr/Makefile.am delete mode 100644 orte/mca/errmgr/base/Makefile.am delete mode 100644 orte/mca/errmgr/base/base.h delete mode 100644 orte/mca/errmgr/base/errmgr_base_fns.c delete mode 100644 orte/mca/errmgr/base/errmgr_base_frame.c delete mode 100644 orte/mca/errmgr/base/errmgr_base_select.c delete mode 100644 orte/mca/errmgr/base/errmgr_private.h delete mode 100644 orte/mca/errmgr/base/help-errmgr-base.txt delete mode 100644 orte/mca/errmgr/base/owner.txt delete mode 100644 orte/mca/errmgr/default_app/Makefile.am delete mode 100644 orte/mca/errmgr/default_app/errmgr_default_app.c delete mode 100644 orte/mca/errmgr/default_app/errmgr_default_app.h delete mode 100644 orte/mca/errmgr/default_app/errmgr_default_app_component.c delete mode 100644 orte/mca/errmgr/default_app/owner.txt delete mode 100644 orte/mca/errmgr/default_hnp/Makefile.am delete mode 100644 orte/mca/errmgr/default_hnp/errmgr_default_hnp.c delete mode 100644 orte/mca/errmgr/default_hnp/errmgr_default_hnp.h delete mode 100644 orte/mca/errmgr/default_hnp/errmgr_default_hnp_component.c delete mode 100644 orte/mca/errmgr/default_hnp/owner.txt delete mode 100644 orte/mca/errmgr/default_orted/Makefile.am delete mode 100644 orte/mca/errmgr/default_orted/errmgr_default_orted.c delete mode 100644 orte/mca/errmgr/default_orted/errmgr_default_orted.h delete mode 100644 orte/mca/errmgr/default_orted/errmgr_default_orted_component.c delete mode 100644 orte/mca/errmgr/default_orted/owner.txt delete mode 100644 orte/mca/errmgr/default_tool/Makefile.am delete mode 100644 orte/mca/errmgr/default_tool/errmgr_default_tool.c delete mode 100644 orte/mca/errmgr/default_tool/errmgr_default_tool.h delete mode 100644 orte/mca/errmgr/default_tool/errmgr_default_tool_component.c delete mode 100644 orte/mca/errmgr/default_tool/owner.txt delete mode 100644 orte/mca/errmgr/errmgr.h delete mode 100644 orte/mca/ess/Makefile.am delete mode 100644 orte/mca/ess/alps/Makefile.am delete mode 100644 orte/mca/ess/alps/configure.m4 delete mode 100644 orte/mca/ess/alps/ess_alps.h delete mode 100644 orte/mca/ess/alps/ess_alps_component.c delete mode 100644 orte/mca/ess/alps/ess_alps_module.c delete mode 100644 orte/mca/ess/alps/ess_alps_utils.c delete mode 100644 orte/mca/ess/base/Makefile.am delete mode 100644 orte/mca/ess/base/base.h delete mode 100644 orte/mca/ess/base/ess_base_fns.c delete mode 100644 orte/mca/ess/base/ess_base_frame.c delete mode 100644 orte/mca/ess/base/ess_base_get.c delete mode 100644 orte/mca/ess/base/ess_base_select.c delete mode 100644 orte/mca/ess/base/ess_base_std_orted.c delete mode 100644 orte/mca/ess/base/ess_base_std_prolog.c delete mode 100644 orte/mca/ess/base/ess_base_std_tool.c delete mode 100644 orte/mca/ess/base/help-ess-base.txt delete mode 100644 orte/mca/ess/base/owner.txt delete mode 100644 orte/mca/ess/env/Makefile.am delete mode 100644 orte/mca/ess/env/ess_env.h delete mode 100644 orte/mca/ess/env/ess_env_component.c delete mode 100644 orte/mca/ess/env/ess_env_module.c delete mode 100644 orte/mca/ess/env/owner.txt delete mode 100644 orte/mca/ess/ess.h delete mode 100644 orte/mca/ess/hnp/Makefile.am delete mode 100644 orte/mca/ess/hnp/ess_hnp.h delete mode 100644 orte/mca/ess/hnp/ess_hnp_component.c delete mode 100644 orte/mca/ess/hnp/ess_hnp_module.c delete mode 100644 orte/mca/ess/hnp/owner.txt delete mode 100644 orte/mca/ess/lsf/Makefile.am delete mode 100644 orte/mca/ess/lsf/configure.m4 delete mode 100644 orte/mca/ess/lsf/ess_lsf.h delete mode 100644 orte/mca/ess/lsf/ess_lsf_component.c delete mode 100644 orte/mca/ess/lsf/ess_lsf_module.c delete mode 100644 orte/mca/ess/lsf/owner.txt delete mode 100644 orte/mca/ess/pmi/Makefile.am delete mode 100644 orte/mca/ess/pmi/ess_pmi.h delete mode 100644 orte/mca/ess/pmi/ess_pmi_component.c delete mode 100644 orte/mca/ess/pmi/ess_pmi_module.c delete mode 100644 orte/mca/ess/pmi/owner.txt delete mode 100644 orte/mca/ess/singleton/Makefile.am delete mode 100644 orte/mca/ess/singleton/ess_singleton.h delete mode 100644 orte/mca/ess/singleton/ess_singleton_component.c delete mode 100644 orte/mca/ess/singleton/ess_singleton_module.c delete mode 100644 orte/mca/ess/singleton/owner.txt delete mode 100644 orte/mca/ess/slurm/Makefile.am delete mode 100644 orte/mca/ess/slurm/configure.m4 delete mode 100644 orte/mca/ess/slurm/ess_slurm.h delete mode 100644 orte/mca/ess/slurm/ess_slurm_component.c delete mode 100644 orte/mca/ess/slurm/ess_slurm_module.c delete mode 100644 orte/mca/ess/slurm/owner.txt delete mode 100644 orte/mca/ess/tm/Makefile.am delete mode 100644 orte/mca/ess/tm/configure.m4 delete mode 100644 orte/mca/ess/tm/ess_tm.h delete mode 100644 orte/mca/ess/tm/ess_tm_component.c delete mode 100644 orte/mca/ess/tm/ess_tm_module.c delete mode 100644 orte/mca/ess/tm/owner.txt delete mode 100644 orte/mca/ess/tool/Makefile.am delete mode 100644 orte/mca/ess/tool/ess_tool.h delete mode 100644 orte/mca/ess/tool/ess_tool_component.c delete mode 100644 orte/mca/ess/tool/ess_tool_module.c delete mode 100644 orte/mca/ess/tool/owner.txt delete mode 100644 orte/mca/filem/Makefile.am delete mode 100644 orte/mca/filem/base/Makefile.am delete mode 100644 orte/mca/filem/base/base.h delete mode 100644 orte/mca/filem/base/filem_base_fns.c delete mode 100644 orte/mca/filem/base/filem_base_frame.c delete mode 100644 orte/mca/filem/base/filem_base_receive.c delete mode 100644 orte/mca/filem/base/filem_base_select.c delete mode 100644 orte/mca/filem/base/owner.txt delete mode 100644 orte/mca/filem/filem.h delete mode 100644 orte/mca/filem/orte_filem.7in delete mode 100644 orte/mca/filem/raw/Makefile.am delete mode 100644 orte/mca/filem/raw/filem_raw.h delete mode 100644 orte/mca/filem/raw/filem_raw_component.c delete mode 100644 orte/mca/filem/raw/filem_raw_module.c delete mode 100644 orte/mca/filem/raw/help-orte-filem-raw.txt delete mode 100644 orte/mca/filem/raw/owner.txt delete mode 100644 orte/mca/grpcomm/Makefile.am delete mode 100644 orte/mca/grpcomm/base/Makefile.am delete mode 100644 orte/mca/grpcomm/base/base.h delete mode 100644 orte/mca/grpcomm/base/grpcomm_base_frame.c delete mode 100644 orte/mca/grpcomm/base/grpcomm_base_select.c delete mode 100644 orte/mca/grpcomm/base/grpcomm_base_stubs.c delete mode 100644 orte/mca/grpcomm/base/owner.txt delete mode 100644 orte/mca/grpcomm/direct/Makefile.am delete mode 100644 orte/mca/grpcomm/direct/grpcomm_direct.c delete mode 100644 orte/mca/grpcomm/direct/grpcomm_direct.h delete mode 100644 orte/mca/grpcomm/direct/grpcomm_direct_component.c delete mode 100644 orte/mca/grpcomm/direct/owner.txt delete mode 100644 orte/mca/grpcomm/grpcomm.h delete mode 100644 orte/mca/iof/Makefile.am delete mode 100644 orte/mca/iof/README.txt delete mode 100644 orte/mca/iof/base/Makefile.am delete mode 100644 orte/mca/iof/base/base.h delete mode 100644 orte/mca/iof/base/help-iof-base.txt delete mode 100644 orte/mca/iof/base/iof_base_frame.c delete mode 100644 orte/mca/iof/base/iof_base_output.c delete mode 100644 orte/mca/iof/base/iof_base_select.c delete mode 100644 orte/mca/iof/base/iof_base_setup.c delete mode 100644 orte/mca/iof/base/iof_base_setup.h delete mode 100644 orte/mca/iof/base/owner.txt delete mode 100644 orte/mca/iof/hnp/Makefile.am delete mode 100644 orte/mca/iof/hnp/iof_hnp.c delete mode 100644 orte/mca/iof/hnp/iof_hnp.h delete mode 100644 orte/mca/iof/hnp/iof_hnp_component.c delete mode 100644 orte/mca/iof/hnp/iof_hnp_read.c delete mode 100644 orte/mca/iof/hnp/iof_hnp_receive.c delete mode 100644 orte/mca/iof/hnp/iof_hnp_send.c delete mode 100644 orte/mca/iof/hnp/owner.txt delete mode 100644 orte/mca/iof/iof.h delete mode 100644 orte/mca/iof/iof_types.h delete mode 100644 orte/mca/iof/orted/Makefile.am delete mode 100644 orte/mca/iof/orted/iof_orted.c delete mode 100644 orte/mca/iof/orted/iof_orted.h delete mode 100644 orte/mca/iof/orted/iof_orted_component.c delete mode 100644 orte/mca/iof/orted/iof_orted_read.c delete mode 100644 orte/mca/iof/orted/iof_orted_receive.c delete mode 100644 orte/mca/iof/orted/owner.txt delete mode 100644 orte/mca/iof/tool/Makefile.am delete mode 100644 orte/mca/iof/tool/iof_tool.c delete mode 100644 orte/mca/iof/tool/iof_tool.h delete mode 100644 orte/mca/iof/tool/iof_tool_component.c delete mode 100644 orte/mca/iof/tool/iof_tool_receive.c delete mode 100644 orte/mca/iof/tool/owner.txt delete mode 100644 orte/mca/mca.h delete mode 100644 orte/mca/odls/Makefile.am delete mode 100644 orte/mca/odls/alps/Makefile.am delete mode 100644 orte/mca/odls/alps/configure.m4 delete mode 100644 orte/mca/odls/alps/help-orte-odls-alps.txt delete mode 100644 orte/mca/odls/alps/odls_alps.h delete mode 100644 orte/mca/odls/alps/odls_alps_component.c delete mode 100644 orte/mca/odls/alps/odls_alps_module.c delete mode 100644 orte/mca/odls/alps/odls_alps_utils.c delete mode 100644 orte/mca/odls/alps/owner.txt delete mode 100644 orte/mca/odls/base/Makefile.am delete mode 100644 orte/mca/odls/base/base.h delete mode 100644 orte/mca/odls/base/help-orte-odls-base.txt delete mode 100644 orte/mca/odls/base/odls_base_default_fns.c delete mode 100644 orte/mca/odls/base/odls_base_frame.c delete mode 100644 orte/mca/odls/base/odls_base_select.c delete mode 100644 orte/mca/odls/base/odls_private.h delete mode 100644 orte/mca/odls/base/owner.txt delete mode 100644 orte/mca/odls/default/Makefile.am delete mode 100644 orte/mca/odls/default/configure.m4 delete mode 100644 orte/mca/odls/default/help-orte-odls-default.txt delete mode 100644 orte/mca/odls/default/odls_default.h delete mode 100644 orte/mca/odls/default/odls_default_component.c delete mode 100644 orte/mca/odls/default/odls_default_module.c delete mode 100644 orte/mca/odls/default/owner.txt delete mode 100644 orte/mca/odls/odls.h delete mode 100644 orte/mca/odls/odls_types.h delete mode 100644 orte/mca/odls/pspawn/Makefile.am delete mode 100644 orte/mca/odls/pspawn/configure.m4 delete mode 100644 orte/mca/odls/pspawn/help-orte-odls-pspawn.txt delete mode 100644 orte/mca/odls/pspawn/odls_pspawn.c delete mode 100644 orte/mca/odls/pspawn/odls_pspawn.h delete mode 100644 orte/mca/odls/pspawn/odls_pspawn_component.c delete mode 100644 orte/mca/odls/pspawn/owner.txt delete mode 100644 orte/mca/oob/Makefile.am delete mode 100644 orte/mca/oob/alps/Makefile.am delete mode 100644 orte/mca/oob/alps/configure.m4 delete mode 100644 orte/mca/oob/alps/oob_alps_component.c delete mode 100644 orte/mca/oob/alps/owner.txt delete mode 100644 orte/mca/oob/base/Makefile.am delete mode 100644 orte/mca/oob/base/base.h delete mode 100644 orte/mca/oob/base/help-oob-base.txt delete mode 100644 orte/mca/oob/base/oob_base_frame.c delete mode 100644 orte/mca/oob/base/oob_base_select.c delete mode 100644 orte/mca/oob/base/oob_base_stubs.c delete mode 100644 orte/mca/oob/base/owner.txt delete mode 100644 orte/mca/oob/oob.h delete mode 100644 orte/mca/oob/tcp/Makefile.am delete mode 100644 orte/mca/oob/tcp/configure.m4 delete mode 100644 orte/mca/oob/tcp/help-oob-tcp.txt delete mode 100644 orte/mca/oob/tcp/oob_tcp.c delete mode 100644 orte/mca/oob/tcp/oob_tcp.h delete mode 100644 orte/mca/oob/tcp/oob_tcp_common.c delete mode 100644 orte/mca/oob/tcp/oob_tcp_common.h delete mode 100644 orte/mca/oob/tcp/oob_tcp_component.c delete mode 100644 orte/mca/oob/tcp/oob_tcp_component.h delete mode 100644 orte/mca/oob/tcp/oob_tcp_connection.c delete mode 100644 orte/mca/oob/tcp/oob_tcp_connection.h delete mode 100644 orte/mca/oob/tcp/oob_tcp_hdr.h delete mode 100644 orte/mca/oob/tcp/oob_tcp_listener.c delete mode 100644 orte/mca/oob/tcp/oob_tcp_listener.h delete mode 100644 orte/mca/oob/tcp/oob_tcp_peer.h delete mode 100644 orte/mca/oob/tcp/oob_tcp_sendrecv.c delete mode 100644 orte/mca/oob/tcp/oob_tcp_sendrecv.h delete mode 100644 orte/mca/oob/tcp/owner.txt delete mode 100644 orte/mca/plm/Makefile.am delete mode 100644 orte/mca/plm/alps/Makefile.am delete mode 100644 orte/mca/plm/alps/configure.m4 delete mode 100644 orte/mca/plm/alps/help-plm-alps.txt delete mode 100644 orte/mca/plm/alps/owner.txt delete mode 100644 orte/mca/plm/alps/plm_alps.h delete mode 100644 orte/mca/plm/alps/plm_alps_component.c delete mode 100644 orte/mca/plm/alps/plm_alps_module.c delete mode 100644 orte/mca/plm/base/Makefile.am delete mode 100644 orte/mca/plm/base/base.h delete mode 100644 orte/mca/plm/base/help-plm-base.txt delete mode 100644 orte/mca/plm/base/owner.txt delete mode 100644 orte/mca/plm/base/plm_base_frame.c delete mode 100644 orte/mca/plm/base/plm_base_jobid.c delete mode 100644 orte/mca/plm/base/plm_base_launch_support.c delete mode 100644 orte/mca/plm/base/plm_base_orted_cmds.c delete mode 100644 orte/mca/plm/base/plm_base_receive.c delete mode 100644 orte/mca/plm/base/plm_base_select.c delete mode 100644 orte/mca/plm/base/plm_private.h delete mode 100644 orte/mca/plm/isolated/Makefile.am delete mode 100644 orte/mca/plm/isolated/configure.m4 delete mode 100644 orte/mca/plm/isolated/owner.txt delete mode 100644 orte/mca/plm/isolated/plm_isolated.c delete mode 100644 orte/mca/plm/isolated/plm_isolated.h delete mode 100644 orte/mca/plm/isolated/plm_isolated_component.c delete mode 100644 orte/mca/plm/lsf/Makefile.am delete mode 100644 orte/mca/plm/lsf/configure.m4 delete mode 100644 orte/mca/plm/lsf/help-plm-lsf.txt delete mode 100644 orte/mca/plm/lsf/owner.txt delete mode 100644 orte/mca/plm/lsf/plm_lsf.h delete mode 100644 orte/mca/plm/lsf/plm_lsf_component.c delete mode 100644 orte/mca/plm/lsf/plm_lsf_module.c delete mode 100644 orte/mca/plm/plm.h delete mode 100644 orte/mca/plm/plm_types.h delete mode 100644 orte/mca/plm/rsh/Makefile.am delete mode 100644 orte/mca/plm/rsh/configure.m4 delete mode 100644 orte/mca/plm/rsh/help-plm-rsh.txt delete mode 100644 orte/mca/plm/rsh/owner.txt delete mode 100644 orte/mca/plm/rsh/plm_rsh.h delete mode 100644 orte/mca/plm/rsh/plm_rsh_component.c delete mode 100644 orte/mca/plm/rsh/plm_rsh_module.c delete mode 100644 orte/mca/plm/slurm/Makefile.am delete mode 100644 orte/mca/plm/slurm/configure.m4 delete mode 100644 orte/mca/plm/slurm/help-plm-slurm.txt delete mode 100644 orte/mca/plm/slurm/owner.txt delete mode 100644 orte/mca/plm/slurm/plm_slurm.h delete mode 100644 orte/mca/plm/slurm/plm_slurm_component.c delete mode 100644 orte/mca/plm/slurm/plm_slurm_module.c delete mode 100644 orte/mca/plm/tm/Makefile.am delete mode 100644 orte/mca/plm/tm/configure.m4 delete mode 100644 orte/mca/plm/tm/help-plm-tm.txt delete mode 100644 orte/mca/plm/tm/owner.txt delete mode 100644 orte/mca/plm/tm/plm_tm.h delete mode 100644 orte/mca/plm/tm/plm_tm_component.c delete mode 100644 orte/mca/plm/tm/plm_tm_module.c delete mode 100644 orte/mca/ras/Makefile.am delete mode 100644 orte/mca/ras/alps/Makefile.am delete mode 100644 orte/mca/ras/alps/configure.m4 delete mode 100644 orte/mca/ras/alps/help-ras-alps.txt delete mode 100644 orte/mca/ras/alps/owner.txt delete mode 100755 orte/mca/ras/alps/ras-alps-command.sh delete mode 100644 orte/mca/ras/alps/ras_alps.h delete mode 100644 orte/mca/ras/alps/ras_alps_component.c delete mode 100644 orte/mca/ras/alps/ras_alps_module.c delete mode 100644 orte/mca/ras/base/Makefile.am delete mode 100644 orte/mca/ras/base/base.h delete mode 100644 orte/mca/ras/base/help-ras-base.txt delete mode 100644 orte/mca/ras/base/owner.txt delete mode 100644 orte/mca/ras/base/ras_base_allocate.c delete mode 100644 orte/mca/ras/base/ras_base_close.c delete mode 100644 orte/mca/ras/base/ras_base_frame.c delete mode 100644 orte/mca/ras/base/ras_base_node.c delete mode 100644 orte/mca/ras/base/ras_base_select.c delete mode 100644 orte/mca/ras/base/ras_private.h delete mode 100644 orte/mca/ras/gridengine/Makefile.am delete mode 100644 orte/mca/ras/gridengine/configure.m4 delete mode 100644 orte/mca/ras/gridengine/help-ras-gridengine.txt delete mode 100644 orte/mca/ras/gridengine/owner.txt delete mode 100644 orte/mca/ras/gridengine/ras_gridengine.h delete mode 100644 orte/mca/ras/gridengine/ras_gridengine_component.c delete mode 100644 orte/mca/ras/gridengine/ras_gridengine_module.c delete mode 100644 orte/mca/ras/lsf/Makefile.am delete mode 100644 orte/mca/ras/lsf/configure.m4 delete mode 100644 orte/mca/ras/lsf/help-ras-lsf.txt delete mode 100644 orte/mca/ras/lsf/owner.txt delete mode 100644 orte/mca/ras/lsf/ras_lsf.h delete mode 100644 orte/mca/ras/lsf/ras_lsf_component.c delete mode 100644 orte/mca/ras/lsf/ras_lsf_module.c delete mode 100644 orte/mca/ras/ras.h delete mode 100644 orte/mca/ras/simulator/Makefile.am delete mode 100644 orte/mca/ras/simulator/help-ras-simulator.txt delete mode 100644 orte/mca/ras/simulator/owner.txt delete mode 100644 orte/mca/ras/simulator/ras_sim.h delete mode 100644 orte/mca/ras/simulator/ras_sim_component.c delete mode 100644 orte/mca/ras/simulator/ras_sim_module.c delete mode 100644 orte/mca/ras/slurm/Makefile.am delete mode 100644 orte/mca/ras/slurm/configure.m4 delete mode 100644 orte/mca/ras/slurm/help-ras-slurm.txt delete mode 100644 orte/mca/ras/slurm/owner.txt delete mode 100644 orte/mca/ras/slurm/ras_slurm.h delete mode 100644 orte/mca/ras/slurm/ras_slurm_component.c delete mode 100644 orte/mca/ras/slurm/ras_slurm_module.c delete mode 100644 orte/mca/ras/tm/Makefile.am delete mode 100644 orte/mca/ras/tm/configure.m4 delete mode 100644 orte/mca/ras/tm/help-ras-tm.txt delete mode 100644 orte/mca/ras/tm/owner.txt delete mode 100644 orte/mca/ras/tm/ras_tm.h delete mode 100644 orte/mca/ras/tm/ras_tm_component.c delete mode 100644 orte/mca/ras/tm/ras_tm_module.c delete mode 100644 orte/mca/rmaps/Makefile.am delete mode 100644 orte/mca/rmaps/base/Makefile.am delete mode 100644 orte/mca/rmaps/base/base.h delete mode 100644 orte/mca/rmaps/base/help-orte-rmaps-base.txt delete mode 100644 orte/mca/rmaps/base/owner.txt delete mode 100644 orte/mca/rmaps/base/rmaps_base_assign_locations.c delete mode 100644 orte/mca/rmaps/base/rmaps_base_binding.c delete mode 100644 orte/mca/rmaps/base/rmaps_base_frame.c delete mode 100644 orte/mca/rmaps/base/rmaps_base_map_job.c delete mode 100644 orte/mca/rmaps/base/rmaps_base_print_fns.c delete mode 100644 orte/mca/rmaps/base/rmaps_base_ranking.c delete mode 100644 orte/mca/rmaps/base/rmaps_base_select.c delete mode 100644 orte/mca/rmaps/base/rmaps_base_support_fns.c delete mode 100644 orte/mca/rmaps/base/rmaps_private.h delete mode 100644 orte/mca/rmaps/mindist/Makefile.am delete mode 100644 orte/mca/rmaps/mindist/help-orte-rmaps-md.txt delete mode 100644 orte/mca/rmaps/mindist/owner.txt delete mode 100644 orte/mca/rmaps/mindist/rmaps_mindist.h delete mode 100644 orte/mca/rmaps/mindist/rmaps_mindist_component.c delete mode 100644 orte/mca/rmaps/mindist/rmaps_mindist_module.c delete mode 100644 orte/mca/rmaps/ppr/Makefile.am delete mode 100644 orte/mca/rmaps/ppr/help-orte-rmaps-ppr.txt delete mode 100644 orte/mca/rmaps/ppr/owner.txt delete mode 100644 orte/mca/rmaps/ppr/rmaps_ppr.c delete mode 100644 orte/mca/rmaps/ppr/rmaps_ppr.h delete mode 100644 orte/mca/rmaps/ppr/rmaps_ppr_component.c delete mode 100644 orte/mca/rmaps/rank_file/Makefile.am delete mode 100644 orte/mca/rmaps/rank_file/common_sym_whitelist.txt delete mode 100644 orte/mca/rmaps/rank_file/help-rmaps_rank_file.txt delete mode 100644 orte/mca/rmaps/rank_file/owner.txt delete mode 100644 orte/mca/rmaps/rank_file/rmaps_rank_file.c delete mode 100644 orte/mca/rmaps/rank_file/rmaps_rank_file.h delete mode 100644 orte/mca/rmaps/rank_file/rmaps_rank_file_component.c delete mode 100644 orte/mca/rmaps/rank_file/rmaps_rank_file_lex.h delete mode 100644 orte/mca/rmaps/rank_file/rmaps_rank_file_lex.l delete mode 100644 orte/mca/rmaps/resilient/Makefile.am delete mode 100644 orte/mca/rmaps/resilient/help-orte-rmaps-resilient.txt delete mode 100644 orte/mca/rmaps/resilient/owner.txt delete mode 100644 orte/mca/rmaps/resilient/rmaps_resilient.c delete mode 100644 orte/mca/rmaps/resilient/rmaps_resilient.h delete mode 100644 orte/mca/rmaps/resilient/rmaps_resilient_component.c delete mode 100644 orte/mca/rmaps/rmaps.h delete mode 100644 orte/mca/rmaps/rmaps_types.h delete mode 100644 orte/mca/rmaps/round_robin/Makefile.am delete mode 100644 orte/mca/rmaps/round_robin/help-orte-rmaps-rr.txt delete mode 100644 orte/mca/rmaps/round_robin/owner.txt delete mode 100644 orte/mca/rmaps/round_robin/rmaps_rr.c delete mode 100644 orte/mca/rmaps/round_robin/rmaps_rr.h delete mode 100644 orte/mca/rmaps/round_robin/rmaps_rr_assign.c delete mode 100644 orte/mca/rmaps/round_robin/rmaps_rr_component.c delete mode 100644 orte/mca/rmaps/round_robin/rmaps_rr_mappers.c delete mode 100644 orte/mca/rmaps/seq/Makefile.am delete mode 100644 orte/mca/rmaps/seq/help-orte-rmaps-seq.txt delete mode 100644 orte/mca/rmaps/seq/owner.txt delete mode 100644 orte/mca/rmaps/seq/rmaps_seq.c delete mode 100644 orte/mca/rmaps/seq/rmaps_seq.h delete mode 100644 orte/mca/rmaps/seq/rmaps_seq_component.c delete mode 100644 orte/mca/rml/Makefile.am delete mode 100644 orte/mca/rml/base/Makefile.am delete mode 100644 orte/mca/rml/base/base.h delete mode 100644 orte/mca/rml/base/owner.txt delete mode 100644 orte/mca/rml/base/rml_base_contact.c delete mode 100644 orte/mca/rml/base/rml_base_frame.c delete mode 100644 orte/mca/rml/base/rml_base_msg_handlers.c delete mode 100644 orte/mca/rml/base/rml_contact.h delete mode 100644 orte/mca/rml/oob/Makefile.am delete mode 100644 orte/mca/rml/oob/owner.txt delete mode 100644 orte/mca/rml/oob/rml_oob.h delete mode 100644 orte/mca/rml/oob/rml_oob_component.c delete mode 100644 orte/mca/rml/oob/rml_oob_send.c delete mode 100644 orte/mca/rml/rml.h delete mode 100644 orte/mca/rml/rml_types.h delete mode 100644 orte/mca/routed/Makefile.am delete mode 100644 orte/mca/routed/base/Makefile.am delete mode 100644 orte/mca/routed/base/base.h delete mode 100644 orte/mca/routed/base/owner.txt delete mode 100644 orte/mca/routed/base/routed_base_fns.c delete mode 100644 orte/mca/routed/base/routed_base_frame.c delete mode 100644 orte/mca/routed/binomial/Makefile.am delete mode 100644 orte/mca/routed/binomial/owner.txt delete mode 100644 orte/mca/routed/binomial/routed_binomial.c delete mode 100644 orte/mca/routed/binomial/routed_binomial.h delete mode 100644 orte/mca/routed/binomial/routed_binomial_component.c delete mode 100644 orte/mca/routed/debruijn/Makefile.am delete mode 100644 orte/mca/routed/debruijn/owner.txt delete mode 100644 orte/mca/routed/debruijn/routed_debruijn.c delete mode 100644 orte/mca/routed/debruijn/routed_debruijn.h delete mode 100644 orte/mca/routed/debruijn/routed_debruijn_component.c delete mode 100644 orte/mca/routed/direct/Makefile.am delete mode 100644 orte/mca/routed/direct/owner.txt delete mode 100644 orte/mca/routed/direct/routed_direct.c delete mode 100644 orte/mca/routed/direct/routed_direct.h delete mode 100644 orte/mca/routed/direct/routed_direct_component.c delete mode 100644 orte/mca/routed/radix/Makefile.am delete mode 100644 orte/mca/routed/radix/routed_radix.c delete mode 100644 orte/mca/routed/radix/routed_radix.h delete mode 100644 orte/mca/routed/radix/routed_radix_component.c delete mode 100644 orte/mca/routed/routed.h delete mode 100644 orte/mca/routed/routed_types.h delete mode 100644 orte/mca/rtc/Makefile.am delete mode 100644 orte/mca/rtc/base/Makefile.am delete mode 100644 orte/mca/rtc/base/base.h delete mode 100644 orte/mca/rtc/base/help-orte-rtc-base.txt delete mode 100644 orte/mca/rtc/base/owner.txt delete mode 100644 orte/mca/rtc/base/rtc_base_frame.c delete mode 100644 orte/mca/rtc/base/rtc_base_select.c delete mode 100644 orte/mca/rtc/base/rtc_base_stubs.c delete mode 100644 orte/mca/rtc/hwloc/Makefile.am delete mode 100644 orte/mca/rtc/hwloc/help-orte-rtc-hwloc.txt delete mode 100644 orte/mca/rtc/hwloc/owner.txt delete mode 100644 orte/mca/rtc/hwloc/rtc_hwloc.c delete mode 100644 orte/mca/rtc/hwloc/rtc_hwloc.h delete mode 100644 orte/mca/rtc/hwloc/rtc_hwloc_component.c delete mode 100644 orte/mca/rtc/rtc.h delete mode 100644 orte/mca/schizo/Makefile.am delete mode 100644 orte/mca/schizo/alps/Makefile.am delete mode 100644 orte/mca/schizo/alps/configure.m4 delete mode 100644 orte/mca/schizo/alps/owner.txt delete mode 100644 orte/mca/schizo/alps/schizo_alps.c delete mode 100644 orte/mca/schizo/alps/schizo_alps.h delete mode 100644 orte/mca/schizo/alps/schizo_alps_component.c delete mode 100644 orte/mca/schizo/base/Makefile.am delete mode 100644 orte/mca/schizo/base/base.h delete mode 100644 orte/mca/schizo/base/owner.txt delete mode 100644 orte/mca/schizo/base/schizo_base_frame.c delete mode 100644 orte/mca/schizo/base/schizo_base_select.c delete mode 100644 orte/mca/schizo/base/schizo_base_stubs.c delete mode 100644 orte/mca/schizo/flux/Makefile.am delete mode 100644 orte/mca/schizo/flux/owner.txt delete mode 100644 orte/mca/schizo/flux/schizo_flux.c delete mode 100644 orte/mca/schizo/flux/schizo_flux.h delete mode 100644 orte/mca/schizo/flux/schizo_flux_component.c delete mode 100644 orte/mca/schizo/jsm/Makefile.am delete mode 100644 orte/mca/schizo/jsm/configure.m4 delete mode 100644 orte/mca/schizo/jsm/owner.txt delete mode 100644 orte/mca/schizo/jsm/schizo_jsm.c delete mode 100644 orte/mca/schizo/jsm/schizo_jsm.h delete mode 100644 orte/mca/schizo/jsm/schizo_jsm_component.c delete mode 100644 orte/mca/schizo/moab/Makefile.am delete mode 100644 orte/mca/schizo/moab/configure.m4 delete mode 100644 orte/mca/schizo/moab/owner.txt delete mode 100644 orte/mca/schizo/moab/schizo_moab.c delete mode 100644 orte/mca/schizo/moab/schizo_moab.h delete mode 100644 orte/mca/schizo/moab/schizo_moab_component.c delete mode 100644 orte/mca/schizo/ompi/Makefile.am delete mode 100644 orte/mca/schizo/ompi/owner.txt delete mode 100644 orte/mca/schizo/ompi/schizo_ompi.c delete mode 100644 orte/mca/schizo/ompi/schizo_ompi.h delete mode 100644 orte/mca/schizo/ompi/schizo_ompi_component.c delete mode 100644 orte/mca/schizo/orte/Makefile.am delete mode 100644 orte/mca/schizo/orte/schizo_orte.c delete mode 100644 orte/mca/schizo/orte/schizo_orte.h delete mode 100644 orte/mca/schizo/orte/schizo_orte_component.c delete mode 100644 orte/mca/schizo/schizo.h delete mode 100644 orte/mca/schizo/slurm/Makefile.am delete mode 100644 orte/mca/schizo/slurm/configure.m4 delete mode 100644 orte/mca/schizo/slurm/owner.txt delete mode 100644 orte/mca/schizo/slurm/schizo_slurm.c delete mode 100644 orte/mca/schizo/slurm/schizo_slurm.h delete mode 100644 orte/mca/schizo/slurm/schizo_slurm_component.c delete mode 100644 orte/mca/snapc/Makefile.am delete mode 100644 orte/mca/snapc/base/Makefile.am delete mode 100644 orte/mca/snapc/base/base.h delete mode 100644 orte/mca/snapc/base/help-orte-snapc-base.txt delete mode 100644 orte/mca/snapc/base/owner.txt delete mode 100644 orte/mca/snapc/base/snapc_base_fns.c delete mode 100644 orte/mca/snapc/base/snapc_base_frame.c delete mode 100644 orte/mca/snapc/base/snapc_base_select.c delete mode 100644 orte/mca/snapc/full/Makefile.am delete mode 100644 orte/mca/snapc/full/configure.m4 delete mode 100644 orte/mca/snapc/full/help-orte-snapc-full.txt delete mode 100644 orte/mca/snapc/full/owner.txt delete mode 100644 orte/mca/snapc/full/snapc_full.h delete mode 100644 orte/mca/snapc/full/snapc_full_app.c delete mode 100644 orte/mca/snapc/full/snapc_full_component.c delete mode 100644 orte/mca/snapc/full/snapc_full_global.c delete mode 100644 orte/mca/snapc/full/snapc_full_local.c delete mode 100644 orte/mca/snapc/full/snapc_full_module.c delete mode 100644 orte/mca/snapc/orte_snapc.7in delete mode 100644 orte/mca/snapc/snapc.h delete mode 100644 orte/mca/sstore/Makefile.am delete mode 100644 orte/mca/sstore/base/Makefile.am delete mode 100644 orte/mca/sstore/base/base.h delete mode 100644 orte/mca/sstore/base/owner.txt delete mode 100644 orte/mca/sstore/base/sstore_base_fns.c delete mode 100644 orte/mca/sstore/base/sstore_base_frame.c delete mode 100644 orte/mca/sstore/base/sstore_base_select.c delete mode 100644 orte/mca/sstore/central/Makefile.am delete mode 100644 orte/mca/sstore/central/configure.m4 delete mode 100644 orte/mca/sstore/central/help-orte-sstore-central.txt delete mode 100644 orte/mca/sstore/central/owner.txt delete mode 100644 orte/mca/sstore/central/sstore_central.h delete mode 100644 orte/mca/sstore/central/sstore_central_app.c delete mode 100644 orte/mca/sstore/central/sstore_central_component.c delete mode 100644 orte/mca/sstore/central/sstore_central_global.c delete mode 100644 orte/mca/sstore/central/sstore_central_local.c delete mode 100644 orte/mca/sstore/central/sstore_central_module.c delete mode 100644 orte/mca/sstore/orte_sstore.7in delete mode 100644 orte/mca/sstore/sstore.h delete mode 100644 orte/mca/sstore/stage/Makefile.am delete mode 100644 orte/mca/sstore/stage/configure.m4 delete mode 100644 orte/mca/sstore/stage/help-orte-sstore-stage.txt delete mode 100644 orte/mca/sstore/stage/owner.txt delete mode 100644 orte/mca/sstore/stage/sstore_stage.h delete mode 100644 orte/mca/sstore/stage/sstore_stage_app.c delete mode 100644 orte/mca/sstore/stage/sstore_stage_component.c delete mode 100644 orte/mca/sstore/stage/sstore_stage_global.c delete mode 100644 orte/mca/sstore/stage/sstore_stage_local.c delete mode 100644 orte/mca/sstore/stage/sstore_stage_module.c delete mode 100644 orte/mca/state/Makefile.am delete mode 100644 orte/mca/state/app/Makefile.am delete mode 100644 orte/mca/state/app/owner.txt delete mode 100644 orte/mca/state/app/state_app.c delete mode 100644 orte/mca/state/app/state_app.h delete mode 100644 orte/mca/state/app/state_app_component.c delete mode 100644 orte/mca/state/base/Makefile.am delete mode 100644 orte/mca/state/base/base.h delete mode 100644 orte/mca/state/base/help-state-base.txt delete mode 100644 orte/mca/state/base/owner.txt delete mode 100644 orte/mca/state/base/state_base_fns.c delete mode 100644 orte/mca/state/base/state_base_frame.c delete mode 100644 orte/mca/state/base/state_base_select.c delete mode 100644 orte/mca/state/base/state_private.h delete mode 100644 orte/mca/state/hnp/Makefile.am delete mode 100644 orte/mca/state/hnp/owner.txt delete mode 100644 orte/mca/state/hnp/state_hnp.c delete mode 100644 orte/mca/state/hnp/state_hnp.h delete mode 100644 orte/mca/state/hnp/state_hnp_component.c delete mode 100644 orte/mca/state/novm/Makefile.am delete mode 100644 orte/mca/state/novm/owner.txt delete mode 100644 orte/mca/state/novm/state_novm.c delete mode 100644 orte/mca/state/novm/state_novm.h delete mode 100644 orte/mca/state/novm/state_novm_component.c delete mode 100644 orte/mca/state/orted/Makefile.am delete mode 100644 orte/mca/state/orted/owner.txt delete mode 100644 orte/mca/state/orted/state_orted.c delete mode 100644 orte/mca/state/orted/state_orted.h delete mode 100644 orte/mca/state/orted/state_orted_component.c delete mode 100644 orte/mca/state/state.h delete mode 100644 orte/mca/state/state_types.h delete mode 100644 orte/mca/state/tool/Makefile.am delete mode 100644 orte/mca/state/tool/owner.txt delete mode 100644 orte/mca/state/tool/state_tool.c delete mode 100644 orte/mca/state/tool/state_tool.h delete mode 100644 orte/mca/state/tool/state_tool_component.c delete mode 100644 orte/orted/Makefile.am delete mode 100644 orte/orted/ft_tester.c delete mode 100644 orte/orted/help-orted.txt delete mode 100644 orte/orted/orted.h delete mode 100644 orte/orted/orted_comm.c delete mode 100644 orte/orted/orted_main.c delete mode 100644 orte/orted/orted_submit.c delete mode 100644 orte/orted/orted_submit.h delete mode 100644 orte/orted/pmix/Makefile.am delete mode 100644 orte/orted/pmix/pmix_server.c delete mode 100644 orte/orted/pmix/pmix_server.h delete mode 100644 orte/orted/pmix/pmix_server_dyn.c delete mode 100644 orte/orted/pmix/pmix_server_fence.c delete mode 100644 orte/orted/pmix/pmix_server_gen.c delete mode 100644 orte/orted/pmix/pmix_server_internal.h delete mode 100644 orte/orted/pmix/pmix_server_pub.c delete mode 100644 orte/orted/pmix/pmix_server_register_fns.c delete mode 100644 orte/runtime/Makefile.am delete mode 100644 orte/runtime/data_type_support/orte_dt_compare_fns.c delete mode 100644 orte/runtime/data_type_support/orte_dt_copy_fns.c delete mode 100644 orte/runtime/data_type_support/orte_dt_packing_fns.c delete mode 100644 orte/runtime/data_type_support/orte_dt_print_fns.c delete mode 100644 orte/runtime/data_type_support/orte_dt_support.h delete mode 100644 orte/runtime/data_type_support/orte_dt_unpacking_fns.c delete mode 100644 orte/runtime/help-orte-runtime.txt delete mode 100644 orte/runtime/orte_cr.c delete mode 100644 orte/runtime/orte_cr.h delete mode 100644 orte/runtime/orte_data_server.c delete mode 100644 orte/runtime/orte_data_server.h delete mode 100644 orte/runtime/orte_finalize.c delete mode 100644 orte/runtime/orte_globals.c delete mode 100644 orte/runtime/orte_globals.h delete mode 100644 orte/runtime/orte_info_support.c delete mode 100644 orte/runtime/orte_info_support.h delete mode 100644 orte/runtime/orte_init.c delete mode 100644 orte/runtime/orte_locks.c delete mode 100644 orte/runtime/orte_locks.h delete mode 100644 orte/runtime/orte_mca_params.c delete mode 100644 orte/runtime/orte_quit.c delete mode 100644 orte/runtime/orte_quit.h delete mode 100644 orte/runtime/orte_wait.c delete mode 100644 orte/runtime/orte_wait.h delete mode 100644 orte/runtime/runtime.h delete mode 100644 orte/runtime/runtime_internals.h delete mode 100644 orte/test/mpi/Makefile delete mode 100644 orte/test/mpi/Makefile.include delete mode 100644 orte/test/mpi/abort.c delete mode 100644 orte/test/mpi/accept.c delete mode 100644 orte/test/mpi/add_host.c delete mode 100644 orte/test/mpi/attach.c delete mode 100644 orte/test/mpi/bad_exit.c delete mode 100644 orte/test/mpi/badcoll.c delete mode 100644 orte/test/mpi/bcast_loop.c delete mode 100644 orte/test/mpi/binding.c delete mode 100644 orte/test/mpi/client.c delete mode 100644 orte/test/mpi/concurrent_spawn.c delete mode 100644 orte/test/mpi/connect.c delete mode 100644 orte/test/mpi/crisscross.c delete mode 100644 orte/test/mpi/debugger.c delete mode 100644 orte/test/mpi/delayed_abort.c delete mode 100644 orte/test/mpi/early_abort.c delete mode 100644 orte/test/mpi/hello.c delete mode 100644 orte/test/mpi/hello_barrier.c delete mode 100644 orte/test/mpi/hello_nodename.c delete mode 100644 orte/test/mpi/hello_output.c delete mode 100644 orte/test/mpi/hello_show_help.c delete mode 100755 orte/test/mpi/hellocycle.pl delete mode 100644 orte/test/mpi/info_spawn.c delete mode 100644 orte/test/mpi/init-exit77.c delete mode 100644 orte/test/mpi/intercomm_create.c delete mode 100644 orte/test/mpi/interlib.c delete mode 100644 orte/test/mpi/iof.c delete mode 100644 orte/test/mpi/loop_child.c delete mode 100644 orte/test/mpi/loop_spawn.c delete mode 100755 orte/test/mpi/makedata.pl delete mode 100644 orte/test/mpi/mpi_barrier.c delete mode 100644 orte/test/mpi/mpi_info.c delete mode 100644 orte/test/mpi/mpi_no_op.c delete mode 100644 orte/test/mpi/mpi_spin.c delete mode 100644 orte/test/mpi/multi_abort.c delete mode 100644 orte/test/mpi/myhello.spec delete mode 100644 orte/test/mpi/myring.spec delete mode 100644 orte/test/mpi/no-disconnect.c delete mode 100644 orte/test/mpi/nonzero.c delete mode 100644 orte/test/mpi/parallel_r64.c delete mode 100644 orte/test/mpi/parallel_r8.c delete mode 100644 orte/test/mpi/parallel_w64.c delete mode 100644 orte/test/mpi/parallel_w8.c delete mode 100644 orte/test/mpi/pinterlib.c delete mode 100644 orte/test/mpi/pmix.c delete mode 100644 orte/test/mpi/pubsub.c delete mode 100644 orte/test/mpi/read_write.c delete mode 100644 orte/test/mpi/reduce-hang.c delete mode 100644 orte/test/mpi/ring.c delete mode 100644 orte/test/mpi/segv.c delete mode 100644 orte/test/mpi/sendrecv_blaster.c delete mode 100644 orte/test/mpi/server.c delete mode 100755 orte/test/mpi/shell_hello delete mode 100644 orte/test/mpi/simple_spawn.c delete mode 100644 orte/test/mpi/singleton_client_server.c delete mode 100644 orte/test/mpi/sio.c delete mode 100644 orte/test/mpi/slave.c delete mode 100644 orte/test/mpi/spawn-problem/Makefile delete mode 100644 orte/test/mpi/spawn-problem/ch_rec.c delete mode 100644 orte/test/mpi/spawn-problem/start.c delete mode 100644 orte/test/mpi/spawn_multiple.c delete mode 100644 orte/test/mpi/spawn_tree.c delete mode 100644 orte/test/mpi/thread_init.c delete mode 100644 orte/test/mpi/xlib.c delete mode 100644 orte/test/mpi/ziaprobe.c delete mode 100644 orte/test/mpi/ziatest.README delete mode 100644 orte/test/mpi/ziatest.c delete mode 100644 orte/test/system/Makefile delete mode 100644 orte/test/system/Makefile.include delete mode 100644 orte/test/system/binom.c delete mode 100644 orte/test/system/event-threads.c delete mode 100644 orte/test/system/evpri-test.c delete mode 100644 orte/test/system/evpri-test2.c delete mode 100644 orte/test/system/evthread-test.c delete mode 100644 orte/test/system/get_limits.c delete mode 100644 orte/test/system/getenv_pmi.c delete mode 100644 orte/test/system/iof_delay.c delete mode 100644 orte/test/system/iof_stress.c delete mode 100644 orte/test/system/mapper.c delete mode 100755 orte/test/system/mapr.py delete mode 100644 orte/test/system/no_op.c delete mode 100644 orte/test/system/ofi_big_msg.c delete mode 100644 orte/test/system/ofi_conduit_stress.c delete mode 100644 orte/test/system/ofi_query_test.c delete mode 100644 orte/test/system/ofi_stress.c delete mode 100644 orte/test/system/oob_stress.c delete mode 100644 orte/test/system/oob_stress_channel.c delete mode 100644 orte/test/system/opal-evpri-test.c delete mode 100644 orte/test/system/opal_hotel.c delete mode 100644 orte/test/system/opal_hwloc.c delete mode 100644 orte/test/system/opal_interface.c delete mode 100644 orte/test/system/orte_abort.c delete mode 100644 orte/test/system/orte_dfs.c delete mode 100644 orte/test/system/orte_errors.c delete mode 100644 orte/test/system/orte_exit.c delete mode 100644 orte/test/system/orte_loop_child.c delete mode 100644 orte/test/system/orte_loop_spawn.c delete mode 100644 orte/test/system/orte_no_op.c delete mode 100644 orte/test/system/orte_nodename.c delete mode 100644 orte/test/system/orte_notify.c delete mode 100644 orte/test/system/orte_spawn.c delete mode 100644 orte/test/system/orte_spin.c delete mode 100644 orte/test/system/orte_tool.c delete mode 100644 orte/test/system/pmixtool.c delete mode 100644 orte/test/system/psm_keygen.c delete mode 100644 orte/test/system/pspawn.c delete mode 100644 orte/test/system/radix.c delete mode 100755 orte/test/system/red.py delete mode 100644 orte/test/system/reducer.c delete mode 100644 orte/test/system/regex.c delete mode 100644 orte/test/system/segfault.c delete mode 100644 orte/test/system/sigusr_trap.c delete mode 100644 orte/test/system/spin.c delete mode 100644 orte/test/system/test-time.c delete mode 100644 orte/test/system/threads.c delete mode 100644 orte/test/system/ulfm.c delete mode 100644 orte/tools/Makefile.am delete mode 100644 orte/tools/orte-clean/Makefile.am delete mode 100644 orte/tools/orte-clean/help-orte-clean.txt delete mode 100644 orte/tools/orte-clean/orte-clean.1in delete mode 100644 orte/tools/orte-clean/orte-clean.c delete mode 100644 orte/tools/orte-info/Makefile.am delete mode 100644 orte/tools/orte-info/components.c delete mode 100644 orte/tools/orte-info/help-orte-info.txt delete mode 100644 orte/tools/orte-info/orte-info.1in delete mode 100644 orte/tools/orte-info/orte-info.c delete mode 100644 orte/tools/orte-info/orte-info.h delete mode 100644 orte/tools/orte-info/output.c delete mode 100644 orte/tools/orte-info/param.c delete mode 100644 orte/tools/orte-info/version.c delete mode 100644 orte/tools/orte-server/Makefile.am delete mode 100644 orte/tools/orte-server/help-orte-server.txt delete mode 100644 orte/tools/orte-server/orte-server.1in delete mode 100644 orte/tools/orte-server/orte-server.c delete mode 100644 orte/tools/orted/Makefile.am delete mode 100644 orte/tools/orted/orted.1in delete mode 100644 orte/tools/orted/orted.c delete mode 100644 orte/tools/orterun/Makefile.am delete mode 100644 orte/tools/orterun/help-orterun.txt delete mode 100644 orte/tools/orterun/main.c delete mode 100644 orte/tools/orterun/orterun.1in delete mode 100644 orte/tools/orterun/orterun.c delete mode 100644 orte/tools/orterun/orterun.h delete mode 100644 orte/tools/wrappers/Makefile.am delete mode 100644 orte/tools/wrappers/orte.pc.in delete mode 100644 orte/tools/wrappers/orte_wrapper_script.in delete mode 100644 orte/tools/wrappers/ortecc-wrapper-data.txt.in delete mode 100644 orte/util/Makefile.am delete mode 100644 orte/util/attr.c delete mode 100644 orte/util/attr.h delete mode 100644 orte/util/comm/comm.c delete mode 100644 orte/util/comm/comm.h delete mode 100644 orte/util/context_fns.c delete mode 100644 orte/util/context_fns.h delete mode 100644 orte/util/dash_host/dash_host.c delete mode 100644 orte/util/dash_host/dash_host.h delete mode 100644 orte/util/dash_host/help-dash-host.txt delete mode 100644 orte/util/error_strings.c delete mode 100644 orte/util/error_strings.h delete mode 100644 orte/util/help-regex.txt delete mode 100644 orte/util/hnp_contact.c delete mode 100644 orte/util/hnp_contact.h delete mode 100644 orte/util/hostfile/help-hostfile.txt delete mode 100644 orte/util/hostfile/hostfile.c delete mode 100644 orte/util/hostfile/hostfile.h delete mode 100644 orte/util/hostfile/hostfile_lex.h delete mode 100644 orte/util/hostfile/hostfile_lex.l delete mode 100644 orte/util/hostfile/orte_hosts.7in delete mode 100644 orte/util/listener.c delete mode 100644 orte/util/listener.h delete mode 100644 orte/util/name_fns.c delete mode 100644 orte/util/name_fns.h delete mode 100644 orte/util/nidmap.c delete mode 100644 orte/util/nidmap.h delete mode 100644 orte/util/parse_options.c delete mode 100644 orte/util/parse_options.h delete mode 100644 orte/util/pre_condition_transports.c delete mode 100644 orte/util/pre_condition_transports.h delete mode 100644 orte/util/proc_info.c delete mode 100644 orte/util/proc_info.h delete mode 100644 orte/util/session_dir.c delete mode 100644 orte/util/session_dir.h delete mode 100644 orte/util/show_help.c delete mode 100644 orte/util/show_help.h delete mode 100644 orte/util/threads.h create mode 160000 prrte diff --git a/.gitmodules b/.gitmodules index c7d93416a43..96e1724f88e 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,11 @@ [submodule "hwloc-20x"] path = opal/mca/hwloc/hwloc2/hwloc url = https://github.com/open-mpi/hwloc.git +[submodule "prrte"] + path = prrte + url = https://github.com/openpmix/prrte + branch = master +[submodule "openpmix"] + path = opal/mca/pmix/pmix4x/openpmix + url = https://github.com/openpmix/openpmix.git + branch = master diff --git a/Makefile.am b/Makefile.am index 99316916f74..4ca1b7dce37 100644 --- a/Makefile.am +++ b/Makefile.am @@ -11,9 +11,10 @@ # All rights reserved. # Copyright (c) 2006-2016 Cisco Systems, Inc. All rights reserved. # Copyright (c) 2012-2015 Los Alamos National Security, Inc. All rights reserved. -# Copyright (c) 2014 Intel, Inc. All rights reserved. +# Copyright (c) 2014-2019 Intel, Inc. All rights reserved. # Copyright (c) 2017-2018 Amazon.com, Inc. or its affiliates. # All Rights reserved. +# Copyright (c) 2020 IBM Corporation. All rights reserved. # $COPYRIGHT$ # # Additional copyrights may follow @@ -22,7 +23,14 @@ # SUBDIRS = config contrib $(MCA_PROJECT_SUBDIRS) test +if OMPI_WANT_PRRTE +SUBDIRS += prrte +endif + DIST_SUBDIRS = config contrib $(MCA_PROJECT_DIST_SUBDIRS) test +if OMPI_WANT_PRRTE +DIST_SUBDIRS += prrte +endif EXTRA_DIST = README INSTALL VERSION Doxyfile LICENSE autogen.pl README.JAVA.txt AUTHORS include examples/Makefile.include diff --git a/VERSION b/VERSION index 8bf3d33068d..479ae0952e7 100644 --- a/VERSION +++ b/VERSION @@ -90,7 +90,6 @@ libmpi_mpifh_so_version=0:0:0 libmpi_usempi_tkr_so_version=0:0:0 libmpi_usempi_ignore_tkr_so_version=0:0:0 libmpi_usempif08_so_version=0:0:0 -libopen_rte_so_version=0:0:0 libopen_pal_so_version=0:0:0 libmpi_java_so_version=0:0:0 liboshmem_so_version=0:0:0 @@ -105,9 +104,6 @@ libompitrace_so_version=0:0:0 libmca_ompi_common_ompio_so_version=0:0:0 libmca_ompi_common_monitoring_so_version=0:0:0 -# ORTE layer -libmca_orte_common_alps_so_version=0:0:0 - # OPAL layer libmca_opal_common_cuda_so_version=0:0:0 libmca_opal_common_ofi_so_version=0:0:0 diff --git a/autogen.pl b/autogen.pl index caa0cac8719..33105e59fcc 100755 --- a/autogen.pl +++ b/autogen.pl @@ -7,7 +7,7 @@ # Copyright (c) 2013-2020 Intel, Inc. All rights reserved. # Copyright (c) 2015-2019 Research Organization for Information Science # and Technology (RIST). All rights reserved. -# Copyright (c) 2015 IBM Corporation. All rights reserved. +# Copyright (c) 2015-2020 IBM Corporation. All rights reserved. # # $COPYRIGHT$ # @@ -47,6 +47,7 @@ # Command line parameters my $no_ompi_arg = 0; my $no_orte_arg = 0; +my $no_prrte_arg = 0; my $no_oshmem_arg = 0; my $quiet_arg = 0; my $debug_arg = 0; @@ -1121,6 +1122,7 @@ sub in_tarball { my $ok = Getopt::Long::GetOptions("no-ompi" => \$no_ompi_arg, "no-orte" => \$no_orte_arg, + "no-prrte" => \$no_prrte_arg, "no-oshmem" => \$no_oshmem_arg, "quiet|q" => \$quiet_arg, "debug|d" => \$debug_arg, @@ -1136,7 +1138,8 @@ sub in_tarball { if (!$ok); print "Options: --no-ompi | -no-ompi Do not build the Open MPI layer - --no-orte | -no-orte Do not build the ORTE layer + --no-orte | -no-orte Do not build Open MPI's runtime support (alias for --no-prrte) + --no-prrte | -no-prrte Do not build Open MPI's runtime support --no-oshmem | -no-oshmem Do not build the OSHMEM layer --quiet | -q Do not display normal verbose output --debug | -d Output lots of debug information @@ -1164,31 +1167,22 @@ sub in_tarball { $no_ompi_arg = 1; debug "No ompi subdirectory found - will not build MPI layer\n"; } -if (! -e "orte") { - $no_orte_arg = 1; - debug "No orte subdirectory found - will not build ORTE\n"; +if (! -e "prrte") { + $no_prrte_arg = 1; + debug "No prrte subdirectory found - will not build PRRTE\n"; } if (! -e "oshmem") { $no_oshmem_arg = 1; debug "No oshmem subdirectory found - will not build OSHMEM\n"; } +# alias --no-orte to --no-prrte +if ($no_orte_arg == 1) { + $no_prrte_arg = 1; +} -if (-e "orcm") { - # bozo check - ORCM requires ORTE - if ($no_orte_arg == 1) { - print "Cannot build ORCM without ORTE\n"; - my_exit(1); - } - $project_name_long = "Open Resilient Cluster Manager"; - $project_name_short = "open-rcm"; -} elsif ($no_ompi_arg == 1) { - if ($no_orte_arg == 0) { - $project_name_long = "Open MPI Run Time Environment"; - $project_name_short = "open-rte"; - } else { - $project_name_long = "Open Portability Access Layer"; - $project_name_short = "open-pal"; - } +if ($no_ompi_arg == 1) { + $project_name_long = "Open Portability Access Layer"; + $project_name_short = "open-pal"; } #--------------------------------------------------------------------------- @@ -1393,19 +1387,18 @@ sub in_tarball { # Top-level projects to examine my $projects; push(@{$projects}, { name => "opal", dir => "opal", need_base => 1 }); -push(@{$projects}, { name => "orte", dir => "orte", need_base => 1 }) - if (!$no_orte_arg); push(@{$projects}, { name => "ompi", dir => "ompi", need_base => 1 }) if (!$no_ompi_arg); push(@{$projects}, { name => "oshmem", dir => "oshmem", need_base => 1 }) if (!$no_ompi_arg && !$no_oshmem_arg); -push(@{$projects}, { name => "orcm", dir => "orcm", need_base => 1 }) - if (-e "orcm"); $m4 .= "dnl Separate m4 define for each project\n"; foreach my $p (@$projects) { $m4 .= "m4_define([project_$p->{name}], [1])\n"; } +if (!$no_prrte_arg) { + $m4 .= "m4_define([project_prrte], [1])\n"; +} $m4 .= "\ndnl Project names m4_define([project_name_long], [$project_name_long]) @@ -1433,6 +1426,10 @@ sub in_tarball { ++$step; verbose "\n$step. Processing autogen.subdirs directories\n"; +if (!$no_prrte_arg) { + process_autogen_subdirs("."); +} + if ($#subdirs >= 0) { foreach my $d (@subdirs) { process_subdir($d); diff --git a/autogen.subdirs b/autogen.subdirs new file mode 100644 index 00000000000..c7eba030ae1 --- /dev/null +++ b/autogen.subdirs @@ -0,0 +1 @@ +prrte diff --git a/config/ompi_config_files.m4 b/config/ompi_config_files.m4 index e0a968b3ac7..7a4d6b2dd28 100644 --- a/config/ompi_config_files.m4 +++ b/config/ompi_config_files.m4 @@ -57,5 +57,6 @@ AC_DEFUN([OMPI_CONFIG_FILES],[ ompi/tools/wrappers/ompi-fort.pc ompi/tools/wrappers/mpijavac.pl ompi/tools/mpisync/Makefile + ompi/tools/mpirun/Makefile ]) ]) diff --git a/config/ompi_setup_prrte.m4 b/config/ompi_setup_prrte.m4 new file mode 100644 index 00000000000..593bcd1cffe --- /dev/null +++ b/config/ompi_setup_prrte.m4 @@ -0,0 +1,103 @@ +# -*- shell-script -*- +# +# Copyright (c) 2004-2009 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-2007 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-2009 Cisco Systems, Inc. All rights reserved. +# Copyright (c) 2006-2008 Sun Microsystems, Inc. All rights reserved. +# Copyright (c) 2006-2007 Los Alamos National Security, LLC. All rights +# reserved. +# Copyright (c) 2009 Oak Ridge National Labs. All rights reserved. +# Copyright (c) 2019-2020 Intel, Inc. All rights reserved. +# $COPYRIGHT$ +# +# Additional copyrights may follow +# +# $HEADER$ +# + +AC_DEFUN([OMPI_SETUP_PRRTE],[ + OPAL_VAR_SCOPE_PUSH([opal_prrte_save_CPPFLAGS opal_prrte_save_CFLAGS opal_prrte_save_LDFLAGS opal_prrte_save_LIBS opal_prrte_args opal_prrte_save_enable_dlopen opal_prrte_save_enable_mca_dso opal_prrte_save_enable_mca_static]) + + opal_prrte_save_CFLAGS=$CFLAGS + opal_prrte_save_CPPFLAGS=$CPPFLAGS + opal_prrte_save_LDFLAGS=$LDFLAGS + opal_prrte_save_LIBS=$LIBS + opal_prrte_save_enable_dlopen=enable_dlopen + opal_prrte_save_enable_mca_dso=enable_mca_dso + opal_prrte_save_enable_mca_static=enable_mca_static + + AC_ARG_ENABLE([internal-rte], + [AC_HELP_STRING([--enable-internal-rte], + [Enable internal runtime support and provide mpiexec/mpirun (default: enabled)])]) + AC_MSG_CHECKING([if RTE support is enabled]) + if test "$enable_internal_rte" != "no"; then + AC_MSG_RESULT([yes]) + if test -z $with_libevent || test "$with_libevent" = "internal" || test "$with_libevent" = "yes"; then + opal_prrte_libevent_arg="--with-libevent-header=$OMPI_TOP_SRCDIR/opal/mca/event/event.h" + elif test "$with_libevent" = "external"; then + opal_prrte_libevent_arg="" + else + opal_prrte_libevent_arg="--with-libevent=$with_libevent" + fi + + if test -z $with_hwloc || test "$with_hwloc" = "internal" || test "$with_hwloc" = "yes"; then + opal_prrte_hwloc_arg="--with-hwloc-header=$OMPI_TOP_SRCDIR/opal/mca/hwloc/hwloc-internal.h" + elif test "$with_hwloc" = "external"; then + opal_prrte_hwloc_arg="" + else + opal_prrte_hwloc_arg="--with-hwloc=$with_hwloc" + fi + + if test -z $with_pmix || test "$with_pmix" = "internal" || test "$with_pmix" = "yes"; then + opal_prrte_pmix_arg="--with-pmix-header=$OMPI_TOP_SRCDIR/opal/mca/pmix/pmix-internal.h" + elif test "$with_pmix" = "external"; then + opal_prrte_pmix_arg="" + else + opal_prrte_pmix_arg="--with-pmix=$with_pmix" + fi + + opal_prrte_args="--prefix=$prefix --disable-dlopen $opal_prrte_libevent_arg $opal_prrte_hwloc_arg $opal_prrte_pmix_arg" + AS_IF([test "$enable_debug" = "yes"], + [opal_prrte_args="--enable-debug $opal_prrte_args" + CFLAGS="$OPAL_CFLAGS_BEFORE_PICKY $OPAL_VISIBILITY_CFLAGS -g"], + [opal_prrte_args="--disable-debug $opal_prrte_args" + CFLAGS="$OPAL_CFLAGS_BEFORE_PICKY $OPAL_VISIBILITY_CFLAGS"]) + AS_IF([test "$with_devel_headers" = "yes"], + [opal_prrte_args="--with-devel-headers $opal_prrte_args"]) + # add the extra libs + opal_prrte_args="$opal_prrte_args --with-prrte-extra-lib=$OMPI_TOP_BUILDDIR/opal/libopen-pal.la --with-prrte-extra-ltlib=$OMPI_TOP_BUILDDIR/opal/libopen-pal.la" + + AC_MSG_CHECKING([final prrte configure args]) + AC_MSG_RESULT([$opal_prrte_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([prrte], + [$opal_prrte_args $opal_subdir_args 'CFLAGS=$CFLAGS' 'CPPFLAGS=$CPPFLAGS'], + [opal_prrte_happy=1], [opal_prrte_happy=0]) + + OPAL_SUMMARY_ADD([[Miscellaneous]],[[PRRTE]],[prrte],[yes]) + + else + OPAL_SUMMARY_ADD([[Miscellaneous]],[[PRRTE]],[prrte],[no (disabled)]) + AC_MSG_RESULT([no (disabled)]) + fi + + CFLAGS=$opal_prrte_save_CFLAGS + CPPFLAGS=$opal_prrte_save_CPPFLAGS + LDFLAGS=$opal_prrte_save_LDFLAGS + LIBS=$opal_prrte_save_LIBS + enable_dlopen=$opal_prrte_save_enable_dlopen + enable_mca_dso=$opal_prrte_save_enable_mca_dso + enable_mca_static=$opal_prrte_save_enable_mca_static + + OPAL_VAR_SCOPE_POP + +]) diff --git a/config/opal_check_pmi.m4 b/config/opal_check_pmi.m4 index 19f6f8a4595..9aa9f5906de 100644 --- a/config/opal_check_pmi.m4 +++ b/config/opal_check_pmi.m4 @@ -24,219 +24,6 @@ # $HEADER$ # -# define an internal function for checking the existence -# and validity of a PMI library -# -# OPAL_CHECK_PMI_LIB(installdir, libdir, pmi, function, [action-if-slurm], [action-if-valid], [action-if-not-valid]) -# -------------------------------------------------------- -AC_DEFUN([OPAL_CHECK_PMI_LIB], -[ - # save flags - opal_check_$3_save_CPPFLAGS=$CPPFLAGS - opal_check_$3_save_LDFLAGS=$LDFLAGS - opal_check_$3_save_LIBS=$LIBS - opal_check_$3_hdr_happy= - opal_check_$3_mycppflags= - - # check for the header - AS_IF([test -n "$1"], - [AC_MSG_CHECKING([for $3.h in $1]) - AS_IF([test -f $1/$3.h && test -r $1/$3.h], - [AC_MSG_RESULT([found]) - opal_check_$3_mycppflags="-I$1"], - [AC_MSG_RESULT([not found]) - AC_MSG_CHECKING([for $3.h in $1/include]) - AS_IF([test -f $1/include/$3.h && test -r $1/include/$3.h], - [AC_MSG_RESULT([found]) - opal_check_$3_mycppflags="-I$1/include"], - [AC_MSG_RESULT([not found]) - AC_MSG_CHECKING([for $3.h in $1/include/slurm]) - AS_IF([test -f $1/include/slurm/$3.h && test -r $1/include/slurm/$3.h], - [AC_MSG_RESULT([found]) - opal_check_$3_mycppflags="-I$1/include/slurm" - $5], - [AC_MSG_RESULT([not found]) - opal_check_$3_hdr_happy=no])])])], - [AC_MSG_CHECKING([for $3.h in /usr/include]) - AS_IF([test -f /usr/include/$3.h && test -r /usr/include/$3.h], - [AC_MSG_RESULT([found])], - [AC_MSG_RESULT([not found]) - AC_MSG_CHECKING([for $3.h in /usr/include/slurm]) - AS_IF([test -f /usr/include/slurm/$3.h && test -r /usr/include/slurm/$3.h], - [AC_MSG_RESULT([found]) - opal_check_$3_mycppflags="-I/usr/include/slurm" - $5], - [AC_MSG_RESULT([not found]) - opal_check_$3_hdr_happy=no])])]) - - AS_IF([test "$opal_check_$3_hdr_happy" != "no"], - [CPPFLAGS="$CPPFLAGS $opal_check_$3_mycppflags" - AC_CHECK_HEADER([$3.h], - [opal_check_$3_hdr_happy=yes - $3_CPPFLAGS="$opal_check_$3_mycppflags"], - [opal_check_$3_hdr_happy=no])]) - - # check for library and function - opal_check_$3_lib_happy= - LIBS="$LIBS -l$3" - - # check for the library in the given location in case - # an exact path was given - AS_IF([test -z "$1" && test -z "$2"], - [AC_CHECK_LIB([$3], [$4], - [opal_check_$3_lib_happy=yes], - [opal_check_$3_lib_happy=no])], - [AS_IF([test -n "$2"], - [AC_MSG_CHECKING([for lib$3 in $2]) - files=`ls $2/lib$3.* 2> /dev/null | wc -l` - AS_IF([test "$files" -gt "0"], - [AC_MSG_RESULT([found]) - LDFLAGS="$LDFLAGS -L$2" - AC_CHECK_LIB([$3], [$4], - [opal_check_$3_lib_happy=yes - $3_LDFLAGS=-L$2 - $3_rpath=$2], - [opal_check_$3_lib_happy=no])], - [opal_check_$3_lib_happy=no - AC_MSG_RESULT([not found])])], - [AC_MSG_CHECKING([for lib$3 in $1/lib]) - files=`ls $1/lib/lib$3.* 2> /dev/null | wc -l` - AS_IF([test "$files" -gt "0"], - [AC_MSG_RESULT([found]) - LDFLAGS="$LDFLAGS -L$1/lib" - AC_CHECK_LIB([$3], [$4], - [opal_check_$3_lib_happy=yes - $3_LDFLAGS=-L$1/lib - $3_rpath=$1/lib], - [opal_check_$3_lib_happy=no])], - [# check for presence of lib64 directory - if found, see if the - # desired library is present and matches our build requirements - AC_MSG_CHECKING([for lib$3 in $1/lib64]) - files=`ls $1/lib64/lib$3.* 2> /dev/null | wc -l` - AS_IF([test "$files" -gt "0"], - [AC_MSG_RESULT([found]) - LDFLAGS="$LDFLAGS -L$1/lib64" - AC_CHECK_LIB([$3], [$4], - [opal_check_$3_lib_happy=yes - $3_LDFLAGS=-L$1/lib64 - $3_rpath=$1/lib64], - [opal_check_$3_lib_happy=no])], - [opal_check_$3_lib_happy=no - AC_MSG_RESULT([not found])])])])]) - - # restore flags - CPPFLAGS=$opal_check_$3_save_CPPFLAGS - LDFLAGS=$opal_check_$3_save_LDFLAGS - LIBS=$opal_check_$3_save_LIBS - - AS_IF([test "$opal_check_$3_hdr_happy" = "yes" && test "$opal_check_$3_lib_happy" = "yes"], - [$6], [$7]) - -]) - -# OPAL_CHECK_PMI() -# -------------------------------------------------------- -AC_DEFUN([OPAL_CHECK_PMI],[ - OPAL_VAR_SCOPE_PUSH([check_pmi_install_dir check_pmi_lib_dir default_pmi_libloc slurm_pmi_found]) - - AC_ARG_WITH([pmi], - [AC_HELP_STRING([--with-pmi(=DIR)], - [Build PMI support, optionally adding DIR to the search path (default: no)])], - [], with_pmi=no) - - AC_ARG_WITH([pmi-libdir], - [AC_HELP_STRING([--with-pmi-libdir=DIR], - [Look for libpmi or libpmi2 in the given directory DIR, DIR/lib or DIR/lib64])]) - - check_pmi_install_dir= - check_pmi_lib_dir= - default_pmi_libloc= - slurm_pmi_found= - opal_enable_pmix=no - - AC_MSG_CHECKING([if user requested PMI support]) - AS_IF([test "$with_pmi" = "no"], - [AC_MSG_RESULT([no]) - $3], - [AC_MSG_RESULT([yes]) - # cannot use OPAL_CHECK_PACKAGE as its backend header - # support appends "include" to the path, which won't - # work with slurm :-( - AS_IF([test -n "$with_pmi" && test "$with_pmi" != "yes"], - [check_pmi_install_dir=$with_pmi]) - AS_IF([test -n "$with_pmi_libdir"], - [check_pmi_lib_dir=$with_pmi_libdir]) - - # check for pmi-1 lib */ - slurm_pmi_found=no - OPAL_CHECK_PMI_LIB([$check_pmi_install_dir], - [$check_pmi_lib_dir], - [pmi], [PMI_Init], - [slurm_pmi_found=yes], - [opal_enable_pmi1=yes - opal_pmi1_LIBS="-lpmi" - AC_SUBST(opal_pmi1_LIBS)], - [opal_enable_pmi1=no]) - - AS_IF([test "$opal_enable_pmi1" = "yes"], - [AS_IF([test "$slurm_pmi_found" = "yes"], - [opal_pmi1_CPPFLAGS="$pmi_CPPFLAGS" - AC_SUBST(opal_pmi1_CPPFLAGS)]) - AS_IF([test "$slurm_pmi_found" = "yes"], - [opal_pmi1_LDFLAGS="$pmi_LDFLAGS" - AC_SUBST(opal_pmi1_LDFLAGS) - opal_pmi1_rpath="$pmi_rpath" - AC_SUBST(opal_pmi1_rpath)])]) - - # check for pmi2 lib */ - slurm_pmi_found=no - OPAL_CHECK_PMI_LIB([$check_pmi_install_dir], - [$check_pmi_lib_dir], - [pmi2], [PMI2_Init], - [slurm_pmi_found=yes], - [opal_enable_pmi2=yes - opal_pmi2_LIBS="-lpmi2" - AC_SUBST(opal_pmi2_LIBS)], - [opal_enable_pmi2=no]) - - AS_IF([test "$opal_enable_pmi2" = "yes"], - [AS_IF([test "$slurm_pmi_found" = "yes"], - [opal_pmi2_CPPFLAGS="$pmi2_CPPFLAGS" - AC_SUBST(opal_pmi2_CPPFLAGS)]) - AS_IF([test "$slurm_pmi_found" = "yes"], - [opal_pmi2_LDFLAGS="$pmi2_LDFLAGS" - AC_SUBST(opal_pmi2_LDFLAGS) - opal_pmi2_rpath="$pmi2_rpath" - AC_SUBST(opal_pmi2_rpath)])]) - - # check for pmix lib installed by slurm */ - slurm_pmix_found=no - OPAL_CHECK_PMIX_LIB([$check_pmi_install_dir], - [$check_pmi_lib_dir], - [opal_enable_pmix=yes], - [opal_enable_pmix=no]) - - # since support was explicitly requested, then we should error out - # if we didn't find the required support - AC_MSG_CHECKING([can PMI support be built]) - AS_IF([test "$opal_enable_pmi1" != "yes" && test "$opal_enable_pmi2" != "yes" && test "$opal_enable_pmix" != "yes"], - [AC_MSG_RESULT([no]) - AC_MSG_WARN([PMI support requested (via --with-pmi) but neither pmi.h,]) - AC_MSG_WARN([pmi2.h or pmix.h were found under locations:]) - AC_MSG_WARN([ $check_pmi_install_dir]) - AC_MSG_WARN([ $check_pmi_install_dir/slurm]) - AC_MSG_WARN([Specified path: $with_pmi]) - AC_MSG_WARN([OR neither libpmi, libpmi2, or libpmix were found under:]) - AC_MSG_WARN([ $check_pmi_lib_dir/lib]) - AC_MSG_WARN([ $check_pmi_lib_dir/lib64]) - AC_MSG_WARN([Specified path: $with_pmi_libdir]) - AC_MSG_ERROR([Aborting])], - [AC_MSG_RESULT([yes])]) - ]) - - OPAL_VAR_SCOPE_POP -]) - # define an internal function for checking the existence # and validity of an external PMIx library # @@ -251,12 +38,14 @@ AC_DEFUN([OPAL_CHECK_PMIX_LIB],[ files=`ls $1/pmix.h 2> /dev/null | wc -l` AS_IF([test "$files" -gt 0], [AC_MSG_RESULT([found]) + pmix_ext_install_incdir=$1 opal_external_pmix_header_happy=yes], [AC_MSG_RESULT([not found]) AC_MSG_CHECKING([for pmix.h in $1/include]) files=`ls $1/include/pmix.h 2> /dev/null | wc -l` AS_IF([test "$files" -gt 0], [AC_MSG_RESULT([found]) + pmix_ext_install_incdir=$1/include opal_external_pmix_header_happy=yes], [AC_MSG_RESULT([not found]) opal_external_pmix_header_happy=no])]) @@ -307,7 +96,12 @@ AC_DEFUN([OPAL_CHECK_PMIX_LIB],[ # this must be from a pre-1.1.5 version OMPI does # NOT support anything older than v1.2.5 AC_MSG_CHECKING([PMIx version]) - CPPFLAGS="-I$1/include $CPPFLAGS" + AS_IF([test "$pmix_ext_install_incdir" != "/usr" && test "$pmix_ext_install_incdir" != "/usr/include"], + [CPPFLAGS="-I$pmix_ext_install_incdir $CPPFLAGS"]) + AS_IF([test "$pmix_ext_install_libdir" != "/usr" && test "$pmix_ext_install_libdir" != "/usr/include"], + [LDFLAGS="-L$pmix_ext_install_libdir $LDFLAGS"]) + LIBS="$LIBS -lpmix" + AS_IF([test "x`ls $1/include/pmix_version.h 2> /dev/null`" = "x"], [AC_MSG_RESULT([version file not found - assuming v1.1.4]) opal_external_pmix_version_found=1 @@ -381,12 +175,19 @@ AC_DEFUN([OPAL_CHECK_PMIX_LIB],[ AC_MSG_WARN([be detected]) opal_external_pmix_happy=no]) - CPPFLAGS=$opal_external_pmix_save_CPPFLAGS - LDFLAGS=$opal_external_pmix_save_LDFLAGS - LIBS=$opal_external_pmix_save_LIBS ]) AS_IF([test "$opal_external_pmix_happy" = "yes"], - [$3], [$4]) + [$3 + # add the new flags to our wrapper compilers + AS_IF([test "$pmix_ext_install_incdir" != "/usr" && test "$pmix_ext_install_incdir" != "/usr/include"], + [pmix_pmix4x_WRAPPER_EXTRA_CPPFLAGS="-I$pmix_ext_install_incdir"]) + AS_IF([test "$pmix_ext_install_libdir" != "/usr" && test "$pmix_ext_install_libdir" != "/usr/include"], + [pmix_external_WRAPPER_EXTRA_LDFLAGS="-L$pmix_ext_install_libdir"]) + pmix_external_WRAPPER_EXTRA_LIBS=-lpmix], + [CPPFLAGS=$opal_external_pmix_save_CPPFLAGS + LDFLAGS=$opal_external_pmix_save_LDFLAGS + LIBS=$opal_external_pmix_save_LIBS + $4]) OPAL_VAR_SCOPE_POP ]) @@ -400,7 +201,7 @@ AC_DEFUN([OPAL_CHECK_PMIX],[ AC_ARG_WITH([pmix-libdir], [AC_HELP_STRING([--with-pmix-libdir=DIR], - [Look for libpmix the given directory DIR, DIR/lib or DIR/lib64])]) + [Look for libpmix in the given directory DIR, DIR/lib or DIR/lib64])]) AS_IF([test "$with_pmix" = "no"], [AC_MSG_WARN([Open MPI requires PMIx support. It can be built]) @@ -409,58 +210,55 @@ AC_DEFUN([OPAL_CHECK_PMIX],[ AC_MSG_ERROR([Cannot continue])]) opal_external_have_pmix1=0 - AS_IF([test "$opal_enable_pmix" = "no"], - [AC_MSG_CHECKING([if user requested internal PMIx support($with_pmix)]) - opal_external_pmix_happy=no - pmix_ext_install_libdir= - pmix_ext_install_dir= - - AS_IF([test "$with_pmix" = "internal"], - [AC_MSG_RESULT([yes]) - opal_external_pmix_happy=no - opal_external_pmix_version=internal - opal_enable_pmix=yes], + AC_MSG_CHECKING([if user requested internal PMIx support($with_pmix)]) + opal_external_pmix_happy=no + pmix_ext_install_libdir= + pmix_ext_install_dir= - [AC_MSG_RESULT([no]) - # check for external pmix lib */ - AS_IF([test -z "$with_pmix" || test "$with_pmix" = "yes" || test "$with_pmix" = "external"], - [pmix_ext_install_dir=/usr], - [pmix_ext_install_dir=$with_pmix]) - AS_IF([test -n "$with_pmix_libdir"], - [pmix_ext_install_libdir=$with_pmix_libdir]) - OPAL_CHECK_PMIX_LIB([$pmix_ext_install_dir], - [$pmix_ext_install_libdir], - [opal_external_pmix_happy=yes - opal_enable_pmix=yes], - [opal_external_pmix_happy=no])]) + AS_IF([test "$with_pmix" = "internal"], + [AC_MSG_RESULT([yes]) + opal_external_pmix_happy=no + opal_external_pmix_version=internal + opal_enable_pmix=yes], - # Final check - if they explicitly pointed us at an external - # installation that wasn't acceptable, then error out - AS_IF([test -n "$with_pmix" && test "$with_pmix" != "yes" && test "$with_pmix" != "external" && test "$with_pmix" != "internal" && test "$opal_external_pmix_happy" = "no"], - [AC_MSG_WARN([External PMIx support requested, but either the version]) - AC_MSG_WARN([of the external lib was not supported or the required]) - AC_MSG_WARN([header/library files were not found]) - AC_MSG_ERROR([Cannot continue])]) + [AC_MSG_RESULT([no]) + # check for external pmix lib */ + AS_IF([test -z "$with_pmix" || test "$with_pmix" = "yes" || test "$with_pmix" = "external"], + [pmix_ext_install_dir=/usr], + [pmix_ext_install_dir=$with_pmix]) + AS_IF([test -n "$with_pmix_libdir"], + [pmix_ext_install_libdir=$with_pmix_libdir]) + OPAL_CHECK_PMIX_LIB([$pmix_ext_install_dir], + [$pmix_ext_install_libdir], + [opal_external_pmix_happy=yes + opal_enable_pmix=yes], + [opal_external_pmix_happy=no])]) + + # Final check - if they explicitly pointed us at an external + # installation that wasn't acceptable, then error out + AS_IF([test -n "$with_pmix" && test "$with_pmix" != "yes" && test "$with_pmix" != "external" && test "$with_pmix" != "internal" && test "$opal_external_pmix_happy" = "no"], + [AC_MSG_WARN([External PMIx support requested, but either the version]) + AC_MSG_WARN([of the external lib was not supported or the required]) + AC_MSG_WARN([header/library files were not found]) + AC_MSG_ERROR([Cannot continue])]) - # Final check - if they didn't point us explicitly at an external version - # but we found one anyway, use the internal version if it is higher - AS_IF([test "$opal_external_pmix_version" != "internal" && (test -z "$with_pmix" || test "$with_pmix" = "yes")], - [AS_IF([test "$opal_external_pmix_version" != "3x"], - [AC_MSG_WARN([discovered external PMIx version is less than internal version 3.x]) - AC_MSG_WARN([using internal PMIx]) - opal_external_pmix_version=internal - opal_external_pmix_happy=no])]) - ]) + # Final check - if they didn't point us explicitly at an external version + # but we found one anyway, use the internal version if it is higher + AS_IF([test "$opal_external_pmix_version" != "internal" && (test -z "$with_pmix" || test "$with_pmix" = "yes")], + [AS_IF([test "$opal_external_pmix_version" != "4x"], + [AC_MSG_WARN([discovered external PMIx version is less than internal version 4.x]) + AC_MSG_WARN([using internal PMIx]) + opal_external_pmix_version=internal + opal_external_pmix_happy=no])]) - AS_IF([test "$opal_enable_pmix" = "yes"], - [AC_MSG_CHECKING([PMIx version to be used]) - AS_IF([test "$opal_external_pmix_happy" = "yes"], - [AC_MSG_RESULT([external($opal_external_pmix_version)]) - AS_IF([test "$pmix_ext_install_dir" != "/usr"], - [opal_external_pmix_CPPFLAGS="-I$pmix_ext_install_dir/include" - opal_external_pmix_LDFLAGS=-L$pmix_ext_install_libdir]) - opal_external_pmix_LIBS=-lpmix], - [AC_MSG_RESULT([internal])])]) + AC_MSG_CHECKING([PMIx version to be used]) + AS_IF([test "$opal_external_pmix_happy" = "yes"], + [AC_MSG_RESULT([external($opal_external_pmix_version)]) + AS_IF([test "$pmix_ext_install_dir" != "/usr"], + [opal_external_pmix_CPPFLAGS="-I$pmix_ext_install_dir/include" + opal_external_pmix_LDFLAGS=-L$pmix_ext_install_libdir]) + opal_external_pmix_LIBS=-lpmix], + [AC_MSG_RESULT([internal])]) AC_DEFINE_UNQUOTED([OPAL_PMIX_V1],[$opal_external_have_pmix1], [Whether the external PMIx library is v1]) diff --git a/config/orte_check_lsf.m4 b/config/orte_check_lsf.m4 deleted file mode 100644 index 0de332ca566..00000000000 --- a/config/orte_check_lsf.m4 +++ /dev/null @@ -1,144 +0,0 @@ -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) 2007-2016 Cisco Systems, Inc. All rights reserved. -dnl Copyright (c) 2015 Research Organization for Information Science -dnl and Technology (RIST). All rights reserved. -dnl Copyright (c) 2016 Los Alamos National Security, LLC. All rights -dnl reserved. -dnl Copyright (c) 2017 IBM Corporation. All rights reserved. -dnl $COPYRIGHT$ -dnl -dnl Additional copyrights may follow -dnl -dnl $HEADER$ -dnl - -# check for lsf -# ORTE_CHECK_LSF(prefix, [action-if-found], [action-if-not-found]) -# -------------------------------------------------------- -AC_DEFUN([ORTE_CHECK_LSF],[ - AS_IF([test -z "$orte_check_lsf_happy"],[ - AC_ARG_WITH([lsf], - [AC_HELP_STRING([--with-lsf(=DIR)], - [Build LSF support])]) - OPAL_CHECK_WITHDIR([lsf], [$with_lsf], [include/lsf/lsbatch.h]) - AC_ARG_WITH([lsf-libdir], - [AC_HELP_STRING([--with-lsf-libdir=DIR], - [Search for LSF libraries in DIR])]) - OPAL_CHECK_WITHDIR([lsf-libdir], [$with_lsf_libdir], [libbat.*]) - - AS_IF([test "$with_lsf" != "no"],[ - # Defaults - orte_check_lsf_dir_msg="compiler default" - orte_check_lsf_libdir_msg="linker default" - - # Save directory names if supplied - AS_IF([test ! -z "$with_lsf" && test "$with_lsf" != "yes"], - [orte_check_lsf_dir="$with_lsf" - orte_check_lsf_dir_msg="$orte_check_lsf_dir (from --with-lsf)"]) - AS_IF([test ! -z "$with_lsf_libdir" && test "$with_lsf_libdir" != "yes"], - [orte_check_lsf_libdir="$with_lsf_libdir" - orte_check_lsf_libdir_msg="$orte_check_lsf_libdir (from --with-lsf-libdir)"]) - - # If no directories were specified, look for LSF_LIBDIR, - # LSF_INCLUDEDIR, and/or LSF_ENVDIR. - AS_IF([test -z "$orte_check_lsf_dir" && test -z "$orte_check_lsf_libdir"], - [AS_IF([test ! -z "$LSF_ENVDIR" && test -z "$LSF_LIBDIR" && test -f "$LSF_ENVDIR/lsf.conf"], - [LSF_LIBDIR=`egrep ^LSF_LIBDIR= $LSF_ENVDIR/lsf.conf | cut -d= -f2-`]) - AS_IF([test ! -z "$LSF_ENVDIR" && test -z "$LSF_INCLUDEDIR" && test -f "$LSF_ENVDIR/lsf.conf"], - [LSF_INCLUDEDIR=`egrep ^LSF_INCLUDEDIR= $LSF_ENVDIR/lsf.conf | cut -d= -f2-`]) - AS_IF([test ! -z "$LSF_LIBDIR"], - [orte_check_lsf_libdir=$LSF_LIBDIR - orte_check_lsf_libdir_msg="$LSF_LIBDIR (from \$LSF_LIBDIR)"]) - AS_IF([test ! -z "$LSF_INCLUDEDIR"], - [orte_check_lsf_dir=`dirname $LSF_INCLUDEDIR` - orte_check_lsf_dir_msg="$orte_check_lsf_dir (from \$LSF_INCLUDEDIR)"])]) - - AS_IF([test "$with_lsf" = "no"], - [orte_check_lsf_happy="no"], - [orte_check_lsf_happy="yes"]) - - orte_check_lsf_$1_save_CPPFLAGS="$CPPFLAGS" - orte_check_lsf_$1_save_LDFLAGS="$LDFLAGS" - orte_check_lsf_$1_save_LIBS="$LIBS" - - # liblsf requires yp_all, yp_get_default_domain, and ypprot_err - # on Linux, Solaris, NEC, and Sony NEWSs these are found in libnsl - # on AIX it should be in libbsd - # on HP-UX it should be in libBSD - # on IRIX < 6 it should be in libsun (IRIX 6 and later it is in libc) - OPAL_SEARCH_LIBS_COMPONENT([yp_all_nsl], [yp_all], [nsl bsd BSD sun], - [yp_all_nsl_happy="yes"], - [yp_all_nsl_happy="no"]) - - AS_IF([test "$yp_all_nsl_happy" = "no"], - [orte_check_lsf_happy="no"], - [orte_check_lsf_happy="yes"]) - - # liblsb requires liblsf - using ls_info as a test for liblsf presence - OPAL_CHECK_PACKAGE([ls_info_lsf], - [lsf/lsf.h], - [lsf], - [ls_info], - [$yp_all_nsl_LIBS], - [$orte_check_lsf_dir], - [$orte_check_lsf_libdir], - [ls_info_lsf_happy="yes"], - [ls_info_lsf_happy="no"]) - - AS_IF([test "$ls_info_lsf_happy" = "no"], - [orte_check_lsf_happy="no"], - [orte_check_lsf_happy="yes"]) - - # test function of liblsb LSF package - AS_IF([test "$orte_check_lsf_happy" = "yes"], - [AC_MSG_CHECKING([for LSF dir]) - AC_MSG_RESULT([$orte_check_lsf_dir_msg]) - AC_MSG_CHECKING([for LSF library dir]) - AC_MSG_RESULT([$orte_check_lsf_libdir_msg]) - AC_MSG_CHECKING([for liblsf function]) - AC_MSG_RESULT([$ls_info_lsf_happy]) - AC_MSG_CHECKING([for liblsf yp requirements]) - AC_MSG_RESULT([$yp_all_nsl_happy]) - OPAL_CHECK_PACKAGE([orte_check_lsf], - [lsf/lsbatch.h], - [bat], - [lsb_launch], - [$ls_info_lsf_LIBS $yp_all_nsl_LIBS], - [$orte_check_lsf_dir], - [$orte_check_lsf_libdir], - [orte_check_lsf_happy="yes"], - [orte_check_lsf_happy="no"])]) - - CPPFLAGS="$orte_check_lsf_$1_save_CPPFLAGS" - LDFLAGS="$orte_check_lsf_$1_save_LDFLAGS" - LIBS="$orte_check_lsf_$1_save_LIBS" - - ],[orte_check_lsf_happy=no]) - - OPAL_SUMMARY_ADD([[Resource Managers]],[[LSF]],[$1],[$orte_check_lsf_happy]) - ]) - - AS_IF([test "$orte_check_lsf_happy" = "yes"], - [$1_LIBS="[$]$1_LIBS $orte_check_lsf_LIBS" - $1_LDFLAGS="[$]$1_LDFLAGS $orte_check_lsf_LDFLAGS" - $1_CPPFLAGS="[$]$1_CPPFLAGS $orte_check_lsf_CPPFLAGS" - # add the LSF libraries to static builds as they are required - $1_WRAPPER_EXTRA_LDFLAGS=[$]$1_LDFLAGS - $1_WRAPPER_EXTRA_LIBS=[$]$1_LIBS - $2], - [AS_IF([test ! -z "$with_lsf" && test "$with_lsf" != "no"], - [AC_MSG_WARN([LSF support requested (via --with-lsf) but not found.]) - AC_MSG_ERROR([Aborting.])]) - $3]) -]) diff --git a/config/orte_check_moab.m4 b/config/orte_check_moab.m4 deleted file mode 100644 index e604a2727b7..00000000000 --- a/config/orte_check_moab.m4 +++ /dev/null @@ -1,91 +0,0 @@ -# -*- shell-script -*- -# -# 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) 2009-2016 Cisco Systems, Inc. All rights reserved. -# Copyright (c) 2016 Los Alamos National Security, LLC. All rights -# reserved. -# Copyright (c) 2017 Intel, Inc. All rights reserved. -# $COPYRIGHT$ -# -# Additional copyrights may follow -# -# $HEADER$ -# - -# ORTE_CHECK_MOAB(prefix, [action-if-found], [action-if-not-found]) -# -------------------------------------------------------- -AC_DEFUN([ORTE_CHECK_MOAB],[ - if test -z "$orte_check_moab_happy" ; then - OPAL_VAR_SCOPE_PUSH([orte_check_moab_$1_save_CPPFLAGS orte_check_moab_$1_save_LDFLAGS orte_check_moab_$1_save_LIBS]) - - AC_ARG_WITH([moab], - [AC_HELP_STRING([--with-moab], - [Build MOAB scheduler component (default: yes)])]) - OPAL_CHECK_WITHDIR([moab], [$with_moab], [mapi.h]) - AC_ARG_WITH([moab-libdir], - [AC_HELP_STRING([--with-moab-libdir=DIR], - [Search for Moab libraries in DIR])]) - OPAL_CHECK_WITHDIR([moab-libdir], [$with_moab_libdir], [libmoab.*]) - - orte_check_moab_happy="yes" - AS_IF([test "$with_moab" = "no"], - [orte_check_moab_happy=no]) - - - AS_IF([test $orte_check_moab_happy = yes], - [AC_MSG_CHECKING([looking for moab in]) - AS_IF([test "$with_moab" != "yes"], - [orte_moab_dir=$with_moab - AC_MSG_RESULT([($orte_moab_dir)])], - [AC_MSG_RESULT([(default search paths)])]) - AS_IF([test ! -z "$with_moab_libdir" && \ - test "$with_moab_libdir" != "yes"], - [orte_moab_libdir=$with_moab_libdir]) - ]) - - orte_check_moab_$1_save_CPPFLAGS=$CPPFLAGS - orte_check_moab_$1_save_LDFLAGS=$LDFLAGS - orte_check_moab_$1_save_LIBS=$LIBS - - AS_IF([test $orte_check_moab_happy = yes], - [OPAL_CHECK_PACKAGE([orte_check_moab], - [mapi.h], - [cmoab], - [MCCJobGetRemainingTime], - [], - [$orte_moab_dir], - [$orte_moab_libdir], - [], - [orte_check_moab_happy=no])]) - - CPPFLAGS=$orte_check_moab_$1_save_CPPFLAGS - LDFLAGS=$orte_check_moab_$1_save_LDFLAGS - LIBS=$orte_check_moab_$1_save_LIBS - - OPAL_SUMMARY_ADD([[Resource Managers]],[[Moab]],[$1],[$orte_check_moab_happy]) - OPAL_VAR_SCOPE_POP - fi - - if test $orte_check_moab_happy = yes ; then - $1_CPPFLAGS="[$]$1_CPPFLAGS $orte_check_moab_CPPFLAGS" - $1_LIBS="[$]$1_LIBS $orte_check_moab_LIBS" - $1_LDFLAGS="[$]$1_LDFLAGS $orte_check_moab_LDFLAGS" - - AC_SUBST($1_CPPFLAGS) - AC_SUBST($1_LDFLAGS) - AC_SUBST($1_LIBS) - fi - - AS_IF([test "$orte_check_moab_happy" = "yes"], - [$2], - [$3]) -]) diff --git a/config/orte_check_sge.m4 b/config/orte_check_sge.m4 deleted file mode 100644 index 142381b5608..00000000000 --- a/config/orte_check_sge.m4 +++ /dev/null @@ -1,59 +0,0 @@ -# -*- shell-script -*- -# -# 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-2016 Cisco Systems, Inc. All rights reserved. -# Copyright (c) 2016 Los Alamos National Security, LLC. All rights -# reserved. -# $COPYRIGHT$ -# -# Additional copyrights may follow -# -# $HEADER$ -# - -# 1. if --with-sge is given, always build -# 2. if --without-sge is given, never build -# 3. if neither is given, build if-and-only-if you find either qrsh in path or -# sge_root in environment - -# ORTE_CHECK_GRIDENGINE(prefix, [action-if-found], [action-if-not-found]) -# -------------------------------------------------------- -AC_DEFUN([ORTE_CHECK_GRIDENGINE],[ - if test -z "$orte_gridengine_build" ; then - AC_ARG_WITH([sge], - [AC_HELP_STRING([--with-sge], - [Build SGE or Grid Engine support (default: no)])]) - - AC_MSG_CHECKING([if user requested SGE build]) - orte_gridengine_build="no" - AS_IF([test "$with_sge" = "yes"], - [AC_MSG_RESULT([yes]) - orte_gridengine_build=yes], - [AS_IF([test "$with_sge" = "no"], - [AC_MSG_RESULT([no])], - [AC_MSG_RESULT([not specified; checking environment]) - AC_CHECK_PROG([QRSH], [qrsh], [qrsh]) - AS_IF([test "$QRSH" != ""], - [orte_gridengine_build=yes], - [AC_MSG_CHECKING([for SGE_ROOT environment variable]) - AS_IF([test "$SGE_ROOT" != ""], - [AC_MSG_RESULT([found]) - orte_gridengine_build=yes], - [AC_MSG_RESULT([not found])])])])]) - - OPAL_SUMMARY_ADD([[Resource Managers]],[[Grid Engine]],[$1],[$orte_gridengine_build]) - fi - - AS_IF([test "$orte_gridengine_build" = "yes"], - [$2], - [$3]) -]) diff --git a/config/orte_check_slurm.m4 b/config/orte_check_slurm.m4 deleted file mode 100644 index ee5cd02cce7..00000000000 --- a/config/orte_check_slurm.m4 +++ /dev/null @@ -1,87 +0,0 @@ -# -*- shell-script -*- -# -# 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) 2009-2016 Cisco Systems, Inc. All rights reserved. -# Copyright (c) 2016 Los Alamos National Security, LLC. All rights -# reserved. -# Copyright (c) 2017 Intel, Inc. All rights reserved. -# $COPYRIGHT$ -# -# Additional copyrights may follow -# -# $HEADER$ -# - -# ORTE_CHECK_SLURM(prefix, [action-if-found], [action-if-not-found]) -# -------------------------------------------------------- -AC_DEFUN([ORTE_CHECK_SLURM],[ - if test -z "$orte_check_slurm_happy" ; then - AC_ARG_WITH([slurm], - [AC_HELP_STRING([--with-slurm], - [Build SLURM scheduler component (default: yes)])]) - - if test "$with_slurm" = "no" ; then - orte_check_slurm_happy="no" - elif test "$with_slurm" = "" ; then - # unless user asked, only build slurm component on linux, AIX, - # and OS X systems (these are the platforms that SLURM - # supports) - case $host in - *-linux*|*-aix*|*-apple-darwin*) - orte_check_slurm_happy="yes" - ;; - *) - AC_MSG_CHECKING([for SLURM srun in PATH]) - OPAL_WHICH([srun], [ORTE_CHECK_SLURM_SRUN]) - if test "$ORTE_CHECK_SLURM_SRUN" = ""; then - orte_check_slurm_happy="no" - else - orte_check_slurm_happy="yes" - fi - AC_MSG_RESULT([$orte_check_slurm_happy]) - ;; - esac - else - orte_check_slurm_happy="yes" - fi - - AS_IF([test "$orte_check_slurm_happy" = "yes"], - [AC_CHECK_FUNC([fork], - [orte_check_slurm_happy="yes"], - [orte_check_slurm_happy="no"])]) - - AS_IF([test "$orte_check_slurm_happy" = "yes"], - [AC_CHECK_FUNC([execve], - [orte_check_slurm_happy="yes"], - [orte_check_slurm_happy="no"])]) - - AS_IF([test "$orte_check_slurm_happy" = "yes"], - [AC_CHECK_FUNC([setpgid], - [orte_check_slurm_happy="yes"], - [orte_check_slurm_happy="no"])]) - - # check to see if this is a Cray nativized slurm env. - - slurm_cray_env=0 - OPAL_CHECK_ALPS([orte_slurm_cray], - [slurm_cray_env=1]) - - AC_DEFINE_UNQUOTED([SLURM_CRAY_ENV],[$slurm_cray_env], - [defined to 1 if slurm cray env, 0 otherwise]) - - OPAL_SUMMARY_ADD([[Resource Managers]],[[Slurm]],[$1],[$orte_check_slurm_happy]) - fi - - AS_IF([test "$orte_check_slurm_happy" = "yes"], - [$2], - [$3]) -]) diff --git a/config/orte_check_tm.m4 b/config/orte_check_tm.m4 deleted file mode 100644 index 285874857c2..00000000000 --- a/config/orte_check_tm.m4 +++ /dev/null @@ -1,173 +0,0 @@ -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-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 Los Alamos National Security, LLC. All rights -dnl reserved. -dnl $COPYRIGHT$ -dnl -dnl Additional copyrights may follow -dnl -dnl $HEADER$ -dnl - -# ORTE_CHECK_TM_LIBS_FLAGS(prefix, [LIBS or LDFLAGS]) -# --------------------------------------------------- -AC_DEFUN([ORTE_CHECK_TM_LIBS_FLAGS],[ - OPAL_VAR_SCOPE_PUSH([orte_check_tm_flags]) - orte_check_tm_flags=`$orte_check_tm_pbs_config --libs` - for orte_check_tm_val in $orte_check_tm_flags; do - if test "`echo $orte_check_tm_val | cut -c1-2`" = "-l"; then - if test "$2" = "LIBS"; then - $1_$2="$$1_$2 $orte_check_tm_val" - fi - else - if test "$2" = "LDFLAGS"; then - $1_$2="$$1_$2 $orte_check_tm_val" - fi - fi - done - OPAL_VAR_SCOPE_POP -]) - - -# ORTE_CHECK_TM(prefix, [action-if-found], [action-if-not-found]) -# -------------------------------------------------------- -AC_DEFUN([ORTE_CHECK_TM],[ - if test -z $orte_check_tm_happy ; then - OPAL_VAR_SCOPE_PUSH([orte_check_tm_found orte_check_tm_dir orte_check_tm_pbs_config orte_check_tm_LDFLAGS_save orte_check_tm_CPPFLAGS_save orte_check_tm_LIBS_save]) - - AC_ARG_WITH([tm], - [AC_HELP_STRING([--with-tm(=DIR)], - [Build TM (Torque, PBSPro, and compatible) support, optionally adding DIR/include, DIR/lib, and DIR/lib64 to the search path for headers and libraries])]) - OPAL_CHECK_WITHDIR([tm], [$with_tm], [include/tm.h]) - - orte_check_tm_found=no - AS_IF([test "$with_tm" = "no"], - [orte_check_tm_happy="no"], - [orte_check_tm_happy="yes" - AS_IF([test ! -z "$with_tm" && test "$with_tm" != "yes"], - [orte_check_tm_dir="$with_tm"], - [orte_check_tm_dir=""])]) - - AS_IF([test "$orte_check_tm_happy" = "yes"], - [AC_MSG_CHECKING([for pbs-config]) - orte_check_tm_pbs_config="not found" - AS_IF([test "$orte_check_tm_dir" != "" && test -d "$orte_check_tm_dir" && test -x "$orte_check_tm_dir/bin/pbs-config"], - [orte_check_tm_pbs_config="$orte_check_tm_dir/bin/pbs-config"], - [AS_IF([pbs-config --prefix >/dev/null 2>&1], - [orte_check_tm_pbs_config="pbs-config"])]) - AC_MSG_RESULT([$orte_check_tm_pbs_config])]) - - # If we have pbs-config, get the flags we need from there and then - # do simplistic tests looking for the tm headers and symbols - - AS_IF([test "$orte_check_tm_happy" = "yes" && test "$orte_check_tm_pbs_config" != "not found"], - [orte_check_tm_CPPFLAGS=`$orte_check_tm_pbs_config --cflags` - OPAL_LOG_MSG([orte_check_tm_CPPFLAGS from pbs-config: $orte_check_tm_CPPFLAGS], 1) - - ORTE_CHECK_TM_LIBS_FLAGS([orte_check_tm], [LDFLAGS]) - OPAL_LOG_MSG([orte_check_tm_LDFLAGS from pbs-config: $orte_check_tm_LDFLAGS], 1) - - ORTE_CHECK_TM_LIBS_FLAGS([orte_check_tm], [LIBS]) - OPAL_LOG_MSG([orte_check_tm_LIBS from pbs-config: $orte_check_tm_LIBS], 1) - - # Now that we supposedly have the right flags, try them out. - - orte_check_tm_CPPFLAGS_save="$CPPFLAGS" - orte_check_tm_LDFLAGS_save="$LDFLAGS" - orte_check_tm_LIBS_save="$LIBS" - - CPPFLAGS="$CPPFLAGS $orte_check_tm_CPPFLAGS" - LIBS="$LIBS $orte_check_tm_LIBS" - LDFLAGS="$LDFLAGS $orte_check_tm_LDFLAGS" - - AC_CHECK_HEADER([tm.h], - [AC_CHECK_FUNC([tm_finalize], - [orte_check_tm_found="yes"])]) - - CPPFLAGS="$orte_check_tm_CPPFLAGS_save" - LDFLAGS="$orte_check_tm_LDFLAGS_save" - LIBS="$orte_check_tm_LIBS_save"]) - - # If we don't have pbs-config, then we have to look around - # manually. - - # Note that Torque 2.1.0 changed the name of their back-end - # library to "libtorque". So we have to check for both libpbs and - # libtorque. First, check for libpbs. - - orte_check_package_$1_save_CPPFLAGS="$CPPFLAGS" - orte_check_package_$1_save_LDFLAGS="$LDFLAGS" - orte_check_package_$1_save_LIBS="$LIBS" - - AS_IF([test "$orte_check_tm_found" = "no"], - [AS_IF([test "$orte_check_tm_happy" = "yes"], - [_OPAL_CHECK_PACKAGE_HEADER([orte_check_tm], - [tm.h], - [$orte_check_tm_dir], - [orte_check_tm_found="yes"], - [orte_check_tm_found="no"])]) - - AS_IF([test "$orte_check_tm_found" = "yes"], - [_OPAL_CHECK_PACKAGE_LIB([orte_check_tm], - [pbs], - [tm_init], - [], - [$orte_check_tm_dir], - [$orte_check_tm_libdir], - [orte_check_tm_found="yes"], - [_OPAL_CHECK_PACKAGE_LIB([orte_check_tm], - [pbs], - [tm_init], - [-lcrypto], - [$orte_check_tm_dir], - [$orte_check_tm_libdir], - [orte_check_tm_found="yes"], - [_OPAL_CHECK_PACKAGE_LIB([orte_check_tm], - [torque], - [tm_init], - [], - [$orte_check_tm_dir], - [$orte_check_tm_libdir], - [orte_check_tm_found="yes"], - [orte_check_tm_found="no"])])])])]) - - CPPFLAGS="$orte_check_package_$1_save_CPPFLAGS" - LDFLAGS="$orte_check_package_$1_save_LDFLAGS" - LIBS="$orte_check_package_$1_save_LIBS" - - if test "$orte_check_tm_found" = "no" ; then - orte_check_tm_happy=no - fi - - OPAL_SUMMARY_ADD([[Resource Managers]],[[Torque]],[$1],[$orte_check_tm_happy]) - - OPAL_VAR_SCOPE_POP - fi - - # Did we find the right stuff? - AS_IF([test "$orte_check_tm_happy" = "yes"], - [$1_LIBS="[$]$1_LIBS $orte_check_tm_LIBS" - $1_LDFLAGS="[$]$1_LDFLAGS $orte_check_tm_LDFLAGS" - $1_CPPFLAGS="[$]$1_CPPFLAGS $orte_check_tm_CPPFLAGS" - # add the TM libraries to static builds as they are required - $1_WRAPPER_EXTRA_LDFLAGS=[$]$1_LDFLAGS - $1_WRAPPER_EXTRA_LIBS=[$]$1_LIBS - $2], - [AS_IF([test ! -z "$with_tm" && test "$with_tm" != "no"], - [AC_MSG_ERROR([TM support requested but not found. Aborting])]) - orte_check_tm_happy="no" - $3]) -]) diff --git a/config/orte_config_files.m4 b/config/orte_config_files.m4 deleted file mode 100644 index 191d280131c..00000000000 --- a/config/orte_config_files.m4 +++ /dev/null @@ -1,32 +0,0 @@ -# -*- shell-script -*- -# -# Copyright (c) 2009-2010 Cisco Systems, Inc. All rights reserved. -# Copyright (c) 2009-2010 The Trustees of Indiana University and Indiana -# University Research and Technology -# Corporation. All rights reserved. -# Copyright (c) 2011-2012 Los Alamos National Security, LLC. All rights -# reserved. -# Copyright (c) 2015-2018 Intel, Inc. All rights reserved. -# $COPYRIGHT$ -# -# Additional copyrights may follow -# -# $HEADER$ -# - -AC_DEFUN([ORTE_CONFIG_FILES],[ - AC_CONFIG_FILES([ - orte/Makefile - orte/include/Makefile - orte/etc/Makefile - - orte/tools/orted/Makefile - orte/tools/orterun/Makefile - orte/tools/wrappers/Makefile - orte/tools/wrappers/ortecc-wrapper-data.txt - orte/tools/wrappers/orte.pc - orte/tools/orte-clean/Makefile - orte/tools/orte-info/Makefile - orte/tools/orte-server/Makefile - ]) -]) diff --git a/config/orte_configure_options.m4 b/config/orte_configure_options.m4 deleted file mode 100644 index 8aaf6626944..00000000000 --- a/config/orte_configure_options.m4 +++ /dev/null @@ -1,57 +0,0 @@ -dnl -*- shell-script -*- -dnl -dnl Copyright (c) 2004-2007 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 Cisco Systems, Inc. All rights reserved. -dnl Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved. -dnl Copyright (c) 2009 IBM Corporation. All rights reserved. -dnl Copyright (c) 2009-2013 Los Alamos National Security, LLC. All rights -dnl reserved. -dnl Copyright (c) 2009 Oak Ridge National Labs. All rights reserved. -dnl -dnl Copyright (c) 2016 Intel, Inc. All rights reserved. -dnl $COPYRIGHT$ -dnl -dnl Additional copyrights may follow -dnl -dnl $HEADER$ -dnl - - -AC_DEFUN([ORTE_CONFIGURE_OPTIONS],[ -opal_show_subtitle "ORTE Configuration options" - -# -# Do we want orterun's --prefix behavior to be enabled by default? -# -AC_MSG_CHECKING([if want orterun "--prefix" behavior to be enabled by default]) -AC_ARG_ENABLE([orterun-prefix-by-default], - [AC_HELP_STRING([--enable-orterun-prefix-by-default], - [Make "orterun ..." behave exactly the same as "orterun --prefix \$prefix" (where \$prefix is the value given to --prefix in configure)])]) -AC_ARG_ENABLE([mpirun-prefix-by-default], - [AC_HELP_STRING([--enable-mpirun-prefix-by-default], - [Synonym for --enable-orterun-prefix-by-default])]) -if test "$enable_orterun_prefix_by_default" = ""; then - enable_orterun_prefix_by_default=$enable_mpirun_prefix_by_default -fi -if test "$enable_orterun_prefix_by_default" = "yes"; then - AC_MSG_RESULT([yes]) - orte_want_orterun_prefix_by_default=1 -else - AC_MSG_RESULT([no]) - orte_want_orterun_prefix_by_default=0 -fi -AC_DEFINE_UNQUOTED([ORTE_WANT_ORTERUN_PREFIX_BY_DEFAULT], - [$orte_want_orterun_prefix_by_default], - [Whether we want orterun to effect "--prefix $prefix" by default]) - - -])dnl diff --git a/config/orte_setup_debugger_flags.m4 b/config/orte_setup_debugger_flags.m4 deleted file mode 100644 index 5bd970bf7d8..00000000000 --- a/config/orte_setup_debugger_flags.m4 +++ /dev/null @@ -1,96 +0,0 @@ -dnl -*- shell-script -*- -dnl -dnl Copyright (c) 2004-2009 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-2007 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-2019 Cisco Systems, Inc. All rights reserved. -dnl Copyright (c) 2006-2009 Sun Microsystems, Inc. All rights reserved. -dnl Copyright (c) 2006-2007 Los Alamos National Security, LLC. All rights -dnl reserved. -dnl Copyright (c) 2009 Oak Ridge National Labs. All rights reserved. -dnl Copyright (c) 2015 Research Organization for Information Science -dnl and Technology (RIST). All rights reserved. -dnl $COPYRIGHT$ -dnl -dnl Additional copyrights may follow -dnl -dnl $HEADER$ -dnl - -dnl Check to see if specific CFLAGS work -dnl $1: compiler flags to check -dnl $2: Action if the flags work -dnl $3: Action if the flags do not work -AC_DEFUN([_ORTE_SETUP_DEBUGGER_FLAGS_TRY_CFLAGS],[ - OPAL_VAR_SCOPE_PUSH([ORTE_SETUP_DEBUGGER_FLAGS_CFLAGS_save]) - - ORTE_SETUP_DEBUGGER_FLAGS_CFLAGS_save=$CFLAGS - AC_MSG_CHECKING([if $1 compiler flag works]) - CFLAGS="$CFLAGS $1" - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[int i = 3;])], - [ORTE_SETUP_DEBUGGER_FLAGS_HAPPY=yes], - [ORTE_SETUP_DEBUGGER_FLAGS_HAPPY=no]) - AC_MSG_RESULT([$ORTE_SETUP_DEBUGGER_FLAGS_HAPPY]) - CFLAGS=$ORTE_SETUP_DEBUGGER_FLAGS_CFLAGS_save - - OPAL_VAR_SCOPE_POP - - AS_IF([test $ORTE_SETUP_DEBUGGER_FLAGS_HAPPY = yes], - [$2], [$3]) -]) - -AC_DEFUN([ORTE_SETUP_DEBUGGER_FLAGS],[ - # - # Do a final process of the CFLAGS to make a WITHOUT_OPTFLAGS - # version. We need this so that we can guarantee to build the - # debugger-sensitive files with -g and nothing else. - # - - OPAL_STRIP_OPTFLAGS($CFLAGS) - CFLAGS_WITHOUT_OPTFLAGS="$s_result" - # Tweak the compiler flags passed to orterun for Sun Studio SPARC - # https://svn.open-mpi.org/trac/ompi/ticket/1448 - if test "x$opal_cv_c_compiler_vendor" = "xsun" && test -n "`echo $host | $GREP sparc`"; then - DEBUGGER_CFLAGS="-g -xO0" - else - # Tweak the compiler flags passed for intel - # to stop its aggressive inlining of functions - if test "x$opal_cv_c_compiler_vendor" = "xintel"; then - DEBUGGER_CFLAGS="-g -O0" - else - DEBUGGER_CFLAGS="-g" - fi - fi - AC_MSG_CHECKING([which of CFLAGS are ok for debugger modules]) - AC_MSG_RESULT([$CFLAGS_WITHOUT_OPTFLAGS]) - AC_MSG_CHECKING([for debugger extra CFLAGS]) - AC_MSG_RESULT([$DEBUGGER_CFLAGS]) - - AC_SUBST(CFLAGS_WITHOUT_OPTFLAGS) - AC_SUBST(DEBUGGER_CFLAGS) - - # Check for compiler specific flag to add in unwind information. - # This is needed when attaching using MPIR to unwind back to the - # user's main function. Certain optimisations can prevent GDB from - # producing a stack when explicit unwind information is unavailable. - # This is implied by -g, but we want to save space and don't need - # full debug symbols. - _ORTE_SETUP_DEBUGGER_FLAGS_TRY_CFLAGS([-fasynchronous-unwind-tables], - [MPIR_UNWIND_CFLAGS="-fasynchronous-unwind-tables"], - [_ORTE_SETUP_DEBUGGER_FLAGS_TRY_CFLAGS([-Meh_frame -Mframe], - [MPIR_UNWIND_CFLAGS="-Meh_frame -Mframe"], - [MPIR_UNWIND_CFLAGS=-g]) - ]) - - AC_MSG_CHECKING([for final compiler unwind flags]) - AC_MSG_RESULT([$MPIR_UNWIND_CFLAGS]) - - AC_SUBST(MPIR_UNWIND_CFLAGS) -]) diff --git a/configure.ac b/configure.ac index c3b92d06ec7..bfd73a6ddd6 100644 --- a/configure.ac +++ b/configure.ac @@ -120,11 +120,6 @@ m4_ifdef([project_ompi], [OPAL_SAVE_VERSION([OMPI], [Open MPI], [$srcdir/VERSION], [ompi/include/ompi/version.h])]) -m4_ifdef([project_orte], - [OPAL_SAVE_VERSION([ORTE], [Open MPI Run-Time Environment], - [$srcdir/VERSION], - [orte/include/orte/version.h])]) - m4_ifdef([project_oshmem], [OPAL_SAVE_VERSION([OSHMEM], [Open SHMEM], [$srcdir/VERSION], @@ -145,8 +140,6 @@ m4_ifdef([project_ompi], AC_SUBST(libmpi_usempif08_so_version) AC_SUBST(libmpi_java_so_version) AC_SUBST(libompitrace_so_version)]) -m4_ifdef([project_orte], - [AC_SUBST(libopen_rte_so_version)]) m4_ifdef([project_oshmem], [AC_SUBST(liboshmem_so_version)]) AC_SUBST(libopen_pal_so_version) @@ -159,7 +152,6 @@ AC_SUBST(libmca_opal_common_ofi_so_version) AC_SUBST(libmca_opal_common_cuda_so_version) AC_SUBST(libmca_opal_common_sm_so_version) AC_SUBST(libmca_opal_common_ugni_so_version) -AC_SUBST(libmca_orte_common_alps_so_version) AC_SUBST(libmca_ompi_common_ompio_so_version) AC_SUBST(libmca_ompi_common_monitoring_so_version) AC_SUBST(libmca_opal_common_ucx_so_version) @@ -242,12 +234,6 @@ OPAL_TOP_BUILDDIR="$OMPI_TOP_BUILDDIR" AC_SUBST(OPAL_TOP_SRCDIR) AC_SUBST(OPAL_TOP_BUILDDIR) -m4_ifdef([project_orte], - [ORTE_TOP_SRCDIR="$OMPI_TOP_SRCDIR" - ORTE_TOP_BUILDDIR="$OMPI_TOP_BUILDDIR" - AC_SUBST(ORTE_TOP_SRCDIR) - AC_SUBST(ORTE_TOP_BUILDDIR)]) - m4_ifdef([project_oshmem], [OSHMEM_TOP_SRCDIR="$OMPI_TOP_SRCDIR" OSHMEM_TOP_BUILDDIR="$OMPI_TOP_BUILDDIR" @@ -261,9 +247,7 @@ m4_ifdef([project_oshmem], OPAL_CONFIGURE_OPTIONS OPAL_CHECK_OS_FLAVORS OPAL_CHECK_CUDA -OPAL_CHECK_PMI OPAL_CHECK_PMIX -m4_ifdef([project_orte], [ORTE_CONFIGURE_OPTIONS]) m4_ifdef([project_ompi], [OMPI_CONFIGURE_OPTIONS]) m4_ifdef([project_oshmem], [OSHMEM_CONFIGURE_OPTIONS]) @@ -271,9 +255,6 @@ m4_ifdef([project_oshmem], [OSHMEM_CONFIGURE_OPTIONS]) AS_IF([test "$enable_ompi" != "no"], [project_ompi_amc=true], [project_ompi_amc=false]) m4_ifndef([project_ompi], [project_ompi_amc=false]) -AS_IF([test "$enable_orte" != "no"], [project_orte_amc=true], [project_orte_amc=false]) -m4_ifndef([project_orte], [project_orte_amc=false]) - AS_IF([test "$enable_oshmem" != "no"], [project_oshmem_amc=true], [project_oshmem_amc="no (disabled)"]) m4_ifndef([project_oshmem], [project_oshmem_amc="no (not available)"]) @@ -303,8 +284,6 @@ fi # The library prefixes must be set before we call OPAL MCA. Here is # as good a place as any. OPAL_SET_LIB_PREFIX([]) -m4_ifdef([project_orte], - [ORTE_SET_LIB_PREFIX([])]) m4_ifdef([project_ompi], [OMPI_SET_LIB_NAME([])]) @@ -554,7 +533,7 @@ OPAL_CHECK_OFFSETOF # C++ compiler characteristics ################################## -# We don't need C++ unless we're building Open MPI; ORTE and OPAL do +# We don't need C++ unless we're building Open MPI and OPAL do # not use C++ at all. The OPAL macro name appears to be a bit of a # misnomer; I'm not sure why it was split into a second macro and put # into OPAL...? All it does is setup the C++ compiler (the OMPI macro @@ -1022,11 +1001,6 @@ if test -z "$LEX" || \ fi fi -# -# Look for ps command and arguments for orte-clean -# -m4_ifdef([project_orte], [OPAL_PS_FLAVOR_CHECK]) - # # File system case sensitivity # @@ -1209,7 +1183,6 @@ opal_show_title "Symbol visibility feature" OPAL_CHECK_VISIBILITY - ############################################################################ # Final top-level OMPI configuration ############################################################################ @@ -1283,8 +1256,7 @@ LT_OUTPUT # final compiler config ############################################################################ -m4_ifdef([project_ompi], [opal_show_subtitle "Compiler flags"], - [m4_ifdef([project_orte], [opal_show_subtitle "Compiler flags"])]) +m4_ifdef([project_ompi], [opal_show_subtitle "Compiler flags"]) # # This is needed for VPATH builds, so that it will -I the appropriate @@ -1293,31 +1265,23 @@ m4_ifdef([project_ompi], [opal_show_subtitle "Compiler flags"], # purely aesthetic. # # Because opal_config.h and mpi.h are created by AC_CONFIG_HEADERS, we -# don't need to -I the builddir for /include. However, we do -# need to add it for orte as it doesn't have an AC_CONFIG_HEADERS that -# will install it for us. If we VPATH building, we do need to include the -# source directories, however. +# don't need to -I the builddir for /include. If we VPATH +# building, we do need to include the source directories, however. # if test "$OMPI_TOP_BUILDDIR" != "$OMPI_TOP_SRCDIR"; then # Note the embedded m4 directives here -- we must embed them # rather than have successive assignments to these shell # variables, lest the $(foo) names try to get evaluated here. # Yuck! - CPPFLAGS='-I$(top_srcdir) -I$(top_builddir) -I$(top_srcdir)/opal/include m4_ifdef([project_orte], [-I$(top_srcdir)/orte/include -I$(top_builddir)/orte/include]) m4_ifdef([project_ompi], [-I$(top_srcdir)/ompi/include]) m4_ifdef([project_oshmem], [-I$(top_srcdir)/oshmem/include])'" $CPPFLAGS" + CPPFLAGS='-I$(top_srcdir) -I$(top_builddir) -I$(top_srcdir)/opal/include m4_ifdef([project_ompi], [-I$(top_srcdir)/ompi/include]) m4_ifdef([project_oshmem], [-I$(top_srcdir)/oshmem/include])'" $CPPFLAGS" # C++ is only relevant if we're building OMPI - m4_ifdef([project_ompi], [CXXCPPFLAGS='-I$(top_srcdir) -I$(top_builddir) -I$(top_srcdir)/opal/include -I$(top_srcdir)/orte/include -I$(top_srcdir)/ompi/include'" $CXXCPPFLAGS"]) + m4_ifdef([project_ompi], [CXXCPPFLAGS='-I$(top_srcdir) -I$(top_builddir) -I$(top_srcdir)/opal/include -I$(top_srcdir)/ompi/include'" $CXXCPPFLAGS"]) else - CPPFLAGS='-I$(top_srcdir) m4_ifdef([project_orte], [-I$(top_srcdir)/orte/include])'" $CPPFLAGS" + CPPFLAGS='-I$(top_srcdir)'" $CPPFLAGS" # C++ is only relevant if we're building OMPI m4_ifdef([project_ompi], [CXXCPPFLAGS='-I$(top_srcdir)'" $CXXCPPFLAGS"]) fi -# OMPI/ORTE wants some additional processing of the flags (e.g., get -# versions without optimization for debugger modules). - -m4_ifdef([project_orte], [ORTE_SETUP_DEBUGGER_FLAGS], - [m4_ifdef([project_ompi], [ORTE_SETUP_DEBUGGER_FLAGS])]) - # # Delayed the substitution of CFLAGS and CXXFLAGS until now because # they may have been modified throughout the course of this script. @@ -1343,7 +1307,7 @@ AC_SUBST([AMCA_PARAM_SETS_DIR], ['$(opaldatadir)/amca-param-sets']) ############################################################################ opal_show_subtitle "Wrapper compiler final setup" -# The ORTE and OMPI wrapper scripts (i.e., not the C-compiled +# The OMPI wrapper scripts (i.e., not the C-compiled # executables) need perl. AC_PATH_PROG(PERL, perl, perl) @@ -1371,8 +1335,8 @@ if test $ac_cv_header_sys_synch_h = yes ; then fi # If there is a local hook for each project, call it. This allows 3rd -# parties to add configuration steps to OPAL, ORTE, and/or OMPI simply -# by placing a file in [opal|orte|ompi]/config/whatever.m4 that +# parties to add configuration steps to OPAL and/or OMPI simply +# by placing a file in [opal|ompi]/config/whatever.m4 that # AC_DEFUN's the appropriate macro name -- no patching is necessary. # If that macro is defined, we'll run it here. # @@ -1392,8 +1356,6 @@ fi # :-\ m4_ifdef([opal_CONFIG_LOCAL], [opal_CONFIG_LOCAL]) -m4_ifdef([project_orte], - [m4_ifdef([orte_CONFIG_LOCAL], [orte_CONFIG_LOCAL])]) m4_ifdef([project_ompi], [m4_ifdef([ompi_CONFIG_LOCAL], [ompi_CONFIG_LOCAL])]) @@ -1406,7 +1368,6 @@ m4_ifdef([project_ompi], # MCA tests. If a project is to be disabled, also remove it from # MCA_PROJECT_SUBDIRS to actually disable building. AM_CONDITIONAL([PROJECT_OMPI], [test "$project_ompi_amc" = "true"]) -AM_CONDITIONAL([PROJECT_ORTE], [test "$project_orte_amc" = "true"]) AM_CONDITIONAL([PROJECT_OSHMEM], [test "$project_oshmem_amc" = "true"]) AC_MSG_CHECKING([if libtool needs -no-undefined flag to build shared libraries]) @@ -1424,7 +1385,7 @@ esac # opaldatadir, opallibdir, and opalinclude are essentially the same as # pkg*dir, but will always be */openmpi. This is to make it a bit -# easier to deal with the problem of opal, orte, and ompi built from +# easier to deal with the problem of opal and ompi built from # their own tarballs, with their own PACKAGE variables. opaldatadir='${datadir}/openmpi' opallibdir='${libdir}/openmpi' @@ -1435,13 +1396,6 @@ AC_SUBST(opalincludedir) OPAL_SET_MCA_PREFIX([OMPI_MCA_]) OPAL_SET_MCA_CMD_LINE_ID([mca]) -m4_ifdef([project_orte], - [ortedatadir="$opaldatadir" - AC_SUBST(ortedatadir) - ortelibdir="$opallibdir" - AC_SUBST(ortelibdir) - orteincludedir="$opalincludedir" - AC_SUBST(orteincludedir)]) m4_ifdef([project_ompi], [ompidatadir="$opaldatadir" AC_SUBST(ompidatadir) @@ -1459,6 +1413,13 @@ m4_ifdef([project_oshmem], opal_show_subtitle "Final output" +AC_MSG_CHECKING([OMPI final CPPFLAGS]) +AC_MSG_RESULT([$CPPFLAGS]) +AC_MSG_CHECKING([OMPI final LDFLAGS]) +AC_MSG_RESULT([$LDFLAGS]) +AC_MSG_CHECKING([OMPI final LIBS]) +AC_MSG_RESULT([$LIBS]) + AC_CONFIG_FILES([ Makefile @@ -1490,12 +1451,26 @@ AC_CONFIG_FILES([contrib/dist/mofed/compile_debian_mlnx_example], [chmod +x contrib/dist/mofed/compile_debian_mlnx_example]) OPAL_CONFIG_FILES -m4_ifdef([project_orte], [ORTE_CONFIG_FILES]) m4_ifdef([project_ompi], [OMPI_CONFIG_FILES]) m4_ifdef([project_oshmem], [OSHMEM_CONFIG_FILES]) OPAL_CHECK_LIBNL_SUMMARY +################################## +# PRRTE support +################################## + +opal_show_title "Setup PRRTE support" + +m4_ifdef([project_prrte], + [OMPI_SETUP_PRRTE + ompi_want_prrte=yes], + [ompi_want_prrte=no]) +AM_CONDITIONAL(OMPI_WANT_PRRTE, test "$ompi_want_prrte" = "yes") + +# checkpoint results +AC_CACHE_SAVE + AC_OUTPUT OPAL_SUMMARY_PRINT diff --git a/contrib/scaling/mpi_memprobe.c b/contrib/scaling/mpi_memprobe.c index 3f25543d849..0858977bba6 100644 --- a/contrib/scaling/mpi_memprobe.c +++ b/contrib/scaling/mpi_memprobe.c @@ -9,7 +9,7 @@ #include #include "mpi.h" -#include "opal/mca/pmix/pmix.h" +#include "opal/mca/pmix/pmix-internal.h" #include "opal/util/argv.h" #include "opal/util/printf.h" #include "orte/runtime/runtime.h" diff --git a/ompi/Makefile.am b/ompi/Makefile.am index dfaa42b0e7a..6cc160ee582 100644 --- a/ompi/Makefile.am +++ b/ompi/Makefile.am @@ -14,7 +14,7 @@ # Copyright (c) 2010-2011 Sandia National Laboratories. All rights reserved. # Copyright (c) 2013-2015 Los Alamos National Security, LLC. All rights # reserved. -# Copyright (c) 2015-2017 Intel, Inc. All rights reserved. +# Copyright (c) 2015-2019 Intel, Inc. All rights reserved. # Copyright (c) 2015-2018 Research Organization for Information Science # and Technology (RIST). All rights reserved. # Copyright (c) 2016 IBM Corporation. All rights reserved. @@ -152,10 +152,6 @@ lib@OMPI_LIBMPI_NAME@_la_LIBADD = \ $(OMPI_LIBMPI_EXTRA_LIBS) -if OMPI_RTE_ORTE -lib@OMPI_LIBMPI_NAME@_la_LIBADD += \ - $(OMPI_TOP_BUILDDIR)/orte/lib@ORTE_LIB_PREFIX@open-rte.la -endif lib@OMPI_LIBMPI_NAME@_la_LIBADD += \ $(OMPI_TOP_BUILDDIR)/opal/lib@OPAL_LIB_PREFIX@open-pal.la lib@OMPI_LIBMPI_NAME@_la_DEPENDENCIES = $(lib@OMPI_LIBMPI_NAME@_la_LIBADD) diff --git a/ompi/communicator/comm.c b/ompi/communicator/comm.c index 50b19ee98d5..7b0ecf6230c 100644 --- a/ompi/communicator/comm.c +++ b/ompi/communicator/comm.c @@ -20,7 +20,7 @@ * All rights reserved. * Copyright (c) 2014-2017 Research Organization for Information Science * and Technology (RIST). All rights reserved. - * Copyright (c) 2014-2015 Intel, Inc. All rights reserved. + * Copyright (c) 2014-2019 Intel, Inc. All rights reserved. * Copyright (c) 2015 Mellanox Technologies. All rights reserved. * Copyright (c) 2017 IBM Corporation. All rights reserved. * $COPYRIGHT$ @@ -37,7 +37,7 @@ #include "ompi/constants.h" #include "opal/mca/hwloc/base/base.h" #include "opal/dss/dss.h" -#include "opal/mca/pmix/pmix.h" +#include "opal/mca/pmix/pmix-internal.h" #include "opal/util/string_copy.h" #include "ompi/proc/proc.h" @@ -673,7 +673,7 @@ static int ompi_comm_split_type_get_part (ompi_group_t *group, const int split_t u16ptr = &locality; - OPAL_MODEX_RECV_VALUE(ret, OPAL_PMIX_LOCALITY, &proc_name, &u16ptr, OPAL_UINT16); + OPAL_MODEX_RECV_VALUE(ret, PMIX_LOCALITY, &proc_name, &u16ptr, PMIX_UINT16); if (OPAL_SUCCESS != ret) { continue; } @@ -1655,7 +1655,7 @@ int ompi_comm_get_rprocs ( ompi_communicator_t *local_comm, * to provide this information at startup */ uint16_t *u16ptr, u16; u16ptr = &u16; - OPAL_MODEX_RECV_VALUE(rc, OPAL_PMIX_LOCALITY, &rprocs[i]->super.proc_name, &u16ptr, OPAL_UINT16); + OPAL_MODEX_RECV_VALUE(rc, PMIX_LOCALITY, &rprocs[i]->super.proc_name, &u16ptr, PMIX_UINT16); if (OPAL_SUCCESS == rc) { rprocs[i]->super.proc_flags = u16; } else { diff --git a/ompi/communicator/comm_cid.c b/ompi/communicator/comm_cid.c index 01e36e8220e..8ff2cac9ced 100644 --- a/ompi/communicator/comm_cid.c +++ b/ompi/communicator/comm_cid.c @@ -17,7 +17,7 @@ * Copyright (c) 2012-2016 Los Alamos National Security, LLC. All rights * reserved. * Copyright (c) 2012 Oak Ridge National Labs. All rights reserved. - * Copyright (c) 2013-2016 Intel, Inc. All rights reserved. + * Copyright (c) 2013-2019 Intel, Inc. All rights reserved. * Copyright (c) 2014-2016 Research Organization for Information Science * and Technology (RIST). All rights reserved. * Copyright (c) 2016 IBM Corporation. All rights reserved. @@ -33,7 +33,7 @@ #include "ompi_config.h" #include "opal/dss/dss.h" -#include "opal/mca/pmix/pmix.h" +#include "opal/mca/pmix/base/base.h" #include "opal/util/printf.h" #include "ompi/proc/proc.h" @@ -43,7 +43,7 @@ #include "opal/class/opal_pointer_array.h" #include "opal/class/opal_list.h" #include "ompi/mca/pml/pml.h" -#include "ompi/mca/rte/rte.h" +#include "ompi/runtime/ompi_rte.h" #include "ompi/mca/coll/base/base.h" #include "ompi/request/request.h" #include "ompi/runtime/mpiruntime.h" @@ -891,11 +891,12 @@ static int ompi_comm_allreduce_pmix_reduce_complete (ompi_comm_request_t *reques ompi_comm_allreduce_context_t *context = (ompi_comm_allreduce_context_t *) request->context; ompi_comm_cid_context_t *cid_context = context->cid_context; int32_t size_count = context->count; - opal_value_t info; - opal_pmix_pdata_t pdat; + pmix_info_t info; + pmix_pdata_t pdat; opal_buffer_t sbuf; int rc; int bytes_written; + char *key; const int output_id = 0; const int verbosity_level = 1; @@ -907,32 +908,34 @@ static int ompi_comm_allreduce_pmix_reduce_complete (ompi_comm_request_t *reques return rc; } - OBJ_CONSTRUCT(&info, opal_value_t); - OBJ_CONSTRUCT(&pdat, opal_pmix_pdata_t); + PMIX_PDATA_CONSTRUCT(&pdat); - info.type = OPAL_BYTE_OBJECT; + info.value.type = OPAL_BYTE_OBJECT; pdat.value.type = OPAL_BYTE_OBJECT; - opal_dss.unload(&sbuf, (void**)&info.data.bo.bytes, &info.data.bo.size); + opal_dss.unload(&sbuf, (void**)&info.value.data.bo.bytes, &rc); + info.value.data.bo.size = rc; OBJ_DESTRUCT(&sbuf); - bytes_written = opal_asprintf(&info.key, + bytes_written = opal_asprintf(&key, cid_context->send_first ? "%s:%s:send:%d" : "%s:%s:recv:%d", cid_context->port_string, cid_context->pmix_tag, cid_context->iter); - + PMIX_LOAD_KEY(&info, key); + free(key); if (bytes_written == -1) { opal_output_verbose (verbosity_level, output_id, "writing info.key failed\n"); } else { - bytes_written = opal_asprintf(&pdat.value.key, + bytes_written = opal_asprintf(&key, cid_context->send_first ? "%s:%s:recv:%d" : "%s:%s:send:%d", cid_context->port_string, cid_context->pmix_tag, cid_context->iter); - + PMIX_LOAD_KEY(&pdat.key, key); + free(key); if (bytes_written == -1) { opal_output_verbose (verbosity_level, output_id, "writing pdat.value.key failed\n"); } @@ -950,8 +953,8 @@ static int ompi_comm_allreduce_pmix_reduce_complete (ompi_comm_request_t *reques /* this macro is not actually non-blocking. if a non-blocking version becomes available this function * needs to be reworked to take advantage of it. */ - OPAL_PMIX_EXCHANGE(rc, &info, &pdat, 600); // give them 10 minutes - OBJ_DESTRUCT(&info); + rc = opal_pmix_base_exchange(&info, &pdat, 600); // give them 10 minutes + PMIX_INFO_DESTRUCT(&info); if (OPAL_SUCCESS != rc) { OBJ_DESTRUCT(&pdat); return rc; @@ -959,9 +962,6 @@ static int ompi_comm_allreduce_pmix_reduce_complete (ompi_comm_request_t *reques OBJ_CONSTRUCT(&sbuf, opal_buffer_t); opal_dss.load(&sbuf, pdat.value.data.bo.bytes, pdat.value.data.bo.size); - pdat.value.data.bo.bytes = NULL; - pdat.value.data.bo.size = 0; - OBJ_DESTRUCT(&pdat); rc = opal_dss.unpack (&sbuf, context->outbuf, &size_count, OPAL_INT); OBJ_DESTRUCT(&sbuf); diff --git a/ompi/communicator/comm_init.c b/ompi/communicator/comm_init.c index 824c0680019..3c11f2186f5 100644 --- a/ompi/communicator/comm_init.c +++ b/ompi/communicator/comm_init.c @@ -20,7 +20,7 @@ * All rights reserved. * Copyright (c) 2015-2017 Research Organization for Information Science * and Technology (RIST). All rights reserved. - * Copyright (c) 2015-2017 Intel, Inc. All rights reserved. + * Copyright (c) 2015-2019 Intel, Inc. All rights reserved. * Copyright (c) 2016-2017 IBM Corporation. All rights reserved. * $COPYRIGHT$ * @@ -36,7 +36,7 @@ #include "opal/util/bit_ops.h" #include "opal/util/info_subscriber.h" #include "opal/util/string_copy.h" -#include "opal/mca/pmix/pmix.h" +#include "opal/mca/pmix/pmix-internal.h" #include "ompi/constants.h" #include "ompi/mca/pml/pml.h" #include "ompi/mca/coll/base/base.h" @@ -162,7 +162,7 @@ int ompi_comm_init(void) char *str=NULL; int rc; - OPAL_MODEX_RECV_VALUE_OPTIONAL(rc, OPAL_PMIX_MAPBY, &wildcard, &str, OPAL_STRING); + OPAL_MODEX_RECV_VALUE_OPTIONAL(rc, PMIX_MAPBY, &wildcard, &str, PMIX_STRING); if ( 0 == rc && NULL != str) { if ( strstr ( str, "BYNODE") ) { OMPI_COMM_SET_MAPBY_NODE(&ompi_mpi_comm_world.comm); diff --git a/ompi/debuggers/ompi_debuggers.c b/ompi/debuggers/ompi_debuggers.c index 13415b7469b..f9d7c28bb18 100644 --- a/ompi/debuggers/ompi_debuggers.c +++ b/ompi/debuggers/ompi_debuggers.c @@ -14,6 +14,7 @@ * Copyright (c) 2012-2015 Los Alamos National Security, LLC. All rights * reserved. * Copyright (c) 2018 Amazon.com, Inc. or its affiliates. All Rights reserved. + * Copyright (c) 2019 Intel, Inc. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -52,7 +53,7 @@ #include "opal/util/printf.h" #include "opal/mca/installdirs/installdirs.h" #include "debuggers.h" -#include "ompi/mca/rte/rte.h" +#include "ompi/runtime/ompi_rte.h" /** * BEWARE: The following headers are required by optimized builds in order * to get access to the type information. Some compilers remove all type diff --git a/ompi/dpm/dpm.c b/ompi/dpm/dpm.c index 040fa1f39e6..efd13069f32 100644 --- a/ompi/dpm/dpm.c +++ b/ompi/dpm/dpm.c @@ -45,13 +45,13 @@ #include "opal/util/printf.h" #include "opal/dss/dss.h" #include "opal/mca/hwloc/base/base.h" -#include "opal/mca/pmix/pmix.h" +#include "opal/mca/pmix/base/base.h" #include "ompi/communicator/communicator.h" #include "ompi/group/group.h" #include "ompi/proc/proc.h" #include "ompi/mca/pml/pml.h" -#include "ompi/mca/rte/rte.h" +#include "ompi/runtime/ompi_rte.h" #include "ompi/info/info.h" #include "ompi/dpm/dpm.h" @@ -95,12 +95,16 @@ int ompi_dpm_connect_accept(ompi_communicator_t *comm, int root, ompi_communicator_t **newcomm) { int k, size, rsize, rank, rc, rportlen=0; - char **members = NULL, *nstring, *rport=NULL; + char **members = NULL, *nstring, *rport=NULL, *key, *pkey; bool dense, isnew; opal_process_name_t pname; opal_list_t ilist, mlist, rlist; - opal_value_t info; - opal_pmix_pdata_t pdat; + pmix_info_t info; + pmix_value_t pval; + pmix_pdata_t pdat; + pmix_proc_t *procs, pxproc; + size_t nprocs, n; + pmix_status_t pret; opal_namelist_t *nm; opal_jobid_t jobid; @@ -112,18 +116,6 @@ int ompi_dpm_connect_accept(ompi_communicator_t *comm, int root, ompi_group_t *new_group_pointer; ompi_dpm_proct_caddy_t *cd; - if (NULL == opal_pmix.publish || NULL == opal_pmix.connect || - NULL == opal_pmix.unpublish || - (NULL == opal_pmix.lookup && NULL == opal_pmix.lookup_nb)) { - /* print a nice message explaining we don't have support */ - opal_show_help("help-mpi-runtime.txt", "noconxcpt", true); - return OMPI_ERR_NOT_SUPPORTED; - } - if (!ompi_rte_connect_accept_support(port_string)) { - /* they will have printed the help message */ - return OMPI_ERR_NOT_SUPPORTED; - } - /* set default error return */ *newcomm = MPI_COMM_NULL; @@ -150,9 +142,10 @@ int ompi_dpm_connect_accept(ompi_communicator_t *comm, int root, /* have to add the number of procs in the job so the remote side * can correctly add the procs by computing their names, and our nspace * so they can update their records */ - if (NULL == (nstring = (char*)opal_pmix.get_nspace(OMPI_PROC_MY_NAME->jobid))) { + nstring = opal_jobid_print(pname.jobid); + if (NULL == nstring) { opal_argv_free(members); - return OMPI_ERR_NOT_SUPPORTED; + return OMPI_ERROR; } opal_argv_append_nosize(&members, nstring); (void)opal_asprintf(&nstring, "%d", size); @@ -192,10 +185,10 @@ int ompi_dpm_connect_accept(ompi_communicator_t *comm, int root, } opal_argv_append_nosize(&members, nstring); free(nstring); - if (NULL == (nstring = (char*)opal_pmix.get_nspace(proc_name.jobid))) { + nstring = opal_jobid_print(pname.jobid); + if (OPAL_SUCCESS != rc) { opal_argv_free(members); - free (proc_list); - return OMPI_ERR_NOT_SUPPORTED; + return OMPI_ERROR; } opal_argv_append_nosize(&members, nstring); } @@ -207,30 +200,31 @@ int ompi_dpm_connect_accept(ompi_communicator_t *comm, int root, if (rank == root) { /* the roots for each side exchange their list of participants */ - OBJ_CONSTRUCT(&info, opal_value_t); - OBJ_CONSTRUCT(&pdat, opal_pmix_pdata_t); if (send_first) { - (void)opal_asprintf(&info.key, "%s:connect", port_string); - (void)opal_asprintf(&pdat.value.key, "%s:accept", port_string); + (void)opal_asprintf(&key, "%s:connect", port_string); + (void)opal_asprintf(&pkey, "%s:accept", port_string); } else { - (void)opal_asprintf(&info.key, "%s:accept", port_string); - (void)opal_asprintf(&pdat.value.key, "%s:connect", port_string); + (void)opal_asprintf(&key, "%s:accept", port_string); + (void)opal_asprintf(&pkey, "%s:connect", port_string); } - info.type = OPAL_STRING; - info.data.string = opal_argv_join(members, ':'); - pdat.value.type = OPAL_STRING; + nstring = opal_argv_join(members, ':'); + PMIX_INFO_LOAD(&info, key, nstring, PMIX_STRING); + PMIX_LOAD_KEY(pdat.key, pkey); + free(nstring); + free(key); + free(pkey); - OPAL_PMIX_EXCHANGE(rc, &info, &pdat, 600); // give them 10 minutes - OBJ_DESTRUCT(&info); + rc = opal_pmix_base_exchange(&info, &pdat, 600); // give them 10 minutes + PMIX_INFO_DESTRUCT(&info); if (OPAL_SUCCESS != rc) { - OBJ_DESTRUCT(&pdat); + PMIX_PDATA_DESTRUCT(&pdat); return rc; } /* save the result */ rport = strdup(pdat.value.data.string); // need this later rportlen = strlen(rport) + 1; // retain the NULL terminator - OBJ_DESTRUCT(&pdat); + PMIX_PDATA_DESTRUCT(&pdat); } /* if we aren't in a comm_spawn, the non-root members won't have @@ -313,6 +307,16 @@ int ompi_dpm_connect_accept(ompi_communicator_t *comm, int root, opal_argv_free(members); members = NULL; + /* convert the list of members to a pmix_proc_t array */ + nprocs = opal_list_get_size(&mlist); + PMIX_PROC_CREATE(procs, nprocs); + n = 0; + OPAL_LIST_FOREACH(nm, &mlist, opal_namelist_t) { + OPAL_PMIX_CONVERT_NAME(&procs[n], &nm->name); + ++n; + } + OPAL_LIST_DESTRUCT(&mlist); + /* rport contains a colon-delimited list * of process names for the remote procs - convert it * into an argv array */ @@ -331,6 +335,7 @@ int ompi_dpm_connect_accept(ompi_communicator_t *comm, int root, opal_argv_free(members); OPAL_LIST_DESTRUCT(&ilist); OPAL_LIST_DESTRUCT(&rlist); + PMIX_PROC_FREE(procs, nprocs); goto exit; } /* next entry is the nspace - register it */ @@ -340,9 +345,9 @@ int ompi_dpm_connect_accept(ompi_communicator_t *comm, int root, opal_argv_free(members); OPAL_LIST_DESTRUCT(&ilist); OPAL_LIST_DESTRUCT(&rlist); + PMIX_PROC_FREE(procs, nprocs); goto exit; } - opal_pmix.register_jobid(nm->name.jobid, members[i]); if (OPAL_VPID_WILDCARD == nm->name.vpid) { jobid = nm->name.jobid; OBJ_RELEASE(nm); @@ -356,6 +361,7 @@ int ompi_dpm_connect_accept(ompi_communicator_t *comm, int root, OPAL_LIST_DESTRUCT(&ilist); OPAL_LIST_DESTRUCT(&rlist); rc = OMPI_ERR_BAD_PARAM; + PMIX_PROC_FREE(procs, nprocs); goto exit; } rsize = strtoul(members[i+1], NULL, 10); @@ -397,8 +403,9 @@ int ompi_dpm_connect_accept(ompi_communicator_t *comm, int root, /* tell the host RTE to connect us - this will download * all known data for the nspace's of participating procs * so that add_procs will not result in a slew of lookups */ - rc = opal_pmix.connect(&mlist); - OPAL_LIST_DESTRUCT(&mlist); + pret = PMIx_Connect(procs, nprocs, NULL, 0); + PMIX_PROC_FREE(procs, nprocs); + rc = opal_pmix_convert_status(pret); if (OPAL_SUCCESS != rc) { OMPI_ERROR_LOG(rc); OPAL_LIST_DESTRUCT(&ilist); @@ -420,8 +427,8 @@ int ompi_dpm_connect_accept(ompi_communicator_t *comm, int root, wildcard_rank.jobid = proc->super.proc_name.jobid; wildcard_rank.vpid = OMPI_NAME_WILDCARD->vpid; /* retrieve the local peers */ - OPAL_MODEX_RECV_VALUE_OPTIONAL(rc, OPAL_PMIX_LOCAL_PEERS, - &wildcard_rank, &val, OPAL_STRING); + OPAL_MODEX_RECV_VALUE_OPTIONAL(rc, PMIX_LOCAL_PEERS, + &wildcard_rank, &val, PMIX_STRING); if (OPAL_SUCCESS == rc && NULL != val) { char **peers = opal_argv_split(val, ','); free(val); @@ -435,8 +442,8 @@ int ompi_dpm_connect_accept(ompi_communicator_t *comm, int root, /* get my locality string */ val = NULL; - OPAL_MODEX_RECV_VALUE_OPTIONAL(rc, OPAL_PMIX_LOCALITY_STRING, - OMPI_PROC_MY_NAME, &val, OPAL_STRING); + OPAL_MODEX_RECV_VALUE_OPTIONAL(rc, PMIX_LOCALITY_STRING, + OMPI_PROC_MY_NAME, &val, PMIX_STRING); if (OPAL_SUCCESS == rc && NULL != val) { mycpuset = val; } else { @@ -445,7 +452,6 @@ int ompi_dpm_connect_accept(ompi_communicator_t *comm, int root, i = 0; OPAL_LIST_FOREACH(cd, &ilist, ompi_dpm_proct_caddy_t) { - opal_value_t *kv; proc = cd->p; new_proc_list[i] = proc ; /* ompi_proc_complete_init_single() initializes and optionally retrieves @@ -458,7 +464,7 @@ int ompi_dpm_connect_accept(ompi_communicator_t *comm, int root, if (peer_ranks[prn] == proc->super.proc_name.vpid) { /* get their locality string */ val = NULL; - OPAL_MODEX_RECV_VALUE_IMMEDIATE(rc, OPAL_PMIX_LOCALITY_STRING, + OPAL_MODEX_RECV_VALUE_IMMEDIATE(rc, PMIX_LOCALITY_STRING, &proc->super.proc_name, &val, OPAL_STRING); if (OPAL_SUCCESS == rc && NULL != val) { u16 = opal_hwloc_compute_relative_locality(mycpuset, val); @@ -469,12 +475,10 @@ int ompi_dpm_connect_accept(ompi_communicator_t *comm, int root, } proc->super.proc_flags = u16; /* save the locality for later */ - kv = OBJ_NEW(opal_value_t); - kv->key = strdup(OPAL_PMIX_LOCALITY); - kv->type = OPAL_UINT16; - kv->data.uint16 = proc->super.proc_flags; - opal_pmix.store_local(&proc->super.proc_name, kv); - OBJ_RELEASE(kv); // maintain accounting + OPAL_PMIX_CONVERT_NAME(&pxproc, &proc->super.proc_name); + pval.type = PMIX_UINT16; + pval.data.uint16 = proc->super.proc_flags; + PMIx_Store_internal(&pxproc, PMIX_LOCALITY, &pval); break; } } @@ -623,8 +627,12 @@ static int construct_peers(ompi_group_t *group, opal_list_t *peers) int ompi_dpm_disconnect(ompi_communicator_t *comm) { int ret; + pmix_status_t rc; ompi_group_t *group; opal_list_t coll; + opal_namelist_t *nm; + pmix_proc_t *procs; + size_t nprocs, n; /* Note that we explicitly use an RTE-based barrier (vs. an MPI barrier). See a lengthy comment in @@ -648,15 +656,24 @@ int ompi_dpm_disconnect(ompi_communicator_t *comm) OPAL_LIST_DESTRUCT(&coll); return ret; } + nprocs = opal_list_get_size(&coll); + PMIX_PROC_CREATE(procs, nprocs); + n = 0; + OPAL_LIST_FOREACH(nm, &coll, opal_namelist_t) { + OPAL_PMIX_CONVERT_NAME(&procs[n], &nm->name); + ++n; + } + OPAL_LIST_DESTRUCT(&coll); /* ensure we tell the host RM to disconnect us - this * is a blocking operation so just use a fence */ - if (OMPI_SUCCESS != (ret = opal_pmix.fence(&coll, false))) { + if (PMIX_SUCCESS != (rc = PMIx_Fence(procs, nprocs, NULL, 0))) { + ret = opal_pmix_convert_status(rc); OMPI_ERROR_LOG(ret); - OPAL_LIST_DESTRUCT(&coll); + PMIX_PROC_FREE(procs, nprocs); return ret; } - OPAL_LIST_DESTRUCT(&coll); + PMIX_PROC_FREE(procs, nprocs); return ret; } @@ -679,14 +696,17 @@ int ompi_dpm_spawn(int count, const char *array_of_commands[], char slot_list[OPAL_MAX_INFO_VAL]; uint32_t ui32; bool personality = false; - opal_jobid_t jobid; - - opal_list_t apps; + char *tmp; + pmix_app_t *apps, *app; opal_list_t job_info; - opal_pmix_app_t *app; - opal_value_t *info; + opal_list_t app_info; + opal_info_item_t *info; bool local_spawn, non_mpi; char **envars; + size_t ninfo, n; + pmix_info_t *pinfo = NULL; + pmix_status_t pret; + pmix_nspace_t nspace; /* parse the info object */ /* check potentially for: @@ -726,20 +746,12 @@ int ompi_dpm_spawn(int count, const char *array_of_commands[], /* setup the job object */ OBJ_CONSTRUCT(&job_info, opal_list_t); - OBJ_CONSTRUCT(&apps, opal_list_t); + PMIX_APP_CREATE(apps, count); - /* Convert the list of commands to list of opal_pmix_app_t */ + /* Convert the list of commands to array of pmix_app_t */ for (i = 0; i < count; ++i) { - app = OBJ_NEW(opal_pmix_app_t); - if (NULL == app) { - OMPI_ERROR_LOG(OMPI_ERR_OUT_OF_RESOURCE); - OPAL_LIST_DESTRUCT(&apps); - opal_progress_event_users_decrement(); - return OMPI_ERR_OUT_OF_RESOURCE; - } - /* add the app to the job data */ - opal_list_append(&apps, &app->super); - + app = &apps[i]; + OBJ_CONSTRUCT(&app_info, opal_list_t); /* copy over the name of the executable */ app->cmd = strdup(array_of_commands[i]); opal_argv_append_nosize(&app->argv, app->cmd); @@ -773,46 +785,41 @@ int ompi_dpm_spawn(int count, const char *array_of_commands[], ompi_info_get (array_of_info[i], "personality", sizeof(host) - 1, host, &flag); if ( flag ) { personality = true; - info = OBJ_NEW(opal_value_t); - info->key = strdup(OPAL_PMIX_PERSONALITY); - opal_value_load(info, host, OPAL_STRING); + info = OBJ_NEW(opal_info_item_t); + PMIX_INFO_LOAD(&info->info, PMIX_PERSONALITY, host, PMIX_STRING); opal_list_append(&job_info, &info->super); } /* check for 'host' */ ompi_info_get (array_of_info[i], "host", sizeof(host) - 1, host, &flag); if ( flag ) { - info = OBJ_NEW(opal_value_t); - info->key = strdup(OPAL_PMIX_HOST); - opal_value_load(info, host, OPAL_STRING); - opal_list_append(&app->info, &info->super); + info = OBJ_NEW(opal_info_item_t); + PMIX_INFO_LOAD(&info->info, PMIX_HOST, host, PMIX_STRING); + opal_list_append(&app_info, &info->super); } /* check for 'hostfile' */ ompi_info_get (array_of_info[i], "hostfile", sizeof(host) - 1, host, &flag); if ( flag ) { - info = OBJ_NEW(opal_value_t); - info->key = strdup(OPAL_PMIX_HOSTFILE); - opal_value_load(info, host, OPAL_STRING); - opal_list_append(&app->info, &info->super); + info = OBJ_NEW(opal_info_item_t); + PMIX_INFO_LOAD(&info->info, PMIX_HOSTFILE, host, PMIX_STRING); + opal_list_append(&app_info, &info->super); } /* check for 'add-hostfile' */ ompi_info_get (array_of_info[i], "add-hostfile", sizeof(host) - 1, host, &flag); if ( flag ) { - info = OBJ_NEW(opal_value_t); - info->key = strdup(OPAL_PMIX_ADD_HOSTFILE); - opal_value_load(info, host, OPAL_STRING); - opal_list_append(&app->info, &info->super); + info = OBJ_NEW(opal_info_item_t); + PMIX_INFO_LOAD(&info->info, PMIX_ADD_HOSTFILE, host, PMIX_STRING); + opal_list_append(&app_info, &info->super); } /* check for 'add-host' */ ompi_info_get (array_of_info[i], "add-host", sizeof(host) - 1, host, &flag); if ( flag ) { - info = OBJ_NEW(opal_value_t); - info->key = strdup(OPAL_PMIX_ADD_HOST); - opal_value_load(info, host, OPAL_STRING); - opal_list_append(&app->info, &info->super); + info = OBJ_NEW(opal_info_item_t); + PMIX_INFO_LOAD(&info->info, PMIX_ADD_HOST, host, PMIX_STRING); + opal_list_append(&app_info, &info->super); } /* check for env */ @@ -834,106 +841,95 @@ int ompi_dpm_spawn(int count, const char *array_of_commands[], */ ompi_info_get (array_of_info[i], "ompi_prefix", sizeof(prefix) - 1, prefix, &flag); if ( flag ) { - info = OBJ_NEW(opal_value_t); - info->key = strdup(OPAL_PMIX_PREFIX); - opal_value_load(info, prefix, OPAL_STRING); + info = OBJ_NEW(opal_info_item_t); + PMIX_INFO_LOAD(&info->info, PMIX_PREFIX, prefix, PMIX_STRING); opal_list_append(&job_info, &info->super); } /* check for 'wdir' */ ompi_info_get (array_of_info[i], "wdir", sizeof(cwd) - 1, cwd, &flag); if ( flag ) { - info = OBJ_NEW(opal_value_t); - info->key = strdup(OPAL_PMIX_WDIR); - opal_value_load(info, cwd, OPAL_STRING); - opal_list_append(&app->info, &info->super); + info = OBJ_NEW(opal_info_item_t); + PMIX_INFO_LOAD(&info->info, PMIX_WDIR, cwd, PMIX_STRING); + opal_list_append(&app_info, &info->super); have_wdir = 1; } /* check for 'mapper' - a job-level key */ ompi_info_get(array_of_info[i], "mapper", sizeof(mapper) - 1, mapper, &flag); if ( flag ) { - info = OBJ_NEW(opal_value_t); - info->key = strdup(OPAL_PMIX_MAPPER); - opal_value_load(info, mapper, OPAL_STRING); + info = OBJ_NEW(opal_info_item_t); + PMIX_INFO_LOAD(&info->info, PMIX_MAPPER, mapper, PMIX_STRING); opal_list_append(&job_info, &info->super); } /* check for 'display_map' - a job-level key */ ompi_info_get_bool(array_of_info[i], "display_map", &local_spawn, &flag); if ( flag ) { - info = OBJ_NEW(opal_value_t); - info->key = strdup(OPAL_PMIX_DISPLAY_MAP); - opal_value_load(info, &local_spawn, OPAL_BOOL); + info = OBJ_NEW(opal_info_item_t); + PMIX_INFO_LOAD(&info->info, PMIX_DISPLAY_MAP, &local_spawn, PMIX_BOOL); opal_list_append(&job_info, &info->super); } /* check for 'npernode' and 'ppr' - job-level key */ ompi_info_get (array_of_info[i], "npernode", sizeof(slot_list) - 1, slot_list, &flag); if ( flag ) { - info = OBJ_NEW(opal_value_t); - info->key = strdup(OPAL_PMIX_PPR); - info->type = OPAL_STRING; - (void)opal_asprintf(&(info->data.string), "%s:n", slot_list); + info = OBJ_NEW(opal_info_item_t); + (void)opal_asprintf(&tmp, "%s:n", slot_list); + PMIX_INFO_LOAD(&info->info, PMIX_PPR, tmp, PMIX_STRING); + free(tmp); opal_list_append(&job_info, &info->super); } ompi_info_get (array_of_info[i], "pernode", sizeof(slot_list) - 1, slot_list, &flag); if ( flag ) { - info = OBJ_NEW(opal_value_t); - info->key = strdup(OPAL_PMIX_PPR); - opal_value_load(info, "1:n", OPAL_STRING); + info = OBJ_NEW(opal_info_item_t); + PMIX_INFO_LOAD(&info->info, PMIX_PPR, "1:n", PMIX_STRING); opal_list_append(&job_info, &info->super); } ompi_info_get (array_of_info[i], "ppr", sizeof(slot_list) - 1, slot_list, &flag); if ( flag ) { - info = OBJ_NEW(opal_value_t); - info->key = strdup(OPAL_PMIX_PPR); - opal_value_load(info, slot_list, OPAL_STRING); + info = OBJ_NEW(opal_info_item_t); + PMIX_INFO_LOAD(&info->info, PMIX_PPR, slot_list, PMIX_STRING); opal_list_append(&job_info, &info->super); } /* check for 'map_by' - job-level key */ ompi_info_get(array_of_info[i], "map_by", sizeof(slot_list) - 1, slot_list, &flag); if ( flag ) { - info = OBJ_NEW(opal_value_t); - info->key = strdup(OPAL_PMIX_MAPBY); - opal_value_load(info, slot_list, OPAL_STRING); + info = OBJ_NEW(opal_info_item_t); + PMIX_INFO_LOAD(&info->info, PMIX_MAPBY, slot_list, PMIX_STRING); opal_list_append(&job_info, &info->super); } /* check for 'rank_by' - job-level key */ ompi_info_get(array_of_info[i], "rank_by", sizeof(slot_list) - 1, slot_list, &flag); if ( flag ) { - info = OBJ_NEW(opal_value_t); - info->key = strdup(OPAL_PMIX_RANKBY); - opal_value_load(info, slot_list, OPAL_STRING); + info = OBJ_NEW(opal_info_item_t); + PMIX_INFO_LOAD(&info->info, PMIX_RANKBY, slot_list, PMIX_STRING); opal_list_append(&job_info, &info->super); } /* check for 'bind_to' - job-level key */ ompi_info_get(array_of_info[i], "bind_to", sizeof(slot_list) - 1, slot_list, &flag); if ( flag ) { - info = OBJ_NEW(opal_value_t); - info->key = strdup(OPAL_PMIX_BINDTO); - opal_value_load(info, slot_list, OPAL_STRING); + info = OBJ_NEW(opal_info_item_t); + PMIX_INFO_LOAD(&info->info, PMIX_BINDTO, slot_list, PMIX_STRING); opal_list_append(&job_info, &info->super); } /* check for 'preload_binary' - job-level key */ ompi_info_get_bool(array_of_info[i], "ompi_preload_binary", &local_spawn, &flag); if ( flag ) { - info = OBJ_NEW(opal_value_t); - info->key = strdup(OPAL_PMIX_PRELOAD_BIN); - opal_value_load(info, &local_spawn, OPAL_BOOL); + info = OBJ_NEW(opal_info_item_t); + PMIX_INFO_LOAD(&info->info, PMIX_PRELOAD_BIN, &local_spawn, PMIX_BOOL); opal_list_append(&job_info, &info->super); } /* check for 'preload_files' - job-level key */ ompi_info_get (array_of_info[i], "ompi_preload_files", sizeof(cwd) - 1, cwd, &flag); if ( flag ) { - info = OBJ_NEW(opal_value_t); - info->key = strdup(OPAL_PMIX_PRELOAD_FILES); - opal_value_load(info, cwd, OPAL_STRING); + info = OBJ_NEW(opal_info_item_t); + PMIX_INFO_LOAD(&info->info, PMIX_PRELOAD_BIN, cwd, PMIX_STRING); opal_list_append(&job_info, &info->super); } @@ -942,9 +938,8 @@ int ompi_dpm_spawn(int count, const char *array_of_commands[], */ ompi_info_get_bool(array_of_info[i], "ompi_non_mpi", &non_mpi, &flag); if (flag && non_mpi) { - info = OBJ_NEW(opal_value_t); - info->key = strdup(OPAL_PMIX_NON_PMI); - opal_value_load(info, &non_mpi, OPAL_BOOL); + info = OBJ_NEW(opal_info_item_t); + PMIX_INFO_LOAD(&info->info, PMIX_NON_PMI, &non_mpi, PMIX_BOOL); opal_list_append(&job_info, &info->super); } @@ -966,9 +961,8 @@ int ompi_dpm_spawn(int count, const char *array_of_commands[], } else { ui32 = strtoul(stdin_target, NULL, 10); } - info = OBJ_NEW(opal_value_t); - info->key = strdup(OPAL_PMIX_STDIN_TGT); - opal_value_load(info, &ui32, OPAL_UINT32); + info = OBJ_NEW(opal_info_item_t); + PMIX_INFO_LOAD(&info->info, PMIX_STDIN_TGT, &ui32, PMIX_UINT32); opal_list_append(&job_info, &info->super); } } @@ -979,33 +973,57 @@ int ompi_dpm_spawn(int count, const char *array_of_commands[], if ( !have_wdir ) { if (OMPI_SUCCESS != (rc = opal_getcwd(cwd, OPAL_PATH_MAX))) { OMPI_ERROR_LOG(rc); - OPAL_LIST_DESTRUCT(&apps); + PMIX_APP_FREE(apps, (size_t)count); opal_progress_event_users_decrement(); return rc; } - info = OBJ_NEW(opal_value_t); - info->key = strdup(OPAL_PMIX_WDIR); - opal_value_load(info, cwd, OPAL_STRING); - opal_list_append(&app->info, &info->super); + info = OBJ_NEW(opal_info_item_t); + PMIX_INFO_LOAD(&info->info, PMIX_WDIR, cwd, PMIX_STRING); + opal_list_append(&app_info, &info->super); } /* leave the map info alone - the launcher will * decide where to put things */ + + ninfo = opal_list_get_size(&app_info); + if (0 < ninfo) { + PMIX_INFO_CREATE(app->info, ninfo); + app->ninfo = ninfo; + n = 0; + OPAL_LIST_FOREACH(info, &app_info, opal_info_item_t) { + PMIX_INFO_XFER(&app->info[n], &info->info); + ++n; + } + } + OPAL_LIST_DESTRUCT(&app_info); } /* for (i = 0 ; i < count ; ++i) */ /* default the personality - job-level key */ if (!personality) { - info = OBJ_NEW(opal_value_t); - info->key = strdup(OPAL_PMIX_PERSONALITY); - opal_value_load(info, "ompi", OPAL_STRING); + info = OBJ_NEW(opal_info_item_t); + PMIX_INFO_LOAD(&info->info, PMIX_PERSONALITY, "ompi", PMIX_STRING); opal_list_append(&job_info, &info->super); } /* spawn procs */ - rc = opal_pmix.spawn(&job_info, &apps, &jobid); + ninfo = opal_list_get_size(&job_info); + if (0 < ninfo) { + PMIX_INFO_CREATE(pinfo, ninfo); + n = 0; + OPAL_LIST_FOREACH(info, &job_info, opal_info_item_t) { + PMIX_INFO_XFER(&pinfo[n], &info->info); + ++n; + } + } OPAL_LIST_DESTRUCT(&job_info); - OPAL_LIST_DESTRUCT(&apps); + + pret = PMIx_Spawn(pinfo, ninfo, apps, count, nspace); + rc = opal_pmix_convert_status(pret); + if (NULL != pinfo) { + PMIX_INFO_FREE(pinfo, ninfo); + } + PMIX_APP_FREE(apps, (size_t)count); if (OPAL_SUCCESS != rc) { opal_progress_event_users_decrement(); diff --git a/ompi/errhandler/errhandler.c b/ompi/errhandler/errhandler.c index 1a12cc54a34..b81a4e30064 100644 --- a/ompi/errhandler/errhandler.c +++ b/ompi/errhandler/errhandler.c @@ -14,7 +14,7 @@ * Copyright (c) 2009 Sun Microsystems, Inc. All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. - * Copyright (c) 2015-2016 Intel, Inc. All rights reserved. + * Copyright (c) 2015-2019 Intel, Inc. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -31,7 +31,7 @@ #include "ompi/errhandler/errhandler.h" #include "ompi/errhandler/errhandler_predefined.h" #include "opal/class/opal_pointer_array.h" -#include "opal/mca/pmix/pmix.h" +#include "opal/mca/pmix/pmix-internal.h" #include "opal/util/string_copy.h" @@ -165,7 +165,7 @@ int ompi_errhandler_finalize(void) /* JMS Add stuff here checking for unreleased errorhandlers, similar to communicators, info handles, etc. */ - opal_pmix.deregister_evhandler(default_errhandler_id, NULL, NULL); + PMIx_Deregister_event_handler(default_errhandler_id, NULL, NULL); /* Remove errhandler F2C table */ @@ -237,16 +237,17 @@ void ompi_errhandler_registration_callback(int status, /** * Default errhandler callback */ -void ompi_errhandler_callback(int status, - const opal_process_name_t *source, - opal_list_t *info, opal_list_t *results, - opal_pmix_notification_complete_fn_t cbfunc, +void ompi_errhandler_callback(size_t refid, 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) { /* tell the event chain engine to go no further - we * will handle this */ if (NULL != cbfunc) { - cbfunc(OMPI_ERR_HANDLERS_COMPLETE, NULL, NULL, NULL, cbdata); + cbfunc(PMIX_EVENT_ACTION_COMPLETE, NULL, 0, NULL, NULL, cbdata); } /* our default action is to abort */ ompi_mpi_abort(MPI_COMM_WORLD, status); diff --git a/ompi/errhandler/errhandler.h b/ompi/errhandler/errhandler.h index 0209c57fd8a..558478225cc 100644 --- a/ompi/errhandler/errhandler.h +++ b/ompi/errhandler/errhandler.h @@ -12,7 +12,7 @@ * All rights reserved. * Copyright (c) 2008-2018 Cisco Systems, Inc. All rights reserved * Copyright (c) 2008-2009 Sun Microsystems, Inc. All rights reserved. - * Copyright (c) 2015-2016 Intel, Inc. All rights reserved. + * Copyright (c) 2015-2019 Intel, Inc. All rights reserved. * Copyright (c) 2016 Los Alamos National Security, LLC. All rights * reserved. * Copyright (c) 2016 Research Organization for Information Science @@ -35,7 +35,7 @@ #include "opal/prefetch.h" #include "opal/class/opal_object.h" #include "opal/class/opal_pointer_array.h" -#include "opal/mca/pmix/pmix.h" +#include "opal/mca/pmix/pmix-internal.h" #include "ompi/runtime/mpiruntime.h" #include "ompi/errhandler/errhandler_predefined.h" @@ -392,10 +392,11 @@ typedef struct { int status; } ompi_errhandler_errtrk_t; -OMPI_DECLSPEC void ompi_errhandler_callback(int status, - const opal_process_name_t *source, - opal_list_t *info, opal_list_t *results, - opal_pmix_notification_complete_fn_t cbfunc, +OMPI_DECLSPEC void ompi_errhandler_callback(size_t refid, 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); OMPI_DECLSPEC void ompi_errhandler_registration_callback(int status, diff --git a/ompi/errhandler/errhandler_predefined.c b/ompi/errhandler/errhandler_predefined.c index 8eb4954db5e..f21e36eee1a 100644 --- a/ompi/errhandler/errhandler_predefined.c +++ b/ompi/errhandler/errhandler_predefined.c @@ -15,7 +15,7 @@ * Copyright (c) 2010-2011 Oak Ridge National Labs. All rights reserved. * Copyright (c) 2012 Los Alamos National Security, LLC. * All rights reserved. - * Copyright (c) 2016 Intel, Inc. All rights reserved. + * Copyright (c) 2016-2019 Intel, Inc. All rights reserved. * Copyright (c) 2018 Amazon.com, Inc. or its affiliates. All Rights reserved. * $COPYRIGHT$ * @@ -35,7 +35,7 @@ #endif #include "opal/util/show_help.h" -#include "ompi/mca/rte/rte.h" +#include "ompi/runtime/ompi_rte.h" #include "ompi/errhandler/errhandler_predefined.h" #include "ompi/errhandler/errcode.h" #include "ompi/communicator/communicator.h" diff --git a/ompi/include/ompi/constants.h b/ompi/include/ompi/constants.h index ed9e463853b..34826b8fd93 100644 --- a/ompi/include/ompi/constants.h +++ b/ompi/include/ompi/constants.h @@ -10,6 +10,8 @@ * Copyright (c) 2004-2005 The Regents of the University of California. * All rights reserved. * Copyright (c) 2016 Intel, Inc. All rights reserved. + * Copyright (c) 2019 Research Organization for Information Science + * and Technology (RIST). All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -20,13 +22,8 @@ #ifndef OMPI_CONSTANTS_H #define OMPI_CONSTANTS_H -#if defined(OMPI_RTE_ORTE) && OMPI_RTE_ORTE -#include "orte/constants.h" -#define OMPI_ERR_BASE ORTE_ERR_MAX -#else #include "opal/constants.h" #define OMPI_ERR_BASE OPAL_ERR_MAX -#endif /* error codes */ enum { diff --git a/ompi/interlib/interlib.c b/ompi/interlib/interlib.c index cf9cd2c7429..34f125282f9 100644 --- a/ompi/interlib/interlib.c +++ b/ompi/interlib/interlib.c @@ -14,7 +14,7 @@ * Copyright (c) 2009 Sun Microsystems, Inc. All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. - * Copyright (c) 2015-2017 Intel, Inc. All rights reserved. + * Copyright (c) 2015-2019 Intel, Inc. All rights reserved. * Copyright (c) 2017 IBM Corporation. All rights reserved. * $COPYRIGHT$ * @@ -27,52 +27,32 @@ #include -#include "opal/mca/pmix/pmix.h" -#include "ompi/mca/rte/rte.h" +#include "opal/mca/pmix/pmix-internal.h" +#include "ompi/runtime/ompi_rte.h" #include "ompi/interlib/interlib.h" #include "mpi.h" -typedef struct { - int status; - volatile bool active; -} myreg_t; - -/* - * errhandler id - */ -static size_t interlibhandler_id = SIZE_MAX; - - -static void model_registration_callback(int status, - size_t errhandler_ref, - void *cbdata) -{ - myreg_t *trk = (myreg_t*)cbdata; - - trk->status = status; - interlibhandler_id = errhandler_ref; - trk->active = false; -} -static void model_callback(int status, - const opal_process_name_t *source, - opal_list_t *info, opal_list_t *results, - opal_pmix_notification_complete_fn_t cbfunc, +static void model_callback(size_t refid, 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) { - opal_value_t *val; + size_t n; if (NULL != getenv("OMPI_SHOW_MODEL_CALLBACK")) { /* we can ignore our own callback as we obviously * know that we are MPI */ if (NULL != info) { - OPAL_LIST_FOREACH(val, info, opal_value_t) { - if (0 == strcmp(val->key, OPAL_PMIX_PROGRAMMING_MODEL) && - 0 == strcmp(val->data.string, "MPI")) { + for (n=0; n < ninfo; n++) { + if (PMIX_CHECK_KEY(&info[n], PMIX_PROGRAMMING_MODEL) && + 0 == strcmp(info[n].value.data.string, "MPI")) { goto cback; } - if (OPAL_STRING == val->type) { - opal_output(0, "OMPI Model Callback Key: %s Val %s", val->key, val->data.string); + if (OPAL_STRING == info[n].value.type) { + opal_output(0, "OMPI Model Callback Key: %s Val %s", info[n].key, info[n].value.data.string); } } } @@ -84,79 +64,49 @@ static void model_callback(int status, * are the last step as that will prevent it from notifying * anyone else that might be listening for declarations */ if (NULL != cbfunc) { - cbfunc(OMPI_SUCCESS, NULL, NULL, NULL, cbdata); + cbfunc(PMIX_SUCCESS, NULL, 0, NULL, NULL, cbdata); } } int ompi_interlib_declare(int threadlevel, char *version) { - opal_list_t info, directives; - opal_value_t *kv; - myreg_t trk; + pmix_info_t info[4], directives; int ret; + pmix_status_t rc; + pmix_status_t code = PMIX_MODEL_DECLARED; /* Register an event handler for library model declarations */ - trk.status = OPAL_ERROR; - trk.active = true; /* give it a name so we can distinguish it */ - OBJ_CONSTRUCT(&directives, opal_list_t); - kv = OBJ_NEW(opal_value_t); - kv->key = strdup(OPAL_PMIX_EVENT_HDLR_NAME); - kv->type = OPAL_STRING; - kv->data.string = strdup("MPI-Model-Declarations"); - opal_list_append(&directives, &kv->super); - /* specify the event code */ - OBJ_CONSTRUCT(&info, opal_list_t); - kv = OBJ_NEW(opal_value_t); - kv->key = strdup("status"); // the key here is irrelevant - kv->type = OPAL_INT; - kv->data.integer = OPAL_ERR_MODEL_DECLARED; - opal_list_append(&info, &kv->super); + PMIX_INFO_LOAD(&directives, PMIX_EVENT_HDLR_NAME, "MPI-Model-Declarations", PMIX_STRING); /* we could constrain the range to proc_local - technically, this * isn't required so long as the code that generates * the event stipulates its range as proc_local. We rely * on that here */ - opal_pmix.register_evhandler(&info, &directives, model_callback, - model_registration_callback, - (void*)&trk); - OMPI_LAZY_WAIT_FOR_COMPLETION(trk.active); - - OPAL_LIST_DESTRUCT(&directives); - OPAL_LIST_DESTRUCT(&info); - if (OPAL_SUCCESS != trk.status) { - return trk.status; + rc = PMIx_Register_event_handler(&code, 1, &directives, 1, model_callback, NULL, NULL); + PMIX_INFO_DESTRUCT(&directives); + if (rc < 0) { + PMIX_INFO_DESTRUCT(&directives); + return OMPI_ERROR; } /* declare that we are present and active */ - OBJ_CONSTRUCT(&info, opal_list_t); - kv = OBJ_NEW(opal_value_t); - kv->key = strdup(OPAL_PMIX_PROGRAMMING_MODEL); - kv->type = OPAL_STRING; - kv->data.string = strdup("MPI"); - opal_list_append(&info, &kv->super); - kv = OBJ_NEW(opal_value_t); - kv->key = strdup(OPAL_PMIX_MODEL_LIBRARY_NAME); - kv->type = OPAL_STRING; - kv->data.string = strdup("OpenMPI"); - opal_list_append(&info, &kv->super); - kv = OBJ_NEW(opal_value_t); - kv->key = strdup(OPAL_PMIX_MODEL_LIBRARY_VERSION); - kv->type = OPAL_STRING; - kv->data.string = strdup(version); - opal_list_append(&info, &kv->super); - kv = OBJ_NEW(opal_value_t); - kv->key = strdup(OPAL_PMIX_THREADING_MODEL); - kv->type = OPAL_STRING; + PMIX_INFO_LOAD(&info[0], PMIX_PROGRAMMING_MODEL, "MPI", PMIX_STRING); + PMIX_INFO_LOAD(&info[1], PMIX_MODEL_LIBRARY_NAME, "OpenMPI", PMIX_STRING); + PMIX_INFO_LOAD(&info[2], PMIX_MODEL_LIBRARY_VERSION, version, PMIX_STRING); if (MPI_THREAD_SINGLE == threadlevel) { - kv->data.string = strdup("NONE"); + PMIX_INFO_LOAD(&info[3], PMIX_THREADING_MODEL, "NONE", PMIX_STRING); } else { - kv->data.string = strdup("PTHREAD"); + PMIX_INFO_LOAD(&info[3], PMIX_THREADING_MODEL, "PTHREAD", PMIX_STRING); } - opal_list_append(&info, &kv->super); + /* call pmix to initialize these values */ - ret = opal_pmix.init(&info); - OPAL_LIST_DESTRUCT(&info); + rc = PMIx_Init(NULL, info, 4); + PMIX_INFO_DESTRUCT(&info[0]); + PMIX_INFO_DESTRUCT(&info[1]); + PMIX_INFO_DESTRUCT(&info[2]); + PMIX_INFO_DESTRUCT(&info[3]); /* account for our refcount on pmix_init */ - opal_pmix.finalize(); + PMIx_Finalize(NULL, 0); + ret = opal_pmix_convert_status(rc); return ret; } diff --git a/ompi/mca/bml/r2/bml_r2_ft.c b/ompi/mca/bml/r2/bml_r2_ft.c index 8dc45d4f1e3..4652738c556 100644 --- a/ompi/mca/bml/r2/bml_r2_ft.c +++ b/ompi/mca/bml/r2/bml_r2_ft.c @@ -12,6 +12,7 @@ * Copyright (c) 2007-2012 Los Alamos National Security, LLC. All rights * reserved. * Copyright (c) 2008 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2019-2020 Intel, Inc. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -27,7 +28,7 @@ #include "opal/runtime/opal_progress.h" #include "opal/mca/btl/base/base.h" -#include "opal/mca/pmix/pmix.h" +#include "opal/mca/pmix/pmix-internal.h" #include "ompi/runtime/ompi_cr.h" #include "ompi/mca/bml/base/base.h" @@ -155,7 +156,7 @@ int mca_bml_r2_ft_event(int state) * Barrier to make all processes have been successfully restarted before * we try to remove some restart only files. */ - if( OMPI_SUCCESS != (ret = opal_pmix.fence(NULL, 0))) { + if( OMPI_SUCCESS != (ret = PMIx_Fence(NULL, 0, NULL, 0))) { opal_output(0, "bml:r2: ft_event(Restart): Failed to fence complete\n"); return ret; } @@ -227,7 +228,7 @@ int mca_bml_r2_ft_event(int state) * Barrier to make all processes have been successfully restarted before * we try to remove some restart only files. */ - if( OMPI_SUCCESS != (ret = opal_pmix.fence(NULL, 0))) { + if( OMPI_SUCCESS != (ret = PMIx_Fence(NULL, 0, NULL, 0))) { opal_output(0, "bml:r2: ft_event(Restart): Failed to fence complete\n"); return ret; } diff --git a/ompi/mca/coll/base/coll_base_find_available.c b/ompi/mca/coll/base/coll_base_find_available.c index b2e25944f3f..81055078b67 100644 --- a/ompi/mca/coll/base/coll_base_find_available.c +++ b/ompi/mca/coll/base/coll_base_find_available.c @@ -14,6 +14,7 @@ * 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 @@ -36,7 +37,7 @@ #include "opal/mca/base/base.h" #include "opal/mca/base/mca_base_component_repository.h" -#include "ompi/mca/rte/rte.h" +#include "ompi/runtime/ompi_rte.h" #include "ompi/mca/coll/coll.h" #include "ompi/mca/coll/base/base.h" diff --git a/ompi/mca/coll/cuda/coll_cuda_module.c b/ompi/mca/coll/cuda/coll_cuda_module.c index 137f55a7636..f672f7e07fa 100644 --- a/ompi/mca/coll/cuda/coll_cuda_module.c +++ b/ompi/mca/coll/cuda/coll_cuda_module.c @@ -21,8 +21,8 @@ #include "mpi.h" + #include "opal/util/show_help.h" -#include "ompi/mca/rte/rte.h" #include "ompi/constants.h" #include "ompi/communicator/communicator.h" diff --git a/ompi/mca/coll/hcoll/coll_hcoll.h b/ompi/mca/coll/hcoll/coll_hcoll.h index d7bb79658e1..141792d636b 100644 --- a/ompi/mca/coll/hcoll/coll_hcoll.h +++ b/ompi/mca/coll/hcoll/coll_hcoll.h @@ -1,7 +1,7 @@ /** Copyright (c) 2011 Mellanox Technologies. All rights reserved. - Copyright (c) 2015 Research Organization for Information Science - and Technology (RIST). All rights reserved. + Copyright (c) 2015-2019 Research Organization for Information Science + and Technology (RIST). All rights reserved. $COPYRIGHT$ Additional copyrights may follow @@ -15,6 +15,7 @@ #include "ompi_config.h" #include "mpi.h" +#include "ompi/runtime/ompi_rte.h" #include "ompi/mca/mca.h" #include "opal/memoryhooks/memory.h" #include "opal/mca/memory/base/base.h" @@ -26,8 +27,6 @@ #include "ompi/attribute/attribute.h" #include "ompi/op/op.h" -#include "orte/runtime/orte_globals.h" - #include "hcoll/api/hcoll_api.h" #include "hcoll/api/hcoll_constants.h" diff --git a/ompi/mca/coll/hcoll/coll_hcoll_rte.c b/ompi/mca/coll/hcoll/coll_hcoll_rte.c index b7b87d0f41a..e2a1ea9dabf 100644 --- a/ompi/mca/coll/hcoll/coll_hcoll_rte.c +++ b/ompi/mca/coll/hcoll/coll_hcoll_rte.c @@ -7,8 +7,8 @@ * reserved. * Copyright (c) 2015 Los Alamos National Security, LLC. All rights * reserved. - * Copyright (c) 2015 Research Organization for Information Science - * and Technology (RIST). All rights reserved. + * Copyright (c) 2015-2019 Research Organization for Information Science + * and Technology (RIST). All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -316,7 +316,7 @@ static rte_grp_handle_t get_world_group_handle(void) } static uint32_t jobid(void){ - return ORTE_PROC_MY_NAME->jobid; + return OMPI_PROC_MY_NAME->jobid; } static int group_id(rte_grp_handle_t group){ diff --git a/ompi/mca/coll/sm/coll_sm_module.c b/ompi/mca/coll/sm/coll_sm_module.c index ba7c6f9364e..781215251ea 100644 --- a/ompi/mca/coll/sm/coll_sm_module.c +++ b/ompi/mca/coll/sm/coll_sm_module.c @@ -15,7 +15,7 @@ * All rights reserved. * Copyright (c) 2014-2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. - * Copyright (c) 2015 Intel, Inc. All rights reserved. + * Copyright (c) 2015-2019 Intel, Inc. All rights reserved. * Copyright (c) 2018 Amazon.com, Inc. or its affiliates. All Rights reserved. * $COPYRIGHT$ * @@ -58,7 +58,7 @@ #include "ompi/group/group.h" #include "ompi/mca/coll/coll.h" #include "ompi/mca/coll/base/base.h" -#include "ompi/mca/rte/rte.h" +#include "ompi/runtime/ompi_rte.h" #include "ompi/proc/proc.h" #include "coll_sm.h" diff --git a/ompi/mca/coll/sync/coll_sync_module.c b/ompi/mca/coll/sync/coll_sync_module.c index 02c81f513c5..2b8f83973eb 100644 --- a/ompi/mca/coll/sync/coll_sync_module.c +++ b/ompi/mca/coll/sync/coll_sync_module.c @@ -12,7 +12,7 @@ * Copyright (c) 2009 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2016 Research Organization for Information Science * and Technology (RIST). All rights reserved. - * Copyright (c) 2018 Intel, Inc. All rights reserved. + * Copyright (c) 2018-2019 Intel, Inc. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -32,7 +32,7 @@ #include "mpi.h" #include "opal/util/show_help.h" -#include "ompi/mca/rte/rte.h" +#include "ompi/runtime/ompi_rte.h" #include "ompi/constants.h" #include "ompi/communicator/communicator.h" diff --git a/ompi/mca/crcp/bkmrk/crcp_bkmrk_pml.c b/ompi/mca/crcp/bkmrk/crcp_bkmrk_pml.c index da4b8d8a5b7..2fef5bef307 100644 --- a/ompi/mca/crcp/bkmrk/crcp_bkmrk_pml.c +++ b/ompi/mca/crcp/bkmrk/crcp_bkmrk_pml.c @@ -8,7 +8,7 @@ * Copyright (c) 2010-2012 Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2012-2015 Los Alamos National Security, LLC. All rights * reserved. - * Copyright (c) 2015 Intel, Inc. All rights reserved. + * Copyright (c) 2015-2020 Intel, Inc. All rights reserved. * Copyright (c) 2018 Amazon.com, Inc. or its affiliates. All Rights reserved. * $COPYRIGHT$ * @@ -35,10 +35,10 @@ #include "opal/util/opal_environ.h" #include "ompi/mca/mca.h" -#include "opal/mca/pmix/pmix.h" +#include "opal/mca/pmix/pmix-internal.h" #include "ompi/request/request.h" -#include "ompi/mca/rte/rte.h" +#include "ompi/runtime/ompi_rte.h" #include "ompi/mca/pml/pml.h" #include "ompi/mca/pml/base/base.h" #include "ompi/mca/pml/base/pml_base_request.h" @@ -3030,7 +3030,7 @@ ompi_crcp_base_pml_state_t* ompi_crcp_bkmrk_pml_ft_event( if( opal_cr_timing_barrier_enabled ) { OPAL_CR_SET_TIMER(OPAL_CR_TIMER_CRCPBR0); - if( OMPI_SUCCESS != (ret = opal_pmix.fence(NULL, 0))) { + if( OMPI_SUCCESS != (ret = PMIx_Fence(NULL, 0,NULL, 0))) { exit_status = ret; goto DONE; } @@ -3101,7 +3101,7 @@ ompi_crcp_base_pml_state_t* ompi_crcp_bkmrk_pml_ft_event( if( opal_cr_timing_barrier_enabled ) { OPAL_CR_SET_TIMER(OPAL_CR_TIMER_COREBR1); - if( OMPI_SUCCESS != (ret = opal_pmix.fence(NULL, 0))) { + if( OMPI_SUCCESS != (ret = PMIx_Fence(NULL, 0,NULL, 0))) { exit_status = ret; goto DONE; } @@ -6222,7 +6222,7 @@ static void display_all_timers(int state) { return; } else if( 2 == timing_enabled ) { - if( OPAL_SUCCESS != (ret = opal_pmix.fence(NULL, 0))) { + if( OPAL_SUCCESS != (ret = PMIx_Fence(NULL, 0,NULL, 0))) { OPAL_ERROR_LOG(ret); } return; @@ -6245,7 +6245,7 @@ static void display_all_timers(int state) { if( timing_enabled >= 2) { barrier_start = get_time(); - if( OPAL_SUCCESS != (ret = opal_pmix.fence(NULL, 0))) { + if( OPAL_SUCCESS != (ret = PMIx_Fence(NULL, 0,NULL, 0))) { OPAL_ERROR_LOG(ret); } barrier_stop = get_time(); diff --git a/ompi/mca/io/romio321/src/Makefile.extra b/ompi/mca/io/romio321/src/Makefile.extra index 0ed9b27b348..77d021366ad 100644 --- a/ompi/mca/io/romio321/src/Makefile.extra +++ b/ompi/mca/io/romio321/src/Makefile.extra @@ -10,9 +10,9 @@ # University of Stuttgart. All rights reserved. # Copyright (c) 2004-2005 The Regents of the University of California. # All rights reserved. -# Copyright (c) 2015 Cisco Systems, Inc. All rights reserved. -# Copyright (c) 2017 Research Organization for Information Science -# and Technology (RIST). All rights reserved. +# Copyright (c) 2015 Cisco Systems, Inc. All rights reserved. +# Copyright (c) 2017-2019 Research Organization for Information Science +# and Technology (RIST). All rights reserved. # $COPYRIGHT$ # # Additional copyrights may follow @@ -26,10 +26,6 @@ AM_CPPFLAGS = \ -I$(OMPI_TOP_BUILDDIR)/opal/include \ -I$(OMPI_TOP_SRCDIR)/opal \ -I$(OMPI_TOP_SRCDIR)/opal/include \ - -I$(OMPI_TOP_BUILDDIR)/orte \ - -I$(OMPI_TOP_BUILDDIR)/orte/include \ - -I$(OMPI_TOP_SRCDIR)/orte \ - -I$(OMPI_TOP_SRCDIR)/orte/include \ -I$(OMPI_TOP_BUILDDIR)/ompi \ -I$(OMPI_TOP_BUILDDIR)/ompi/include \ -I$(OMPI_TOP_SRCDIR)/ompi \ diff --git a/ompi/mca/mtl/ofi/mtl_ofi_compat.h b/ompi/mca/mtl/ofi/mtl_ofi_compat.h index 1a878418436..a53e4639a5d 100644 --- a/ompi/mca/mtl/ofi/mtl_ofi_compat.h +++ b/ompi/mca/mtl/ofi/mtl_ofi_compat.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015 Intel, Inc. All rights reserved. + * Copyright (c) 2015-2020 Intel, Inc. All rights reserved. * Copyright (c) 2015 Cisco Systems, Inc. All rights reserved. * $COPYRIGHT$ * @@ -20,15 +20,14 @@ #if (OPAL_MAJOR_VERSION >= 2) -#include "opal/mca/pmix/pmix.h" -#include "opal/mca/pmix/pmix_types.h" +#include "opal/mca/pmix/pmix-internal.h" #define OFI_COMPAT_MODEX_RECV(ret, mtl_version, proc, ep_name, size) \ OPAL_MODEX_RECV((ret), (mtl_version), &(proc)->super.proc_name, (ep_name), (size)); #define OFI_COMPAT_MODEX_SEND(ret, mtl_version, ep_name, namelen) \ OPAL_MODEX_SEND((ret), \ - OPAL_PMIX_GLOBAL, \ + PMIX_GLOBAL, \ (mtl_version), \ (ep_name)[0], \ (namelen)); diff --git a/ompi/mca/mtl/portals4/mtl_portals4.c b/ompi/mca/mtl/portals4/mtl_portals4.c index 6d2dc9498da..22bd95cf8f6 100644 --- a/ompi/mca/mtl/portals4/mtl_portals4.c +++ b/ompi/mca/mtl/portals4/mtl_portals4.c @@ -10,7 +10,7 @@ * Copyright (c) 2004-2005 The Regents of the University of California. * All rights reserved. * Copyright (c) 2010-2019 Sandia National Laboratories. All rights reserved. - * Copyright (c) 2014 Intel, Inc. All rights reserved. + * Copyright (c) 2014-2019 Intel, Inc. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -26,7 +26,7 @@ #include "ompi/proc/proc.h" #include "ompi/mca/mtl/mtl.h" #include "opal/class/opal_list.h" -#include "opal/mca/pmix/pmix.h" +#include "opal/mca/pmix/pmix-internal.h" #include "mtl_portals4.h" #include "mtl_portals4_recv_short.h" diff --git a/ompi/mca/mtl/portals4/mtl_portals4_component.c b/ompi/mca/mtl/portals4/mtl_portals4_component.c index 915e3e2fc74..5193fa9013a 100644 --- a/ompi/mca/mtl/portals4/mtl_portals4_component.c +++ b/ompi/mca/mtl/portals4/mtl_portals4_component.c @@ -11,7 +11,7 @@ * Copyright (c) 2004-2005 The Regents of the University of California. * All rights reserved. * Copyright (c) 2010-2012 Sandia National Laboratories. All rights reserved. - * Copyright (c) 2014 Intel, Inc. All rights reserved. + * Copyright (c) 2014-2020 Intel, Inc. All rights reserved. * Copyright (c) 2015 Los Alamos National Security, LLC. All rights * reserved. * $COPYRIGHT$ @@ -25,7 +25,7 @@ #include "opal/mca/event/event.h" #include "opal/util/output.h" -#include "opal/mca/pmix/pmix.h" +#include "opal/mca/pmix/pmix-internal.h" #include "mtl_portals4.h" #include "mtl_portals4_request.h" @@ -411,7 +411,7 @@ ompi_mtl_portals4_component_init(bool enable_progress_threads, OPAL_OUTPUT_VERBOSE((90, ompi_mtl_base_framework.framework_output, "PtlGetPhysId rank=%x nid=%x pid=%x\n", id.rank, id.phys.nid, id.phys.pid)); - OPAL_MODEX_SEND(ret, OPAL_PMIX_GLOBAL, + OPAL_MODEX_SEND(ret, PMIX_GLOBAL, &mca_mtl_portals4_component.mtl_version, &id, sizeof(id)); if (OMPI_SUCCESS != ret) { diff --git a/ompi/mca/mtl/psm2/mtl_psm2.c b/ompi/mca/mtl/psm2/mtl_psm2.c index 4b5fc9cfd9a..1774a4a3023 100644 --- a/ompi/mca/mtl/psm2/mtl_psm2.c +++ b/ompi/mca/mtl/psm2/mtl_psm2.c @@ -11,7 +11,7 @@ * Copyright (c) 2004-2006 The Regents of the University of California. * All rights reserved. * Copyright (c) 2006 QLogic Corporation. All rights reserved. - * Copyright (c) 2013-2017 Intel, Inc. All rights reserved + * Copyright (c) 2013-2020 Intel, Inc. All rights reserved. * Copyright (c) 2014 Los Alamos National Security, LLC. All rights * reserved. * Copyright (c) 2016 Research Organization for Information Science @@ -25,7 +25,7 @@ #include "ompi_config.h" -#include "opal/mca/pmix/pmix.h" +#include "opal/mca/pmix/pmix-internal.h" #include "ompi/mca/mtl/mtl.h" #include "ompi/mca/mtl/base/mtl_base_datatype.h" #include "opal/util/show_help.h" @@ -159,7 +159,7 @@ int ompi_mtl_psm2_module_init(int local_rank, int num_local_procs) { ompi_mtl_psm2.epid = epid; ompi_mtl_psm2.mq = mq; - OPAL_MODEX_SEND(rc, OPAL_PMIX_GLOBAL, + OPAL_MODEX_SEND(rc, PMIX_GLOBAL, &mca_mtl_psm2_component.super.mtl_version, &ompi_mtl_psm2.epid, sizeof(psm2_epid_t)); diff --git a/ompi/mca/pml/base/pml_base_select.c b/ompi/mca/pml/base/pml_base_select.c index fbd1bae0127..20cb3010dc3 100644 --- a/ompi/mca/pml/base/pml_base_select.c +++ b/ompi/mca/pml/base/pml_base_select.c @@ -12,7 +12,7 @@ * All rights reserved. * Copyright (c) 2012 Los Alamos National Security, LLC. All rights * reserved. - * Copyright (c) 2013-2014 Intel, Inc. All rights reserved + * Copyright (c) 2013-2019 Intel, Inc. All rights reserved. * Copyright (c) 2015 Cisco Systems, Inc. All rights reserved. * $COPYRIGHT$ * @@ -32,7 +32,7 @@ #include "ompi/mca/mca.h" #include "opal/mca/base/base.h" #include "opal/runtime/opal.h" -#include "opal/mca/pmix/pmix.h" +#include "opal/mca/pmix/pmix-internal.h" #include "ompi/constants.h" #include "ompi/mca/pml/pml.h" @@ -312,7 +312,7 @@ mca_pml_base_pml_selected(const char *name) { int rc; - OPAL_MODEX_SEND(rc, OPAL_PMIX_GLOBAL, &pml_base_component, name, strlen(name) + 1); + OPAL_MODEX_SEND(rc, PMIX_GLOBAL, &pml_base_component, name, strlen(name) + 1); return rc; } diff --git a/ompi/mca/pml/ob1/pml_ob1.c b/ompi/mca/pml/ob1/pml_ob1.c index f38369bb833..8067e264fa6 100644 --- a/ompi/mca/pml/ob1/pml_ob1.c +++ b/ompi/mca/pml/ob1/pml_ob1.c @@ -21,6 +21,7 @@ * Copyright (c) 2018 Sandia National Laboratories * All rights reserved. * Copyright (c) 2018 IBM Corporation. All rights reserved. + * Copyright (c) 2019-2020 Intel, Inc. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -44,7 +45,7 @@ #include "ompi/mca/pml/base/base.h" #include "ompi/mca/pml/base/base.h" #include "ompi/mca/bml/base/base.h" -#include "opal/mca/pmix/pmix.h" +#include "opal/mca/pmix/pmix-internal.h" #include "ompi/runtime/ompi_cr.h" #include "pml_ob1.h" @@ -843,7 +844,7 @@ int mca_pml_ob1_ft_event( int state ) if(OPAL_CRS_CHECKPOINT == state) { if( opal_cr_timing_barrier_enabled ) { OPAL_CR_SET_TIMER(OPAL_CR_TIMER_CRCPBR1); - if (OMPI_SUCCESS != (ret = opal_pmix.fence(NULL, 0))) { + if (OMPI_SUCCESS != (ret = pmix_fence(null, 0, NULL, 0))) { opal_output(0, "pml:ob1: ft_event(Restart): Failed to fence complete"); return ret; } @@ -857,7 +858,7 @@ int mca_pml_ob1_ft_event( int state ) if( !first_continue_pass ) { if( opal_cr_timing_barrier_enabled ) { OPAL_CR_SET_TIMER(OPAL_CR_TIMER_COREBR0); - if (OMPI_SUCCESS != (ret = opal_pmix.fence(NULL, 0))) { + if (OMPI_SUCCESS != (ret = PMIx_Fence(NULL, 0,NULL, 0))) { opal_output(0, "pml:ob1: ft_event(Restart): Failed to fence complete"); return ret; } @@ -960,7 +961,7 @@ int mca_pml_ob1_ft_event( int state ) if( !first_continue_pass ) { if( opal_cr_timing_barrier_enabled ) { OPAL_CR_SET_TIMER(OPAL_CR_TIMER_P2PBR1); - if (OMPI_SUCCESS != (ret = opal_pmix.fence(NULL, 0))) { + if (OMPI_SUCCESS != (ret = PMIx_Fence(NULL, 0,NULL, 0))) { opal_output(0, "pml:ob1: ft_event(Restart): Failed to fence complete"); return ret; } @@ -969,7 +970,7 @@ int mca_pml_ob1_ft_event( int state ) } if (opal_cr_continue_like_restart && !first_continue_pass) { - if (OMPI_SUCCESS != (ret = opal_pmix.fence(NULL, 0))) { + if (OMPI_SUCCESS != (ret = PMIx_Fence(NULL, 0,NULL, 0))) { opal_output(0, "pml:ob1: ft_event(Restart): Failed to fence complete"); return ret; } @@ -984,7 +985,7 @@ int mca_pml_ob1_ft_event( int state ) } /* Is this barrier necessary ? JJH */ - if (OMPI_SUCCESS != (ret = opal_pmix.fence(NULL, 0))) { + if (OMPI_SUCCESS != (ret = PMIx_Fence(NULL, 0,NULL, 0))) { opal_output(0, "pml:ob1: ft_event(Restart): Failed to fence complete"); return ret; } @@ -1000,7 +1001,7 @@ int mca_pml_ob1_ft_event( int state ) if( !first_continue_pass ) { if( opal_cr_timing_barrier_enabled ) { OPAL_CR_SET_TIMER(OPAL_CR_TIMER_P2PBR2); - if (OMPI_SUCCESS != (ret = opal_pmix.fence(NULL, 0))) { + if (OMPI_SUCCESS != (ret = PMIx_Fence(NULL, 0,NULL, 0))) { opal_output(0, "pml:ob1: ft_event(Restart): Failed to fence complete"); return ret; } @@ -1016,7 +1017,7 @@ int mca_pml_ob1_ft_event( int state ) * Exchange the modex information once again. * BTLs will have republished their modex information. */ - if (OMPI_SUCCESS != (ret = opal_pmix.fence(NULL, 0))) { + if (OMPI_SUCCESS != (ret = PMIx_Fence(NULL, 0,NULL, 0))) { opal_output(0, "pml:ob1: ft_event(Restart): Failed to fence complete"); return ret; } @@ -1031,7 +1032,7 @@ int mca_pml_ob1_ft_event( int state ) } /* Is this barrier necessary ? JJH */ - if (OMPI_SUCCESS != (ret = opal_pmix.fence(NULL, 0))) { + if (OMPI_SUCCESS != (ret = PMIx_Fence(NULL, 0,NULL, 0))) { opal_output(0, "pml:ob1: ft_event(Restart): Failed to fence complete"); return ret; } diff --git a/ompi/mca/pml/ucx/pml_ucx.c b/ompi/mca/pml/ucx/pml_ucx.c index 5228f4e9aba..22b6b31b0a5 100644 --- a/ompi/mca/pml/ucx/pml_ucx.c +++ b/ompi/mca/pml/ucx/pml_ucx.c @@ -3,9 +3,10 @@ * Copyright (c) 2016 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. - * Copyright (c) 2018 Research Organization for Information Science + * Copyright (c) 2018-2019 Research Organization for Information Science * and Technology (RIST). All rights reserved. * Copyright (c) 2018 IBM Corporation. All rights reserved. + * Copyright (c) 2019 Intel, Inc. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -16,7 +17,7 @@ #include "pml_ucx.h" #include "opal/runtime/opal.h" -#include "opal/mca/pmix/pmix.h" +#include "opal/mca/pmix/pmix-internal.h" #include "ompi/attribute/attribute.h" #include "ompi/message/message.h" #include "ompi/mca/pml/base/pml_base_bsend.h" @@ -111,7 +112,7 @@ static int mca_pml_ucx_send_worker_address_type(int addr_flags, int modex_scope) } PML_UCX_VERBOSE(2, "Pack %s worker address, size %ld", - (modex_scope == OPAL_PMIX_LOCAL) ? "local" : "remote", + (modex_scope == PMIX_LOCAL) ? "local" : "remote", attrs.address_length); return OMPI_SUCCESS; @@ -135,7 +136,7 @@ static int mca_pml_ucx_send_worker_address(void) PML_UCX_VERBOSE(2, "Pack worker address, size %ld", addrlen); - OPAL_MODEX_SEND(rc, OPAL_PMIX_GLOBAL, + OPAL_MODEX_SEND(rc, PMIX_GLOBAL, &mca_pml_ucx_component.pmlm_version, (void*)address, addrlen); ucp_worker_release_address(ompi_pml_ucx.ucp_worker, address); @@ -146,12 +147,12 @@ static int mca_pml_ucx_send_worker_address(void) #else /* Pack just network device addresses for remote node peers */ status = mca_pml_ucx_send_worker_address_type(UCP_WORKER_ADDRESS_FLAG_NET_ONLY, - OPAL_PMIX_REMOTE); + PMIX_REMOTE); if (UCS_OK != status) { goto err; } - status = mca_pml_ucx_send_worker_address_type(0, OPAL_PMIX_LOCAL); + status = mca_pml_ucx_send_worker_address_type(0, PMIX_LOCAL); if (UCS_OK != status) { goto err; } diff --git a/ompi/mca/rte/Makefile.am b/ompi/mca/rte/Makefile.am deleted file mode 100644 index a6c7658178b..00000000000 --- a/ompi/mca/rte/Makefile.am +++ /dev/null @@ -1,27 +0,0 @@ -# -# Copyright (c) 2012 Los Alamos National Security, LLC. All rights reserved. -# $COPYRIGHT$ -# -# Additional copyrights may follow -# -# $HEADER$ -# - -# main library setup -noinst_LTLIBRARIES = libmca_rte.la -libmca_rte_la_SOURCES = - -# local files -headers = rte.h -libmca_rte_la_SOURCES += $(headers) - -# Conditionally install the header files -if WANT_INSTALL_HEADERS -ompidir = $(ompiincludedir)/$(subdir) -nobase_ompi_HEADERS = $(headers) -endif - -include base/Makefile.am - -distclean-local: - rm -f base/static-components.h diff --git a/ompi/mca/rte/base/Makefile.am b/ompi/mca/rte/base/Makefile.am deleted file mode 100644 index aa7534be2e4..00000000000 --- a/ompi/mca/rte/base/Makefile.am +++ /dev/null @@ -1,15 +0,0 @@ -# -# Copyright (c) 2012-2013 Los Alamos National Security, LLC. All rights reserved. -# $COPYRIGHT$ -# -# Additional copyrights may follow -# -# $HEADER$ -# - -headers += \ - base/base.h - -libmca_rte_la_SOURCES += \ - base/rte_base_frame.c - diff --git a/ompi/mca/rte/base/base.h b/ompi/mca/rte/base/base.h deleted file mode 100644 index a4f3b5b5afe..00000000000 --- a/ompi/mca/rte/base/base.h +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) 2010 Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2012-2013 Los Alamos National Security, LLC. - * All rights reserved. - * Copyright (c) 2014 Intel, Inc. All rights reserved - * $COPYRIGHT$ - * - * Additional copyrights may follow - * - * $HEADER$ - */ - -#ifndef OMPI_RTE_BASE_H -#define OMPI_RTE_BASE_H - -#include "ompi_config.h" - -#include "opal/class/opal_list.h" - -#include "ompi/mca/rte/rte.h" - -/* - * Global functions for MCA overall rte open and close - */ - -BEGIN_C_DECLS - -OMPI_DECLSPEC extern mca_base_framework_t ompi_rte_base_framework; - -END_C_DECLS - -#endif /* OMPI_BASE_RTE_H */ diff --git a/ompi/mca/rte/base/rte_base_frame.c b/ompi/mca/rte/base/rte_base_frame.c deleted file mode 100644 index c08d911b070..00000000000 --- a/ompi/mca/rte/base/rte_base_frame.c +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) 2012-2013 Los Alamos National Security, LLC. - * All rights reserved. - * Copyright (c) 2014 Cisco Systems, Inc. All rights reserved. - * $COPYRIGHT$ - * - * Additional copyrights may follow - * - * $HEADER$ - */ - - -#include "ompi_config.h" -#include "ompi/constants.h" - -#include "opal_stdint.h" -#include "opal/util/output.h" -#include "ompi/mca/mca.h" -#include "opal/mca/base/base.h" - -#include "ompi/mca/rte/rte.h" -#include "ompi/mca/rte/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 "ompi/mca/rte/base/static-components.h" - - -static int ompi_rte_base_close(void) -{ - return mca_base_framework_components_close(&ompi_rte_base_framework, NULL); -} - -static int ompi_rte_base_open(mca_base_open_flag_t flags) -{ - /* Open up all available components */ - int ret = mca_base_framework_components_open(&ompi_rte_base_framework, flags); - - /* Sanity check. Many things will break if this is not true - (e.g., opal dstore needs this to be true). */ - assert(sizeof(ompi_process_name_t) == sizeof(uint64_t)); - - return ret; -} - -MCA_BASE_FRAMEWORK_DECLARE(ompi, rte, "OMPI Run-Time Environment Interface", NULL, - ompi_rte_base_open, ompi_rte_base_close, - mca_rte_base_static_components, 0); - - -OBJ_CLASS_INSTANCE(ompi_namelist_t, - opal_list_item_t, - NULL, NULL); diff --git a/ompi/mca/rte/configure.m4 b/ompi/mca/rte/configure.m4 deleted file mode 100644 index 3ccf2aefa5f..00000000000 --- a/ompi/mca/rte/configure.m4 +++ /dev/null @@ -1,34 +0,0 @@ -dnl -*- shell-script -*- -dnl -dnl Copyright (c) 2010-2011 Cisco Systems, Inc. All rights reserved. -dnl Copyright (c) 2012 Los Alamos National Security, LLC. All rights reserved. - -dnl $COPYRIGHT$ -dnl -dnl Additional copyrights may follow -dnl -dnl $HEADER$ -dnl - -# There will only be one component used in this framework, and it will -# be selected at configure time by priority. If a component succeeds, -# it must also set the shell variable ompi_rte_base_include to the -# path from /ompi/mca/rte/ to the header containing the -# RTE interface. - -dnl We only want one winning component. -m4_define(MCA_ompi_rte_CONFIGURE_MODE, STOP_AT_FIRST) - -AC_DEFUN([MCA_ompi_rte_CONFIG],[ - ompi_rte_base_include= - - # configure all the components - MCA_CONFIGURE_FRAMEWORK($1, $2, 1) - - AS_IF([test "$ompi_rte_base_include" = ""], - [AC_MSG_ERROR([Did not find a suitable rte component])]) - - AC_DEFINE_UNQUOTED([MCA_rte_IMPLEMENTATION_HEADER], - ["ompi/mca/rte/$ompi_rte_base_include"], - [Header to include for rte implementation]) -]) diff --git a/ompi/mca/rte/orte/Makefile.am b/ompi/mca/rte/orte/Makefile.am deleted file mode 100644 index 9e405d8e868..00000000000 --- a/ompi/mca/rte/orte/Makefile.am +++ /dev/null @@ -1,76 +0,0 @@ -# -# Copyright (c) 2012 Los Alamos National Security, LLC. -# All rights reserved. -# Copyright (c) 2014 Cisco Systems, Inc. All rights reserved. -# Copyright (c) 2016-2018 Intel, Inc. All rights reserved. -# Copyright (c) 2019 Research Organization for Information Science -# and Technology (RIST). All rights reserved. -# $COPYRIGHT$ -# -# Additional copyrights may follow -# -# $HEADER$ -# - -headers = rte_orte.h - -sources = \ - rte_orte_component.c \ - rte_orte_module.c - -# Conditionally install the header files -if WANT_INSTALL_HEADERS -ompidir = $(ompiincludedir)/$(subdir) -nobase_ompi_HEADERS = $(headers) -endif - -# We only ever build this component statically -noinst_LTLIBRARIES = libmca_rte_orte.la -libmca_rte_orte_la_SOURCES =$(sources) $(headers) -libmca_rte_orte_la_LDFLAGS = -module -avoid-version -libmca_rte_orte_la_LIBADD = $(top_builddir)/orte/lib@ORTE_LIB_PREFIX@open-rte.la - -man_pages = mpirun.1 mpiexec.1 ompi-clean.1 ompi-server.1 - -if OPAL_INSTALL_BINARIES -if PROJECT_ORTE -nodist_man_MANS = $(man_pages) - -install-exec-hook: - (cd $(DESTDIR)$(bindir); rm -f mpirun$(EXEEXT); $(LN_S) orterun$(EXEEXT) mpirun$(EXEEXT)) - (cd $(DESTDIR)$(bindir); rm -f mpiexec$(EXEEXT); $(LN_S) orterun$(EXEEXT) mpiexec$(EXEEXT)) - (cd $(DESTDIR)$(bindir); rm -f ompi-clean$(EXEEXT); $(LN_S) orte-clean$(EXEEXT) ompi-clean$(EXEEXT)) - (cd $(DESTDIR)$(bindir); rm -f ompi-server$(EXEEXT); $(LN_S) orte-server$(EXEEXT) ompi-server$(EXEEXT)) - -uninstall-local: - rm -f $(DESTDIR)$(bindir)/mpirun$(EXEEXT) \ - $(DESTDIR)$(bindir)/mpiexec$(EXEEXT) \ - $(DESTDIR)$(bindir)/ompi-clean$(EXEEXT) \ - $(DESTDIR)$(bindir)/ompi-server$(EXEEXT) - -endif # PROJECT_ORTE -endif # OPAL_INSTALL_BINARIES - -$(top_builddir)/orte/tools/orterun/orterun.1: - (cd $(top_builddir)/orte/tools/orterun && $(MAKE) $(AM_MAKEFLAGS) orterun.1) - -mpirun.1: $(top_builddir)/orte/tools/orterun/orterun.1 - cp -f $(top_builddir)/orte/tools/orterun/orterun.1 mpirun.1 - -mpiexec.1: $(top_builddir)/orte/tools/orterun/orterun.1 - cp -f $(top_builddir)/orte/tools/orterun/orterun.1 mpiexec.1 - -$(top_builddir)/orte/tools/orte-clean/orte-clean.1: - (cd $(top_builddir)/orte/tools/orte-clean && $(MAKE) $(AM_MAKEFLAGS) orte-clean.1) - -ompi-clean.1: $(top_builddir)/orte/tools/orte-clean/orte-clean.1 - cp -f $(top_builddir)/orte/tools/orte-clean/orte-clean.1 ompi-clean.1 - -$(top_builddir)/orte/tools/orte-server/orte-server.1: - (cd $(top_builddir)/orte/tools/orte-server && $(MAKE) $(AM_MAKEFLAGS) orte-server.1) - -ompi-server.1: $(top_builddir)/orte/tools/orte-server/orte-server.1 - cp -f $(top_builddir)/orte/tools/orte-server/orte-server.1 ompi-server.1 - -clean-local: - rm -f $(man_pages) diff --git a/ompi/mca/rte/orte/configure.m4 b/ompi/mca/rte/orte/configure.m4 deleted file mode 100644 index e6d46e6b47d..00000000000 --- a/ompi/mca/rte/orte/configure.m4 +++ /dev/null @@ -1,52 +0,0 @@ -# -*- shell-script -*- -# -# Copyright (c) 2012 Los Alamos National Security, LLC. All rights reserved. -# Copyright (c) 2013 Sandia National Laboratories. All rights reserved. -# Copyright (c) 2017 Intel, Inc. All rights reserved. -# Copyright (c) 2019 Research Organization for Information Science -# and Technology (RIST). All rights reserved. -# $COPYRIGHT$ -# -# Additional copyrights may follow -# -# $HEADER$ -# - -# Lowest priority, as it's the default and we want -# it to be able to be overridden -AC_DEFUN([MCA_ompi_rte_orte_PRIORITY], [10]) - -# Force this component to compile in static-only mode -AC_DEFUN([MCA_ompi_rte_orte_COMPILE_MODE], [ - AC_MSG_CHECKING([for MCA component $2:$3 compile mode]) - $4="static" - AC_MSG_RESULT([$$4]) -]) - -# If component was selected, $1 will be 1 and we should set the base header -AC_DEFUN([MCA_ompi_rte_orte_POST_CONFIG],[ - AS_IF([test "$1" = "1"], [ompi_rte_base_include="orte/rte_orte.h"]) - AC_DEFINE_UNQUOTED([OMPI_RTE_ORTE], [$1], - [Defined to 1 if the OMPI runtime component is ORTE]) - AM_CONDITIONAL([OMPI_RTE_ORTE], [test $1 = 1]) -])dnl - -# MCA_rte_orte_CONFIG([action-if-can-compile], -# [action-if-cant-compile]) -# ------------------------------------------------ -AC_DEFUN([MCA_ompi_rte_orte_CONFIG],[ - AC_CONFIG_FILES([ompi/mca/rte/orte/Makefile]) - - m4_ifdef([project_orte], - [# This will need to get more complicated when we can build against - # an external ORTE. - AC_ARG_WITH([orte], - AC_HELP_STRING([--with-orte], - [Use ORTE run-time environment (default: yes)])) - AS_IF([test "$with_orte" != "no"], - [$1], - [AC_MSG_NOTICE([ORTE disabled by user]) - $2]) - ], - [$2]) -]) diff --git a/ompi/mca/rte/orte/rte_orte.h b/ompi/mca/rte/orte/rte_orte.h deleted file mode 100644 index 665cdd9e7bc..00000000000 --- a/ompi/mca/rte/orte/rte_orte.h +++ /dev/null @@ -1,103 +0,0 @@ -/* - * Copyright (c) 2012-2013 Los Alamos National Security, LLC. - * All rights reserved. - * Copyright (c) 2013-2017 Intel, Inc. All rights reserved. - * Copyright (c) 2014 Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2014-2016 Research Organization for Information Science - * and Technology (RIST). All rights reserved. - * Copyright (c) 2015 Intel, Inc. All rights reserved. - * Copyright (c) 2016-2017 IBM Corporation. All rights reserved. - * $COPYRIGHT$ - * - * Additional copyrights may follow - * - * $HEADER$ - * - * When this component is used, this file is included in the rest of - * the OPAL/ORTE/OMPI code base via ompi/mca/rte/rte.h. As such, - * this header represents the public interface to this static component. - */ - -#ifndef MCA_OMPI_RTE_ORTE_H -#define MCA_OMPI_RTE_ORTE_H - -#include "ompi_config.h" -#include "ompi/constants.h" - -struct opal_proc_t; - -#include "opal/threads/threads.h" - -#include "orte/types.h" -#include "orte/mca/errmgr/errmgr.h" -#include "orte/mca/rml/base/rml_contact.h" -#include "orte/mca/rml/rml.h" -#include "orte/mca/routed/routed.h" -#include "orte/runtime/orte_data_server.h" -#include "orte/runtime/runtime.h" -#include "orte/util/name_fns.h" -#include "orte/util/proc_info.h" - -struct ompi_proc_t; -struct ompi_communicator_t; - -BEGIN_C_DECLS - -/* Process name objects and operations */ -typedef orte_process_name_t ompi_process_name_t; -typedef orte_jobid_t ompi_jobid_t; -typedef orte_vpid_t ompi_vpid_t; -typedef orte_ns_cmp_bitmask_t ompi_rte_cmp_bitmask_t; -#define OMPI_PROC_MY_NAME ORTE_PROC_MY_NAME -#define OMPI_NAME_PRINT(a) ORTE_NAME_PRINT((const orte_process_name_t*)a) -#define ompi_rte_compare_name_fields(a, b, c) orte_util_compare_name_fields(a, (const orte_process_name_t*)(b), (const orte_process_name_t*)(c)) -#define ompi_rte_convert_string_to_process_name(a,b) orte_util_convert_string_to_process_name(a,b) -#define ompi_rte_convert_process_name_to_string(a,b) orte_util_convert_process_name_to_string(a,b) -#define OMPI_NAME_WILDCARD ORTE_NAME_WILDCARD -#define OMPI_NODE_RANK_INVALID ORTE_NODE_RANK_INVALID -#define OMPI_LOCAL_RANK_INVALID ORTE_LOCAL_RANK_INVALID -#define OMPI_RTE_CMP_JOBID ORTE_NS_CMP_JOBID -#define OMPI_RTE_CMP_VPID ORTE_NS_CMP_VPID -#define OMPI_RTE_CMP_ALL ORTE_NS_CMP_ALL -#define OMPI_LOCAL_JOBID(jobid) ORTE_LOCAL_JOBID(jobid) -#define OMPI_JOB_FAMILY(jobid) ORTE_JOB_FAMILY(jobid) -#define OMPI_CONSTRUCT_JOBID(family,local) ORTE_CONSTRUCT_JOBID(family,local) - -/* This is the DSS tag to serialize a proc name */ -#define OMPI_NAME ORTE_NAME -#define OMPI_PROCESS_NAME_HTON ORTE_PROCESS_NAME_HTON -#define OMPI_PROCESS_NAME_NTOH ORTE_PROCESS_NAME_NTOH - -#if OPAL_ENABLE_DEBUG -static inline orte_process_name_t * OMPI_CAST_RTE_NAME(opal_process_name_t * name) { - return (orte_process_name_t *)name; -} -#else -#define OMPI_CAST_RTE_NAME(a) ((orte_process_name_t*)(a)) -#endif - -/* Process info struct and values */ -typedef orte_node_rank_t ompi_node_rank_t; -typedef orte_local_rank_t ompi_local_rank_t; -#define ompi_process_info orte_process_info -#define ompi_rte_proc_is_bound orte_proc_is_bound - -/* Error handling objects and operations */ -OMPI_DECLSPEC void __opal_attribute_noreturn__ - ompi_rte_abort(int error_code, char *fmt, ...); -#define ompi_rte_abort_peers(a, b, c) orte_errmgr.abort_peers(a, b, c) -#define OMPI_ERROR_LOG ORTE_ERROR_LOG - -/* Init and finalize objects and operations */ -#define ompi_rte_init(a, b) orte_init(a, b, ORTE_PROC_MPI) -#define ompi_rte_finalize() orte_finalize() -OMPI_DECLSPEC void ompi_rte_wait_for_debugger(void); - -/* check dynamics support */ -OMPI_DECLSPEC bool ompi_rte_connect_accept_support(const char *port); - -#define ompi_proc_applied_binding orte_proc_applied_binding - -END_C_DECLS - -#endif /* MCA_OMPI_RTE_ORTE_H */ diff --git a/ompi/mca/rte/orte/rte_orte_component.c b/ompi/mca/rte/orte/rte_orte_component.c deleted file mode 100644 index 50e49935bd7..00000000000 --- a/ompi/mca/rte/orte/rte_orte_component.c +++ /dev/null @@ -1,80 +0,0 @@ -/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ -/* - * Copyright (c) 2012 Los Alamos National Security, LLC. All rights reserved. - * Copyright (c) 2014-2017 Intel, Inc. All rights reserved. - * Copyright (c) 2015 Los Alamos National Security, LLC. 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 "ompi_config.h" -#include "ompi/constants.h" - -#include "opal/threads/threads.h" -#include "opal/class/opal_list.h" - -#include "orte/mca/rml/rml.h" -#include "orte/mca/grpcomm/base/base.h" - -#include "ompi/mca/rte/rte.h" -#include "rte_orte.h" - -/* - * Public string showing the component version number - */ -const char *ompi_rte_orte_component_version_string = - "OMPI orte rte MCA component version " OMPI_VERSION; - -/* - * Local function - */ -static int rte_orte_open(void); -static int rte_orte_close(void); - -/* - * Instantiate the public struct with all of our public information - * and pointers to our public functions in it - */ - -ompi_rte_component_t mca_rte_orte_component = { - /* First, the mca_component_t struct containing meta information - about the component itself */ - - .base_version = { - OMPI_RTE_BASE_VERSION_1_0_0, - - /* Component name and version */ - .mca_component_name = "orte", - MCA_BASE_MAKE_VERSION(component, OMPI_MAJOR_VERSION, OMPI_MINOR_VERSION, - OMPI_RELEASE_VERSION), - - /* Component open and close functions */ - .mca_open_component = rte_orte_open, - .mca_close_component = rte_orte_close, - }, - .base_data = { - /* The component is checkpoint ready */ - MCA_BASE_METADATA_PARAM_CHECKPOINT - }, -}; - -static int rte_orte_open(void) -{ - return OMPI_SUCCESS; -} - -static int rte_orte_close(void) -{ - return OMPI_SUCCESS; -} diff --git a/ompi/mca/rte/orte/rte_orte_module.c b/ompi/mca/rte/orte/rte_orte_module.c deleted file mode 100644 index 046b6d2532e..00000000000 --- a/ompi/mca/rte/orte/rte_orte_module.c +++ /dev/null @@ -1,247 +0,0 @@ -/* - * Copyright (c) 2012-2013 Los Alamos National Security, LLC. - * All rights reserved. - * Copyright (c) 2013-2017 Intel, Inc. All rights reserved. - * Copyright (c) 2012-2014 The University of Tennessee and The University - * of Tennessee Research Foundation. All rights - * reserved. - * Copyright (c) 2014 Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2018 Amazon.com, Inc. or its affiliates. All Rights reserved. - * $COPYRIGHT$ - */ -#include "ompi_config.h" -#include "ompi/constants.h" - -#include -#include -#include - -#include "opal/dss/dss.h" -#include "opal/util/argv.h" -#include "opal/util/proc.h" -#include "opal/util/opal_getcwd.h" -#include "opal/util/printf.h" -#include "opal/mca/pmix/pmix.h" -#include "opal/threads/threads.h" -#include "opal/class/opal_list.h" -#include "opal/dss/dss.h" - -#include "orte/mca/errmgr/errmgr.h" -#include "orte/mca/ess/ess.h" -#include "orte/mca/grpcomm/base/base.h" -#include "orte/mca/odls/odls.h" -#include "orte/mca/plm/plm.h" -#include "orte/mca/rml/rml.h" -#include "orte/mca/rml/rml_types.h" -#include "orte/mca/rmaps/rmaps.h" -#include "orte/mca/rmaps/rmaps_types.h" -#include "orte/mca/rmaps/base/base.h" -#include "orte/mca/rml/base/rml_contact.h" -#include "orte/mca/state/state.h" -#include "orte/mca/routed/routed.h" -#include "orte/util/name_fns.h" -#include "orte/util/session_dir.h" -#include "orte/util/show_help.h" -#include "orte/runtime/orte_globals.h" -#include "orte/runtime/orte_wait.h" -#include "orte/runtime/orte_data_server.h" - -#include "ompi/mca/rte/base/base.h" -#include "ompi/mca/rte/rte.h" -#include "ompi/debuggers/debuggers.h" -#include "ompi/proc/proc.h" -#include "ompi/runtime/params.h" -#include "ompi/communicator/communicator.h" - -extern ompi_rte_component_t mca_rte_orte_component; - -void ompi_rte_abort(int error_code, char *fmt, ...) -{ - va_list arglist; - - /* If there was a message, output it */ - va_start(arglist, fmt); - if( NULL != fmt ) { - char* buffer = NULL; - opal_vasprintf( &buffer, fmt, arglist ); - opal_output( 0, "%s", buffer ); - free( buffer ); - } - va_end(arglist); - - /* if I am a daemon or the HNP... */ - if (ORTE_PROC_IS_HNP || ORTE_PROC_IS_DAEMON) { - /* whack my local procs */ - orte_odls.kill_local_procs(NULL); - /* whack any session directories */ - orte_session_dir_cleanup(ORTE_JOBID_WILDCARD); - } else { - /* cleanup my session directory */ - orte_session_dir_finalize(ORTE_PROC_MY_NAME); - } - - /* if a critical connection failed, or a sensor limit was exceeded, exit without dropping a core */ - if (ORTE_ERR_CONNECTION_FAILED == error_code || - ORTE_ERR_SENSOR_LIMIT_EXCEEDED == error_code) { - orte_ess.abort(error_code, false); - } else { - orte_ess.abort(error_code, true); - } - - /* - * We must exit in orte_ess.abort; all implementations of orte_ess.abort - * contain __opal_attribute_noreturn__ - */ - /* No way to reach here, but put an exit() here a) just to cover - for bugs, and b) to let the compiler know we're honoring the - __opal_attribute_noreturn__. */ - exit(-1); -} - -static size_t handler = SIZE_MAX; -static bool debugger_register_active = true; -static bool debugger_event_active = true; - -static void _release_fn(int status, - const opal_process_name_t *source, - opal_list_t *info, opal_list_t *results, - opal_pmix_notification_complete_fn_t cbfunc, - void *cbdata) -{ - /* must let the notifier know we are done */ - if (NULL != cbfunc) { - cbfunc(ORTE_SUCCESS, NULL, NULL, NULL, cbdata); - } - debugger_event_active = false; -} - -static void _register_fn(int status, - size_t evhandler_ref, - void *cbdata) -{ - opal_list_t *codes = (opal_list_t*)cbdata; - - handler = evhandler_ref; - OPAL_LIST_RELEASE(codes); - debugger_register_active = false; -} - -/* - * Wait for a debugger if asked. We support two ways of waiting for - * attaching debuggers -- see big comment in - * orte/tools/orterun/debuggers.c explaining the two scenarios. - */ -void ompi_rte_wait_for_debugger(void) -{ - int debugger; - opal_list_t *codes, directives; - opal_value_t *kv; - char *evar; - int time; - - /* See lengthy comment in orte/tools/orterun/debuggers.c about - orte_in_parallel_debugger */ - debugger = orte_in_parallel_debugger; - - if (1 == MPIR_being_debugged) { - debugger = 1; - } - - if (!debugger && NULL == getenv("ORTE_TEST_DEBUGGER_ATTACH")) { - /* if not, just return */ - return; - } - - /* if we are being debugged, then we need to find - * the correct plug-ins - */ - ompi_debugger_setup_dlls(); - - if (NULL != (evar = getenv("ORTE_TEST_DEBUGGER_SLEEP"))) { - time = strtol(evar, NULL, 10); - sleep(time); - return; - } - - if (orte_standalone_operation) { - /* spin until debugger attaches and releases us */ - while (MPIR_debug_gate == 0) { -#if defined(HAVE_USLEEP) - usleep(100000); /* microseconds */ -#else - sleep(1); /* seconds */ -#endif - } - } else { - - /* register an event handler for the ORTE_ERR_DEBUGGER_RELEASE event */ - codes = OBJ_NEW(opal_list_t); - kv = OBJ_NEW(opal_value_t); - kv->key = strdup("errorcode"); - kv->type = OPAL_INT; - kv->data.integer = ORTE_ERR_DEBUGGER_RELEASE; - opal_list_append(codes, &kv->super); - - OBJ_CONSTRUCT(&directives, opal_list_t); - kv = OBJ_NEW(opal_value_t); - kv->key = strdup(OPAL_PMIX_EVENT_HDLR_NAME); - kv->type = OPAL_STRING; - kv->data.string = strdup("MPI-DEBUGGER-ATTACH"); - opal_list_append(&directives, &kv->super); - - opal_pmix.register_evhandler(codes, &directives, _release_fn, _register_fn, codes); - /* let the MPI progress engine run while we wait for registration to complete */ - OMPI_WAIT_FOR_COMPLETION(debugger_register_active); - OPAL_LIST_DESTRUCT(&directives); - - /* let the MPI progress engine run while we wait for debugger release */ - OMPI_WAIT_FOR_COMPLETION(debugger_event_active); - - /* deregister the event handler */ - opal_pmix.deregister_evhandler(handler, NULL, NULL); - } -} - -bool ompi_rte_connect_accept_support(const char *port) -{ - char *ptr, *tmp; - orte_process_name_t name; - - /* were we launched by mpirun, or are we calling - * without a defined port? */ - if (NULL == orte_process_info.my_hnp_uri || - NULL == port || 0 == strlen(port)) { - return true; - } - - /* is the job family in the port different than my own? */ - tmp = strdup(port); // protect input - if (NULL == (ptr = strchr(tmp, ':'))) { - /* this port didn't come from us! */ - orte_show_help("help-orterun.txt", "orterun:malformedport", true); - free(tmp); - return false; - } - *ptr = '\0'; - if (ORTE_SUCCESS != orte_util_convert_string_to_process_name(&name, tmp)) { - free(tmp); - orte_show_help("help-orterun.txt", "orterun:malformedport", true); - return false; - } - free(tmp); - if (ORTE_JOB_FAMILY(ORTE_PROC_MY_NAME->jobid) == ORTE_JOB_FAMILY(name.jobid)) { - /* same job family, so our infrastructure is adequate */ - return true; - } - - /* if the job family of the port is different than our own - * and we were launched by mpirun, then we require ompi-server - * support */ - if (NULL == orte_data_server_uri) { - /* print a pretty help message */ - orte_show_help("help-orterun.txt", "orterun:server-unavailable", true); - return false; - } - - return true; -} diff --git a/ompi/mca/rte/pmix/Makefile.am b/ompi/mca/rte/pmix/Makefile.am deleted file mode 100644 index 7ed2a4f61f4..00000000000 --- a/ompi/mca/rte/pmix/Makefile.am +++ /dev/null @@ -1,29 +0,0 @@ -# -# Copyright (c) 2012 Los Alamos National Security, LLC. -# All rights reserved. -# Copyright (c) 2014 Cisco Systems, Inc. All rights reserved. -# Copyright (c) 2016-2017 Intel, Inc. All rights reserved. -# $COPYRIGHT$ -# -# Additional copyrights may follow -# -# $HEADER$ -# - -headers = rte_pmix.h - -sources = \ - rte_pmix_component.c \ - rte_pmix_module.c - -# Conditionally install the header files -if WANT_INSTALL_HEADERS -ompidir = $(ompiincludedir)/$(subdir) -nobase_ompi_HEADERS = $(headers) -endif - -# We only ever build this component statically -noinst_LTLIBRARIES = libmca_rte_pmix.la -libmca_rte_pmix_la_SOURCES =$(sources) $(headers) -libmca_rte_pmix_la_LDFLAGS = -module -avoid-version -libmca_rte_pmix_la_LIBADD = $(top_builddir)/opal/lib@OPAL_LIB_PREFIX@open-pal.la diff --git a/ompi/mca/rte/pmix/configure.m4 b/ompi/mca/rte/pmix/configure.m4 deleted file mode 100644 index d16bdb48a79..00000000000 --- a/ompi/mca/rte/pmix/configure.m4 +++ /dev/null @@ -1,48 +0,0 @@ -# -*- shell-script -*- -# -# Copyright (c) 2012 Los Alamos National Security, LLC. All rights reserved. -# Copyright (c) 2013 Sandia National Laboratories. All rights reserved. -# Copyright (c) 2017 Intel, Inc. All rights reserved. -# Copyright (c) 2019 Research Organization for Information Science -# and Technology (RIST). All rights reserved. -# $COPYRIGHT$ -# -# Additional copyrights may follow -# -# $HEADER$ -# - -# Higher priority to override the default -AC_DEFUN([MCA_ompi_rte_pmix_PRIORITY], [50]) - -# Force this component to compile in static-only mode -AC_DEFUN([MCA_ompi_rte_pmix_COMPILE_MODE], [ - AC_MSG_CHECKING([for MCA component $2:$3 compile mode]) - $4="static" - AC_MSG_RESULT([$$4]) -]) - -# If component was selected, $1 will be 1 and we should set the base header -AC_DEFUN([MCA_ompi_rte_pmix_POST_CONFIG],[ - AS_IF([test "$1" = "1"], [ompi_rte_base_include="pmix/rte_pmix.h"]) - AC_DEFINE_UNQUOTED([OMPI_RTE_PMIX], [$1], - [Defined to 1 if the OMPI runtime component is PMIX]) - AM_CONDITIONAL([OMPI_RTE_PMIX], [test $1 = 1]) -])dnl - -# MCA_rte_pmix_CONFIG([action-if-can-compile], -# [action-if-cant-compile]) -# ------------------------------------------------ -AC_DEFUN([MCA_ompi_rte_pmix_CONFIG],[ - AC_CONFIG_FILES([ompi/mca/rte/pmix/Makefile]) - - m4_ifdef([project_orte], - [AC_ARG_WITH([ompi-pmix-rte], - AC_HELP_STRING([--with-ompi-pmix-rte], - [Use PMIx as the OMPI run-time environment (default: no)])) - AS_IF([test "$with_ompi_pmix_rte" == "yes"], - [$1 - AC_MSG_NOTICE([PMIx RTE selected by user])], - [$2])], - [$1]) -]) diff --git a/ompi/mca/rte/pmix/rte_pmix.h b/ompi/mca/rte/pmix/rte_pmix.h deleted file mode 100644 index fd39621d5f3..00000000000 --- a/ompi/mca/rte/pmix/rte_pmix.h +++ /dev/null @@ -1,147 +0,0 @@ -/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ -/* - * Copyright (c) 2012-2013 Los Alamos National Security, LLC. - * All rights reserved. - * Copyright (c) 2013-2018 Intel, Inc. All rights reserved. - * Copyright (c) 2014 Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2014-2016 Research Organization for Information Science - * and Technology (RIST). All rights reserved. - * Copyright (c) 2015 Intel, Inc. All rights reserved. - * Copyright (c) 2016-2017 IBM Corporation. All rights reserved. - * Copyright (c) 2018 Triad National Security, LLC. All rights - * reserved. - * $COPYRIGHT$ - * - * Additional copyrights may follow - * - * $HEADER$ - * - * When this component is used, this file is included in the rest of - * the OPAL/OMPI code base via ompi/mca/rte/rte.h. As such, - * this header represents the public interface to this static component. - */ - -#ifndef MCA_OMPI_RTE_PMIX_H -#define MCA_OMPI_RTE_PMIX_H - -#include "ompi_config.h" -#include "ompi/constants.h" - -#include - -#ifdef HAVE_SYS_TYPES_H -#include -#endif - -struct opal_proc_t; - -#include "opal/threads/threads.h" -#include "opal/util/proc.h" -#include "opal/mca/hwloc/hwloc-internal.h" -#include "opal/mca/pmix/pmix.h" - -struct ompi_proc_t; -struct ompi_communicator_t; - -BEGIN_C_DECLS - -/* Process name objects and operations */ -typedef opal_process_name_t ompi_process_name_t; -typedef uint32_t ompi_jobid_t; -typedef uint32_t ompi_vpid_t; - -/* some local storage */ -OMPI_DECLSPEC extern opal_process_name_t pmix_name_wildcard; -OMPI_DECLSPEC extern hwloc_cpuset_t ompi_proc_applied_binding; - -#define OMPI_PROC_MY_NAME (&pmix_process_info.my_name) -#define OMPI_NAME_WILDCARD (&pmix_name_wildcard) - -typedef uint8_t ompi_rte_cmp_bitmask_t; -#define OMPI_RTE_CMP_NONE 0x00 -#define OMPI_RTE_CMP_JOBID 0x02 -#define OMPI_RTE_CMP_VPID 0x04 -#define OMPI_RTE_CMP_ALL 0x0f -#define OMPI_RTE_CMP_WILD 0x10 - -OMPI_DECLSPEC char* ompi_pmix_print_name(const ompi_process_name_t *name); - -#define OMPI_NAME_PRINT(a) ompi_pmix_print_name(a) -OMPI_DECLSPEC int ompi_rte_compare_name_fields(ompi_rte_cmp_bitmask_t mask, - const opal_process_name_t* name1, - const opal_process_name_t* name2); -OMPI_DECLSPEC int ompi_rte_convert_string_to_process_name(opal_process_name_t *name, - const char* name_string); -OMPI_DECLSPEC int ompi_rte_convert_process_name_to_string(char** name_string, - const opal_process_name_t *name); - -#define OMPI_LOCAL_JOBID(n) \ - ( (n) & 0x0000ffff) -#define OMPI_JOB_FAMILY(n) \ - (((n) >> 16) & 0x0000ffff) -#define OMPI_CONSTRUCT_LOCAL_JOBID(local, job) \ - ( ((local) & 0xffff0000) | ((job) & 0x0000ffff) ) -#define OMPI_CONSTRUCT_JOB_FAMILY(n) \ - ( ((n) << 16) & 0xffff0000) - -#define OMPI_CONSTRUCT_JOBID(family, local) \ - OMPI_CONSTRUCT_LOCAL_JOBID(OMPI_CONSTRUCT_JOB_FAMILY(family), local) - -/* This is the DSS tag to serialize a proc name */ -#define OMPI_NAME OPAL_NAME -#define OMPI_PROCESS_NAME_HTON OPAL_PROCESS_NAME_HTON -#define OMPI_PROCESS_NAME_NTOH OPAL_PROCESS_NAME_NTOH - -#if OPAL_ENABLE_DEBUG -static inline opal_process_name_t * OMPI_CAST_RTE_NAME(opal_process_name_t * name) { - return (opal_process_name_t *)name; -} -#else -#define OMPI_CAST_RTE_NAME(a) ((opal_process_name_t*)(a)) -#endif - -/* Process info struct and values */ -typedef uint16_t ompi_node_rank_t; -typedef uint16_t ompi_local_rank_t; -#define OMPI_NODE_RANK_INVALID UINT16_MAX -#define OMPI_LOCAL_RANK_INVALID UINT16_MAX - -typedef struct { - opal_process_name_t my_name; - char *my_hnp_uri; - char *nodename; - pid_t pid; - char *job_session_dir; - char *proc_session_dir; - uint16_t my_local_rank; - uint16_t my_node_rank; - int32_t num_local_peers; - uint32_t num_procs; - uint32_t app_num; - char *cpuset; -} pmix_process_info_t; -OMPI_DECLSPEC extern pmix_process_info_t pmix_process_info; -#define ompi_process_info pmix_process_info - -OMPI_DECLSPEC extern bool pmix_proc_is_bound; -#define ompi_rte_proc_is_bound pmix_proc_is_bound - -/* Error handling objects and operations */ -OMPI_DECLSPEC void __opal_attribute_noreturn__ - ompi_rte_abort(int error_code, char *fmt, ...); -OMPI_DECLSPEC void ompi_rte_abort_peers(opal_process_name_t *procs, - int32_t num_procs, - int error_code); -#define OMPI_ERROR_LOG OPAL_ERROR_LOG - -/* Init and finalize operations */ -OMPI_DECLSPEC int ompi_rte_init(int *argc, char ***argv); -OMPI_DECLSPEC int ompi_rte_finalize(void); -OMPI_DECLSPEC void ompi_rte_wait_for_debugger(void); - -/* check dynamics support */ -OMPI_DECLSPEC bool ompi_rte_connect_accept_support(const char *port); - -END_C_DECLS - -#endif /* MCA_OMPI_RTE_PMIX_H */ diff --git a/ompi/mca/rte/pmix/rte_pmix_component.c b/ompi/mca/rte/pmix/rte_pmix_component.c deleted file mode 100644 index a54c0b0ab0a..00000000000 --- a/ompi/mca/rte/pmix/rte_pmix_component.c +++ /dev/null @@ -1,77 +0,0 @@ -/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ -/* - * Copyright (c) 2012 Los Alamos National Security, LLC. All rights reserved. - * Copyright (c) 2014-2017 Intel, Inc. All rights reserved. - * Copyright (c) 2015 Los Alamos National Security, LLC. 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 "ompi_config.h" -#include "ompi/constants.h" - -#include "opal/threads/threads.h" -#include "opal/class/opal_list.h" - -#include "ompi/mca/rte/rte.h" -#include "rte_pmix.h" - -/* - * Public string showing the component version number - */ -const char *ompi_rte_pmix_component_version_string = - "OMPI pmix rte MCA component version " OMPI_VERSION; - -/* - * Local function - */ -static int rte_pmix_open(void); -static int rte_pmix_close(void); - -/* - * Instantiate the public struct with all of our public information - * and pointers to our public functions in it - */ - -ompi_rte_component_t mca_rte_pmix_component = { - /* First, the mca_component_t struct containing meta information - about the component itself */ - - .base_version = { - OMPI_RTE_BASE_VERSION_1_0_0, - - /* Component name and version */ - .mca_component_name = "pmix", - MCA_BASE_MAKE_VERSION(component, OMPI_MAJOR_VERSION, OMPI_MINOR_VERSION, - OMPI_RELEASE_VERSION), - - /* Component open and close functions */ - .mca_open_component = rte_pmix_open, - .mca_close_component = rte_pmix_close, - }, - .base_data = { - /* The component is checkpoint ready */ - MCA_BASE_METADATA_PARAM_CHECKPOINT - }, -}; - -static int rte_pmix_open(void) -{ - return OMPI_SUCCESS; -} - -static int rte_pmix_close(void) -{ - return OMPI_SUCCESS; -} diff --git a/ompi/mca/topo/treematch/topo_treematch_dist_graph_create.c b/ompi/mca/topo/treematch/topo_treematch_dist_graph_create.c index e7faebccf40..216231c019a 100644 --- a/ompi/mca/topo/treematch/topo_treematch_dist_graph_create.c +++ b/ompi/mca/topo/treematch/topo_treematch_dist_graph_create.c @@ -5,7 +5,7 @@ * reserved. * Copyright (c) 2011-2018 Inria. All rights reserved. * Copyright (c) 2011-2018 Bordeaux Polytechnic Institute - * Copyright (c) 2015-2017 Intel, Inc. All rights reserved. + * Copyright (c) 2015-2019 Intel, Inc. All rights reserved. * Copyright (c) 2015-2017 Research Organization for Information Science * and Technology (RIST). All rights reserved. * Copyright (c) 2016 Los Alamos National Security, LLC. All rights @@ -34,7 +34,7 @@ #include "ompi/mca/pml/pml.h" -#include "opal/mca/pmix/pmix.h" +#include "opal/mca/pmix/pmix-internal.h" /* #define __DEBUG__ 1 */ @@ -170,8 +170,8 @@ int mca_topo_treematch_dist_graph_create(mca_topo_base_module_t* topo_module, vpids[num_procs_in_node++] = i; pval = &val; - OPAL_MODEX_RECV_VALUE(err, OPAL_PMIX_NODEID, &(proc->super.proc_name), &pval, OPAL_UINT32); - if( OPAL_SUCCESS != err ) { + OPAL_MODEX_RECV_VALUE(err, PMIX_NODEID, &(proc->super.proc_name), &pval, PMIX_UINT32); + if( PMIX_SUCCESS != err ) { opal_output(0, "Unable to extract peer %s nodeid from the modex.\n", OMPI_NAME_PRINT(&(proc->super.proc_name))); colors[i] = -1; diff --git a/ompi/mca/vprotocol/pessimist/vprotocol_pessimist_eventlog.c b/ompi/mca/vprotocol/pessimist/vprotocol_pessimist_eventlog.c index a6ae610cd74..4724575b835 100644 --- a/ompi/mca/vprotocol/pessimist/vprotocol_pessimist_eventlog.c +++ b/ompi/mca/vprotocol/pessimist/vprotocol_pessimist_eventlog.c @@ -3,7 +3,7 @@ * All rights reserved. * Copyright (c) 2012 Los Alamos National Security, LLC. All rights * reserved. - * Copyright (c) 2015 Intel, Inc. All rights reserved. + * Copyright (c) 2015-2019 Intel, Inc. All rights reserved. * Copyright (c) 2018 Amazon.com, Inc. or its affiliates. All Rights reserved. * $COPYRIGHT$ * @@ -14,33 +14,33 @@ #include "ompi_config.h" #include "vprotocol_pessimist_eventlog.h" -#include "opal/mca/pmix/pmix.h" +#include "opal/mca/pmix/pmix-internal.h" #include "opal/util/printf.h" #include "ompi/dpm/dpm.h" int vprotocol_pessimist_event_logger_connect(int el_rank, ompi_communicator_t **el_comm) { int rc; - char *port; + pmix_status_t prc; + char *port, *tmp; int rank; vprotocol_pessimist_clock_t connect_info[2]; - opal_list_t results; - opal_pmix_pdata_t *pdat; + pmix_pdata_t pdat; - OBJ_CONSTRUCT(&results, opal_list_t); - pdat = OBJ_NEW(opal_pmix_pdata_t); - opal_asprintf(&pdat->value.key, VPROTOCOL_EVENT_LOGGER_NAME_FMT, el_rank); - opal_list_append(&results, &pdat->super); + PMIX_PDATA_CONSTRUCT(&pdat); + opal_asprintf(&tmp, VPROTOCOL_EVENT_LOGGER_NAME_FMT, el_rank); + PMIX_LOAD_KEY(pdat.key, tmp); + free(tmp); - rc = opal_pmix.lookup(&results, NULL); - if (OPAL_SUCCESS != rc || - OPAL_STRING != pdat->value.type || - NULL == pdat->value.data.string) { - OPAL_LIST_DESTRUCT(&results); + prc = PMIx_Lookup(&pdat, 1, NULL, 0); + if (PMIX_SUCCESS != prc || + OPAL_STRING != pdat.value.type || + NULL == pdat.value.data.string) { + PMIX_PDATA_DESTRUCT(&pdat); return OMPI_ERR_NOT_FOUND; } - port = strdup(pdat->value.data.string); - OPAL_LIST_DESTRUCT(&results); + port = strdup(pdat.value.data.string); + PMIX_PDATA_DESTRUCT(&pdat); V_OUTPUT_VERBOSE(45, "Found port < %s >", port); rc = ompi_dpm_connect_accept(MPI_COMM_SELF, 0, port, true, el_comm); diff --git a/ompi/mpi/c/lookup_name.c b/ompi/mpi/c/lookup_name.c index 8f6cdf93514..9b2781f76d5 100644 --- a/ompi/mpi/c/lookup_name.c +++ b/ompi/mpi/c/lookup_name.c @@ -12,7 +12,7 @@ * All rights reserved. * Copyright (c) 2013 Los Alamos National Security, LLC. All rights * reserved. - * Copyright (c) 2015-2016 Intel, Inc. All rights reserved. + * Copyright (c) 2015-2019 Intel, Inc. All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. * Copyright (c) 2015-2018 Cisco Systems, Inc. All rights reserved @@ -26,7 +26,7 @@ #include "ompi_config.h" #include "opal/class/opal_list.h" -#include "opal/mca/pmix/pmix.h" +#include "opal/mca/pmix/pmix-internal.h" #include "opal/util/show_help.h" #include "opal/util/string_copy.h" @@ -50,9 +50,10 @@ int MPI_Lookup_name(const char *service_name, MPI_Info info, char *port_name) { char range[OPAL_MAX_INFO_VAL]; int flag=0, ret; - opal_value_t *rng; - opal_list_t results, pinfo; - opal_pmix_pdata_t *pdat; + pmix_status_t rc; + pmix_pdata_t pdat; + pmix_info_t pinfo; + pmix_data_range_t rng; if ( MPI_PARAM_CHECK ) { OMPI_ERR_INIT_FINALIZE(FUNC_NAME); @@ -71,60 +72,37 @@ int MPI_Lookup_name(const char *service_name, MPI_Info info, char *port_name) } } - if (NULL == opal_pmix.lookup) { - opal_show_help("help-mpi-api.txt", - "MPI function not supported", - true, - FUNC_NAME, - "Underlying runtime environment does not support name lookup functionality"); - return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, - OMPI_ERR_NOT_SUPPORTED, - FUNC_NAME); - } - OPAL_CR_ENTER_LIBRARY(); - OBJ_CONSTRUCT(&pinfo, opal_list_t); - /* OMPI supports info keys to pass the range to * be searched for the given key */ if (MPI_INFO_NULL != info) { ompi_info_get (info, "range", sizeof(range) - 1, range, &flag); if (flag) { if (0 == strcmp(range, "nspace")) { - rng = OBJ_NEW(opal_value_t); - rng->key = strdup(OPAL_PMIX_RANGE); - rng->type = OPAL_INT; - rng->data.integer = OPAL_PMIX_RANGE_NAMESPACE; // share only with procs in same nspace - opal_list_append(&pinfo, &rng->super); + rng = PMIX_RANGE_NAMESPACE; // share only with procs in same nspace } else if (0 == strcmp(range, "session")) { - rng = OBJ_NEW(opal_value_t); - rng->key = strdup(OPAL_PMIX_RANGE); - rng->type = OPAL_INT; - rng->data.integer = OPAL_PMIX_RANGE_SESSION; // share only with procs in same session - opal_list_append(&pinfo, &rng->super); + rng = PMIX_RANGE_SESSION; // share only with procs in same session } else { /* unrecognized scope */ - OPAL_LIST_DESTRUCT(&pinfo); OPAL_CR_EXIT_LIBRARY(); return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG, FUNC_NAME); } } } + PMIX_INFO_LOAD(&pinfo, PMIX_RANGE, &rng, PMIX_DATA_RANGE); /* collect the findings */ - OBJ_CONSTRUCT(&results, opal_list_t); - pdat = OBJ_NEW(opal_pmix_pdata_t); - pdat->value.key = strdup(service_name); - opal_list_append(&results, &pdat->super); - - ret = opal_pmix.lookup(&results, &pinfo); - OPAL_LIST_DESTRUCT(&pinfo); - if (OPAL_SUCCESS != ret || - OPAL_STRING != pdat->value.type || - NULL == pdat->value.data.string) { - if (OPAL_ERR_NOT_SUPPORTED == ret) { + PMIX_PDATA_CONSTRUCT(&pdat); + PMIX_LOAD_KEY(pdat.key, service_name); + + rc = PMIx_Lookup(&pdat, 1, &pinfo, 1); + PMIX_INFO_DESTRUCT(&pinfo); + if (PMIX_SUCCESS != rc || + PMIX_STRING != pdat.value.type || + NULL == pdat.value.data.string) { + if (PMIX_ERR_NOT_SUPPORTED == rc) { ret = OMPI_ERR_NOT_SUPPORTED; opal_show_help("help-mpi-api.txt", "MPI function not supported", @@ -139,9 +117,9 @@ int MPI_Lookup_name(const char *service_name, MPI_Info info, char *port_name) return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, ret, FUNC_NAME); } - opal_string_copy( port_name, pdat->value.data.string, + opal_string_copy( port_name, pdat.value.data.string, MPI_MAX_PORT_NAME ); - OPAL_LIST_DESTRUCT(&results); + PMIX_PDATA_DESTRUCT(&pdat); OPAL_CR_EXIT_LIBRARY(); return MPI_SUCCESS; diff --git a/ompi/mpi/c/publish_name.c b/ompi/mpi/c/publish_name.c index 24270cea8f0..48555a1503f 100644 --- a/ompi/mpi/c/publish_name.c +++ b/ompi/mpi/c/publish_name.c @@ -12,7 +12,7 @@ * All rights reserved. * Copyright (c) 2013 Los Alamos National Security, LLC. All rights * reserved. - * Copyright (c) 2015-2016 Intel, Inc. All rights reserved. + * Copyright (c) 2015-2019 Intel, Inc. All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. * Copyright (c) 2015 Cisco Systems, Inc. All rights reserved. @@ -26,7 +26,7 @@ #include #include "opal/class/opal_list.h" -#include "opal/mca/pmix/pmix.h" +#include "opal/mca/pmix/pmix-internal.h" #include "opal/util/show_help.h" #include "ompi/mpi/c/bindings.h" @@ -48,11 +48,13 @@ static const char FUNC_NAME[] = "MPI_Publish_name"; int MPI_Publish_name(const char *service_name, MPI_Info info, const char *port_name) { - int rc; + int ret; char range[OPAL_MAX_INFO_VAL]; int flag=0; - opal_value_t *rng; - opal_list_t values; + pmix_status_t rc; + pmix_info_t pinfo[3]; + pmix_data_range_t rng = PMIX_RANGE_SESSION; + pmix_persistence_t pers = PMIX_PERSIST_SESSION; if ( MPI_PARAM_CHECK ) { OMPI_ERR_INIT_FINALIZE(FUNC_NAME); @@ -71,19 +73,7 @@ int MPI_Publish_name(const char *service_name, MPI_Info info, } } - if (NULL == opal_pmix.publish) { - opal_show_help("help-mpi-api.txt", - "MPI function not supported", - true, - FUNC_NAME, - "Underlying runtime environment does not support name publishing functionality"); - return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, - OMPI_ERR_NOT_SUPPORTED, - FUNC_NAME); - } - OPAL_CR_ENTER_LIBRARY(); - OBJ_CONSTRUCT(&values, opal_list_t); /* OMPI supports info keys to pass the range and persistence to * be used for the given key */ @@ -91,20 +81,11 @@ int MPI_Publish_name(const char *service_name, MPI_Info info, ompi_info_get (info, "range", sizeof(range) - 1, range, &flag); if (flag) { if (0 == strcmp(range, "nspace")) { - rng = OBJ_NEW(opal_value_t); - rng->key = strdup(OPAL_PMIX_RANGE); - rng->type = OPAL_INT; - rng->data.integer = OPAL_PMIX_RANGE_NAMESPACE; // share only with procs in same nspace - opal_list_append(&values, &rng->super); + rng = PMIX_RANGE_NAMESPACE; // share only with procs in same nspace } else if (0 == strcmp(range, "session")) { - rng = OBJ_NEW(opal_value_t); - rng->key = strdup(OPAL_PMIX_RANGE); - rng->type = OPAL_INT; - rng->data.integer = OPAL_PMIX_RANGE_SESSION; // share only with procs in same session - opal_list_append(&values, &rng->super); + rng = PMIX_RANGE_SESSION; // share only with procs in same session } else { /* unrecognized scope */ - OPAL_LIST_DESTRUCT(&values); OPAL_CR_EXIT_LIBRARY(); return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG, FUNC_NAME); @@ -113,32 +94,15 @@ int MPI_Publish_name(const char *service_name, MPI_Info info, ompi_info_get (info, "persistence", sizeof(range) - 1, range, &flag); if (flag) { if (0 == strcmp(range, "indef")) { - rng = OBJ_NEW(opal_value_t); - rng->key = strdup(OPAL_PMIX_PERSISTENCE); - rng->type = OPAL_INT; - rng->data.integer = OPAL_PMIX_PERSIST_INDEF; // retain until specifically deleted - opal_list_append(&values, &rng->super); + pers = PMIX_PERSIST_INDEF; // retain until specifically deleted } else if (0 == strcmp(range, "proc")) { - rng = OBJ_NEW(opal_value_t); - rng->key = strdup(OPAL_PMIX_PERSISTENCE); - rng->type = OPAL_INT; - rng->data.integer = OPAL_PMIX_PERSIST_PROC; // retain until publishing process terminates - opal_list_append(&values, &rng->super); + pers = PMIX_PERSIST_PROC; // retain until publishing process terminates } else if (0 == strcmp(range, "app")) { - rng = OBJ_NEW(opal_value_t); - rng->key = strdup(OPAL_PMIX_PERSISTENCE); - rng->type = OPAL_INT; - rng->data.integer = OPAL_PMIX_PERSIST_APP; // retain until application terminates - opal_list_append(&values, &rng->super); + pers = PMIX_PERSIST_APP; // retain until application terminates } else if (0 == strcmp(range, "session")) { - rng = OBJ_NEW(opal_value_t); - rng->key = strdup(OPAL_PMIX_PERSISTENCE); - rng->type = OPAL_INT; - rng->data.integer = OPAL_PMIX_PERSIST_SESSION; // retain until session/allocation terminates - opal_list_append(&values, &rng->super); + pers = PMIX_PERSIST_SESSION; // retain until session/allocation terminates } else { /* unrecognized persistence */ - OPAL_LIST_DESTRUCT(&values); OPAL_CR_EXIT_LIBRARY(); return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG, FUNC_NAME); @@ -147,33 +111,33 @@ int MPI_Publish_name(const char *service_name, MPI_Info info, } /* publish the service name */ - rng = OBJ_NEW(opal_value_t); - rng->key = strdup(service_name); - rng->type = OPAL_STRING; - rng->data.string = strdup(port_name); - opal_list_append(&values, &rng->super); + PMIX_INFO_LOAD(&pinfo[0], service_name, port_name, PMIX_STRING); + PMIX_INFO_LOAD(&pinfo[1], PMIX_RANGE, &rng, PMIX_DATA_RANGE); + PMIX_INFO_LOAD(&pinfo[2], PMIX_PERSISTENCE, &pers, PMIX_PERSIST); - rc = opal_pmix.publish(&values); - OPAL_LIST_DESTRUCT(&values); + rc = PMIx_Publish(pinfo, 3); + PMIX_INFO_DESTRUCT(&pinfo[0]); + PMIX_INFO_DESTRUCT(&pinfo[1]); + PMIX_INFO_DESTRUCT(&pinfo[2]); OPAL_CR_EXIT_LIBRARY(); - if ( OPAL_SUCCESS != rc ) { - if (OPAL_EXISTS == rc) { + if ( PMIX_SUCCESS != rc ) { + if (PMIX_EXISTS == rc) { /* already exists - can't publish it */ - rc = MPI_ERR_FILE_EXISTS; - } else if (OPAL_ERR_NOT_SUPPORTED == rc) { + ret = MPI_ERR_FILE_EXISTS; + } else if (PMIX_ERR_NOT_SUPPORTED == rc) { /* this PMIX environment doesn't support publishing */ - rc = OMPI_ERR_NOT_SUPPORTED; + ret = OMPI_ERR_NOT_SUPPORTED; opal_show_help("help-mpi-api.txt", "MPI function not supported", true, FUNC_NAME, "Underlying runtime environment does not support name publishing functionality"); } else { - rc = MPI_ERR_INTERN; + ret = MPI_ERR_INTERN; } - return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, rc, FUNC_NAME); + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, ret, FUNC_NAME); } return MPI_SUCCESS; diff --git a/ompi/mpi/c/unpublish_name.c b/ompi/mpi/c/unpublish_name.c index 019d7106fe6..242df70762b 100644 --- a/ompi/mpi/c/unpublish_name.c +++ b/ompi/mpi/c/unpublish_name.c @@ -12,7 +12,7 @@ * All rights reserved. * Copyright (c) 2012-2013 Los Alamos National Security, LLC. All rights * reserved. - * Copyright (c) 2015-2016 Intel, Inc. All rights reserved. + * Copyright (c) 2015-2019 Intel, Inc. All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. * Copyright (c) 2015 Cisco Systems, Inc. All rights reserved. @@ -26,7 +26,7 @@ #include #include "opal/class/opal_list.h" -#include "opal/mca/pmix/pmix.h" +#include "opal/mca/pmix/pmix-internal.h" #include "opal/util/argv.h" #include "opal/util/show_help.h" @@ -49,11 +49,12 @@ static const char FUNC_NAME[] = "MPI_Unpublish_name"; int MPI_Unpublish_name(const char *service_name, MPI_Info info, const char *port_name) { - int rc; + int ret; char range[OPAL_MAX_INFO_VAL]; int flag=0; - opal_list_t pinfo; - opal_value_t *rng; + pmix_status_t rc; + pmix_info_t pinfo; + pmix_data_range_t rng = PMIX_RANGE_SESSION; char **keys = NULL; if ( MPI_PARAM_CHECK ) { @@ -73,19 +74,7 @@ int MPI_Unpublish_name(const char *service_name, MPI_Info info, } } - if (NULL == opal_pmix.publish) { - opal_show_help("help-mpi-api.txt", - "MPI function not supported", - true, - FUNC_NAME, - "Underlying runtime environment does not support name publishing functionality"); - return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, - OMPI_ERR_NOT_SUPPORTED, - FUNC_NAME); - } - OPAL_CR_ENTER_LIBRARY(); - OBJ_CONSTRUCT(&pinfo, opal_list_t); /* OMPI supports info keys to pass the range to * be searched for the given key */ @@ -93,20 +82,11 @@ int MPI_Unpublish_name(const char *service_name, MPI_Info info, ompi_info_get (info, "range", sizeof(range) - 1, range, &flag); if (flag) { if (0 == strcmp(range, "nspace")) { - rng = OBJ_NEW(opal_value_t); - rng->key = strdup(OPAL_PMIX_RANGE); - rng->type = OPAL_INT; - rng->data.integer = OPAL_PMIX_RANGE_NAMESPACE; // share only with procs in same nspace - opal_list_append(&pinfo, &rng->super); + rng = PMIX_RANGE_NAMESPACE; // share only with procs in same nspace } else if (0 == strcmp(range, "session")) { - rng = OBJ_NEW(opal_value_t); - rng->key = strdup(OPAL_PMIX_RANGE); - rng->type = OPAL_INT; - rng->data.integer = OPAL_PMIX_RANGE_SESSION; // share only with procs in same session - opal_list_append(&pinfo, &rng->super); + rng = PMIX_RANGE_SESSION; // share only with procs in same session } else { /* unrecognized scope */ - OPAL_LIST_DESTRUCT(&pinfo); return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG, FUNC_NAME); } @@ -115,32 +95,33 @@ int MPI_Unpublish_name(const char *service_name, MPI_Info info, /* unpublish the service_name */ opal_argv_append_nosize(&keys, service_name); + PMIX_INFO_LOAD(&pinfo, PMIX_RANGE, &rng, PMIX_DATA_RANGE); - rc = opal_pmix.unpublish(keys, &pinfo); + rc = PMIx_Unpublish(keys, &pinfo, 1); opal_argv_free(keys); - OPAL_LIST_DESTRUCT(&pinfo); + PMIX_INFO_DESTRUCT(&pinfo); - if ( OPAL_SUCCESS != rc ) { - if (OPAL_ERR_NOT_FOUND == rc) { + if ( PMIX_SUCCESS != rc ) { + if (PMIX_ERR_NOT_FOUND == rc) { /* service couldn't be found */ - rc = MPI_ERR_SERVICE; - } else if (OPAL_ERR_PERM == rc) { + ret = MPI_ERR_SERVICE; + } else if (PMIX_ERR_NO_PERMISSIONS == rc) { /* this process didn't own the specified service */ - rc = MPI_ERR_ACCESS; - } else if (OPAL_ERR_NOT_SUPPORTED == rc) { + ret = MPI_ERR_ACCESS; + } else if (PMIX_ERR_NOT_SUPPORTED == rc) { /* this PMIX environment doesn't support publishing */ - rc = OMPI_ERR_NOT_SUPPORTED; + ret = OMPI_ERR_NOT_SUPPORTED; opal_show_help("help-mpi-api.txt", "MPI function not supported", true, FUNC_NAME, "Underlying runtime environment does not support name publishing functionality"); } else { - rc = MPI_ERR_INTERN; + ret = MPI_ERR_INTERN; } OPAL_CR_EXIT_LIBRARY(); - return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, rc, FUNC_NAME); + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, ret, FUNC_NAME); } OPAL_CR_EXIT_LIBRARY(); diff --git a/ompi/mpiext/affinity/c/mpiext_affinity_str.c b/ompi/mpiext/affinity/c/mpiext_affinity_str.c index e6e20419b47..13e37b66527 100644 --- a/ompi/mpiext/affinity/c/mpiext_affinity_str.c +++ b/ompi/mpiext/affinity/c/mpiext_affinity_str.c @@ -8,7 +8,7 @@ * reserved. * Copyright (c) 2015-2017 Research Organization for Information Science * and Technology (RIST). All rights reserved. - * Copyright (c) 2015-2017 Intel, Inc. All rights reserved. + * Copyright (c) 2015-2019 Intel, Inc. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -35,7 +35,7 @@ #include "ompi/communicator/communicator.h" #include "ompi/errhandler/errhandler.h" -#include "ompi/mca/rte/rte.h" +#include "ompi/runtime/ompi_rte.h" #include "ompi/mpi/c/bindings.h" #include "ompi/mpiext/affinity/c/mpiext_affinity_c.h" diff --git a/ompi/patterns/net/allreduce.c b/ompi/patterns/net/allreduce.c index ecf95bfd977..be192255507 100644 --- a/ompi/patterns/net/allreduce.c +++ b/ompi/patterns/net/allreduce.c @@ -4,6 +4,7 @@ * Copyright (c) 2012 Los Alamos National Security, LLC. * All rights reserved. * Copyright (c) 2017 IBM Corporation. All rights reserved. + * Copyright (c) 2019 Intel, Inc. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -19,7 +20,7 @@ #include "ompi/op/op.h" #include "ompi/datatype/ompi_datatype.h" #include "ompi/communicator/communicator.h" -#include "ompi/mca/rte/rte.h" +#include "ompi/runtime/ompi_rte.h" void send_completion(nt status, struct ompi_process_name_t* peer, struct iovec* msg, int count, ompi_rml_tag_t tag, void* cbdata) diff --git a/ompi/patterns/net/netpatterns.h b/ompi/patterns/net/netpatterns.h index d75c721dd5a..9307e247e0c 100644 --- a/ompi/patterns/net/netpatterns.h +++ b/ompi/patterns/net/netpatterns.h @@ -4,6 +4,7 @@ * Copyright (c) 2012 Los Alamos National Security, LLC. * All rights reserved. * Copyright (c) 2017 IBM Corporation. All rights reserved. + * Copyright (c) 2019 Intel, Inc. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -16,7 +17,7 @@ #include "ompi_config.h" -#include "ompi/mca/rte/rte.h" +#include "ompi/runtime/ompi_rte.h" #include "netpatterns_knomial_tree.h" BEGIN_C_DECLS diff --git a/ompi/patterns/net/netpatterns_knomial_tree.c b/ompi/patterns/net/netpatterns_knomial_tree.c index 09b45cc7428..343938a0eb9 100644 --- a/ompi/patterns/net/netpatterns_knomial_tree.c +++ b/ompi/patterns/net/netpatterns_knomial_tree.c @@ -7,6 +7,7 @@ * Copyright (c) 2014 Los Alamos National Security, LLC. All rights * reserved. * Copyright (c) 2017 IBM Corporation. All rights reserved. + * Copyright (c) 2019 Intel, Inc. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -28,7 +29,7 @@ #include "ompi/constants.h" -#include "ompi/mca/rte/rte.h" +#include "ompi/runtime/ompi_rte.h" #include "netpatterns.h" diff --git a/ompi/proc/proc.c b/ompi/proc/proc.c index 5b712bf25e1..a4907d83850 100644 --- a/ompi/proc/proc.c +++ b/ompi/proc/proc.c @@ -13,7 +13,7 @@ * Copyright (c) 2006-2015 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2012-2015 Los Alamos National Security, LLC. All rights * reserved. - * Copyright (c) 2013-2015 Intel, Inc. All rights reserved + * Copyright (c) 2013-2020 Intel, Inc. All rights reserved. * Copyright (c) 2014-2017 Research Organization for Information Science * and Technology (RIST). All rights reserved. * Copyright (c) 2015-2017 Mellanox Technologies. All rights reserved. @@ -37,7 +37,7 @@ #include "opal/util/arch.h" #include "opal/util/show_help.h" #include "opal/mca/hwloc/base/base.h" -#include "opal/mca/pmix/pmix.h" +#include "opal/mca/pmix/pmix-internal.h" #include "opal/util/argv.h" #include "ompi/proc/proc.h" @@ -148,8 +148,8 @@ int ompi_proc_complete_init_single (ompi_proc_t *proc) * we don't chase after it if some system doesn't * provide it */ proc->super.proc_hostname = NULL; - OPAL_MODEX_RECV_VALUE_OPTIONAL(ret, OPAL_PMIX_HOSTNAME, &proc->super.proc_name, - (char**)&(proc->super.proc_hostname), OPAL_STRING); + OPAL_MODEX_RECV_VALUE_OPTIONAL(ret, PMIX_HOSTNAME, &proc->super.proc_name, + (char**)&(proc->super.proc_hostname), PMIX_STRING); #if OPAL_ENABLE_HETEROGENEOUS_SUPPORT /* get the remote architecture - this might force a modex except @@ -157,7 +157,7 @@ int ompi_proc_complete_init_single (ompi_proc_t *proc) { uint32_t *ui32ptr; ui32ptr = &(proc->super.proc_arch); - OPAL_MODEX_RECV_VALUE(ret, OPAL_PMIX_ARCH, &proc->super.proc_name, + OPAL_MODEX_RECV_VALUE(ret, PMIX_ARCH, &proc->super.proc_name, (void**)&ui32ptr, OPAL_UINT32); if (OPAL_SUCCESS == ret) { /* if arch is different than mine, create a new convertor for this proc */ @@ -270,8 +270,8 @@ int ompi_proc_init(void) opal_proc_local_set(&proc->super); #if OPAL_ENABLE_HETEROGENEOUS_SUPPORT /* add our arch to the modex */ - OPAL_MODEX_SEND_VALUE(ret, OPAL_PMIX_GLOBAL, - OPAL_PMIX_ARCH, &opal_local_arch, OPAL_UINT32); + OPAL_MODEX_SEND_VALUE(ret, PMIX_GLOBAL, + PMIX_ARCH, &opal_local_arch, OPAL_UINT32); if (OPAL_SUCCESS != ret) { return ret; } @@ -316,8 +316,8 @@ int ompi_proc_complete_init(void) wildcard_rank.jobid = OMPI_PROC_MY_NAME->jobid; wildcard_rank.vpid = OMPI_NAME_WILDCARD->vpid; /* retrieve the local peers */ - OPAL_MODEX_RECV_VALUE(ret, OPAL_PMIX_LOCAL_PEERS, - &wildcard_rank, &val, OPAL_STRING); + OPAL_MODEX_RECV_VALUE(ret, PMIX_LOCAL_PEERS, + &wildcard_rank, &val, PMIX_STRING); if (OPAL_SUCCESS == ret && NULL != val) { char **peers = opal_argv_split(val, ','); int i; @@ -334,7 +334,7 @@ int ompi_proc_complete_init(void) } /* get the locality information - all RTEs are required * to provide this information at startup */ - OPAL_MODEX_RECV_VALUE_OPTIONAL(ret, OPAL_PMIX_LOCALITY, &proc->super.proc_name, &u16ptr, OPAL_UINT16); + OPAL_MODEX_RECV_VALUE_OPTIONAL(ret, PMIX_LOCALITY, &proc->super.proc_name, &u16ptr, PMIX_UINT16); if (OPAL_SUCCESS == ret) { proc->super.proc_flags = u16; } @@ -662,7 +662,7 @@ ompi_proc_pack(ompi_proc_t **proclist, int proclistsize, } /* retrieve and send the corresponding nspace for this job * as the remote side may not know the translation */ - nspace = (char*)opal_pmix.get_nspace(proc->super.proc_name.jobid); + nspace = opal_jobid_print(proc->super.proc_name.jobid); rc = opal_dss.pack(buf, &nspace, 1, OPAL_STRING); if(rc != OPAL_SUCCESS) { OMPI_ERROR_LOG(rc); @@ -766,7 +766,6 @@ ompi_proc_unpack(opal_buffer_t* buf, free(newprocs); return rc; } - opal_pmix.register_jobid(new_name.jobid, nspace); free(nspace); rc = opal_dss.unpack(buf, &new_arch, &count, OPAL_UINT32); if (rc != OPAL_SUCCESS) { diff --git a/ompi/proc/proc.h b/ompi/proc/proc.h index 1d42ac5f30e..85197c231fd 100644 --- a/ompi/proc/proc.h +++ b/ompi/proc/proc.h @@ -12,7 +12,7 @@ * Copyright (c) 2006-2012 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2007-2012 Los Alamos National Security, LLC. All rights * reserved. - * Copyright (c) 2013-2014 Intel, Inc. All rights reserved + * Copyright (c) 2013-2019 Intel, Inc. All rights reserved. * Copyright (c) 2015-2016 Research Organization for Information Science * and Technology (RIST). All rights reserved. * $COPYRIGHT$ @@ -39,7 +39,7 @@ #include "opal/util/proc.h" -#include "ompi/mca/rte/rte.h" +#include "ompi/runtime/ompi_rte.h" BEGIN_C_DECLS diff --git a/ompi/runtime/Makefile.am b/ompi/runtime/Makefile.am index 71b32e2139a..e452544844c 100644 --- a/ompi/runtime/Makefile.am +++ b/ompi/runtime/Makefile.am @@ -10,7 +10,7 @@ # Copyright (c) 2004-2005 The Regents of the University of California. # All rights reserved. # Copyright (c) 2006-2015 Cisco Systems, Inc. All rights reserved. -# Copyright (c) 2014 Intel, Inc. All rights reserved. +# Copyright (c) 2014-2019 Intel, Inc. All rights reserved. # Copyright (c) 2016 IBM Corporation. All rights reserved. # $COPYRIGHT$ # @@ -28,7 +28,8 @@ headers += \ runtime/ompi_cr.h \ runtime/params.h \ runtime/ompi_info_support.h \ - runtime/ompi_spc.h + runtime/ompi_spc.h \ + runtime/ompi_rte.h lib@OMPI_LIBMPI_NAME@_la_SOURCES += \ runtime/ompi_mpi_abort.c \ @@ -38,7 +39,8 @@ lib@OMPI_LIBMPI_NAME@_la_SOURCES += \ runtime/ompi_mpi_preconnect.c \ runtime/ompi_cr.c \ runtime/ompi_info_support.c \ - runtime/ompi_spc.c + runtime/ompi_spc.c \ + runtime/ompi_rte.c # The MPIR portion of the library must be built with flags to # enable stepping out of MPI_INIT into main. diff --git a/ompi/runtime/help-mpi-runtime.txt b/ompi/runtime/help-mpi-runtime.txt index 5b7c3759119..1fcb93a35e9 100644 --- a/ompi/runtime/help-mpi-runtime.txt +++ b/ompi/runtime/help-mpi-runtime.txt @@ -12,7 +12,7 @@ # All rights reserved. # Copyright (c) 2007-2018 Cisco Systems, Inc. All rights reserved # Copyright (c) 2013 NVIDIA Corporation. All rights reserved. -# Copyright (c) 2017 Intel, Inc. All rights reserved. +# Copyright (c) 2017-2020 Intel, Inc. All rights reserved. # $COPYRIGHT$ # # Additional copyrights may follow @@ -119,3 +119,12 @@ Aborting... There was an error registering software performance counters (SPCs) as MPI_T performance variables. Your job will continue, but SPCs will be disabled for MPI_T. +# +[no-pmi] +PMIx_Init failed for the following reason: + + %s + +Open MPI requires access to a local PMIx server to execute. Please ensure +that either you are operating in a PMIx-enabled environment, or use "mpirun" +to execute the job. diff --git a/ompi/runtime/ompi_info_support.c b/ompi/runtime/ompi_info_support.c index e77a2087722..6b476aed635 100644 --- a/ompi/runtime/ompi_info_support.c +++ b/ompi/runtime/ompi_info_support.c @@ -15,6 +15,7 @@ * Copyright (c) 2010-2015 Los Alamos National Security, LLC. * All rights reserved. * Copyright (c) 2018 Amazon.com, Inc. or its affiliates. All Rights reserved. + * Copyright (c) 2019 Intel, Inc. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -33,10 +34,6 @@ #include "opal/runtime/opal_info_support.h" #include "ompi/runtime/ompi_info_support.h" -#if OMPI_RTE_ORTE -#include "orte/runtime/orte_info_support.h" -#endif - #include "opal/util/show_help.h" #include "opal/util/printf.h" @@ -78,13 +75,6 @@ int ompi_info_register_framework_params(opal_pointer_array_t *component_map) return rc; } -#if OMPI_RTE_ORTE - rc = orte_info_register_framework_params(component_map); - if (ORTE_SUCCESS != rc) { - return rc; - } -#endif - return opal_info_register_project_frameworks(ompi_info_type_ompi, ompi_frameworks, component_map); } @@ -110,11 +100,6 @@ void ompi_info_close_components(void) (void) mca_base_framework_close(ompi_frameworks[i]); } -#if OMPI_RTE_ORTE - /* close the ORTE components */ - (void) orte_info_close_components(); -#endif - (void) opal_info_close_components(); } @@ -138,11 +123,6 @@ void ompi_info_show_ompi_version(const char *scope) opal_info_out("Open MPI release date", tmp, OMPI_RELEASE_DATE); free(tmp); -#if OMPI_RTE_ORTE - /* show the orte version */ - orte_info_show_orte_version(scope); -#endif - /* show the opal version */ opal_info_show_opal_version(scope); diff --git a/ompi/runtime/ompi_mpi_finalize.c b/ompi/runtime/ompi_mpi_finalize.c index f9099b37dd2..a7c0173c6fe 100644 --- a/ompi/runtime/ompi_mpi_finalize.c +++ b/ompi/runtime/ompi_mpi_finalize.c @@ -16,7 +16,7 @@ * Copyright (c) 2006 University of Houston. All rights reserved. * Copyright (c) 2009 Sun Microsystems, Inc. All rights reserved. * Copyright (c) 2011 Sandia National Laboratories. All rights reserved. - * Copyright (c) 2014-2017 Intel, Inc. All rights reserved. + * Copyright (c) 2014-2020 Intel, Inc. All rights reserved. * Copyright (c) 2016 Research Organization for Information Science * and Technology (RIST). All rights reserved. * @@ -56,7 +56,7 @@ #include "opal/mca/mpool/base/mpool_base_tree.h" #include "opal/mca/rcache/base/base.h" #include "opal/mca/allocator/base/base.h" -#include "opal/mca/pmix/pmix.h" +#include "opal/mca/pmix/pmix-internal.h" #include "opal/util/timings.h" #include "mpi.h" @@ -76,8 +76,7 @@ #include "ompi/mca/bml/base/base.h" #include "ompi/mca/osc/base/base.h" #include "ompi/mca/coll/base/base.h" -#include "ompi/mca/rte/rte.h" -#include "ompi/mca/rte/base/base.h" +#include "ompi/runtime/ompi_rte.h" #include "ompi/mca/topo/base/base.h" #include "ompi/mca/io/io.h" #include "ompi/mca/io/base/base.h" @@ -95,7 +94,7 @@ extern bool ompi_enable_timing; -static void fence_cbfunc(int status, void *cbdata) +static void fence_cbfunc(pmix_status_t status, void *cbdata) { volatile bool *active = (volatile bool*)cbdata; OPAL_ACQUIRE_OBJECT(active); @@ -112,6 +111,7 @@ int ompi_mpi_finalize(void) volatile bool active; uint32_t key; ompi_datatype_t * datatype; + pmix_status_t rc; ompi_hook_base_mpi_finalize_top(); @@ -249,37 +249,38 @@ int ompi_mpi_finalize(void) del_procs behavior around May of 2014 (see https://svn.open-mpi.org/trac/ompi/ticket/4669#comment:4 for more details). */ - if (!ompi_async_mpi_finalize) { - if (NULL != opal_pmix.fence_nb) { - active = true; - OPAL_POST_OBJECT(&active); - /* Note that use of the non-blocking PMIx fence will - * allow us to lazily cycle calling - * opal_progress(), which will allow any other pending - * communications/actions to complete. See - * https://github.com/open-mpi/ompi/issues/1576 for the - * original bug report. */ - if (OMPI_SUCCESS != (ret = opal_pmix.fence_nb(NULL, 0, fence_cbfunc, - (void*)&active))) { - OMPI_ERROR_LOG(ret); - /* Reset the active flag to false, to avoid waiting for - * completion when the fence was failed. */ - active = false; - } - OMPI_LAZY_WAIT_FOR_COMPLETION(active); - } else { - /* However, we cannot guarantee that the provided PMIx has - * fence_nb. If it doesn't, then do the best we can: an MPI - * barrier on COMM_WORLD (which isn't the best because of the - * reasons cited above), followed by a blocking PMIx fence - * (which does not call opal_progress()). */ - ompi_communicator_t *comm = &ompi_mpi_comm_world.comm; - comm->c_coll->coll_barrier(comm, comm->c_coll->coll_barrier_module); - - if (OMPI_SUCCESS != (ret = opal_pmix.fence(NULL, 0))) { - OMPI_ERROR_LOG(ret); - } + if (!ompi_async_mpi_finalize && !ompi_singleton) { +#ifdef PMIx_Fence_nb + active = true; + OPAL_POST_OBJECT(&active); + /* Note that use of the non-blocking PMIx fence will + * allow us to lazily cycle calling + * opal_progress(), which will allow any other pending + * communications/actions to complete. See + * https://github.com/open-mpi/ompi/issues/1576 for the + * original bug report. */ + if (PMIX_SUCCESS != (rc = PMIx_Fence_nb(NULL, 0, NULL, 0, fence_cbfunc, (void*)&active))) { + ret = opal_pmix_convert_status(rc); + OMPI_ERROR_LOG(ret); + /* Reset the active flag to false, to avoid waiting for + * completion when the fence was failed. */ + active = false; } + OMPI_LAZY_WAIT_FOR_COMPLETION(active); +#else + /* However, we cannot guarantee that the provided PMIx has + * fence_nb. If it doesn't, then do the best we can: an MPI + * barrier on COMM_WORLD (which isn't the best because of the + * reasons cited above), followed by a blocking PMIx fence + * (which does not call opal_progress()). */ + ompi_communicator_t *comm = &ompi_mpi_comm_world.comm; + comm->c_coll->coll_barrier(comm, comm->c_coll->coll_barrier_module); + + if (PMIX_SUCCESS != (rc = PMIx_Fence(NULL, 0))) { + ret = opal_pmix_convert_status(rc); + OMPI_ERROR_LOG(ret); + } +#endif } /* @@ -482,12 +483,6 @@ int ompi_mpi_finalize(void) } ompi_rte_initialized = false; - /* now close the rte framework */ - if (OMPI_SUCCESS != (ret = mca_base_framework_close(&ompi_rte_base_framework) ) ) { - OMPI_ERROR_LOG(ret); - goto done; - } - /* Now close the hook framework */ if (OMPI_SUCCESS != (ret = mca_base_framework_close(&ompi_hook_base_framework) ) ) { OMPI_ERROR_LOG(ret); diff --git a/ompi/runtime/ompi_mpi_init.c b/ompi/runtime/ompi_mpi_init.c index ec980487240..11f44a5fc35 100644 --- a/ompi/runtime/ompi_mpi_init.c +++ b/ompi/runtime/ompi_mpi_init.c @@ -17,7 +17,7 @@ * Copyright (c) 2008-2009 Sun Microsystems, Inc. All rights reserved. * Copyright (c) 2011 Sandia National Laboratories. All rights reserved. * Copyright (c) 2012-2013 Inria. All rights reserved. - * Copyright (c) 2014-2018 Intel, Inc. All rights reserved. + * Copyright (c) 2014-2020 Intel, Inc. All rights reserved. * Copyright (c) 2014-2016 Research Organization for Information Science * and Technology (RIST). All rights reserved. * Copyright (c) 2016-2018 Mellanox Technologies Ltd. All rights reserved. @@ -88,8 +88,7 @@ #include "ompi/mca/coll/base/base.h" #include "ompi/mca/io/io.h" #include "ompi/mca/io/base/base.h" -#include "ompi/mca/rte/rte.h" -#include "ompi/mca/rte/base/base.h" +#include "ompi/runtime/ompi_rte.h" #include "ompi/debuggers/debuggers.h" #include "ompi/proc/proc.h" #include "ompi/mca/pml/base/pml_base_bsend.h" @@ -363,7 +362,7 @@ static int ompi_register_mca_variables(void) return OMPI_SUCCESS; } -static void fence_release(int status, void *cbdata) +static void fence_release(pmix_status_t status, void *cbdata) { volatile bool *active = (volatile bool*)cbdata; OPAL_ACQUIRE_OBJECT(active); @@ -378,12 +377,10 @@ int ompi_mpi_init(int argc, char **argv, int requested, int *provided, ompi_proc_t** procs; size_t nprocs; char *error = NULL; - ompi_errhandler_errtrk_t errtrk; - opal_list_t info; - opal_value_t *kv; volatile bool active; bool background_fence = false; - + pmix_info_t info[2]; + pmix_status_t rc; OMPI_TIMING_INIT(64); ompi_hook_base_mpi_init_top(argc, argv, requested, provided); @@ -510,13 +507,6 @@ int ompi_mpi_init(int argc, char **argv, int requested, int *provided, free(tmp); } - /* open the rte framework */ - if (OMPI_SUCCESS != (ret = mca_base_framework_open(&ompi_rte_base_framework, 0))) { - error = "ompi_rte_base_open() failed"; - goto error; - } - /* no select is required as this is a static framework */ - /* Setup RTE */ if (OMPI_SUCCESS != (ret = ompi_rte_init(NULL, NULL))) { error = "ompi_mpi_init: ompi_rte_init failed"; @@ -529,28 +519,16 @@ int ompi_mpi_init(int argc, char **argv, int requested, int *provided, ompi_rte_initialized = true; /* Register the default errhandler callback */ - errtrk.status = OPAL_ERROR; - errtrk.active = true; /* we want to go first */ - OBJ_CONSTRUCT(&info, opal_list_t); - kv = OBJ_NEW(opal_value_t); - kv->key = strdup(OPAL_PMIX_EVENT_HDLR_PREPEND); - opal_list_append(&info, &kv->super); + PMIX_INFO_LOAD(&info[0], PMIX_EVENT_HDLR_PREPEND, NULL, PMIX_BOOL); /* give it a name so we can distinguish it */ - kv = OBJ_NEW(opal_value_t); - kv->key = strdup(OPAL_PMIX_EVENT_HDLR_NAME); - kv->type = OPAL_STRING; - kv->data.string = strdup("MPI-Default"); - opal_list_append(&info, &kv->super); - opal_pmix.register_evhandler(NULL, &info, ompi_errhandler_callback, - ompi_errhandler_registration_callback, - (void*)&errtrk); - OMPI_LAZY_WAIT_FOR_COMPLETION(errtrk.active); - - OPAL_LIST_DESTRUCT(&info); - if (OPAL_SUCCESS != errtrk.status) { + PMIX_INFO_LOAD(&info[1], PMIX_EVENT_HDLR_NAME, "MPI-Default", PMIX_STRING); + rc = PMIx_Register_event_handler(NULL, 0, info, 2, ompi_errhandler_callback, NULL, NULL); + PMIX_INFO_DESTRUCT(&info[0]); + PMIX_INFO_DESTRUCT(&info[1]); + if (0 > rc) { error = "Error handler registration"; - ret = errtrk.status; + ret = opal_pmix_convert_status(rc); goto error; } @@ -660,17 +638,23 @@ int ompi_mpi_init(int argc, char **argv, int requested, int *provided, * if data exchange is required. The modex occurs solely across procs * in our job. If a barrier is required, the "modex" function will * perform it internally */ - opal_pmix.commit(); + rc = PMIx_Commit(); + if (PMIX_SUCCESS != rc) { + ret = opal_pmix_convert_status(rc); + error = "PMIx_Commit()"; + goto error; + } OMPI_TIMING_NEXT("commit"); #if (OPAL_ENABLE_TIMING) if (OMPI_TIMING_ENABLED && !opal_pmix_base_async_modex && - opal_pmix_collect_all_data) { - if (OMPI_SUCCESS != (ret = opal_pmix.fence(NULL, 0))) { + opal_pmix_collect_all_data && !ompi_singleton) { + if (PMIX_SUCCESS != (rc = PMIx_Fence(NULL, 0, NULL, 0))) { + ret - opal_pmix_convert_status(rc); error = "timing: pmix-barrier-1 failed"; goto error; } OMPI_TIMING_NEXT("pmix-barrier-1"); - if (OMPI_SUCCESS != (ret = opal_pmix.fence(NULL, 0))) { + if (PMIX_SUCCESS != (rc = PMIx_Fence(NULL, 0, NULL, 0))) { error = "timing: pmix-barrier-2 failed"; goto error; } @@ -678,28 +662,30 @@ int ompi_mpi_init(int argc, char **argv, int requested, int *provided, } #endif - /* If we have a non-blocking fence: - * if we are doing an async modex, but we are collecting all - * data, then execute the non-blocking modex in the background. - * All calls to modex_recv will be cached until the background - * modex completes. If collect_all_data is false, then we skip - * the fence completely and retrieve data on-demand from the - * source node. - * - * If we do not have a non-blocking fence, then we must always - * execute the blocking fence as the system does not support - * later data retrieval. */ - if (NULL != opal_pmix.fence_nb) { - if (opal_pmix_base_async_modex && opal_pmix_collect_all_data) { + if (!ompi_singleton) { + /* If we have a non-blocking fence: + * if we are doing an async modex, but we are collecting all + * data, then execute the non-blocking modex in the background. + * All calls to modex_recv will be cached until the background + * modex completes. If collect_all_data is false, then we skip + * the fence completely and retrieve data on-demand from the + * source node. + * + * If we do not have a non-blocking fence, then we must always + * execute the blocking fence as the system does not support + * later data retrieval. */ + if (opal_pmix_base_async_modex) { /* execute the fence_nb in the background to collect * the data */ background_fence = true; active = true; OPAL_POST_OBJECT(&active); - if( OMPI_SUCCESS != (ret = opal_pmix.fence_nb(NULL, true, + PMIX_INFO_LOAD(&info[0], PMIX_COLLECT_DATA, &opal_pmix_collect_all_data, PMIX_BOOL); + if( PMIX_SUCCESS != (rc = PMIx_Fence_nb(NULL, 0, NULL, 0, fence_release, (void*)&active))) { - error = "opal_pmix.fence_nb() failed"; + ret = opal_pmix_convert_status(rc); + error = "PMIx_Fence_nb() failed"; goto error; } @@ -707,21 +693,15 @@ int ompi_mpi_init(int argc, char **argv, int requested, int *provided, /* we want to do the modex */ active = true; OPAL_POST_OBJECT(&active); - if( OMPI_SUCCESS != (ret = opal_pmix.fence_nb(NULL, - opal_pmix_collect_all_data, fence_release, (void*)&active))) { - error = "opal_pmix.fence_nb() failed"; + PMIX_INFO_LOAD(&info[0], PMIX_COLLECT_DATA, &opal_pmix_collect_all_data, PMIX_BOOL); + if( PMIX_SUCCESS != (rc = PMIx_Fence_nb(NULL, 0, info, 1, fence_release, (void*)&active))) { + ret = opal_pmix_convert_status(rc); + error = "PMIx_Fence() failed"; goto error; } /* cannot just wait on thread as we need to call opal_progress */ OMPI_LAZY_WAIT_FOR_COMPLETION(active); } - /* otherwise, we don't want to do the modex, so fall thru */ - } else if (!opal_pmix_base_async_modex || opal_pmix_collect_all_data) { - if( OMPI_SUCCESS != (ret = opal_pmix.fence(NULL, - opal_pmix_collect_all_data))) { - error = "opal_pmix.fence() failed"; - goto error; - } } OMPI_TIMING_NEXT("modex"); @@ -887,29 +867,27 @@ int ompi_mpi_init(int argc, char **argv, int requested, int *provided, /* Next timing measurement */ OMPI_TIMING_NEXT("modex-barrier"); - /* if we executed the above fence in the background, then - * we have to wait here for it to complete. However, there - * is no reason to do two barriers! */ - if (background_fence) { - OMPI_LAZY_WAIT_FOR_COMPLETION(active); - } else if (!ompi_async_mpi_init) { - /* wait for everyone to reach this point - this is a hard - * barrier requirement at this time, though we hope to relax - * it at a later point */ - if (NULL != opal_pmix.fence_nb) { + if (!ompi_singleton) { + /* if we executed the above fence in the background, then + * we have to wait here for it to complete. However, there + * is no reason to do two barriers! */ + if (background_fence) { + OMPI_LAZY_WAIT_FOR_COMPLETION(active); + } else if (!ompi_async_mpi_init) { + /* wait for everyone to reach this point - this is a hard + * barrier requirement at this time, though we hope to relax + * it at a later point */ + bool flag = false; active = true; OPAL_POST_OBJECT(&active); - if (OMPI_SUCCESS != (ret = opal_pmix.fence_nb(NULL, false, - fence_release, (void*)&active))) { - error = "opal_pmix.fence_nb() failed"; + PMIX_INFO_LOAD(&info[0], PMIX_COLLECT_DATA, &flag, PMIX_BOOL); + if (PMIX_SUCCESS != (rc = PMIx_Fence_nb(NULL, 0, info, 1, + fence_release, (void*)&active))) { + ret = opal_pmix_convert_status(rc); + error = "PMIx_Fence_nb() failed"; goto error; } OMPI_LAZY_WAIT_FOR_COMPLETION(active); - } else { - if (OMPI_SUCCESS != (ret = opal_pmix.fence(NULL, false))) { - error = "opal_pmix.fence() failed"; - goto error; - } } } diff --git a/ompi/runtime/ompi_mpi_params.c b/ompi/runtime/ompi_mpi_params.c index adb9a1a4abb..07d0ad7b32c 100644 --- a/ompi/runtime/ompi_mpi_params.c +++ b/ompi/runtime/ompi_mpi_params.c @@ -14,7 +14,7 @@ * Copyright (c) 2007-2015 Los Alamos National Security, LLC. All rights * reserved. * Copyright (c) 2013 NVIDIA Corporation. All rights reserved. - * Copyright (c) 2013-2017 Intel, Inc. All rights reserved. + * Copyright (c) 2013-2019 Intel, Inc. All rights reserved. * Copyright (c) 2015 Mellanox Technologies, Inc. * All rights reserved. * Copyright (c) 2016-2019 Research Organization for Information Science @@ -35,7 +35,7 @@ #include "ompi/datatype/ompi_datatype.h" #include "ompi/runtime/mpiruntime.h" #include "ompi/runtime/params.h" -#include "ompi/mca/rte/rte.h" +#include "ompi/runtime/ompi_rte.h" #include "opal/mca/pmix/base/base.h" #include "opal/util/argv.h" diff --git a/ompi/mca/rte/pmix/rte_pmix_module.c b/ompi/runtime/ompi_rte.c similarity index 80% rename from ompi/mca/rte/pmix/rte_pmix_module.c rename to ompi/runtime/ompi_rte.c index e876e9895fa..dfdd4a64447 100644 --- a/ompi/mca/rte/pmix/rte_pmix_module.c +++ b/ompi/runtime/ompi_rte.c @@ -2,7 +2,7 @@ /* * Copyright (c) 2012-2013 Los Alamos National Security, LLC. * All rights reserved. - * Copyright (c) 2013-2018 Intel, Inc. All rights reserved. + * Copyright (c) 2013-2020 Intel, Inc. All rights reserved. * Copyright (c) 2012-2014 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. @@ -51,31 +51,27 @@ #include "opal/class/opal_list.h" #include "opal/dss/dss.h" -#include "ompi/mca/rte/base/base.h" -#include "ompi/mca/rte/rte.h" +#include "ompi/runtime/ompi_rte.h" #include "ompi/debuggers/debuggers.h" #include "ompi/proc/proc.h" #include "ompi/runtime/params.h" #include "ompi/communicator/communicator.h" -/* instantiate a debugger-required value */ -volatile int MPIR_being_debugged = 0; - -extern ompi_rte_component_t mca_rte_pmix_component; - /* storage to support OMPI */ opal_process_name_t pmix_name_wildcard = {UINT32_MAX-1, UINT32_MAX-1}; opal_process_name_t pmix_name_invalid = {UINT32_MAX, UINT32_MAX}; hwloc_cpuset_t ompi_proc_applied_binding = NULL; pmix_process_info_t pmix_process_info = {0}; bool pmix_proc_is_bound = false; +bool ompi_singleton = false; -static bool pmix_in_parallel_debugger = false; static bool added_transport_keys = false; static bool added_num_procs = false; static bool added_app_ctx = false; static char* pre_condition_transports_print(uint64_t *unique_key); +static int _setup_top_session_dir(char **sdir); static int _setup_job_session_dir(char **sdir); +static int _setup_proc_session_dir(char **sdir); #define OPAL_SCHEMA_DELIMITER_CHAR '.' #define OPAL_SCHEMA_WILDCARD_CHAR '*' @@ -502,16 +498,17 @@ int ompi_rte_init(int *pargc, char ***pargv) int ret; char *error = NULL; opal_process_name_t pname; - opal_proc_t *myproc; + pmix_proc_t myproc, rproc; int u32, *u32ptr; uint16_t u16, *u16ptr; char **peers=NULL; char *envar, *ev1, *ev2; - opal_value_t *kv; char *val; size_t i; uint64_t unique_key[2]; char *string_key; + pmix_value_t pval; + pmix_status_t rc; u32ptr = &u32; u16ptr = &u16; @@ -533,63 +530,62 @@ int ompi_rte_init(int *pargc, char ***pargv) goto error; } - /* open and setup pmix */ - if (OPAL_SUCCESS != (ret = mca_base_framework_open(&opal_pmix_base_framework, 0))) { - OPAL_ERROR_LOG(ret); - /* we cannot run */ - error = "pmix init"; - goto error; - } - if (OPAL_SUCCESS != (ret = opal_pmix_base_select())) { - /* we cannot run */ - error = "pmix init"; - goto error; - } - /* set the event base */ - opal_pmix_base_set_evbase(opal_sync_event_base); - /* initialize the selected module */ - if (!opal_pmix.initialized() && (OPAL_SUCCESS != (ret = opal_pmix.init(NULL)))) { + if (!PMIx_Initialized() && (PMIX_SUCCESS != (ret = PMIx_Init(&myproc, NULL, 0)))) { /* we cannot run - this could be due to being direct launched * without the required PMI support being built, so print * out a help message indicating it */ - opal_show_help("help-ompi-rte-pmix.txt", "no-pmi", true); + opal_show_help("help-mpi-runtime.txt", "no-pmi", true, PMIx_Error_string(ret)); return OPAL_ERR_SILENT; } - /* opal_pmix.init will have filled in proc name fields in - * OPAL, so transfer them here */ + + /* setup the process name fields */ + OPAL_PMIX_CONVERT_PROCT(rc, &pname, &myproc); + if (OPAL_SUCCESS != rc) { + return rc; + } + OPAL_PROC_MY_NAME.jobid = pname.jobid; + OPAL_PROC_MY_NAME.vpid = pname.vpid; pmix_process_info.my_name.jobid = OPAL_PROC_MY_NAME.jobid; pmix_process_info.my_name.vpid = OPAL_PROC_MY_NAME.vpid; - /* get our hostname */ - myproc = opal_proc_local_get(); - pmix_process_info.nodename = opal_get_proc_hostname(myproc); + /* set our hostname */ + OPAL_MODEX_RECV_VALUE_OPTIONAL(ret, PMIX_HOSTNAME, &OPAL_PROC_MY_NAME, + (char**)&ev1, PMIX_STRING); + if (PMIX_SUCCESS == ret) { + if (NULL != opal_process_info.nodename) { + free(opal_process_info.nodename); + } + opal_process_info.nodename = ev1; // ev1 is an allocated string + } + ompi_process_info.nodename = opal_process_info.nodename; /* get our local rank from PMI */ - OPAL_MODEX_RECV_VALUE(ret, OPAL_PMIX_LOCAL_RANK, - &pmix_process_info.my_name, &u16ptr, OPAL_UINT16); - if (OPAL_SUCCESS != ret) { - error = "getting local rank"; - goto error; + OPAL_MODEX_RECV_VALUE(rc, PMIX_LOCAL_RANK, + &pmix_process_info.my_name, &u16ptr, PMIX_UINT16); + if (PMIX_SUCCESS != rc) { + /* assume we are a singleton */ + u16 = 0; + ompi_singleton = true; } pmix_process_info.my_local_rank = u16; /* get our node rank from PMI */ - OPAL_MODEX_RECV_VALUE(ret, OPAL_PMIX_NODE_RANK, - &pmix_process_info.my_name, &u16ptr, OPAL_UINT16); - if (OPAL_SUCCESS != ret) { - error = "getting node rank"; - goto error; + OPAL_MODEX_RECV_VALUE(rc, PMIX_NODE_RANK, + &pmix_process_info.my_name, &u16ptr, PMIX_UINT16); + if (PMIX_SUCCESS != rc) { + /* assume we are a singleton */ + u16 = 0; } pmix_process_info.my_node_rank = u16; /* get job size */ pname.jobid = pmix_process_info.my_name.jobid; pname.vpid = OPAL_VPID_WILDCARD; - OPAL_MODEX_RECV_VALUE(ret, OPAL_PMIX_JOB_SIZE, - &pname, &u32ptr, OPAL_UINT32); - if (OPAL_SUCCESS != ret) { - error = "getting job size"; - goto error; + OPAL_MODEX_RECV_VALUE(rc, PMIX_JOB_SIZE, + &pname, &u32ptr, PMIX_UINT32); + if (PMIX_SUCCESS != rc) { + /* assume we are a singleton */ + u32 = 1; } pmix_process_info.num_procs = u32; @@ -608,9 +604,9 @@ int ompi_rte_init(int *pargc, char ***pargv) } /* get our app number from PMI - ok if not found */ - OPAL_MODEX_RECV_VALUE_OPTIONAL(ret, OPAL_PMIX_APPNUM, - &pmix_process_info.my_name, &u32ptr, OPAL_UINT32); - if (OPAL_SUCCESS == ret) { + OPAL_MODEX_RECV_VALUE_OPTIONAL(rc, PMIX_APPNUM, + &pmix_process_info.my_name, &u32ptr, PMIX_UINT32); + if (PMIX_SUCCESS == rc) { pmix_process_info.app_num = u32; } else { pmix_process_info.app_num = 0; @@ -618,9 +614,9 @@ int ompi_rte_init(int *pargc, char ***pargv) /* get the number of local peers - required for wireup of * shared memory BTL */ - OPAL_MODEX_RECV_VALUE(ret, OPAL_PMIX_LOCAL_SIZE, - &pname, &u32ptr, OPAL_UINT32); - if (OPAL_SUCCESS == ret) { + OPAL_MODEX_RECV_VALUE(rc, PMIX_LOCAL_SIZE, + &pname, &u32ptr, PMIX_UINT32); + if (PMIX_SUCCESS == rc) { pmix_process_info.num_local_peers = u32 - 1; // want number besides ourselves } else { pmix_process_info.num_local_peers = 0; @@ -637,9 +633,6 @@ int ompi_rte_init(int *pargc, char ***pargv) OPAL_ERROR_LOG(OPAL_ERR_OUT_OF_RESOURCE); return OPAL_ERR_OUT_OF_RESOURCE; } - opal_output_verbose(2, ompi_rte_base_framework.framework_output, - "%s transport key %s", - OPAL_NAME_PRINT(pmix_process_info.my_name), string_key); opal_asprintf(&envar, OPAL_MCA_PREFIX"opal_precondition_transports=%s", string_key); putenv(envar); added_transport_keys = true; @@ -648,19 +641,55 @@ int ompi_rte_init(int *pargc, char ***pargv) } /* retrieve temp directories info */ - OPAL_MODEX_RECV_VALUE_OPTIONAL(ret, OPAL_PMIX_NSDIR, &pname, &val, OPAL_STRING); - if (OPAL_SUCCESS == ret && NULL != val) { + OPAL_MODEX_RECV_VALUE_OPTIONAL(rc, PMIX_TMPDIR, &pname, &val, PMIX_STRING); + if (OPAL_SUCCESS == rc && NULL != val) { + pmix_process_info.top_session_dir = val; + } else { + /* we need to create something */ + rc = _setup_top_session_dir(&pmix_process_info.top_session_dir); + if (OPAL_SUCCESS != rc) { + error = "top session directory"; + goto error; + } + } + + /* retrieve job-session directory info */ + OPAL_MODEX_RECV_VALUE_OPTIONAL(rc, PMIX_NSDIR, &pname, &val, PMIX_STRING); + if (PMIX_SUCCESS == rc && NULL != val) { pmix_process_info.job_session_dir = val; val = NULL; } else { /* we need to create something */ - ret = _setup_job_session_dir(&pmix_process_info.job_session_dir); - if (OPAL_SUCCESS != ret) { + rc = _setup_job_session_dir(&pmix_process_info.job_session_dir); + if (OPAL_SUCCESS != rc) { error = "job session directory"; goto error; } } + /* retrieve proc-session directory info */ + OPAL_MODEX_RECV_VALUE_OPTIONAL(rc, PMIX_PROCDIR, &OPAL_PROC_MY_NAME, &val, OPAL_STRING); + if (OPAL_SUCCESS == rc && NULL != val) { + pmix_process_info.proc_session_dir = val; + } else { + /* we need to create something */ + rc = _setup_proc_session_dir(&pmix_process_info.proc_session_dir); + if (OPAL_SUCCESS != rc) { + error = "proc session directory"; + goto error; + } + } + + /* identify our location */ + val = NULL; + OPAL_MODEX_RECV_VALUE_OPTIONAL(rc, PMIX_LOCALITY_STRING, + &pmix_process_info.my_name, &val, PMIX_STRING); + if (PMIX_SUCCESS == rc && NULL != val) { + pmix_process_info.cpuset = val; + } else { + pmix_process_info.cpuset = NULL; + } + /* get our local peers */ if (0 < pmix_process_info.num_local_peers) { /* if my local rank if too high, then that's an error */ @@ -670,9 +699,9 @@ int ompi_rte_init(int *pargc, char ***pargv) goto error; } /* retrieve the local peers */ - OPAL_MODEX_RECV_VALUE(ret, OPAL_PMIX_LOCAL_PEERS, - &pname, &val, OPAL_STRING); - if (OPAL_SUCCESS == ret && NULL != val) { + OPAL_MODEX_RECV_VALUE(rc, PMIX_LOCAL_PEERS, + &pname, &val, PMIX_STRING); + if (PMIX_SUCCESS == rc && NULL != val) { peers = opal_argv_split(val, ','); free(val); } else { @@ -684,15 +713,6 @@ int ompi_rte_init(int *pargc, char ***pargv) /* set the locality */ if (NULL != peers) { - /* identify our location */ - val = NULL; - OPAL_MODEX_RECV_VALUE_OPTIONAL(ret, OPAL_PMIX_LOCALITY_STRING, - &pmix_process_info.my_name, &val, OPAL_STRING); - if (OPAL_SUCCESS == ret && NULL != val) { - pmix_process_info.cpuset = val; - } else { - pmix_process_info.cpuset = NULL; - } pname.jobid = pmix_process_info.my_name.jobid; for (i=0; NULL != peers[i]; i++) { pname.vpid = strtoul(peers[i], NULL, 10); @@ -701,9 +721,9 @@ int ompi_rte_init(int *pargc, char ***pargv) u16 = OPAL_PROC_ALL_LOCAL; } else { val = NULL; - OPAL_MODEX_RECV_VALUE_OPTIONAL(ret, OPAL_PMIX_LOCALITY_STRING, - &pname, &val, OPAL_STRING); - if (OPAL_SUCCESS == ret && NULL != val) { + OPAL_MODEX_RECV_VALUE_OPTIONAL(rc, PMIX_LOCALITY_STRING, + &pname, &val, PMIX_STRING); + if (PMIX_SUCCESS == rc && NULL != val) { u16 = opal_hwloc_compute_relative_locality(pmix_process_info.cpuset, val); free(val); } else { @@ -711,16 +731,12 @@ int ompi_rte_init(int *pargc, char ***pargv) u16 = OPAL_PROC_ON_CLUSTER | OPAL_PROC_ON_CU | OPAL_PROC_ON_NODE; } } - kv = OBJ_NEW(opal_value_t); - kv->key = strdup(OPAL_PMIX_LOCALITY); - kv->type = OPAL_UINT16; - OPAL_OUTPUT_VERBOSE((1, ompi_rte_base_framework.framework_output, - "%s locality: proc %s locality %s", - OPAL_NAME_PRINT(pmix_process_info.my_name), - OPAL_NAME_PRINT(pname), opal_hwloc_base_print_locality(u16))); - kv->data.uint16 = u16; - ret = opal_pmix.store_local(&pname, kv); - if (OPAL_SUCCESS != ret) { + pval.type = PMIX_UINT16; + pval.data.uint16 = u16; + OPAL_PMIX_CONVERT_NAME(&rproc, &pname); + rc = PMIx_Store_internal(&rproc, PMIX_LOCALITY, &pval); + if (PMIX_SUCCESS != rc) { + ret = opal_pmix_convert_status(rc); error = "local store of locality"; opal_argv_free(peers); if (NULL != pmix_process_info.cpuset) { @@ -728,7 +744,6 @@ int ompi_rte_init(int *pargc, char ***pargv) } goto error; } - OBJ_RELEASE(kv); } opal_argv_free(peers); } @@ -742,28 +757,21 @@ int ompi_rte_init(int *pargc, char ***pargv) * the OPAL layer will have initialized these to NULL, and * anyone between us would not have strdup'd the string, so * we cannot free it here */ + opal_process_info.top_session_dir = pmix_process_info.top_session_dir; opal_process_info.job_session_dir = pmix_process_info.job_session_dir; opal_process_info.proc_session_dir = pmix_process_info.proc_session_dir; opal_process_info.num_local_peers = (int32_t)pmix_process_info.num_local_peers; opal_process_info.my_local_rank = (int32_t)pmix_process_info.my_local_rank; opal_process_info.cpuset = pmix_process_info.cpuset; - /* push our hostname so others can find us, if they need to - the - * native PMIx component will ignore this request as the hostname - * is provided by the system */ - OPAL_MODEX_SEND_VALUE(ret, OPAL_PMIX_GLOBAL, OPAL_PMIX_HOSTNAME, pmix_process_info.nodename, OPAL_STRING); - if (OPAL_SUCCESS != ret) { - error = "db store hostname"; - goto error; - } - return OPAL_SUCCESS; error: if (OPAL_ERR_SILENT != ret ) { - opal_show_help("help-ompi-rte-pmix.txt", - "internal-failure", - true, error, opal_strerror(ret), ret); + opal_show_help("help-mpi-runtime.txt", + "mpi_init:startup:internal-failure", + true, "MPI runtime init", "RTE init", + error, opal_strerror(ret), ret); } opal_finalize(); return ret; @@ -808,10 +816,7 @@ int ompi_rte_finalize(void) } /* shutdown pmix */ - if (NULL != opal_pmix.finalize) { - opal_pmix.finalize(); - (void) mca_base_framework_close(&opal_pmix_base_framework); - } + PMIx_Finalize(NULL, 0); /* cleanup the session directory we created */ if (NULL != pmix_process_info.job_session_dir) { @@ -840,7 +845,7 @@ void ompi_rte_abort(int error_code, char *fmt, ...) va_end(arglist); /* call abort */ - opal_pmix.abort(error_code, buffer, NULL); + PMIx_Abort(error_code, buffer, NULL, 0); if (NULL != buffer) { free(buffer); } @@ -861,33 +866,22 @@ void ompi_rte_abort_peers(opal_process_name_t *procs, } static size_t handler = SIZE_MAX; -static bool debugger_register_active = true; static bool debugger_event_active = true; -static void _release_fn(int status, - const opal_process_name_t *source, - opal_list_t *info, opal_list_t *results, - opal_pmix_notification_complete_fn_t cbfunc, +static void _release_fn(size_t refid, 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) { /* must let the notifier know we are done */ if (NULL != cbfunc) { - cbfunc(OPAL_SUCCESS, NULL, NULL, NULL, cbdata); + cbfunc(PMIX_EVENT_ACTION_COMPLETE, NULL, 0, NULL, NULL, cbdata); } debugger_event_active = false; } -static void _register_fn(int status, - size_t evhandler_ref, - void *cbdata) -{ - opal_list_t *codes = (opal_list_t*)cbdata; - - handler = evhandler_ref; - OPAL_LIST_RELEASE(codes); - debugger_register_active = false; -} - /* * Wait for a debugger if asked. We support two ways of waiting for * attaching debuggers -- see big comment in @@ -895,20 +889,13 @@ static void _register_fn(int status, */ void ompi_rte_wait_for_debugger(void) { - int debugger; - opal_list_t *codes, directives; - opal_value_t *kv; + pmix_info_t directive; char *evar; - int time; + int time, code = PMIX_ERR_DEBUGGER_RELEASE; /* check PMIx to see if we are under a debugger */ - debugger = pmix_in_parallel_debugger; - - if (1 == MPIR_being_debugged) { - debugger = 1; - } - - if (!debugger && NULL == getenv("PMIX_TEST_DEBUGGER_ATTACH")) { + if (NULL == getenv("PMIX_DEBUG_WAIT_FOR_NOTIFY") && + NULL == getenv("PMIX_TEST_DEBUGGER_ATTACH")) { /* if not, just return */ return; } @@ -925,36 +912,15 @@ void ompi_rte_wait_for_debugger(void) } /* register an event handler for the PMIX_ERR_DEBUGGER_RELEASE event */ - codes = OBJ_NEW(opal_list_t); - kv = OBJ_NEW(opal_value_t); - kv->key = strdup("errorcode"); - kv->type = OPAL_INT; - kv->data.integer = OPAL_ERR_DEBUGGER_RELEASE; - opal_list_append(codes, &kv->super); - - OBJ_CONSTRUCT(&directives, opal_list_t); - kv = OBJ_NEW(opal_value_t); - kv->key = strdup(OPAL_PMIX_EVENT_HDLR_NAME); - kv->type = OPAL_STRING; - kv->data.string = strdup("MPI-DEBUGGER-ATTACH"); - opal_list_append(&directives, &kv->super); - - opal_pmix.register_evhandler(codes, &directives, _release_fn, _register_fn, codes); - /* let the MPI progress engine run while we wait for registration to complete */ - OMPI_WAIT_FOR_COMPLETION(debugger_register_active); - OPAL_LIST_DESTRUCT(&directives); + PMIX_INFO_LOAD(&directive, PMIX_EVENT_HDLR_NAME, "MPI-DEBUGGER-ATTACH", PMIX_STRING); + PMIx_Register_event_handler(&code, 1, &directive, 1, _release_fn, NULL, NULL); + PMIX_INFO_DESTRUCT(&directive); /* let the MPI progress engine run while we wait for debugger release */ OMPI_WAIT_FOR_COMPLETION(debugger_event_active); /* deregister the event handler */ - opal_pmix.deregister_evhandler(handler, NULL, NULL); -} - -bool ompi_rte_connect_accept_support(const char *port) -{ - /* not sure how to support this yet */ - return true; + PMIx_Deregister_event_handler(handler, NULL, NULL); } static char* pre_condition_transports_print(uint64_t *unique_key) @@ -1023,25 +989,44 @@ static char* pre_condition_transports_print(uint64_t *unique_key) return string_key; } -static int _setup_job_session_dir(char **sdir) +static int _setup_top_session_dir(char **sdir) { char *tmpdir; - /* get the effective uid */ - uid_t uid = geteuid(); if( NULL == (tmpdir = getenv("TMPDIR")) ) if( NULL == (tmpdir = getenv("TEMP")) ) if( NULL == (tmpdir = getenv("TMP")) ) tmpdir = "/tmp"; - if (0 > opal_asprintf(&pmix_process_info.job_session_dir, - "%s/ompi.%s.%lu/jf.0/%u", tmpdir, - pmix_process_info.nodename, - (unsigned long)uid, - pmix_process_info.my_name.jobid)) { + *sdir = strdup(tmpdir); + return OPAL_SUCCESS; +} + +static int _setup_job_session_dir(char **sdir) +{ + /* get the effective uid */ + uid_t uid = geteuid(); + + if (0 > opal_asprintf(sdir, "%s/ompi.%s.%lu/jf.0/%u", + pmix_process_info.top_session_dir, + pmix_process_info.nodename, + (unsigned long)uid, + pmix_process_info.my_name.jobid)) { pmix_process_info.job_session_dir = NULL; return OPAL_ERR_OUT_OF_RESOURCE; } return OPAL_SUCCESS; } + +static int _setup_proc_session_dir(char **sdir) +{ + if (0 > opal_asprintf(sdir, "%s/%d", + pmix_process_info.job_session_dir, + pmix_process_info.my_name.vpid)) { + pmix_process_info.proc_session_dir = NULL; + return OPAL_ERR_OUT_OF_RESOURCE; + } + + return OPAL_SUCCESS; +} diff --git a/ompi/mca/rte/rte.h b/ompi/runtime/ompi_rte.h similarity index 71% rename from ompi/mca/rte/rte.h rename to ompi/runtime/ompi_rte.h index 2d66ac4f2c4..ac83022ae59 100644 --- a/ompi/mca/rte/rte.h +++ b/ompi/runtime/ompi_rte.h @@ -3,7 +3,9 @@ * Copyright (c) 2012-2015 Los Alamos National Security, LLC. All rights reserved. * Copyright (c) 2013 Mellanox Technologies, Inc. * All rights reserved. - * Copyright (c) 2014-2015 Intel, Inc. All rights reserved. + * Copyright (c) 2014-2020 Intel, Inc. All rights reserved. + * Copyright (c) 2019 Research Organization for Information Science + * and Technology (RIST). All rights reserved. * * $COPYRIGHT$ * @@ -158,46 +160,121 @@ #define OMPI_MCA_RTE_H #include "ompi_config.h" +#include "ompi/constants.h" +#include +#ifdef HAVE_SYS_TYPES_H +#include +#endif + +struct opal_proc_t; + +#include "opal/threads/threads.h" +#include "opal/util/proc.h" +#include "opal/mca/hwloc/hwloc-internal.h" +#include "opal/mca/pmix/pmix-internal.h" #include "opal/dss/dss_types.h" -#include "ompi/mca/mca.h" -#include "opal/mca/base/base.h" + +struct ompi_proc_t; +struct ompi_communicator_t; BEGIN_C_DECLS -/** - * Structure for rte components. - */ -struct ompi_rte_base_component_1_0_0_t { - /** MCA base component */ - mca_base_component_t base_version; - /** MCA base data */ - mca_base_component_data_t base_data; -}; - -/** - * Convenience typedef - */ -typedef struct ompi_rte_base_component_1_0_0_t ompi_rte_base_component_1_0_0_t; -typedef struct ompi_rte_base_component_1_0_0_t ompi_rte_component_t; +/* Process name objects and operations */ +typedef opal_process_name_t ompi_process_name_t; +typedef uint32_t ompi_jobid_t; +typedef uint32_t ompi_vpid_t; -/** - * Macro for use in components that are of type rte - */ -#define OMPI_RTE_BASE_VERSION_1_0_0 \ - OMPI_MCA_BASE_VERSION_2_1_0("rte", 2, 0, 0) +/* some local storage */ +OMPI_DECLSPEC extern opal_process_name_t pmix_name_wildcard; +OMPI_DECLSPEC extern hwloc_cpuset_t ompi_proc_applied_binding; -END_C_DECLS +#define OMPI_PROC_MY_NAME (&pmix_process_info.my_name) +#define OMPI_NAME_WILDCARD (&pmix_name_wildcard) -/* include implementation to call */ -#include MCA_rte_IMPLEMENTATION_HEADER +typedef uint8_t ompi_rte_cmp_bitmask_t; +#define OMPI_RTE_CMP_NONE 0x00 +#define OMPI_RTE_CMP_JOBID 0x02 +#define OMPI_RTE_CMP_VPID 0x04 +#define OMPI_RTE_CMP_ALL 0x0f +#define OMPI_RTE_CMP_WILD 0x10 -BEGIN_C_DECLS +OMPI_DECLSPEC char* ompi_pmix_print_name(const ompi_process_name_t *name); -/* - * MCA Framework - */ -OMPI_DECLSPEC extern mca_base_framework_t ompi_rte_base_framework; +#define OMPI_NAME_PRINT(a) ompi_pmix_print_name(a) +OMPI_DECLSPEC int ompi_rte_compare_name_fields(ompi_rte_cmp_bitmask_t mask, + const opal_process_name_t* name1, + const opal_process_name_t* name2); +OMPI_DECLSPEC int ompi_rte_convert_string_to_process_name(opal_process_name_t *name, + const char* name_string); +OMPI_DECLSPEC int ompi_rte_convert_process_name_to_string(char** name_string, + const opal_process_name_t *name); + +#define OMPI_LOCAL_JOBID(n) \ + ( (n) & 0x0000ffff) +#define OMPI_JOB_FAMILY(n) \ + (((n) >> 16) & 0x0000ffff) +#define OMPI_CONSTRUCT_LOCAL_JOBID(local, job) \ + ( ((local) & 0xffff0000) | ((job) & 0x0000ffff) ) +#define OMPI_CONSTRUCT_JOB_FAMILY(n) \ + ( ((n) << 16) & 0xffff0000) + +#define OMPI_CONSTRUCT_JOBID(family, local) \ + OMPI_CONSTRUCT_LOCAL_JOBID(OMPI_CONSTRUCT_JOB_FAMILY(family), local) + +/* This is the DSS tag to serialize a proc name */ +#define OMPI_NAME OPAL_NAME +#define OMPI_PROCESS_NAME_HTON OPAL_PROCESS_NAME_HTON +#define OMPI_PROCESS_NAME_NTOH OPAL_PROCESS_NAME_NTOH + +#if OPAL_ENABLE_DEBUG +static inline opal_process_name_t * OMPI_CAST_RTE_NAME(opal_process_name_t * name) { + return (opal_process_name_t *)name; +} +#else +#define OMPI_CAST_RTE_NAME(a) ((opal_process_name_t*)(a)) +#endif + +/* Process info struct and values */ +typedef uint16_t ompi_node_rank_t; +typedef uint16_t ompi_local_rank_t; +#define OMPI_NODE_RANK_INVALID UINT16_MAX +#define OMPI_LOCAL_RANK_INVALID UINT16_MAX + +typedef struct { + opal_process_name_t my_name; + char *my_hnp_uri; + char *nodename; + pid_t pid; + char *top_session_dir; + char *job_session_dir; + char *proc_session_dir; + uint16_t my_local_rank; + uint16_t my_node_rank; + int32_t num_local_peers; + uint32_t num_procs; + uint32_t app_num; + char *cpuset; +} pmix_process_info_t; +OMPI_DECLSPEC extern pmix_process_info_t pmix_process_info; +#define ompi_process_info pmix_process_info + +OMPI_DECLSPEC extern bool pmix_proc_is_bound; +#define ompi_rte_proc_is_bound pmix_proc_is_bound + +/* Error handling objects and operations */ +OMPI_DECLSPEC void __opal_attribute_noreturn__ + ompi_rte_abort(int error_code, char *fmt, ...); +OMPI_DECLSPEC void ompi_rte_abort_peers(opal_process_name_t *procs, + int32_t num_procs, + int error_code); +#define OMPI_ERROR_LOG OPAL_ERROR_LOG + +/* Init and finalize operations */ +OMPI_DECLSPEC int ompi_rte_init(int *argc, char ***argv); +OMPI_DECLSPEC int ompi_rte_finalize(void); +OMPI_DECLSPEC void ompi_rte_wait_for_debugger(void); +OMPI_DECLSPEC extern bool ompi_singleton; /* In a few places, we need to barrier until something happens * that changes a flag to indicate we can release - e.g., waiting @@ -207,10 +284,6 @@ OMPI_DECLSPEC extern mca_base_framework_t ompi_rte_base_framework; */ #define OMPI_WAIT_FOR_COMPLETION(flg) \ do { \ - opal_output_verbose(1, ompi_rte_base_framework.framework_output, \ - "%s waiting on RTE event at %s:%d", \ - OMPI_NAME_PRINT(OMPI_PROC_MY_NAME), \ - __FILE__, __LINE__); \ while ((flg)) { \ opal_progress(); \ } \ @@ -218,22 +291,12 @@ OMPI_DECLSPEC extern mca_base_framework_t ompi_rte_base_framework; #define OMPI_LAZY_WAIT_FOR_COMPLETION(flg) \ do { \ - opal_output_verbose(1, ompi_rte_base_framework.framework_output, \ - "%s lazy waiting on RTE event at %s:%d", \ - OMPI_NAME_PRINT(OMPI_PROC_MY_NAME), \ - __FILE__, __LINE__); \ while ((flg)) { \ opal_progress(); \ usleep(100); \ } \ }while(0); -typedef struct { - opal_list_item_t super; - ompi_process_name_t name; -} ompi_namelist_t; -OBJ_CLASS_DECLARATION(ompi_namelist_t); - END_C_DECLS #endif /* OMPI_RTE_H_ */ diff --git a/ompi/tools/Makefile.am b/ompi/tools/Makefile.am index 634a5f4fa94..aca4b3a073c 100644 --- a/ompi/tools/Makefile.am +++ b/ompi/tools/Makefile.am @@ -11,6 +11,7 @@ # Copyright (c) 2004-2005 The Regents of the University of California. # All rights reserved. # Copyright (c) 2014 Intel, Inc. All rights reserved. +# Copyright (c) 2020 IBM Corporation. All rights reserved. # $COPYRIGHT$ # # Additional copyrights may follow @@ -21,11 +22,13 @@ # This makefile.am does not stand on its own - it is included from ompi/Makefile.am SUBDIRS += \ + tools/mpirun \ tools/ompi_info \ tools/wrappers \ tools/mpisync DIST_SUBDIRS += \ + tools/mpirun \ tools/ompi_info \ tools/wrappers \ tools/mpisync diff --git a/ompi/tools/mpirun/Makefile.am b/ompi/tools/mpirun/Makefile.am new file mode 100644 index 00000000000..240a555ee14 --- /dev/null +++ b/ompi/tools/mpirun/Makefile.am @@ -0,0 +1,21 @@ +# +# Copyright (c) 2019 Intel, Inc. All rights reserved. +# Copyright (c) 2020 IBM Corporation. All rights reserved. +# $COPYRIGHT$ +# +# Additional copyrights may follow +# +# $HEADER$ +# + +if OMPI_WANT_PRRTE +install-exec-hook: + (cd $(DESTDIR)$(bindir); rm -f mpirun$(EXEEXT); $(LN_S) prun$(EXEEXT) mpirun$(EXEEXT)) + (cd $(DESTDIR)$(bindir); rm -f mpiexec$(EXEEXT); $(LN_S) prun$(EXEEXT) mpiexec$(EXEEXT)) + (cd $(DESTDIR)$(bindir); rm -f oshrun$(EXEEXT); $(LN_S) prun$(EXEEXT) oshrun$(EXEEXT)) + +uninstall-local: + rm -f $(DESTDIR)$(bindir)/mpirun$(EXEEXT) \ + $(DESTDIR)$(bindir)/mpiexec$(EXEEXT) \ + $(DESTDIR)$(bindir)/oshrun$(EXEEXT) +endif diff --git a/ompi/tools/mpisync/Makefile.am b/ompi/tools/mpisync/Makefile.am index 3514afcc59f..bdafbadda38 100644 --- a/ompi/tools/mpisync/Makefile.am +++ b/ompi/tools/mpisync/Makefile.am @@ -18,6 +18,7 @@ # Copyright (c) 2017 Research Organization for Information Science # and Technology (RIST). All rights reserved. # +# Copyright (c) 2019 Intel, Inc. All rights reserved. # $COPYRIGHT$ # # Additional copyrights may follow @@ -75,9 +76,6 @@ mpisync_SOURCES = \ sync.c mpisync_LDADD = $(top_builddir)/ompi/lib@OMPI_LIBMPI_NAME@.la -if OMPI_RTE_ORTE -mpisync_LDADD += $(top_builddir)/orte/lib@ORTE_LIB_PREFIX@open-rte.la -endif mpisync_LDADD += $(top_builddir)/opal/lib@OPAL_LIB_PREFIX@open-pal.la clean-local: diff --git a/ompi/tools/ompi_info/Makefile.am b/ompi/tools/ompi_info/Makefile.am index cfe81bcc8a4..7a0115f2449 100644 --- a/ompi/tools/ompi_info/Makefile.am +++ b/ompi/tools/ompi_info/Makefile.am @@ -16,6 +16,7 @@ # Copyright (c) 2016 IBM Corporation. All rights reserved. # Copyright (c) 2017 Research Organization for Information Science # and Technology (RIST). All rights reserved. +# Copyright (c) 2019 Intel, Inc. All rights reserved. # $COPYRIGHT$ # # Additional copyrights may follow @@ -65,9 +66,6 @@ ompi_info_SOURCES = \ param.c ompi_info_LDADD = $(top_builddir)/ompi/lib@OMPI_LIBMPI_NAME@.la -if OMPI_RTE_ORTE -ompi_info_LDADD += $(top_builddir)/orte/lib@ORTE_LIB_PREFIX@open-rte.la -endif ompi_info_LDADD += $(top_builddir)/opal/lib@OPAL_LIB_PREFIX@open-pal.la clean-local: diff --git a/ompi/tools/ompi_info/ompi_info.c b/ompi/tools/ompi_info/ompi_info.c index faf9ad6e9b1..5257424bdab 100644 --- a/ompi/tools/ompi_info/ompi_info.c +++ b/ompi/tools/ompi_info/ompi_info.c @@ -13,7 +13,7 @@ * Copyright (c) 2011-2012 University of Houston. All rights reserved. * Copyright (c) 2010-2013 Los Alamos National Security, LLC. * All rights reserved. - * Copyright (c) 2014 Intel, Inc. All rights reserved. + * Copyright (c) 2014-2019 Intel, Inc. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -51,10 +51,6 @@ #include "opal/util/argv.h" #include "opal/util/show_help.h" -#if OMPI_RTE_ORTE -#include "orte/runtime/orte_info_support.h" -#endif - #include "ompi/communicator/communicator.h" #include "ompi/tools/ompi_info/ompi_info.h" #include "ompi/runtime/ompi_info_support.h" @@ -115,11 +111,6 @@ int main(int argc, char *argv[]) /* add in the opal frameworks */ opal_info_register_types(&mca_types); -#if OMPI_RTE_ORTE - /* add in the orte frameworks */ - orte_info_register_types(&mca_types); -#endif - ompi_info_register_types(&mca_types); /* init the component map */ diff --git a/ompi/tools/ompi_info/param.c b/ompi/tools/ompi_info/param.c index b3bb99f2db5..684149ebcc7 100644 --- a/ompi/tools/ompi_info/param.c +++ b/ompi/tools/ompi_info/param.c @@ -13,7 +13,7 @@ * Copyright (c) 2009 Oak Ridge National Labs. All rights reserved. * Copyright (c) 2014-2019 Research Organization for Information Science * and Technology (RIST). All rights reserved. - * Copyright (c) 2015 Intel, Inc. All rights reserved + * Copyright (c) 2015-2019 Intel, Inc. All rights reserved. * Copyright (c) 2018 Amazon.com, Inc. or its affiliates. All Rights reserved. * Copyright (c) 2018 FUJITSU LIMITED. All rights reserved. * $COPYRIGHT$ @@ -123,9 +123,6 @@ void ompi_info_do_config(bool want_all) char *cxxexceptions; char *threads; char *have_dl; -#if OMPI_RTE_ORTE - char *mpirun_prefix_by_default; -#endif char *sparse_groups; char *wtime_support; char *symbol_visibility; @@ -277,9 +274,6 @@ void ompi_info_do_config(bool want_all) fortran_usempi_profiling = (OMPI_BUILD_FORTRAN_BINDINGS >= OMPI_FORTRAN_USEMPI_BINDINGS) ? "yes" : "no"; fortran_usempif08_profiling = (OMPI_BUILD_FORTRAN_BINDINGS >= OMPI_FORTRAN_USEMPIF08_BINDINGS) ? "yes" : "no"; have_dl = OPAL_HAVE_DL_SUPPORT ? "yes" : "no"; -#if OMPI_RTE_ORTE - mpirun_prefix_by_default = ORTE_WANT_ORTERUN_PREFIX_BY_DEFAULT ? "yes" : "no"; -#endif sparse_groups = OMPI_GROUP_SPARSE ? "yes" : "no"; wtime_support = OPAL_TIMER_USEC_NATIVE ? "native" : "gettimeofday"; symbol_visibility = OPAL_C_HAVE_VISIBILITY ? "yes" : "no"; @@ -308,13 +302,8 @@ void ompi_info_do_config(bool want_all) fortran_have_ignore_tkr = strdup("no"); } -#if OMPI_RTE_ORTE - (void)opal_asprintf(&threads, "%s (MPI_THREAD_MULTIPLE: yes, OPAL support: yes, OMPI progress: %s, ORTE progress: yes, Event lib: yes)", - "posix", OPAL_ENABLE_PROGRESS_THREADS ? "yes" : "no"); -#else (void)opal_asprintf(&threads, "%s (MPI_THREAD_MULTIPLE: yes, OPAL support: yes, OMPI progress: %s, Event lib: yes)", "posix", OPAL_ENABLE_PROGRESS_THREADS ? "yes" : "no"); -#endif (void)opal_asprintf(&ft_support, "%s (checkpoint thread: %s)", OPAL_ENABLE_FT ? "yes" : "no", OPAL_ENABLE_FT_THREAD ? "yes" : "no"); @@ -655,10 +644,6 @@ void ompi_info_do_config(bool want_all) opal_info_out("Memory debugging support", "option:mem-debug", memdebug); opal_info_out("dl support", "option:dlopen", have_dl); opal_info_out("Heterogeneous support", "options:heterogeneous", heterogeneous); -#if OMPI_RTE_ORTE - opal_info_out("mpirun default --prefix", "mpirun:prefix_by_default", - mpirun_prefix_by_default); -#endif opal_info_out("MPI_WTIME support", "options:mpi-wtime", wtime_support); opal_info_out("Symbol vis. support", "options:visibility", symbol_visibility); opal_info_out("Host topology support", "options:host-topology", diff --git a/opal/dss/dss_open_close.c b/opal/dss/dss_open_close.c index 4714a59ecf9..c384369847e 100644 --- a/opal/dss/dss_open_close.c +++ b/opal/dss/dss_open_close.c @@ -11,7 +11,7 @@ * 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-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 (c) 2017 IBM Corporation. All rights reserved. @@ -88,10 +88,12 @@ static void opal_value_destruct(opal_value_t* ptr) if (OPAL_STRING == ptr->type && NULL != ptr->data.string) { free(ptr->data.string); - } - if (OPAL_BYTE_OBJECT == ptr->type && + } else if (OPAL_BYTE_OBJECT == ptr->type && NULL != ptr->data.bo.bytes) { free(ptr->data.bo.bytes); + } else if (OPAL_LIST == ptr->type && + NULL != ptr->data.ptr) { + OPAL_LIST_RELEASE(ptr->data.ptr); } } OBJ_CLASS_INSTANCE(opal_value_t, diff --git a/opal/dss/dss_types.h b/opal/dss/dss_types.h index 47da99da6c4..88f329ca20a 100644 --- a/opal/dss/dss_types.h +++ b/opal/dss/dss_types.h @@ -15,7 +15,7 @@ * reserved. * Copyright (c) 2014-2016 Research Organization for Information Science * and Technology (RIST). All rights reserved. - * Copyright (c) 2014-2018 Intel, Inc. All rights reserved. + * Copyright (c) 2014-2019 Intel, Inc. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -108,6 +108,7 @@ typedef struct { #define OPAL_PROC_STATE (opal_data_type_t) 37 /**< corresponds to PMIx proc state type (uint8_t) */ #define OPAL_PROC_INFO (opal_data_type_t) 38 /**< corresponds to PMIx proc_info type */ #define OPAL_ENVAR (opal_data_type_t) 39 /**< corresponds to PMIx envar type */ +#define OPAL_LIST (opal_data_type_t) 40 /**< an opal list */ /* OPAL Dynamic */ #define OPAL_DSS_ID_DYNAMIC (opal_data_type_t) 100 diff --git a/opal/mca/btl/ofi/btl_ofi.h b/opal/mca/btl/ofi/btl_ofi.h index 2e12e6440b8..b04d4b17adf 100644 --- a/opal/mca/btl/ofi/btl_ofi.h +++ b/opal/mca/btl/ofi/btl_ofi.h @@ -12,7 +12,7 @@ * All rights reserved. * Copyright (c) 2015-2018 Los Alamos National Security, LLC. All rights * reserved. - * Copyright (c) 2018 Intel, Inc, All rights reserved + * Copyright (c) 2018-2019 Intel, Inc. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -36,7 +36,7 @@ #include "opal/mca/mpool/mpool.h" #include "opal/mca/btl/base/btl_base_error.h" #include "opal/mca/rcache/base/base.h" -#include "opal/mca/pmix/pmix.h" +#include "opal/mca/pmix/pmix-internal.h" #include "opal/class/opal_hash_table.h" diff --git a/opal/mca/btl/ofi/btl_ofi_component.c b/opal/mca/btl/ofi/btl_ofi_component.c index c57b5040b6b..a7762063f34 100644 --- a/opal/mca/btl/ofi/btl_ofi_component.c +++ b/opal/mca/btl/ofi/btl_ofi_component.c @@ -12,7 +12,7 @@ * All rights reserved. * Copyright (c) 2014-2018 Los Alamos National Security, LLC. All rights * reserved. - * Copyright (c) 2018 Intel, Inc, All rights reserved + * Copyright (c) 2018-2019 Intel, Inc. All rights reserved. * * Copyright (c) 2018 Amazon.com, Inc. or its affiliates. All Rights reserved. * $COPYRIGHT$ @@ -567,7 +567,7 @@ static int mca_btl_ofi_init_device(struct fi_info *info) /* post our endpoint name so peer can use it to connect to us */ OPAL_MODEX_SEND(rc, - OPAL_PMIX_GLOBAL, + PMIX_GLOBAL, &mca_btl_ofi_component.super.btl_version, &ep_name, namelen); diff --git a/opal/mca/btl/portals4/btl_portals4.c b/opal/mca/btl/portals4/btl_portals4.c index 80e28ef47bc..bf63bef119f 100644 --- a/opal/mca/btl/portals4/btl_portals4.c +++ b/opal/mca/btl/portals4/btl_portals4.c @@ -13,7 +13,7 @@ * Copyright (c) 2010-2012 Sandia National Laboratories. All rights reserved. * Copyright (c) 2014 Los Alamos National Security, LLC. All rights * reserved. - * Copyright (c) 2014 Intel, Inc. All rights reserved. + * Copyright (c) 2014-2019 Intel, Inc. All rights reserved. * Copyright (c) 2014 Bull SAS. All rights reserved. * $COPYRIGHT$ * @@ -34,7 +34,7 @@ #include "opal/mca/btl/btl.h" #include "opal/datatype/opal_convertor.h" #include "opal/util/proc.h" -#include "opal/mca/pmix/pmix.h" +#include "opal/mca/pmix/pmix-internal.h" #include "btl_portals4.h" #include "btl_portals4_recv.h" diff --git a/opal/mca/btl/portals4/btl_portals4_component.c b/opal/mca/btl/portals4/btl_portals4_component.c index a56236d3e9f..bd28b3f6b6a 100644 --- a/opal/mca/btl/portals4/btl_portals4_component.c +++ b/opal/mca/btl/portals4/btl_portals4_component.c @@ -11,7 +11,7 @@ * Copyright (c) 2004-2005 The Regents of the University of California. * All rights reserved. * Copyright (c) 2010-2012 Sandia National Laboratories. All rights reserved. - * Copyright (c) 2014-2015 Intel, Inc. All rights reserved. + * Copyright (c) 2014-2019 Intel, Inc. All rights reserved. * Copyright (c) 2014 Bull SAS. All rights reserved. * Copyright (c) 2015 Los Alamos National Security, LLC. All rights * reserved. @@ -26,7 +26,7 @@ #include "opal/mca/event/event.h" #include "opal/util/output.h" -#include "opal/mca/pmix/pmix.h" +#include "opal/mca/pmix/pmix-internal.h" #include "opal/util/show_help.h" #include "opal/mca/btl/btl.h" #include "opal/mca/btl/base/base.h" @@ -457,7 +457,7 @@ static mca_btl_base_module_t** mca_btl_portals4_component_init(int *num_btls, ptl_process_ids[interface].rank, ptl_process_ids[interface].phys.nid, ptl_process_ids[interface].phys.pid)); } - OPAL_MODEX_SEND(ret, OPAL_PMIX_GLOBAL, + OPAL_MODEX_SEND(ret, PMIX_GLOBAL, &mca_btl_portals4_component.super.btl_version, ptl_process_ids, mca_btl_portals4_component.num_btls * sizeof(ptl_process_t)); if (OPAL_SUCCESS != ret) { diff --git a/opal/mca/btl/smcuda/btl_smcuda.c b/opal/mca/btl/smcuda/btl_smcuda.c index 561585ea4bf..70499fcaa9b 100644 --- a/opal/mca/btl/smcuda/btl_smcuda.c +++ b/opal/mca/btl/smcuda/btl_smcuda.c @@ -18,7 +18,7 @@ * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2014-2017 Research Organization for Information Science * and Technology (RIST). All rights reserved. - * Copyright (c) 2015-2016 Intel, Inc. All rights reserved. + * Copyright (c) 2015-2019 Intel, Inc. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -243,7 +243,7 @@ smcuda_btl_first_time_init(mca_btl_smcuda_t *smcuda_btl, /* see if we were given a topology signature */ wildcard_rank.jobid = OPAL_PROC_MY_NAME.jobid; wildcard_rank.vpid = OPAL_VPID_WILDCARD; - OPAL_MODEX_RECV_VALUE_OPTIONAL(rc, OPAL_PMIX_TOPOLOGY_SIGNATURE, + OPAL_MODEX_RECV_VALUE_OPTIONAL(rc, PMIX_TOPOLOGY_SIGNATURE, &wildcard_rank, &loc, OPAL_STRING); if (OPAL_SUCCESS == rc) { /* the number of NUMA nodes is right at the front */ @@ -266,7 +266,7 @@ smcuda_btl_first_time_init(mca_btl_smcuda_t *smcuda_btl, } } /* see if we were given our location */ - OPAL_MODEX_RECV_VALUE_OPTIONAL(rc, OPAL_PMIX_LOCALITY_STRING, + OPAL_MODEX_RECV_VALUE_OPTIONAL(rc, PMIX_LOCALITY_STRING, &OPAL_PROC_MY_NAME, &loc, OPAL_STRING); if (OPAL_SUCCESS == rc) { if (NULL == loc) { diff --git a/opal/mca/btl/tcp/btl_tcp_component.c b/opal/mca/btl/tcp/btl_tcp_component.c index 476c45c4951..e7f40e0c3c5 100644 --- a/opal/mca/btl/tcp/btl_tcp_component.c +++ b/opal/mca/btl/tcp/btl_tcp_component.c @@ -16,7 +16,7 @@ * Copyright (c) 2012-2015 Los Alamos National Security, LLC. All rights * reserved. * Copyright (c) 2013-2015 NVIDIA Corporation. All rights reserved. - * Copyright (c) 2014-2015 Intel, Inc. All rights reserved. + * Copyright (c) 2014-2019 Intel, Inc. All rights reserved. * Copyright (c) 2014-2017 Research Organization for Information Science * and Technology (RIST). All rights reserved. * Copyright (c) 2018-2019 Amazon.com, Inc. or its affiliates. All Rights @@ -77,8 +77,8 @@ #include "opal/mca/btl/base/base.h" #include "opal/mca/mpool/base/base.h" #include "opal/mca/btl/base/btl_base_error.h" -#include "opal/mca/pmix/pmix.h" #include "opal/mca/reachable/base/base.h" +#include "opal/mca/pmix/pmix-internal.h" #include "opal/threads/threads.h" #include "opal/constants.h" @@ -1242,7 +1242,7 @@ static int mca_btl_tcp_component_exchange(void) addrs[i].addr_bandwidth = btl->super.btl_bandwidth; } - OPAL_MODEX_SEND(rc, OPAL_PMIX_GLOBAL, + OPAL_MODEX_SEND(rc, PMIX_GLOBAL, &mca_btl_tcp_component.super.btl_version, addrs, size); free(addrs); @@ -1427,7 +1427,7 @@ static void mca_btl_tcp_component_recv_handler(int sd, short flags, void* user) socklen_t rcvtimeo_save_len = sizeof(save); /* Note, Socket will be in blocking mode during intial handshake - * hence setting SO_RCVTIMEO to say 2 seconds here to avoid waiting + * hence setting SO_RCVTIMEO to say 2 seconds here to avoid waiting * forever when connecting to older versions (that reply to the * handshake with only the guid) or when the remote side isn't OMPI */ diff --git a/opal/mca/btl/tcp/btl_tcp_proc.c b/opal/mca/btl/tcp/btl_tcp_proc.c index c31372324b1..9a0300a6103 100644 --- a/opal/mca/btl/tcp/btl_tcp_proc.c +++ b/opal/mca/btl/tcp/btl_tcp_proc.c @@ -11,7 +11,7 @@ * Copyright (c) 2004-2005 The Regents of the University of California. * All rights reserved. * Copyright (c) 2008-2010 Oracle and/or its affiliates. All rights reserved - * Copyright (c) 2013-2017 Intel, Inc. All rights reserved. + * Copyright (c) 2013-2019 Intel, Inc. All rights reserved. * Copyright (c) 2014-2016 Research Organization for Information Science * and Technology (RIST). All rights reserved. * Copyright (c) 2015-2016 Los Alamos National Security, LLC. All rights @@ -40,7 +40,7 @@ #include "opal/class/opal_hash_table.h" #include "opal/mca/btl/base/btl_base_error.h" #include "opal/mca/reachable/base/base.h" -#include "opal/mca/pmix/pmix.h" +#include "opal/mca/pmix/pmix-internal.h" #include "opal/util/arch.h" #include "opal/util/argv.h" #include "opal/util/if.h" diff --git a/opal/mca/btl/uct/btl_uct.h b/opal/mca/btl/uct/btl_uct.h index 0e4ec9a9498..a3dee5f7d15 100644 --- a/opal/mca/btl/uct/btl_uct.h +++ b/opal/mca/btl/uct/btl_uct.h @@ -13,6 +13,7 @@ * Copyright (c) 2015-2018 Los Alamos National Security, LLC. All rights * reserved. * Copyright (c) 2019 Google, LLC. All rights reserved. + * Copyright (c) 2019 Intel, Inc. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -37,7 +38,7 @@ #include "opal/mca/rcache/base/base.h" #include "opal/class/opal_fifo.h" #include "opal/class/opal_hash_table.h" -#include "opal/mca/pmix/pmix.h" +#include "opal/mca/pmix/pmix-internal.h" #include "opal/threads/tsd.h" #include diff --git a/opal/mca/btl/uct/btl_uct_component.c b/opal/mca/btl/uct/btl_uct_component.c index 5088ad67e5a..cc00ceb2ec8 100644 --- a/opal/mca/btl/uct/btl_uct_component.c +++ b/opal/mca/btl/uct/btl_uct_component.c @@ -18,6 +18,7 @@ * Copyright (c) 2018 Triad National Security, LLC. All rights * reserved. * Copyright (c) 2019 Google, LLC. All rights reserved. + * Copyright (c) 2019 Intel, Inc. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -254,7 +255,7 @@ static int mca_btl_uct_modex_send (void) } } - OPAL_MODEX_SEND(rc, OPAL_PMIX_GLOBAL, &mca_btl_uct_component.super.btl_version, modex, modex_size); + OPAL_MODEX_SEND(rc, PMIX_GLOBAL, &mca_btl_uct_component.super.btl_version, modex, modex_size); return rc; } diff --git a/opal/mca/btl/ugni/btl_ugni_add_procs.c b/opal/mca/btl/ugni/btl_ugni_add_procs.c index c80e34f88dc..3fcb88db622 100644 --- a/opal/mca/btl/ugni/btl_ugni_add_procs.c +++ b/opal/mca/btl/ugni/btl_ugni_add_procs.c @@ -3,7 +3,7 @@ * Copyright (c) 2011-2017 Los Alamos National Security, LLC. All rights * reserved. * Copyright (c) 2011 UT-Battelle, LLC. All rights reserved. - * Copyright (c) 2014-2017 Intel, Inc. All rights reserved. + * Copyright (c) 2014-2019 Intel, Inc. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -18,7 +18,7 @@ #include "btl_ugni_smsg.h" #include "opal/include/opal/align.h" -#include "opal/mca/pmix/pmix.h" +#include "opal/mca/pmix/pmix-internal.h" #define INITIAL_GNI_EPS 1024 @@ -309,7 +309,7 @@ mca_btl_ugni_setup_mpools (mca_btl_ugni_module_t *ugni_module) /* determine how many procs are in the job (might want to check universe size here) */ u32 = &nprocs; - OPAL_MODEX_RECV_VALUE(rc, OPAL_PMIX_UNIV_SIZE, &OPAL_PROC_MY_NAME, + OPAL_MODEX_RECV_VALUE(rc, PMIX_UNIV_SIZE, &OPAL_PROC_MY_NAME, &u32, OPAL_UINT32); if (OPAL_SUCCESS != rc) { /* take a wild conservative guess */ diff --git a/opal/mca/btl/ugni/btl_ugni_endpoint.c b/opal/mca/btl/ugni/btl_ugni_endpoint.c index c44a7723773..98e3ca90c8f 100644 --- a/opal/mca/btl/ugni/btl_ugni_endpoint.c +++ b/opal/mca/btl/ugni/btl_ugni_endpoint.c @@ -3,7 +3,7 @@ * Copyright (c) 2011-2018 Los Alamos National Security, LLC. All rights * reserved. * Copyright (c) 2011-2013 UT-Battelle, LLC. All rights reserved. - * Copyright (c) 2017 Intel, Inc. All rights reserved. + * Copyright (c) 2017-2019 Intel, Inc. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -13,7 +13,7 @@ #include "btl_ugni_endpoint.h" #include "btl_ugni_smsg.h" -#include "opal/mca/pmix/pmix.h" +#include "opal/mca/pmix/pmix-internal.h" static void mca_btl_ugni_ep_construct (mca_btl_base_endpoint_t *ep) { diff --git a/opal/mca/btl/ugni/btl_ugni_init.c b/opal/mca/btl/ugni/btl_ugni_init.c index 53fbf2e7479..c7c46248a35 100644 --- a/opal/mca/btl/ugni/btl_ugni_init.c +++ b/opal/mca/btl/ugni/btl_ugni_init.c @@ -3,7 +3,7 @@ * Copyright (c) 2011-2018 Los Alamos National Security, LLC. All rights * reserved. * Copyright (c) 2011 UT-Battelle, LLC. All rights reserved. - * Copyright (c) 2014-2015 Intel, Inc. All rights reserved. + * Copyright (c) 2014-2019 Intel, Inc. All rights reserved. * Copyright (c) 2014 Research Organization for Information Science * and Technology (RIST). All rights reserved. * $COPYRIGHT$ @@ -20,7 +20,7 @@ #include "opal/class/opal_list.h" #include "opal/dss/dss.h" -#include "opal/mca/pmix/pmix.h" +#include "opal/mca/pmix/pmix-internal.h" #include "opal/util/bit_ops.h" #include "opal/mca/hwloc/base/base.h" @@ -221,7 +221,7 @@ static int mca_btl_ugni_send_modex (void) * new ranks started on the same nodes as the spawnee ranks, etc. */ - OPAL_MODEX_SEND(rc, OPAL_PMIX_GLOBAL, + OPAL_MODEX_SEND(rc, PMIX_GLOBAL, &mca_btl_ugni_component.super.btl_version, modex_msg, modex_size); diff --git a/opal/mca/btl/usnic/btl_usnic_compat.c b/opal/mca/btl/usnic/btl_usnic_compat.c index ba65f1a63fb..b1dc6900c81 100644 --- a/opal/mca/btl/usnic/btl_usnic_compat.c +++ b/opal/mca/btl/usnic/btl_usnic_compat.c @@ -1,6 +1,6 @@ /* * Copyright (c) 2014-2019 Cisco Systems, Inc. All rights reserved - * Copyright (c) 2015 Intel, Inc. All rights reserved. + * Copyright (c) 2015-2019 Intel, Inc. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -27,7 +27,7 @@ void usnic_compat_modex_send(int *rc, opal_btl_usnic_modex_t *modexes, size_t size) { - OPAL_MODEX_SEND(*rc, OPAL_PMIX_REMOTE, component, + OPAL_MODEX_SEND(*rc, PMIX_REMOTE, component, modexes, size); } diff --git a/opal/mca/btl/usnic/btl_usnic_compat.h b/opal/mca/btl/usnic/btl_usnic_compat.h index 4c78a273583..f2a6a486a96 100644 --- a/opal/mca/btl/usnic/btl_usnic_compat.h +++ b/opal/mca/btl/usnic/btl_usnic_compat.h @@ -3,7 +3,7 @@ * Copyright (c) 2013-2019 Cisco Systems, Inc. All rights reserved * Copyright (c) 2015 Los Alamos National Security, LLC. All rights * reserved. - * Copyright (c) 2018 Intel, Inc. All rights reserved. + * Copyright (c) 2018-2019 Intel, Inc. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -26,7 +26,7 @@ #include "opal/util/error.h" /* PMIX / modex stuff */ -#include "opal/mca/pmix/pmix.h" +#include "opal/mca/pmix/pmix-internal.h" /* Proc stuff */ #include "opal/util/proc.h" diff --git a/opal/mca/btl/vader/btl_vader.h b/opal/mca/btl/vader/btl_vader.h index e3921429d5f..0c1b01cbbf9 100644 --- a/opal/mca/btl/vader/btl_vader.h +++ b/opal/mca/btl/vader/btl_vader.h @@ -19,6 +19,7 @@ * reserved. * Copyright (c) 2020 Google, LLC. All rights reserved. * + * Copyright (c) 2019 Intel, Inc. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -60,7 +61,7 @@ #include "opal/util/proc.h" #include "btl_vader_endpoint.h" -#include "opal/mca/pmix/pmix.h" +#include "opal/mca/pmix/pmix-internal.h" #include "btl_vader_xpmem.h" #include "btl_vader_knem.h" diff --git a/opal/mca/btl/vader/btl_vader_component.c b/opal/mca/btl/vader/btl_vader_component.c index f8e25db1f41..1fdf4c1a523 100644 --- a/opal/mca/btl/vader/btl_vader_component.c +++ b/opal/mca/btl/vader/btl_vader_component.c @@ -15,7 +15,7 @@ * Copyright (c) 2010-2018 Los Alamos National Security, LLC. * All rights reserved. * Copyright (c) 2011 NVIDIA Corporation. All rights reserved. - * 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) 2018 Amazon.com, Inc. or its affiliates. All Rights reserved. @@ -403,7 +403,7 @@ static int mca_btl_base_vader_modex_send (void) } #endif - OPAL_MODEX_SEND(rc, OPAL_PMIX_LOCAL, + OPAL_MODEX_SEND(rc, PMIX_LOCAL, &mca_btl_vader_component.super.btl_version, &modex, modex_size); return rc; @@ -571,9 +571,7 @@ static mca_btl_base_module_t **mca_btl_vader_component_init (int *num_btls, free (btls); return NULL; } - if (NULL != opal_pmix.register_cleanup) { - opal_pmix.register_cleanup (sm_file, false, false, false); - } + opal_pmix_register_cleanup (sm_file, false, false, false); rc = opal_shmem_segment_create (&component->seg_ds, sm_file, component->segment_size); free (sm_file); diff --git a/opal/mca/btl/vader/btl_vader_module.c b/opal/mca/btl/vader/btl_vader_module.c index 1a54bbfcab9..fcb068e1692 100644 --- a/opal/mca/btl/vader/btl_vader_module.c +++ b/opal/mca/btl/vader/btl_vader_module.c @@ -14,7 +14,7 @@ * Copyright (c) 2009 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2010-2015 Los Alamos National Security, LLC. All rights * reserved. - * Copyright (c) 2014-2015 Intel, Inc. All rights reserved. + * Copyright (c) 2014-2020 Intel, Inc. All rights reserved. * Copyright (c) 2014-2019 Research Organization for Information Science * and Technology (RIST). All rights reserved. * Copyright (c) 2018-2019 Triad National Security, LLC. All rights @@ -212,7 +212,7 @@ static int init_vader_endpoint (struct mca_btl_base_endpoint_t *ep, struct opal_ return rc; } - /* attatch to the remote segment */ + /* attach to the remote segment */ #if OPAL_BTL_VADER_HAVE_XPMEM if (MCA_BTL_VADER_XPMEM == mca_btl_vader_component.single_copy_mechanism) { /* always use xpmem if it is available */ diff --git a/opal/mca/common/ucx/common_ucx.c b/opal/mca/common/ucx/common_ucx.c index 2482c01feec..d727bfff87e 100644 --- a/opal/mca/common/ucx/common_ucx.c +++ b/opal/mca/common/ucx/common_ucx.c @@ -1,5 +1,8 @@ /* * Copyright (C) Mellanox Technologies Ltd. 2018. ALL RIGHTS RESERVED. + * Copyright (c) 2019 Intel, Inc. All rights reserved. + * Copyright (c) 2019 Research Organization for Information Science + * and Technology (RIST). All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -12,7 +15,7 @@ #include "common_ucx.h" #include "opal/mca/base/mca_base_var.h" #include "opal/mca/base/mca_base_framework.h" -#include "opal/mca/pmix/pmix.h" +#include "opal/mca/pmix/pmix-internal.h" #include "opal/memoryhooks/memory.h" #include @@ -155,7 +158,7 @@ void opal_common_ucx_mca_proc_added(void) OPAL_DECLSPEC int opal_common_ucx_mca_pmix_fence_nb(int *fenced) { - return opal_pmix.fence_nb(NULL, 0, opal_common_ucx_mca_fence_complete_cb, (void *)fenced); + return PMIx_Fence_nb(NULL, 0, NULL, 0, opal_common_ucx_mca_fence_complete_cb, (void *)fenced); } OPAL_DECLSPEC int opal_common_ucx_mca_pmix_fence(ucp_worker_h worker) @@ -163,7 +166,7 @@ OPAL_DECLSPEC int opal_common_ucx_mca_pmix_fence(ucp_worker_h worker) volatile int fenced = 0; int ret = OPAL_SUCCESS; - if (OPAL_SUCCESS != (ret = opal_pmix.fence_nb(NULL, 0, + if (OPAL_SUCCESS != (ret = PMIx_Fence_nb(NULL, 0, NULL, 0, opal_common_ucx_mca_fence_complete_cb, (void*)&fenced))){ return ret; } diff --git a/opal/mca/common/ucx/common_ucx_wpool.c b/opal/mca/common/ucx/common_ucx_wpool.c index 0ef56c44a21..36e479a94c3 100644 --- a/opal/mca/common/ucx/common_ucx_wpool.c +++ b/opal/mca/common/ucx/common_ucx_wpool.c @@ -5,7 +5,7 @@ #include "common_ucx_wpool_int.h" #include "opal/mca/base/mca_base_var.h" #include "opal/mca/base/mca_base_framework.h" -#include "opal/mca/pmix/pmix.h" +#include "opal/mca/pmix/pmix-internal.h" #include "opal/memoryhooks/memory.h" #include diff --git a/opal/mca/hwloc/base/hwloc_base_util.c b/opal/mca/hwloc/base/hwloc_base_util.c index 291a56e0374..988afc0e710 100644 --- a/opal/mca/hwloc/base/hwloc_base_util.c +++ b/opal/mca/hwloc/base/hwloc_base_util.c @@ -56,7 +56,7 @@ #include "opal/util/show_help.h" #include "opal/util/printf.h" #include "opal/threads/tsd.h" -#include "opal/mca/pmix/pmix.h" +#include "opal/mca/pmix/pmix-internal.h" #include "opal/mca/hwloc/hwloc-internal.h" #include "opal/mca/hwloc/base/base.h" @@ -294,75 +294,69 @@ int opal_hwloc_base_get_topology(void) wildcard_rank.jobid = OPAL_PROC_MY_NAME.jobid; wildcard_rank.vpid = OPAL_VPID_WILDCARD; - if (NULL != opal_pmix.get) { #if HWLOC_API_VERSION >= 0x20000 - opal_output_verbose(2, opal_hwloc_base_framework.framework_output, - "hwloc:base: looking for topology in shared memory"); - - /* first try to get the shmem link, if available */ - aptr = &addr; - sptr = &size; - OPAL_MODEX_RECV_VALUE_OPTIONAL(rc, OPAL_PMIX_HWLOC_SHMEM_FILE, - &wildcard_rank, (void**)&shmemfile, OPAL_STRING); - OPAL_MODEX_RECV_VALUE_OPTIONAL(rc2, OPAL_PMIX_HWLOC_SHMEM_ADDR, - &wildcard_rank, (void**)&aptr, OPAL_SIZE); - OPAL_MODEX_RECV_VALUE_OPTIONAL(rc3, OPAL_PMIX_HWLOC_SHMEM_SIZE, - &wildcard_rank, (void**)&sptr, OPAL_SIZE); - if (OPAL_SUCCESS == rc && OPAL_SUCCESS == rc2 && OPAL_SUCCESS == rc3) { - if (0 > (fd = open(shmemfile, O_RDONLY))) { - free(shmemfile); - OPAL_ERROR_LOG(OPAL_ERR_FILE_OPEN_FAILURE) - return OPAL_ERR_FILE_OPEN_FAILURE; - } + opal_output_verbose(2, opal_hwloc_base_framework.framework_output, + "hwloc:base: looking for topology in shared memory"); + + /* first try to get the shmem link, if available */ + aptr = &addr; + sptr = &size; + OPAL_MODEX_RECV_VALUE_OPTIONAL(rc, PMIX_HWLOC_SHMEM_FILE, + &wildcard_rank, (void**)&shmemfile, PMIX_STRING); + OPAL_MODEX_RECV_VALUE_OPTIONAL(rc2, PMIX_HWLOC_SHMEM_ADDR, + &wildcard_rank, (void**)&aptr, PMIX_SIZE); + OPAL_MODEX_RECV_VALUE_OPTIONAL(rc3, PMIX_HWLOC_SHMEM_SIZE, + &wildcard_rank, (void**)&sptr, PMIX_SIZE); + if (OPAL_SUCCESS == rc && OPAL_SUCCESS == rc2 && OPAL_SUCCESS == rc3) { + if (0 > (fd = open(shmemfile, O_RDONLY))) { free(shmemfile); - if (0 != hwloc_shmem_topology_adopt(&opal_hwloc_topology, fd, - 0, (void*)addr, size, 0)) { - if (4 < opal_output_get_verbosity(opal_hwloc_base_framework.framework_output)) { - FILE *file = fopen("/proc/self/maps", "r"); - if (file) { - char line[256]; - opal_output(0, "Dumping /proc/self/maps"); - - while (fgets(line, sizeof(line), file) != NULL) { - char *end = strchr(line, '\n'); - if (end) { - *end = '\0'; - } - opal_output(0, "%s", line); + OPAL_ERROR_LOG(OPAL_ERR_FILE_OPEN_FAILURE) + return OPAL_ERR_FILE_OPEN_FAILURE; + } + free(shmemfile); + if (0 != hwloc_shmem_topology_adopt(&opal_hwloc_topology, fd, + 0, (void*)addr, size, 0)) { + if (4 < opal_output_get_verbosity(opal_hwloc_base_framework.framework_output)) { + FILE *file = fopen("/proc/self/maps", "r"); + if (file) { + char line[256]; + opal_output(0, "Dumping /proc/self/maps"); + + while (fgets(line, sizeof(line), file) != NULL) { + char *end = strchr(line, '\n'); + if (end) { + *end = '\0'; } - fclose(file); + opal_output(0, "%s", line); } + fclose(file); } - /* failed to adopt from shmem, fallback to other ways to get the topology */ - } else { - opal_output_verbose(2, opal_hwloc_base_framework.framework_output, - "hwloc:base: topology in shared memory"); - topo_in_shmem = true; - return OPAL_SUCCESS; } + /* failed to adopt from shmem, fallback to other ways to get the topology */ + } else { + opal_output_verbose(2, opal_hwloc_base_framework.framework_output, + "hwloc:base: topology in shared memory"); + topo_in_shmem = true; + return OPAL_SUCCESS; } + } #endif - /* if that isn't available, then try to retrieve - * the xml representation from the PMIx data store */ - opal_output_verbose(1, opal_hwloc_base_framework.framework_output, - "hwloc:base[%s:%d] getting topology XML string", - __FILE__, __LINE__); + /* if that isn't available, then try to retrieve + * the xml representation from the PMIx data store */ + opal_output_verbose(1, opal_hwloc_base_framework.framework_output, + "hwloc:base[%s:%d] getting topology XML string", + __FILE__, __LINE__); #if HWLOC_API_VERSION >= 0x20000 - OPAL_MODEX_RECV_VALUE_IMMEDIATE(rc, OPAL_PMIX_HWLOC_XML_V2, - &wildcard_rank, &val, OPAL_STRING); + OPAL_MODEX_RECV_VALUE_IMMEDIATE(rc, PMIX_HWLOC_XML_V2, + &wildcard_rank, &val, PMIX_STRING); #else - OPAL_MODEX_RECV_VALUE_IMMEDIATE(rc, OPAL_PMIX_HWLOC_XML_V1, - &wildcard_rank, &val, OPAL_STRING); + OPAL_MODEX_RECV_VALUE_IMMEDIATE(rc, PMIX_HWLOC_XML_V1, + &wildcard_rank, &val, PMIX_STRING); #endif - if (rc != OPAL_SUCCESS) { - /* check the old topo key to keep compatibility with older RMs */ - OPAL_MODEX_RECV_VALUE_OPTIONAL(rc, OPAL_PMIX_LOCAL_TOPO, - &wildcard_rank, &val, OPAL_STRING); - } - } else { - opal_output_verbose(1, opal_hwloc_base_framework.framework_output, - "hwloc:base PMIx not available"); - rc = OPAL_ERR_NOT_SUPPORTED; + if (rc != OPAL_SUCCESS) { + /* check the old topo key to keep compatibility with older RMs */ + OPAL_MODEX_RECV_VALUE_OPTIONAL(rc, PMIX_LOCAL_TOPO, + &wildcard_rank, &val, PMIX_STRING); } if (OPAL_SUCCESS == rc && NULL != val) { diff --git a/opal/mca/pmix/Makefile.am b/opal/mca/pmix/Makefile.am index 0d71f702cdb..ae479349ef6 100644 --- a/opal/mca/pmix/Makefile.am +++ b/opal/mca/pmix/Makefile.am @@ -1,5 +1,5 @@ # -# Copyright (c) 2014 Intel, Inc. All rights reserved. +# Copyright (c) 2014-2019 Intel, Inc. All rights reserved. # $COPYRIGHT$ # # Additional copyrights may follow @@ -7,17 +7,15 @@ # $HEADER$ # -AM_CPPFLAGS = $(LTDLINCL) $(pmix_CPPFLAGS) +EXTRA_DIST = autogen.options +dist_opaldata_DATA = # main library setup noinst_LTLIBRARIES = libmca_pmix.la libmca_pmix_la_SOURCES = -# pkgdata setup -dist_opaldata_DATA = - # local files -headers = pmix.h pmix_types.h pmix_server.h +headers = pmix-internal.h libmca_pmix_la_SOURCES += $(headers) # Conditionally install the header files diff --git a/opal/mca/pmix/autogen.options b/opal/mca/pmix/autogen.options new file mode 100644 index 00000000000..4399a0c907f --- /dev/null +++ b/opal/mca/pmix/autogen.options @@ -0,0 +1,14 @@ +# Copyright (c) 2017 Cisco Systems, Inc. All rights reserved +# Copyright (c) 2019 Intel, Inc. All rights reserved. +# $COPYRIGHT$ +# + +# Per https://github.com/open-mpi/ompi/issues/2616, we cannot have an +# "pmix.h" in the framework directory (due to conflicts of finding +# the system pmix.h file when using "--with-pmix=external"). Hence, +# we need to deviate from the framework norm of having +# framework/framework.h (i.e., pmix/pmix.h). Instead, we'll have +# pmix/pmix-internal.h to make sure that this header file can never +# be mistaken for a system-level pmix.h. + +framework_header = pmix-internal.h diff --git a/opal/mca/pmix/base/Makefile.am b/opal/mca/pmix/base/Makefile.am index 3af899e2b02..79186fb3a59 100644 --- a/opal/mca/pmix/base/Makefile.am +++ b/opal/mca/pmix/base/Makefile.am @@ -1,7 +1,7 @@ # # Copyright (c) 2010 Cisco Systems, Inc. All rights reserved. # Copyright (c) 2012-2013 Los Alamos National Security, Inc. All rights reserved. -# Copyright (c) 2014-2015 Intel, Inc. All rights reserved. +# Copyright (c) 2014-2019 Intel, Inc. All rights reserved. # $COPYRIGHT$ # # Additional copyrights may follow @@ -12,12 +12,8 @@ dist_opaldata_DATA += base/help-pmix-base.txt headers += \ - base/base.h \ - base/pmix_base_fns.h \ - base/pmix_base_hash.h + base/base.h libmca_pmix_la_SOURCES += \ base/pmix_base_frame.c \ - base/pmix_base_select.c \ - base/pmix_base_fns.c \ - base/pmix_base_hash.c + base/pmix_base_fns.c diff --git a/opal/mca/pmix/base/base.h b/opal/mca/pmix/base/base.h index 83365891070..9dbfa1483a8 100644 --- a/opal/mca/pmix/base/base.h +++ b/opal/mca/pmix/base/base.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2018 Intel, Inc. All rights reserved. + * Copyright (c) 2014-2019 Intel, Inc. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -18,8 +18,7 @@ #include "opal/mca/mca.h" #include "opal/mca/base/mca_base_framework.h" -#include "opal/mca/pmix/pmix_types.h" -#include "opal/mca/pmix/pmix.h" +#include "opal/mca/pmix/pmix-internal.h" BEGIN_C_DECLS @@ -32,43 +31,10 @@ OPAL_DECLSPEC int opal_pmix_base_select(void); OPAL_DECLSPEC extern bool opal_pmix_base_allow_delayed_server; -OPAL_DECLSPEC void opal_pmix_base_register_handler(opal_list_t *event_codes, - opal_list_t *info, - opal_pmix_notification_fn_t evhandler, - opal_pmix_evhandler_reg_cbfunc_t cbfunc, - void *cbdata); -OPAL_DECLSPEC void opal_pmix_base_deregister_handler(size_t errhandler, - opal_pmix_op_cbfunc_t cbfunc, - void *cbdata); -OPAL_DECLSPEC int opal_pmix_base_notify_event(int status, - const opal_process_name_t *source, - opal_pmix_data_range_t range, - opal_list_t *info, - opal_pmix_op_cbfunc_t cbfunc, void *cbdata); -OPAL_DECLSPEC void opal_pmix_base_evhandler(int status, - const opal_process_name_t *source, - opal_list_t *info, opal_list_t *results, - opal_pmix_notification_complete_fn_t cbfunc, void *cbdata); -OPAL_DECLSPEC int opal_pmix_base_exchange(opal_value_t *info, - opal_pmix_pdata_t *pdat, +OPAL_DECLSPEC int opal_pmix_base_exchange(pmix_info_t *info, + pmix_pdata_t *pdat, int timeout); -OPAL_DECLSPEC void opal_pmix_base_set_evbase(opal_event_base_t *evbase); - -#define opal_pmix_condition_wait(a,b) pthread_cond_wait(a, &(b)->m_lock_pthread) -typedef pthread_cond_t opal_pmix_condition_t; -#define opal_pmix_condition_broadcast(a) pthread_cond_broadcast(a) -#define opal_pmix_condition_signal(a) pthread_cond_signal(a) -#define OPAL_PMIX_CONDITION_STATIC_INIT PTHREAD_COND_INITIALIZER - -typedef struct { - opal_mutex_t mutex; - opal_pmix_condition_t cond; - volatile bool active; - int status; -} opal_pmix_lock_t; - - typedef struct { opal_event_base_t *evbase; int timeout; @@ -78,112 +44,7 @@ typedef struct { extern opal_pmix_base_t opal_pmix_base; -#define OPAL_PMIX_CONSTRUCT_LOCK(l) \ - do { \ - OBJ_CONSTRUCT(&(l)->mutex, opal_mutex_t); \ - pthread_cond_init(&(l)->cond, NULL); \ - (l)->active = true; \ - OPAL_POST_OBJECT((l)); \ - } while(0) - -#define OPAL_PMIX_DESTRUCT_LOCK(l) \ - do { \ - OPAL_ACQUIRE_OBJECT((l)); \ - OBJ_DESTRUCT(&(l)->mutex); \ - pthread_cond_destroy(&(l)->cond); \ - } while(0) - - -#if OPAL_ENABLE_DEBUG -#define OPAL_PMIX_ACQUIRE_THREAD(lck) \ - do { \ - opal_mutex_lock(&(lck)->mutex); \ - if (opal_debug_threads) { \ - opal_output(0, "Waiting for thread %s:%d", \ - __FILE__, __LINE__); \ - } \ - while ((lck)->active) { \ - opal_pmix_condition_wait(&(lck)->cond, &(lck)->mutex); \ - } \ - if (opal_debug_threads) { \ - opal_output(0, "Thread obtained %s:%d", \ - __FILE__, __LINE__); \ - } \ - (lck)->active = true; \ - } while(0) -#else -#define OPAL_PMIX_ACQUIRE_THREAD(lck) \ - do { \ - opal_mutex_lock(&(lck)->mutex); \ - while ((lck)->active) { \ - opal_pmix_condition_wait(&(lck)->cond, &(lck)->mutex); \ - } \ - (lck)->active = true; \ - } while(0) -#endif - - -#if OPAL_ENABLE_DEBUG -#define OPAL_PMIX_WAIT_THREAD(lck) \ - do { \ - opal_mutex_lock(&(lck)->mutex); \ - if (opal_debug_threads) { \ - opal_output(0, "Waiting for thread %s:%d", \ - __FILE__, __LINE__); \ - } \ - while ((lck)->active) { \ - opal_pmix_condition_wait(&(lck)->cond, &(lck)->mutex); \ - } \ - if (opal_debug_threads) { \ - opal_output(0, "Thread obtained %s:%d", \ - __FILE__, __LINE__); \ - } \ - OPAL_ACQUIRE_OBJECT(&lck); \ - opal_mutex_unlock(&(lck)->mutex); \ - } while(0) -#else -#define OPAL_PMIX_WAIT_THREAD(lck) \ - do { \ - opal_mutex_lock(&(lck)->mutex); \ - while ((lck)->active) { \ - opal_pmix_condition_wait(&(lck)->cond, &(lck)->mutex); \ - } \ - OPAL_ACQUIRE_OBJECT(lck); \ - opal_mutex_unlock(&(lck)->mutex); \ - } while(0) -#endif - - -#if OPAL_ENABLE_DEBUG -#define OPAL_PMIX_RELEASE_THREAD(lck) \ - do { \ - if (opal_debug_threads) { \ - opal_output(0, "Releasing thread %s:%d", \ - __FILE__, __LINE__); \ - } \ - (lck)->active = false; \ - opal_pmix_condition_broadcast(&(lck)->cond); \ - opal_mutex_unlock(&(lck)->mutex); \ - } while(0) -#else -#define OPAL_PMIX_RELEASE_THREAD(lck) \ - do { \ - assert(0 != opal_mutex_trylock(&(lck)->mutex)); \ - (lck)->active = false; \ - opal_pmix_condition_broadcast(&(lck)->cond); \ - opal_mutex_unlock(&(lck)->mutex); \ - } while(0) -#endif - - -#define OPAL_PMIX_WAKEUP_THREAD(lck) \ - do { \ - opal_mutex_lock(&(lck)->mutex); \ - (lck)->active = false; \ - OPAL_POST_OBJECT(lck); \ - opal_pmix_condition_broadcast(&(lck)->cond); \ - opal_mutex_unlock(&(lck)->mutex); \ - } while(0) +#define OPAL_PMIX_CONDITION_STATIC_INIT PTHREAD_COND_INITIALIZER END_C_DECLS diff --git a/opal/mca/pmix/base/pmix_base_fns.c b/opal/mca/pmix/base/pmix_base_fns.c index f6e198cc1d7..ad13e437f8e 100644 --- a/opal/mca/pmix/base/pmix_base_fns.c +++ b/opal/mca/pmix/base/pmix_base_fns.c @@ -2,7 +2,7 @@ /* * Copyright (c) 2012-2015 Los Alamos National Security, LLC. All rights * reserved. - * Copyright (c) 2014-2018 Intel, Inc. All rights reserved. + * Copyright (c) 2014-2019 Intel, Inc. All rights reserved. * Copyright (c) 2014-2017 Research Organization for Information Science * and Technology (RIST). All rights reserved. * Copyright (c) 2016 Mellanox Technologies, Inc. @@ -36,699 +36,808 @@ #include "opal/util/show_help.h" #include "opal/mca/pmix/base/base.h" -#include "opal/mca/pmix/base/pmix_base_fns.h" -#include "opal/mca/pmix/base/pmix_base_hash.h" -#define OPAL_PMI_PAD 10 -void opal_pmix_base_set_evbase(opal_event_base_t *evbase) -{ - opal_pmix_base.evbase = evbase; -} - -/******** ERRHANDLER SUPPORT FOR COMPONENTS THAT - ******** DO NOT NATIVELY SUPPORT IT - ********/ -static opal_pmix_notification_fn_t evhandler = NULL; - -void opal_pmix_base_register_handler(opal_list_t *event_codes, - opal_list_t *info, - opal_pmix_notification_fn_t err, - opal_pmix_evhandler_reg_cbfunc_t cbfunc, - void *cbdata) -{ - evhandler = err; - if (NULL != cbfunc) { - cbfunc(OPAL_SUCCESS, 0, cbdata); - } -} - -void opal_pmix_base_evhandler(int status, - const opal_process_name_t *source, - opal_list_t *info, opal_list_t *results, - opal_pmix_notification_complete_fn_t cbfunc, void *cbdata) -{ - if (NULL != evhandler) { - evhandler(status, source, info, results, cbfunc, cbdata); - } -} - -void opal_pmix_base_deregister_handler(size_t errid, - opal_pmix_op_cbfunc_t cbfunc, - void *cbdata) -{ - evhandler = NULL; - if (NULL != cbfunc) { - cbfunc(OPAL_SUCCESS, cbdata); - } -} - -int opal_pmix_base_notify_event(int status, - const opal_process_name_t *source, - opal_pmix_data_range_t range, - opal_list_t *info, - opal_pmix_op_cbfunc_t cbfunc, void *cbdata) -{ - return OPAL_SUCCESS; -} - -int opal_pmix_base_exchange(opal_value_t *indat, - opal_pmix_pdata_t *outdat, +int opal_pmix_base_exchange(pmix_info_t *indat, + pmix_pdata_t *outdat, int timeout) { - int rc; - opal_list_t ilist, mlist; - opal_value_t *info; - opal_pmix_pdata_t *pdat; - - /* protect the incoming value */ - opal_dss.copy((void**)&info, indat, OPAL_VALUE); - OBJ_CONSTRUCT(&ilist, opal_list_t); - opal_list_append(&ilist, &info->super); - /* tell the server to delete upon read */ - info = OBJ_NEW(opal_value_t); - info->key = strdup(OPAL_PMIX_PERSISTENCE); - info->type = OPAL_PERSIST; - info->data.integer = OPAL_PMIX_PERSIST_FIRST_READ; - opal_list_append(&ilist, &info->super); - + pmix_status_t rc; + pmix_info_t info[2]; + pmix_persistence_t firstread = PMIX_PERSIST_FIRST_READ; + + /* publish the provided value - it defaults to + * "session" range, but we will add a persistence + * to delete it upon first read */ + PMIX_INFO_XFER(&info[0], indat); + PMIX_INFO_LOAD(&info[1], PMIX_PERSISTENCE, &firstread, PMIX_PERSIST); /* publish it with "session" scope */ - rc = opal_pmix.publish(&ilist); - OPAL_LIST_DESTRUCT(&ilist); - if (OPAL_SUCCESS != rc) { - return rc; + rc = PMIx_Publish(info, 2); + PMIX_INFO_DESTRUCT(&info[0]); + PMIX_INFO_DESTRUCT(&info[1]); + if (PMIX_SUCCESS != rc) { + return opal_pmix_convert_status(rc); } - /* lookup the other side's info - if a non-blocking form - * of lookup isn't available, then we use the blocking - * form and trust that the underlying system will WAIT - * until the other side publishes its data */ - pdat = OBJ_NEW(opal_pmix_pdata_t); - pdat->value.key = strdup(outdat->value.key); - pdat->value.type = outdat->value.type; - /* setup the constraints */ - OBJ_CONSTRUCT(&mlist, opal_list_t); + /* lookup the other side's info */ /* tell it to wait for the data to arrive */ - info = OBJ_NEW(opal_value_t); - info->key = strdup(OPAL_PMIX_WAIT); - info->type = OPAL_BOOL; - info->data.flag = true; - opal_list_append(&mlist, &info->super); + PMIX_INFO_LOAD(&info[0], PMIX_WAIT, NULL, PMIX_BOOL); /* pass along the given timeout as we don't know when * the other side will publish - it doesn't * have to be simultaneous */ - info = OBJ_NEW(opal_value_t); - info->key = strdup(OPAL_PMIX_TIMEOUT); - info->type = OPAL_INT; - if (0 < opal_pmix_base.timeout) { - /* the user has overridden the default */ - info->data.integer = opal_pmix_base.timeout; + if (0 < timeout) { + PMIX_INFO_LOAD(&info[1], PMIX_TIMEOUT, &timeout, PMIX_INT); } else { - info->data.integer = timeout; - } - opal_list_append(&mlist, &info->super); - - /* if a non-blocking version of lookup isn't - * available, then use the blocking version */ - OBJ_CONSTRUCT(&ilist, opal_list_t); - opal_list_append(&ilist, &pdat->super); - rc = opal_pmix.lookup(&ilist, &mlist); - OPAL_LIST_DESTRUCT(&mlist); - if (OPAL_SUCCESS != rc) { - OPAL_LIST_DESTRUCT(&ilist); - return rc; + PMIX_INFO_LOAD(&info[1], PMIX_TIMEOUT, &opal_pmix_base.timeout, PMIX_INT); } + rc = PMIx_Lookup(outdat, 1, info, 2); + PMIX_INFO_DESTRUCT(&info[0]); + PMIX_INFO_DESTRUCT(&info[1]); - /* pass back the result */ - outdat->proc = pdat->proc; - free(outdat->value.key); - rc = opal_value_xfer(&outdat->value, &pdat->value); - OPAL_LIST_DESTRUCT(&ilist); - return rc; + return opal_pmix_convert_status(rc); } +pmix_status_t opal_pmix_convert_rc(int rc) +{ + switch (rc) { + case OPAL_ERR_DEBUGGER_RELEASE: + return PMIX_ERR_DEBUGGER_RELEASE; -/******** DATA CONSOLIDATION ********/ + case OPAL_ERR_HANDLERS_COMPLETE: + return PMIX_EVENT_ACTION_COMPLETE; -static char* setup_key(const opal_process_name_t* name, const char *key, int pmix_keylen_max); -static char *pmi_encode(const void *val, size_t vallen); -static uint8_t *pmi_decode (const char *data, size_t *retlen); + case OPAL_ERR_PROC_ABORTED: + return PMIX_ERR_PROC_ABORTED; -int opal_pmix_base_store_encoded(const char *key, const void *data, - opal_data_type_t type, char** buffer, int* length) -{ - opal_byte_object_t *bo; - size_t data_len = 0; - size_t needed; + case OPAL_ERR_PROC_REQUESTED_ABORT: + return PMIX_ERR_PROC_REQUESTED_ABORT; - int pmi_packed_data_off = *length; - char* pmi_packed_data = *buffer; + case OPAL_ERR_PROC_ABORTING: + return PMIX_ERR_PROC_ABORTING; - switch (type) { - case OPAL_STRING: - { - char *ptr = *(char **)data; - data_len = ptr ? strlen(ptr) + 1 : 0; - data = ptr; - break; - } - case OPAL_INT: - case OPAL_UINT: - data_len = sizeof (int); - break; - case OPAL_INT16: - case OPAL_UINT16: - data_len = sizeof (int16_t); - break; - case OPAL_INT32: - case OPAL_UINT32: - data_len = sizeof (int32_t); - break; - case OPAL_INT64: - case OPAL_UINT64: - data_len = sizeof (int64_t); - break; - case OPAL_BYTE_OBJECT: - bo = (opal_byte_object_t *) data; - data = bo->bytes; - data_len = bo->size; - } + case OPAL_ERR_NODE_DOWN: + return PMIX_ERR_NODE_DOWN; - needed = 10 + data_len + strlen (key); + case OPAL_ERR_NODE_OFFLINE: + return PMIX_ERR_NODE_OFFLINE; - if (NULL == pmi_packed_data) { - pmi_packed_data = calloc (needed, 1); - } else { - /* grow the region */ - pmi_packed_data = realloc (pmi_packed_data, pmi_packed_data_off + needed); - } + case OPAL_ERR_JOB_TERMINATED: + return PMIX_ERR_JOB_TERMINATED; - /* special length meaning NULL */ - if (NULL == data) { - data_len = 0xffff; - } + case OPAL_ERR_PROC_RESTART: + return PMIX_ERR_PROC_RESTART; - /* serialize the opal datatype */ - pmi_packed_data_off += sprintf (pmi_packed_data + pmi_packed_data_off, - "%s%c%02x%c%04x%c", key, '\0', type, '\0', - (int) data_len, '\0'); - if (NULL != data) { - memmove (pmi_packed_data + pmi_packed_data_off, data, data_len); - pmi_packed_data_off += data_len; - } + case OPAL_ERR_PROC_CHECKPOINT: + return PMIX_ERR_PROC_CHECKPOINT; - *length = pmi_packed_data_off; - *buffer = pmi_packed_data; - return OPAL_SUCCESS; -} + case OPAL_ERR_PROC_MIGRATE: + return PMIX_ERR_PROC_MIGRATE; -int opal_pmix_base_commit_packed( char** data, int* data_offset, - char** enc_data, int* enc_data_offset, - int max_key, int* pack_key, kvs_put_fn fn) -{ - int rc; - char *pmikey = NULL, *tmp; - char tmp_key[32]; - char *encoded_data; - int encoded_data_len; - int data_len; - int pkey; - - pkey = *pack_key; - - if (NULL == (tmp = malloc(max_key))) { - OPAL_ERROR_LOG(OPAL_ERR_OUT_OF_RESOURCE); - return OPAL_ERR_OUT_OF_RESOURCE; - } - data_len = *data_offset; - if (NULL == (encoded_data = pmi_encode(*data, data_len))) { - OPAL_ERROR_LOG(OPAL_ERR_OUT_OF_RESOURCE); - free(tmp); - return OPAL_ERR_OUT_OF_RESOURCE; - } - *data = NULL; - *data_offset = 0; + case OPAL_ERR_EVENT_REGISTRATION: + return PMIX_ERR_EVENT_REGISTRATION; - encoded_data_len = (int)strlen(encoded_data); - while (encoded_data_len+*enc_data_offset > max_key - 2) { - memcpy(tmp, *enc_data, *enc_data_offset); - memcpy(tmp+*enc_data_offset, encoded_data, max_key-*enc_data_offset-1); - tmp[max_key-1] = 0; + case OPAL_ERR_NOT_IMPLEMENTED: + case OPAL_ERR_NOT_SUPPORTED: + return PMIX_ERR_NOT_SUPPORTED; - sprintf (tmp_key, "key%d", pkey); + case OPAL_ERR_NOT_FOUND: + return PMIX_ERR_NOT_FOUND; - if (NULL == (pmikey = setup_key(&OPAL_PROC_MY_NAME, tmp_key, max_key))) { - OPAL_ERROR_LOG(OPAL_ERR_BAD_PARAM); - rc = OPAL_ERR_BAD_PARAM; - break; - } + case OPAL_ERR_PERM: + case OPAL_ERR_UNREACH: + case OPAL_ERR_SERVER_NOT_AVAIL: + return PMIX_ERR_UNREACH; - rc = fn(pmikey, tmp); - free(pmikey); - if (OPAL_SUCCESS != rc) { - *pack_key = pkey; - free(tmp); - free(encoded_data); - return rc; - } + case OPAL_ERR_BAD_PARAM: + return PMIX_ERR_BAD_PARAM; - pkey++; - memmove(encoded_data, encoded_data+max_key-1-*enc_data_offset, encoded_data_len - max_key + *enc_data_offset + 2); - *enc_data_offset = 0; - encoded_data_len = (int)strlen(encoded_data); - } - memcpy(tmp, *enc_data, *enc_data_offset); - memcpy(tmp+*enc_data_offset, encoded_data, encoded_data_len+1); - tmp[*enc_data_offset+encoded_data_len+1] = '\0'; - tmp[*enc_data_offset+encoded_data_len] = '-'; - free(encoded_data); - - sprintf (tmp_key, "key%d", pkey); - - if (NULL == (pmikey = setup_key(&OPAL_PROC_MY_NAME, tmp_key, max_key))) { - OPAL_ERROR_LOG(OPAL_ERR_BAD_PARAM); - rc = OPAL_ERR_BAD_PARAM; - free(tmp); - return rc; - } + case OPAL_ERR_OUT_OF_RESOURCE: + return PMIX_ERR_OUT_OF_RESOURCE; - rc = fn(pmikey, tmp); - free(pmikey); - if (OPAL_SUCCESS != rc) { - *pack_key = pkey; - free(tmp); - return rc; - } + case OPAL_ERR_DATA_VALUE_NOT_FOUND: + return PMIX_ERR_DATA_VALUE_NOT_FOUND; + + case OPAL_ERR_TIMEOUT: + return PMIX_ERR_TIMEOUT; + + case OPAL_ERR_WOULD_BLOCK: + return PMIX_ERR_WOULD_BLOCK; + + case OPAL_EXISTS: + return PMIX_EXISTS; - pkey++; - free(*data); - *data = NULL; - *data_offset = 0; - free(tmp); - if (NULL != *enc_data) { - free(*enc_data); - *enc_data = NULL; - *enc_data_offset = 0; + case OPAL_ERR_PARTIAL_SUCCESS: + return PMIX_QUERY_PARTIAL_SUCCESS; + + case OPAL_ERR_MODEL_DECLARED: + return PMIX_MODEL_DECLARED; + + case OPAL_ERROR: + return PMIX_ERROR; + case OPAL_SUCCESS: + return PMIX_SUCCESS; + default: + return rc; } - *pack_key = pkey; - return OPAL_SUCCESS; } -int opal_pmix_base_partial_commit_packed( char** data, int* data_offset, - char** enc_data, int* enc_data_offset, - int max_key, int* pack_key, kvs_put_fn fn) +int opal_pmix_convert_status(pmix_status_t status) { - int rc; - char *pmikey = NULL, *tmp; - char tmp_key[32]; - char *encoded_data; - int encoded_data_len; - int data_len; - int pkey; - - pkey = *pack_key; - - if (NULL == (tmp = malloc(max_key))) { - OPAL_ERROR_LOG(OPAL_ERR_OUT_OF_RESOURCE); - return OPAL_ERR_OUT_OF_RESOURCE; - } - data_len = *data_offset - (*data_offset%3); - if (NULL == (encoded_data = pmi_encode(*data, data_len))) { - OPAL_ERROR_LOG(OPAL_ERR_OUT_OF_RESOURCE); - free(tmp); - return OPAL_ERR_OUT_OF_RESOURCE; - } - if (*data_offset == data_len) { - *data = NULL; - *data_offset = 0; - } else { - memmove(*data, *data+data_len, *data_offset - data_len); - *data = realloc(*data, *data_offset - data_len); - *data_offset -= data_len; - } + switch (status) { + case PMIX_ERR_DEBUGGER_RELEASE: + return OPAL_ERR_DEBUGGER_RELEASE; - encoded_data_len = (int)strlen(encoded_data); - while (encoded_data_len+*enc_data_offset > max_key - 2) { - memcpy(tmp, *enc_data, *enc_data_offset); - memcpy(tmp+*enc_data_offset, encoded_data, max_key-*enc_data_offset-1); - tmp[max_key-1] = 0; + case PMIX_EVENT_ACTION_COMPLETE: + return OPAL_ERR_HANDLERS_COMPLETE; - sprintf (tmp_key, "key%d", pkey); + case PMIX_ERR_PROC_ABORTED: + return OPAL_ERR_PROC_ABORTED; - if (NULL == (pmikey = setup_key(&OPAL_PROC_MY_NAME, tmp_key, max_key))) { - OPAL_ERROR_LOG(OPAL_ERR_BAD_PARAM); - rc = OPAL_ERR_BAD_PARAM; - break; - } + case PMIX_ERR_PROC_REQUESTED_ABORT: + return OPAL_ERR_PROC_REQUESTED_ABORT; - rc = fn(pmikey, tmp); - free(pmikey); - if (OPAL_SUCCESS != rc) { - *pack_key = pkey; - free(tmp); - free(encoded_data); - return rc; - } + case PMIX_ERR_PROC_ABORTING: + return OPAL_ERR_PROC_ABORTING; - pkey++; - memmove(encoded_data, encoded_data+max_key-1-*enc_data_offset, encoded_data_len - max_key + *enc_data_offset + 2); - *enc_data_offset = 0; - encoded_data_len = (int)strlen(encoded_data); - } - free(tmp); - if (NULL != *enc_data) { - free(*enc_data); - } - *enc_data = realloc(encoded_data, strlen(encoded_data)+1); - *enc_data_offset = strlen(encoded_data); - *pack_key = pkey; - return OPAL_SUCCESS; -} + case PMIX_ERR_NODE_DOWN: + return OPAL_ERR_NODE_DOWN; -int opal_pmix_base_get_packed(const opal_process_name_t* proc, char **packed_data, - size_t *len, int vallen, kvs_get_fn fn) -{ - char *tmp_encoded = NULL, *pmikey, *pmi_tmp; - int remote_key, size; - size_t bytes_read; - int rc = OPAL_ERR_NOT_FOUND; + case PMIX_ERR_NODE_OFFLINE: + return OPAL_ERR_NODE_OFFLINE; + + case PMIX_ERR_JOB_TERMINATED: + return OPAL_ERR_JOB_TERMINATED; + + case PMIX_ERR_PROC_RESTART: + return OPAL_ERR_PROC_RESTART; + + case PMIX_ERR_PROC_CHECKPOINT: + return OPAL_ERR_PROC_CHECKPOINT; + + case PMIX_ERR_PROC_MIGRATE: + return OPAL_ERR_PROC_MIGRATE; + + case PMIX_ERR_EVENT_REGISTRATION: + return OPAL_ERR_EVENT_REGISTRATION; + + case PMIX_ERR_NOT_SUPPORTED: + return OPAL_ERR_NOT_SUPPORTED; - /* set default */ - *packed_data = NULL; - *len = 0; + case PMIX_ERR_NOT_FOUND: + return OPAL_ERR_NOT_FOUND; - pmi_tmp = calloc (vallen, 1); - if (NULL == pmi_tmp) { + case PMIX_ERR_OUT_OF_RESOURCE: return OPAL_ERR_OUT_OF_RESOURCE; - } - /* read all of the packed data from this proc */ - for (remote_key = 0, bytes_read = 0 ; ; ++remote_key) { - char tmp_key[32]; + case PMIX_ERR_INIT: + return OPAL_ERROR; - sprintf (tmp_key, "key%d", remote_key); + case PMIX_ERR_BAD_PARAM: + return OPAL_ERR_BAD_PARAM; - if (NULL == (pmikey = setup_key(proc, tmp_key, vallen))) { - rc = OPAL_ERR_OUT_OF_RESOURCE; - OPAL_ERROR_LOG(rc); - free(pmi_tmp); - if (NULL != tmp_encoded) { - free(tmp_encoded); - } - return rc; - } + case PMIX_ERR_UNREACH: + case PMIX_ERR_NO_PERMISSIONS: + return OPAL_ERR_UNREACH; - OPAL_OUTPUT_VERBOSE((10, opal_pmix_base_framework.framework_output, - "GETTING KEY %s", pmikey)); + case PMIX_ERR_TIMEOUT: + return OPAL_ERR_TIMEOUT; - rc = fn(pmikey, pmi_tmp, vallen); - free (pmikey); - if (OPAL_SUCCESS != rc) { - break; - } + case PMIX_ERR_WOULD_BLOCK: + return OPAL_ERR_WOULD_BLOCK; - size = strlen (pmi_tmp); + case PMIX_ERR_LOST_CONNECTION_TO_SERVER: + case PMIX_ERR_LOST_PEER_CONNECTION: + case PMIX_ERR_LOST_CONNECTION_TO_CLIENT: + return OPAL_ERR_COMM_FAILURE; - if (NULL == tmp_encoded) { - tmp_encoded = malloc (size + 1); - } else { - tmp_encoded = realloc (tmp_encoded, bytes_read + size + 1); - } + case PMIX_EXISTS: + return OPAL_EXISTS; - strcpy (tmp_encoded + bytes_read, pmi_tmp); - bytes_read += size; + case PMIX_QUERY_PARTIAL_SUCCESS: + return OPAL_ERR_PARTIAL_SUCCESS; - /* is the string terminator present? */ - if ('-' == tmp_encoded[bytes_read-1]) { - break; - } - } + case PMIX_MONITOR_HEARTBEAT_ALERT: + return OPAL_ERR_HEARTBEAT_ALERT; - free (pmi_tmp); + case PMIX_MONITOR_FILE_ALERT: + return OPAL_ERR_FILE_ALERT; - OPAL_OUTPUT_VERBOSE((10, opal_pmix_base_framework.framework_output, - "Read data %s\n", - (NULL == tmp_encoded) ? "NULL" : tmp_encoded)); + case PMIX_MODEL_DECLARED: + return OPAL_ERR_MODEL_DECLARED; - if (NULL != tmp_encoded) { - *packed_data = (char *) pmi_decode (tmp_encoded, len); - free (tmp_encoded); - if (NULL == *packed_data) { - return OPAL_ERR_OUT_OF_RESOURCE; - } + case PMIX_ERROR: + return OPAL_ERROR; + case PMIX_SUCCESS: + return OPAL_SUCCESS; + default: + return status; } - - return rc; } -int opal_pmix_base_cache_keys_locally(const opal_process_name_t* id, const char* key, - opal_value_t **out_kv, char* kvs_name, - int vallen, kvs_get_fn fn) +pmix_proc_state_t opal_pmix_convert_state(int state) { - char *tmp, *tmp2, *tmp3, *tmp_val; - opal_data_type_t stored_type; - size_t len, offset; - int rc, size; - opal_value_t *kv, *knew; - opal_list_t values; - - /* set the default */ - *out_kv = NULL; - - /* first try to fetch data from data storage */ - OBJ_CONSTRUCT(&values, opal_list_t); - rc = opal_pmix_base_fetch(id, key, &values); - if (OPAL_SUCCESS == rc) { - kv = (opal_value_t*)opal_list_get_first(&values); - /* create the copy */ - if (OPAL_SUCCESS != (rc = opal_dss.copy((void**)&knew, kv, OPAL_VALUE))) { - OPAL_ERROR_LOG(rc); - } else { - *out_kv = knew; - } - OPAL_LIST_DESTRUCT(&values); - return rc; + switch(state) { + case 0: + return PMIX_PROC_STATE_UNDEF; + case 1: + return PMIX_PROC_STATE_LAUNCH_UNDERWAY; + case 2: + return PMIX_PROC_STATE_RESTART; + case 3: + return PMIX_PROC_STATE_TERMINATE; + case 4: + return PMIX_PROC_STATE_RUNNING; + case 5: + return PMIX_PROC_STATE_CONNECTED; + case 51: + return PMIX_PROC_STATE_KILLED_BY_CMD; + case 52: + return PMIX_PROC_STATE_ABORTED; + case 53: + return PMIX_PROC_STATE_FAILED_TO_START; + case 54: + return PMIX_PROC_STATE_ABORTED_BY_SIG; + case 55: + return PMIX_PROC_STATE_TERM_WO_SYNC; + case 56: + return PMIX_PROC_STATE_COMM_FAILED; + case 58: + return PMIX_PROC_STATE_CALLED_ABORT; + case 59: + return PMIX_PROC_STATE_MIGRATING; + case 61: + return PMIX_PROC_STATE_CANNOT_RESTART; + case 62: + return PMIX_PROC_STATE_TERM_NON_ZERO; + case 63: + return PMIX_PROC_STATE_FAILED_TO_LAUNCH; + default: + return PMIX_PROC_STATE_UNDEF; } - OPAL_LIST_DESTRUCT(&values); - - OPAL_OUTPUT_VERBOSE((1, opal_pmix_base_framework.framework_output, - "pmix: get all keys for proc %s in KVS %s", - OPAL_NAME_PRINT(*id), kvs_name)); +} - rc = opal_pmix_base_get_packed(id, &tmp_val, &len, vallen, fn); - if (OPAL_SUCCESS != rc) { - return rc; +int opal_pmix_convert_pstate(pmix_proc_state_t state) +{ + switch(state) { + case PMIX_PROC_STATE_UNDEF: + return 0; + case PMIX_PROC_STATE_PREPPED: + case PMIX_PROC_STATE_LAUNCH_UNDERWAY: + return 1; + case PMIX_PROC_STATE_RESTART: + return 2; + case PMIX_PROC_STATE_TERMINATE: + return 3; + case PMIX_PROC_STATE_RUNNING: + return 4; + case PMIX_PROC_STATE_CONNECTED: + return 5; + case PMIX_PROC_STATE_UNTERMINATED: + return 15; + case PMIX_PROC_STATE_TERMINATED: + return 20; + case PMIX_PROC_STATE_KILLED_BY_CMD: + return 51; + case PMIX_PROC_STATE_ABORTED: + return 52; + case PMIX_PROC_STATE_FAILED_TO_START: + return 53; + case PMIX_PROC_STATE_ABORTED_BY_SIG: + return 54; + case PMIX_PROC_STATE_TERM_WO_SYNC: + return 55; + case PMIX_PROC_STATE_COMM_FAILED: + return 56; + case PMIX_PROC_STATE_CALLED_ABORT: + return 58; + case PMIX_PROC_STATE_MIGRATING: + return 60; + case PMIX_PROC_STATE_CANNOT_RESTART: + return 61; + case PMIX_PROC_STATE_TERM_NON_ZERO: + return 62; + case PMIX_PROC_STATE_FAILED_TO_LAUNCH: + return 63; + default: + return 0; // undef } +} - /* search for each key in the decoded data */ - for (offset = 0 ; offset < len ; ) { - /* type */ - tmp = tmp_val + offset + strlen (tmp_val + offset) + 1; - /* size */ - tmp2 = tmp + strlen (tmp) + 1; - /* data */ - tmp3 = tmp2 + strlen (tmp2) + 1; - - stored_type = (opal_data_type_t) strtol (tmp, NULL, 16); - size = strtol (tmp2, NULL, 16); - /* cache value locally so we don't have to look it up via pmi again */ - kv = OBJ_NEW(opal_value_t); - kv->key = strdup(tmp_val + offset); - kv->type = stored_type; - - switch (stored_type) { - case OPAL_BYTE: - kv->data.byte = *tmp3; - break; - case OPAL_STRING: - kv->data.string = strdup(tmp3); - break; - case OPAL_PID: - kv->data.pid = strtoul(tmp3, NULL, 10); - break; - case OPAL_INT: - kv->data.integer = strtol(tmp3, NULL, 10); - break; - case OPAL_INT8: - kv->data.int8 = strtol(tmp3, NULL, 10); - break; - case OPAL_INT16: - kv->data.int16 = strtol(tmp3, NULL, 10); - break; - case OPAL_INT32: - kv->data.int32 = strtol(tmp3, NULL, 10); - break; - case OPAL_INT64: - kv->data.int64 = strtol(tmp3, NULL, 10); - break; - case OPAL_UINT: - kv->data.uint = strtoul(tmp3, NULL, 10); - break; - case OPAL_UINT8: - kv->data.uint8 = strtoul(tmp3, NULL, 10); - break; - case OPAL_UINT16: - kv->data.uint16 = strtoul(tmp3, NULL, 10); - break; - case OPAL_UINT32: - kv->data.uint32 = strtoul(tmp3, NULL, 10); - break; - case OPAL_UINT64: - kv->data.uint64 = strtoull(tmp3, NULL, 10); - break; - case OPAL_BYTE_OBJECT: - if (size == 0xffff) { - kv->data.bo.bytes = NULL; - kv->data.bo.size = 0; - size = 0; - } else { - kv->data.bo.bytes = malloc(size); - memcpy(kv->data.bo.bytes, tmp3, size); - kv->data.bo.size = size; +void opal_pmix_value_load(pmix_value_t *v, + opal_value_t *kv) +{ + opal_list_t *list; + opal_value_t *val; + pmix_info_t *info; + size_t n; + + switch(kv->type) { + case OPAL_UNDEF: + v->type = PMIX_UNDEF; + break; + case OPAL_BOOL: + v->type = PMIX_BOOL; + memcpy(&(v->data.flag), &kv->data.flag, 1); + break; + case OPAL_BYTE: + v->type = PMIX_BYTE; + memcpy(&(v->data.byte), &kv->data.byte, 1); + break; + case OPAL_STRING: + v->type = PMIX_STRING; + if (NULL != kv->data.string) { + v->data.string = strdup(kv->data.string); + } else { + v->data.string = NULL; + } + break; + case OPAL_SIZE: + v->type = PMIX_SIZE; + memcpy(&(v->data.size), &kv->data.size, sizeof(size_t)); + break; + case OPAL_PID: + v->type = PMIX_PID; + memcpy(&(v->data.pid), &kv->data.pid, sizeof(pid_t)); + break; + case OPAL_INT: + v->type = PMIX_INT; + memcpy(&(v->data.integer), &kv->data.integer, sizeof(int)); + break; + case OPAL_INT8: + v->type = PMIX_INT8; + memcpy(&(v->data.int8), &kv->data.int8, 1); + break; + case OPAL_INT16: + v->type = PMIX_INT16; + memcpy(&(v->data.int16), &kv->data.int16, 2); + break; + case OPAL_INT32: + v->type = PMIX_INT32; + memcpy(&(v->data.int32), &kv->data.int32, 4); + break; + case OPAL_INT64: + v->type = PMIX_INT64; + memcpy(&(v->data.int64), &kv->data.int64, 8); + break; + case OPAL_UINT: + v->type = PMIX_UINT; + memcpy(&(v->data.uint), &kv->data.uint, sizeof(int)); + break; + case OPAL_UINT8: + v->type = PMIX_UINT8; + memcpy(&(v->data.uint8), &kv->data.uint8, 1); + break; + case OPAL_UINT16: + v->type = PMIX_UINT16; + memcpy(&(v->data.uint16), &kv->data.uint16, 2); + break; + case OPAL_UINT32: + v->type = PMIX_UINT32; + memcpy(&(v->data.uint32), &kv->data.uint32, 4); + break; + case OPAL_UINT64: + v->type = PMIX_UINT64; + memcpy(&(v->data.uint64), &kv->data.uint64, 8); + break; + case OPAL_FLOAT: + v->type = PMIX_FLOAT; + memcpy(&(v->data.fval), &kv->data.fval, sizeof(float)); + break; + case OPAL_DOUBLE: + v->type = PMIX_DOUBLE; + memcpy(&(v->data.dval), &kv->data.dval, sizeof(double)); + break; + case OPAL_TIMEVAL: + v->type = PMIX_TIMEVAL; + memcpy(&(v->data.tv), &kv->data.tv, sizeof(struct timeval)); + break; + case OPAL_TIME: + v->type = PMIX_TIME; + memcpy(&(v->data.time), &kv->data.time, sizeof(time_t)); + break; + case OPAL_STATUS: + v->type = PMIX_STATUS; + v->data.status = opal_pmix_convert_rc(kv->data.status); + break; + case OPAL_JOBID: + v->type = PMIX_PROC; + /* have to stringify the jobid */ + PMIX_PROC_CREATE(v->data.proc, 1); + OPAL_PMIX_CONVERT_JOBID(v->data.proc->nspace, kv->data.name.jobid); + /* leave the rank as invalid */ + break; + case OPAL_VPID: + v->type = PMIX_PROC_RANK; + OPAL_PMIX_CONVERT_VPID(v->data.rank, kv->data.name.vpid); + break; + case OPAL_NAME: + v->type = PMIX_PROC; + /* have to stringify the jobid */ + PMIX_PROC_CREATE(v->data.proc, 1); + OPAL_PMIX_CONVERT_JOBID(v->data.proc->nspace, kv->data.name.jobid); + OPAL_PMIX_CONVERT_VPID(v->data.proc->rank, kv->data.name.vpid); + break; + case OPAL_BYTE_OBJECT: + v->type = PMIX_BYTE_OBJECT; + if (NULL != kv->data.bo.bytes) { + v->data.bo.bytes = (char*)malloc(kv->data.bo.size); + memcpy(v->data.bo.bytes, kv->data.bo.bytes, kv->data.bo.size); + v->data.bo.size = (size_t)kv->data.bo.size; + } else { + v->data.bo.bytes = NULL; + v->data.bo.size = 0; + } + break; + case OPAL_PERSIST: + v->type = PMIX_PERSIST; + v->data.persist = (pmix_persistence_t)kv->data.uint8; + break; + case OPAL_SCOPE: + v->type = PMIX_SCOPE; + v->data.scope = (pmix_scope_t)kv->data.uint8; + break; + case OPAL_DATA_RANGE: + v->type = PMIX_DATA_RANGE; + v->data.range = (pmix_data_range_t)kv->data.uint8; + break; + case OPAL_PROC_STATE: + v->type = PMIX_PROC_STATE; + /* the OPAL layer doesn't have any concept of proc state, + * so the ORTE layer is responsible for converting it */ + memcpy(&v->data.state, &kv->data.uint8, sizeof(uint8_t)); + break; + case OPAL_PTR: + v->type = PMIX_POINTER; + v->data.ptr = kv->data.ptr; + break; + case OPAL_LIST: + list = (opal_list_t*)kv->data.ptr; + v->type = PMIX_DATA_ARRAY; + v->data.darray = (pmix_data_array_t*)malloc(sizeof(pmix_data_array_t)); + v->data.darray->type = PMIX_INFO; + v->data.darray->size = (NULL == list)?0:opal_list_get_size(list); + if (0 < v->data.darray->size) { + PMIX_INFO_CREATE(info, v->data.darray->size); + v->data.darray->array = info; + n=0; + OPAL_LIST_FOREACH(val, list, opal_value_t) { + if (NULL != val->key) { + (void)strncpy(info[n].key, val->key, PMIX_MAX_KEYLEN); + } + opal_pmix_value_load(&info[n].value, val); + ++n; } - break; - default: - opal_output(0, "UNSUPPORTED TYPE %d", stored_type); - return OPAL_ERROR; + } else { + v->data.darray->array = NULL; + } + break; + case OPAL_PROC_INFO: + v->type = PMIX_PROC_INFO; + PMIX_PROC_INFO_CREATE(v->data.pinfo, 1); + OPAL_PMIX_CONVERT_JOBID(v->data.pinfo->proc.nspace, kv->data.pinfo.name.jobid); + OPAL_PMIX_CONVERT_VPID(v->data.pinfo->proc.rank, kv->data.pinfo.name.vpid); + if (NULL != kv->data.pinfo.hostname) { + v->data.pinfo->hostname = strdup(kv->data.pinfo.hostname); + } + if (NULL != kv->data.pinfo.executable_name) { + v->data.pinfo->executable_name = strdup(kv->data.pinfo.executable_name); + } + v->data.pinfo->pid = kv->data.pinfo.pid; + v->data.pinfo->exit_code = kv->data.pinfo.exit_code; + v->data.pinfo->state = opal_pmix_convert_state(kv->data.pinfo.state); + break; + case OPAL_ENVAR: + v->type = PMIX_ENVAR; + PMIX_ENVAR_CONSTRUCT(&v->data.envar); + if (NULL != kv->data.envar.envar) { + v->data.envar.envar = strdup(kv->data.envar.envar); + } + if (NULL != kv->data.envar.value) { + v->data.envar.value = strdup(kv->data.envar.value); + } + v->data.envar.separator = kv->data.envar.separator; + break; + default: + /* silence warnings */ + break; + } +} + +int opal_pmix_value_unload(opal_value_t *kv, + const pmix_value_t *v) +{ + int rc=OPAL_SUCCESS; + opal_list_t *lt; + opal_value_t *ival; + size_t n; + + switch(v->type) { + case PMIX_UNDEF: + kv->type = OPAL_UNDEF; + break; + case PMIX_BOOL: + kv->type = OPAL_BOOL; + memcpy(&kv->data.flag, &(v->data.flag), 1); + break; + case PMIX_BYTE: + kv->type = OPAL_BYTE; + memcpy(&kv->data.byte, &(v->data.byte), 1); + break; + case PMIX_STRING: + kv->type = OPAL_STRING; + if (NULL != v->data.string) { + kv->data.string = strdup(v->data.string); } - /* store data in local hash table */ - if (OPAL_SUCCESS != (rc = opal_pmix_base_store(id, kv))) { - OPAL_ERROR_LOG(rc); + break; + case PMIX_SIZE: + kv->type = OPAL_SIZE; + memcpy(&kv->data.size, &(v->data.size), sizeof(size_t)); + break; + case PMIX_PID: + kv->type = OPAL_PID; + memcpy(&kv->data.pid, &(v->data.pid), sizeof(pid_t)); + break; + case PMIX_INT: + kv->type = OPAL_INT; + memcpy(&kv->data.integer, &(v->data.integer), sizeof(int)); + break; + case PMIX_INT8: + kv->type = OPAL_INT8; + memcpy(&kv->data.int8, &(v->data.int8), 1); + break; + case PMIX_INT16: + kv->type = OPAL_INT16; + memcpy(&kv->data.int16, &(v->data.int16), 2); + break; + case PMIX_INT32: + kv->type = OPAL_INT32; + memcpy(&kv->data.int32, &(v->data.int32), 4); + break; + case PMIX_INT64: + kv->type = OPAL_INT64; + memcpy(&kv->data.int64, &(v->data.int64), 8); + break; + case PMIX_UINT: + kv->type = OPAL_UINT; + memcpy(&kv->data.uint, &(v->data.uint), sizeof(int)); + break; + case PMIX_UINT8: + kv->type = OPAL_UINT8; + memcpy(&kv->data.uint8, &(v->data.uint8), 1); + break; + case PMIX_UINT16: + kv->type = OPAL_UINT16; + memcpy(&kv->data.uint16, &(v->data.uint16), 2); + break; + case PMIX_UINT32: + kv->type = OPAL_UINT32; + memcpy(&kv->data.uint32, &(v->data.uint32), 4); + break; + case PMIX_UINT64: + kv->type = OPAL_UINT64; + memcpy(&kv->data.uint64, &(v->data.uint64), 8); + break; + case PMIX_FLOAT: + kv->type = OPAL_FLOAT; + memcpy(&kv->data.fval, &(v->data.fval), sizeof(float)); + break; + case PMIX_DOUBLE: + kv->type = OPAL_DOUBLE; + memcpy(&kv->data.dval, &(v->data.dval), sizeof(double)); + break; + case PMIX_TIMEVAL: + kv->type = OPAL_TIMEVAL; + memcpy(&kv->data.tv, &(v->data.tv), sizeof(struct timeval)); + break; + case PMIX_TIME: + kv->type = OPAL_TIME; + memcpy(&kv->data.time, &(v->data.time), sizeof(time_t)); + break; + case PMIX_STATUS: + kv->type = OPAL_STATUS; + kv->data.status = opal_pmix_convert_status(v->data.status); + break; + case PMIX_PROC_RANK: + kv->type = OPAL_VPID; + OPAL_PMIX_CONVERT_RANK(kv->data.name.vpid, v->data.rank); + break; + case PMIX_PROC: + kv->type = OPAL_NAME; + OPAL_PMIX_CONVERT_NSPACE(rc, &kv->data.name.jobid, v->data.proc->nspace); + OPAL_PMIX_CONVERT_RANK(kv->data.name.vpid, v->data.proc->rank); + break; + case PMIX_BYTE_OBJECT: + kv->type = OPAL_BYTE_OBJECT; + if (NULL != v->data.bo.bytes && 0 < v->data.bo.size) { + kv->data.bo.bytes = (uint8_t*)malloc(v->data.bo.size); + memcpy(kv->data.bo.bytes, v->data.bo.bytes, v->data.bo.size); + kv->data.bo.size = (int)v->data.bo.size; + } else { + kv->data.bo.bytes = NULL; + kv->data.bo.size = 0; } - /* keep going and cache everything locally */ - offset = (size_t) (tmp3 - tmp_val) + size; - if (0 == strcmp(kv->key, key)) { - /* create the copy */ - if (OPAL_SUCCESS != (rc = opal_dss.copy((void**)&knew, kv, OPAL_VALUE))) { - OPAL_ERROR_LOG(rc); - } else { - *out_kv = knew; + break; + case PMIX_PERSIST: + kv->type = OPAL_PERSIST; + kv->data.uint8 = v->data.persist; + break; + case PMIX_SCOPE: + kv->type = OPAL_SCOPE; + kv->data.uint8 = v->data.scope; + break; + case PMIX_DATA_RANGE: + kv->type = OPAL_DATA_RANGE; + kv->data.uint8 = v->data.range; + break; + case PMIX_PROC_STATE: + kv->type = OPAL_PROC_STATE; + kv->data.integer = opal_pmix_convert_pstate(v->data.state); + break; + case PMIX_POINTER: + kv->type = OPAL_PTR; + kv->data.ptr = v->data.ptr; + break; + case PMIX_DATA_ARRAY: + if (NULL == v->data.darray || NULL == v->data.darray->array) { + kv->data.ptr = NULL; + break; + } + lt = OBJ_NEW(opal_list_t); + kv->type = OPAL_PTR; + kv->data.ptr = (void*)lt; + for (n=0; n < v->data.darray->size; n++) { + ival = OBJ_NEW(opal_value_t); + opal_list_append(lt, &ival->super); + /* handle the various types */ + if (PMIX_INFO == v->data.darray->type) { + pmix_info_t *iptr = (pmix_info_t*)v->data.darray->array; + if (0 < strlen(iptr[n].key)) { + ival->key = strdup(iptr[n].key); + } + rc = opal_pmix_value_unload(ival, &iptr[n].value); + if (OPAL_SUCCESS != rc) { + OPAL_LIST_RELEASE(lt); + kv->type = OPAL_UNDEF; + kv->data.ptr = NULL; + break; + } } } - } - free (tmp_val); - /* if there was no issue with unpacking the message, but - * we didn't find the requested info, then indicate that - * the info wasn't found */ - if (OPAL_SUCCESS == rc && NULL == *out_kv) { - return OPAL_ERR_NOT_FOUND; + break; + case PMIX_PROC_INFO: + kv->type = OPAL_PROC_INFO; + if (NULL == v->data.pinfo) { + rc = OPAL_ERR_BAD_PARAM; + break; + } + OPAL_PMIX_CONVERT_NSPACE(rc, &kv->data.pinfo.name.jobid, v->data.pinfo->proc.nspace); + OPAL_PMIX_CONVERT_RANK(kv->data.pinfo.name.vpid, v->data.pinfo->proc.rank); + if (NULL != v->data.pinfo->hostname) { + kv->data.pinfo.hostname = strdup(v->data.pinfo->hostname); + } + if (NULL != v->data.pinfo->executable_name) { + kv->data.pinfo.executable_name = strdup(v->data.pinfo->executable_name); + } + kv->data.pinfo.pid = v->data.pinfo->pid; + kv->data.pinfo.exit_code = v->data.pinfo->exit_code; + kv->data.pinfo.state = opal_pmix_convert_pstate(v->data.pinfo->state); + break; + case PMIX_ENVAR: + kv->type = OPAL_ENVAR; + OBJ_CONSTRUCT(&kv->data.envar, opal_envar_t); + if (NULL != v->data.envar.envar) { + kv->data.envar.envar = strdup(v->data.envar.envar); + } + if (NULL != v->data.envar.value) { + kv->data.envar.value = strdup(v->data.envar.value); + } + kv->data.envar.separator = v->data.envar.separator; + break; + default: + /* silence warnings */ + rc = OPAL_ERROR; + break; } return rc; } -static char* setup_key(const opal_process_name_t* name, const char *key, int pmix_keylen_max) +static void cleanup_cbfunc(pmix_status_t status, + pmix_info_t *info, size_t ninfo, + void *cbdata, + pmix_release_cbfunc_t release_fn, + void *release_cbdata) { - char *pmi_kvs_key; - - if (pmix_keylen_max <= asprintf(&pmi_kvs_key, "%" PRIu32 "-%" PRIu32 "-%s", - name->jobid, name->vpid, key)) { - free(pmi_kvs_key); - return NULL; - } + opal_pmix_lock_t *lk = (opal_pmix_lock_t*)cbdata; - return pmi_kvs_key; -} - -/* base64 encoding with illegal (to Cray PMI) characters removed ('=' is replaced by ' ') */ -static inline unsigned char pmi_base64_encsym (unsigned char value) { - assert (value < 64); + OPAL_POST_OBJECT(lk); - if (value < 26) { - return 'A' + value; - } else if (value < 52) { - return 'a' + (value - 26); - } else if (value < 62) { - return '0' + (value - 52); + /* let the library release the data and cleanup from + * the operation */ + if (NULL != release_fn) { + release_fn(release_cbdata); } - return (62 == value) ? '+' : '/'; + /* release the block */ + lk->status = status; + OPAL_PMIX_WAKEUP_THREAD(lk); } -static inline unsigned char pmi_base64_decsym (unsigned char value) { - if ('+' == value) { - return 62; - } else if ('/' == value) { - return 63; - } else if (' ' == value) { - return 64; - } else if (value <= '9') { - return (value - '0') + 52; - } else if (value <= 'Z') { - return (value - 'A'); - } else if (value <= 'z') { - return (value - 'a') + 26; +int opal_pmix_register_cleanup(char *path, bool directory, bool ignore, bool jobscope) +{ + opal_pmix_lock_t lk; + pmix_info_t pinfo[3]; + size_t n, ninfo=0; + pmix_status_t rc, ret; + pmix_proc_t proc; + + OPAL_PMIX_CONSTRUCT_LOCK(&lk); + + if (ignore) { + /* they want this path ignored */ + PMIX_INFO_LOAD(&pinfo[ninfo], PMIX_CLEANUP_IGNORE, path, PMIX_STRING); + ++ninfo; + } else { + if (directory) { + PMIX_INFO_LOAD(&pinfo[ninfo], PMIX_REGISTER_CLEANUP_DIR, path, PMIX_STRING); + ++ninfo; + /* recursively cleanup directories */ + PMIX_INFO_LOAD(&pinfo[ninfo], PMIX_CLEANUP_RECURSIVE, NULL, PMIX_BOOL); + ++ninfo; + } else { + /* order cleanup of the provided path */ + PMIX_INFO_LOAD(&pinfo[ninfo], PMIX_REGISTER_CLEANUP, path, PMIX_STRING); + ++ninfo; + } } - return 64; -} - -static inline void pmi_base64_encode_block (const unsigned char in[3], char out[4], int len) { - out[0] = pmi_base64_encsym (in[0] >> 2); - out[1] = pmi_base64_encsym (((in[0] & 0x03) << 4) | ((in[1] & 0xf0) >> 4)); - /* Cray PMI doesn't allow = in PMI attributes so pad with spaces */ - out[2] = 1 < len ? pmi_base64_encsym(((in[1] & 0x0f) << 2) | ((in[2] & 0xc0) >> 6)) : ' '; - out[3] = 2 < len ? pmi_base64_encsym(in[2] & 0x3f) : ' '; -} - -static inline int pmi_base64_decode_block (const char in[4], unsigned char out[3]) { - char in_dec[4]; - in_dec[0] = pmi_base64_decsym (in[0]); - in_dec[1] = pmi_base64_decsym (in[1]); - in_dec[2] = pmi_base64_decsym (in[2]); - in_dec[3] = pmi_base64_decsym (in[3]); - - out[0] = in_dec[0] << 2 | in_dec[1] >> 4; - if (64 == in_dec[2]) { - return 1; + /* if they want this applied to the job, then indicate so */ + if (jobscope) { + rc = PMIx_Job_control_nb(NULL, 0, pinfo, ninfo, cleanup_cbfunc, (void*)&lk); + } else { + /* only applies to us */ + (void)snprintf(proc.nspace, PMIX_MAX_NSLEN, "%s", + OPAL_JOBID_PRINT(OPAL_PROC_MY_NAME.jobid)); + proc.rank = OPAL_PROC_MY_NAME.vpid; + rc = PMIx_Job_control_nb(&proc, 1, pinfo, ninfo, cleanup_cbfunc, (void*)&lk); + } + if (PMIX_SUCCESS != rc) { + ret = rc; + } else { +#if PMIX_VERSION_MAJOR == 3 && PMIX_VERSION_MINOR == 0 && PMIX_VERSION_RELEASE < 3 + /* There is a bug in PMIx 3.0.0 up to 3.0.2 that causes the callback never + * being called, so assumes the everything went well and avoid a deadlock. */ + cleanup_cbfunc(PMIX_SUCCESS, NULL, 0, (void *)&lk, NULL, NULL); +#endif + OPAL_PMIX_WAIT_THREAD(&lk); + ret = lk.status; } - - out[1] = in_dec[1] << 4 | in_dec[2] >> 2; - if (64 == in_dec[3]) { - return 2; + OPAL_PMIX_DESTRUCT_LOCK(&lk); + for (n=0; n < ninfo; n++) { + PMIX_INFO_DESTRUCT(&pinfo[n]); } - - out[2] = ((in_dec[2] << 6) & 0xc0) | in_dec[3]; - return 3; + return ret; } -/* PMI only supports strings. For now, do a simple base64. */ -static char *pmi_encode(const void *val, size_t vallen) +/* CLASS INSTANTIATIONS */ +static void dsicon(opal_ds_info_t *p) { - char *outdata, *tmp; - size_t i; - - outdata = calloc (((2 + vallen) * 4) / 3 + 2, 1); - if (NULL == outdata) { - return NULL; - } - - for (i = 0, tmp = outdata ; i < vallen ; i += 3, tmp += 4) { - pmi_base64_encode_block((unsigned char *) val + i, tmp, vallen - i); - } - - tmp[0] = (unsigned char)'\0'; - - return outdata; + PMIX_PROC_CONSTRUCT(&p->source); + p->info = NULL; + p->persistence = PMIX_PERSIST_INVALID; } +OBJ_CLASS_INSTANCE(opal_ds_info_t, + opal_list_item_t, + dsicon, NULL); -static uint8_t *pmi_decode (const char *data, size_t *retlen) +static void infoitmcon(opal_info_item_t *p) { - size_t input_len = strlen (data) / 4; - unsigned char *ret; - int out_len; - size_t i; - - /* default */ - *retlen = 0; - - ret = calloc (1, 3 * input_len); - if (NULL == ret) { - return ret; - } - for (i = 0, out_len = 0 ; i < input_len ; i++, data += 4) { - out_len += pmi_base64_decode_block(data, ret + 3 * i); - } - *retlen = out_len; - return ret; + PMIX_INFO_CONSTRUCT(&p->info); +} +static void infoitdecon(opal_info_item_t *p) +{ + PMIX_INFO_DESTRUCT(&p->info); } +OBJ_CLASS_INSTANCE(opal_info_item_t, + opal_list_item_t, + infoitmcon, infoitdecon); diff --git a/opal/mca/pmix/base/pmix_base_fns.h b/opal/mca/pmix/base/pmix_base_fns.h deleted file mode 100644 index e46bee0e3df..00000000000 --- a/opal/mca/pmix/base/pmix_base_fns.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) 2014 Intel, Inc. All rights reserved. - * Copyright (c) 2014 Research Organization for Information Science - * and Technology (RIST). All rights reserved. - * $COPYRIGHT$ - * - * Additional copyrights may follow - * - * $HEADER$ - */ - -#ifndef MCA_PMIX_BASE_FNS_H -#define MCA_PMIX_BASE_FNS_H - -#include "opal_config.h" -#include "opal/util/error.h" -#include "opal/dss/dss_types.h" - - -BEGIN_C_DECLS - -typedef int (*kvs_put_fn)(const char key[], const char value[]); -typedef int (*kvs_get_fn)(const char key[], char value [], int maxvalue); - -OPAL_DECLSPEC int opal_pmix_base_store_encoded(const char *key, const void *data, - opal_data_type_t type, char** buffer, int* length); -OPAL_DECLSPEC int opal_pmix_base_commit_packed(char** data, int* data_offset, - char** enc_data, int* enc_data_offset, - int max_key, int* pack_key, kvs_put_fn fn); -OPAL_DECLSPEC int opal_pmix_base_partial_commit_packed(char** data, int* data_offset, - char** enc_data, int* enc_data_offset, - int max_key, int* pack_key, kvs_put_fn fn); -OPAL_DECLSPEC int opal_pmix_base_cache_keys_locally(const opal_process_name_t* id, const char* key, - opal_value_t **out_kv, char* kvs_name, int vallen, kvs_get_fn fn); -OPAL_DECLSPEC int opal_pmix_base_get_packed(const opal_process_name_t* proc, char **packed_data, - size_t *len, int vallen, kvs_get_fn fn); - -END_C_DECLS - -#endif diff --git a/opal/mca/pmix/base/pmix_base_frame.c b/opal/mca/pmix/base/pmix_base_frame.c index e06d18c0e36..eacb1e48c3a 100644 --- a/opal/mca/pmix/base/pmix_base_frame.c +++ b/opal/mca/pmix/base/pmix_base_frame.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2017 Intel, Inc. All rights reserved. + * Copyright (c) 2014-2019 Intel, Inc. All rights reserved. * Copyright (c) 2015-2016 Cisco Systems, Inc. All rights reserved. * $COPYRIGHT$ * @@ -18,7 +18,7 @@ #include "opal/util/output.h" #include "opal/mca/base/base.h" -#include "opal/mca/pmix/pmix.h" +#include "opal/mca/pmix/pmix-internal.h" #include "opal/mca/pmix/base/base.h" @@ -30,9 +30,6 @@ #include "opal/mca/pmix/base/static-components.h" -/* Note that this initializer is important -- do not remove it! See - https://github.com/open-mpi/ompi/issues/375 for details. */ -opal_pmix_base_module_t opal_pmix = { 0 }; bool opal_pmix_collect_all_data = true; int opal_pmix_verbose_output = -1; bool opal_pmix_base_async_modex = false; @@ -71,8 +68,6 @@ static int opal_pmix_base_frame_close(void) int rc; rc = mca_base_framework_components_close(&opal_pmix_base_framework, NULL); - /* reset the opal_pmix function pointers to NULL */ - memset(&opal_pmix, 0, sizeof(opal_pmix)); return rc; } @@ -82,8 +77,6 @@ static int opal_pmix_base_frame_open(mca_base_open_flag_t flags) /* Open up all available components */ rc = mca_base_framework_components_open(&opal_pmix_base_framework, flags); - /* ensure the function pointers are NULL */ - memset(&opal_pmix, 0, sizeof(opal_pmix)); /* default to the OPAL event base */ opal_pmix_base.evbase = opal_sync_event_base; /* pass across the verbosity */ @@ -96,80 +89,3 @@ MCA_BASE_FRAMEWORK_DECLARE(opal, pmix, "OPAL PMI Client Framework", opal_pmix_base_frame_open, opal_pmix_base_frame_close, mca_pmix_base_static_components, 0); - -/**** PMIX FRAMEWORK OBJECTS ****/ -static void lkcon(opal_pmix_pdata_t *p) -{ - p->proc.jobid = OPAL_JOBID_INVALID; - p->proc.vpid = OPAL_VPID_INVALID; - OBJ_CONSTRUCT(&p->value, opal_value_t); -} -static void lkdes(opal_pmix_pdata_t *p) -{ - OBJ_DESTRUCT(&p->value); -} -OBJ_CLASS_INSTANCE(opal_pmix_pdata_t, - opal_list_item_t, - lkcon, lkdes); - -static void mdcon(opal_pmix_modex_data_t *p) -{ - p->proc.jobid = OPAL_JOBID_INVALID; - p->proc.vpid = OPAL_VPID_INVALID; - p->blob = NULL; - p->size = 0; -} -static void mddes(opal_pmix_modex_data_t *p) -{ - if (NULL != p->blob) { - free(p->blob); - } -} -OBJ_CLASS_INSTANCE(opal_pmix_modex_data_t, - opal_list_item_t, - mdcon, mddes); - -static void apcon(opal_pmix_app_t *p) -{ - p->cmd = NULL; - p->argv = NULL; - p->env = NULL; - p->cwd = NULL; - p->maxprocs = 0; - OBJ_CONSTRUCT(&p->info, opal_list_t); -} -static void apdes(opal_pmix_app_t *p) -{ - if (NULL != p->cmd) { - free(p->cmd); - } - if (NULL != p->argv) { - opal_argv_free(p->argv); - } - if (NULL != p->env) { - opal_argv_free(p->env); - } - if (NULL != p->cwd) { - free(p->cwd); - } - OPAL_LIST_DESTRUCT(&p->info); -} -OBJ_CLASS_INSTANCE(opal_pmix_app_t, - opal_list_item_t, - apcon, apdes); - -static void qcon(opal_pmix_query_t *p) -{ - p->keys = NULL; - OBJ_CONSTRUCT(&p->qualifiers, opal_list_t); -} -static void qdes(opal_pmix_query_t *p) -{ - if (NULL != p->keys) { - opal_argv_free(p->keys); - } - OPAL_LIST_DESTRUCT(&p->qualifiers); -} -OBJ_CLASS_INSTANCE(opal_pmix_query_t, - opal_list_item_t, - qcon, qdes); diff --git a/opal/mca/pmix/base/pmix_base_hash.c b/opal/mca/pmix/base/pmix_base_hash.c deleted file mode 100644 index 41530ca1ce9..00000000000 --- a/opal/mca/pmix/base/pmix_base_hash.c +++ /dev/null @@ -1,298 +0,0 @@ -/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ -/* - * Copyright (c) 2010-2016 Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2004-2011 The University of Tennessee and The University - * of Tennessee Research Foundation. All rights - * reserved. - * Copyright (c) 2011-2014 Los Alamos National Security, LLC. All rights - * reserved. - * Copyright (c) 2014-2015 Intel, Inc. All rights reserved. - * Copyright (c) 2014 Research Organization for Information Science - * and Technology (RIST). All rights reserved. - * $COPYRIGHT$ - * - * Additional copyrights may follow - * - * $HEADER$ - * - */ - -#include "opal_config.h" -#include "opal/constants.h" - -#include -#include - -#include "opal_stdint.h" -#include "opal/class/opal_hash_table.h" -#include "opal/class/opal_pointer_array.h" -#include "opal/dss/dss_types.h" -#include "opal/util/error.h" -#include "opal/util/output.h" -#include "opal/util/proc.h" -#include "opal/util/show_help.h" - -#include "opal/mca/pmix/base/base.h" -#include "opal/mca/pmix/base/pmix_base_hash.h" - -/** - * Data for a particular opal process - * The name association is maintained in the - * proc_data hash table. - */ -typedef struct { - /** Structure can be put on lists (including in hash tables) */ - opal_list_item_t super; - bool loaded; - /* List of opal_value_t structures containing all data - received from this process, sorted by key. */ - opal_list_t data; -} opal_pmix_proc_data_t; -static void proc_data_construct(opal_pmix_proc_data_t *ptr) -{ - ptr->loaded = false; - OBJ_CONSTRUCT(&ptr->data, opal_list_t); -} - -static void proc_data_destruct(opal_pmix_proc_data_t *ptr) -{ - OPAL_LIST_DESTRUCT(&ptr->data); -} -OBJ_CLASS_INSTANCE(opal_pmix_proc_data_t, - opal_list_item_t, - proc_data_construct, - proc_data_destruct); - -/** - * Find data for a given key in a given proc_data_t - * container. - */ -static opal_value_t* lookup_keyval(opal_pmix_proc_data_t *proc_data, - const char *key) -{ - opal_value_t *kv; - - OPAL_LIST_FOREACH(kv, &proc_data->data, opal_value_t) { - if (0 == strcmp(key, kv->key)) { - return kv; - } - } - return NULL; -} - -/** - * Find proc_data_t container associated with given - * opal_process_name_t. - */ -static opal_pmix_proc_data_t* lookup_proc(opal_proc_table_t *ptable, - opal_process_name_t id, bool create) -{ - opal_pmix_proc_data_t *proc_data = NULL; - - opal_proc_table_get_value(ptable, id, (void**)&proc_data); - if (NULL == proc_data && create) { - proc_data = OBJ_NEW(opal_pmix_proc_data_t); - if (NULL == proc_data) { - opal_output(0, "pmix:hash:lookup_proc: unable to allocate proc_data_t\n"); - return NULL; - } - opal_proc_table_set_value(ptable, id, proc_data); - } - - return proc_data; -} - - -static opal_proc_table_t ptable; - -/* Initialize our hash table */ -void opal_pmix_base_hash_init(void) -{ - OBJ_CONSTRUCT(&ptable, opal_proc_table_t); - opal_proc_table_init(&ptable, 16, 256); -} - -void opal_pmix_base_hash_finalize(void) -{ - opal_pmix_proc_data_t *proc_data; - opal_process_name_t key; - void *node1, *node2; - - /* to assist in getting a clean valgrind, cycle thru the hash table - * and release all data stored in it - */ - if (OPAL_SUCCESS == opal_proc_table_get_first_key(&ptable, &key, - (void**)&proc_data, - &node1, &node2)) { - if (NULL != proc_data) { - OBJ_RELEASE(proc_data); - } - while (OPAL_SUCCESS == opal_proc_table_get_next_key(&ptable, &key, - (void**)&proc_data, - node1, &node1, - node2, &node2)) { - if (NULL != proc_data) { - OBJ_RELEASE(proc_data); - } - } - } - OBJ_DESTRUCT(&ptable); -} - - - -int opal_pmix_base_store(const opal_process_name_t *id, - opal_value_t *val) -{ - opal_pmix_proc_data_t *proc_data; - opal_value_t *kv; - int rc; - - opal_output_verbose(1, opal_pmix_base_framework.framework_output, - "%s pmix:hash:store storing data for proc %s", - OPAL_NAME_PRINT(OPAL_PROC_MY_NAME), OPAL_NAME_PRINT(*id)); - - /* lookup the proc data object for this proc */ - if (NULL == (proc_data = lookup_proc(&ptable, *id, true))) { - /* unrecoverable error */ - OPAL_OUTPUT_VERBOSE((5, opal_pmix_base_framework.framework_output, - "%s pmix:hash:store: storing data for proc %s unrecoverably failed", - OPAL_NAME_PRINT(OPAL_PROC_MY_NAME), OPAL_NAME_PRINT(*id))); - return OPAL_ERR_OUT_OF_RESOURCE; - } - - /* see if we already have this key in the data - means we are updating - * a pre-existing value - */ - kv = lookup_keyval(proc_data, val->key); -#if OPAL_ENABLE_DEBUG - char *_data_type = opal_dss.lookup_data_type(val->type); - OPAL_OUTPUT_VERBOSE((5, opal_pmix_base_framework.framework_output, - "%s pmix:hash:store: %s key %s[%s] for proc %s", - OPAL_NAME_PRINT(OPAL_PROC_MY_NAME), - (NULL == kv ? "storing" : "updating"), - val->key, _data_type, OPAL_NAME_PRINT(*id))); - free (_data_type); -#endif - - if (NULL != kv) { - opal_list_remove_item(&proc_data->data, &kv->super); - OBJ_RELEASE(kv); - } - /* create the copy */ - if (OPAL_SUCCESS != (rc = opal_dss.copy((void**)&kv, val, OPAL_VALUE))) { - OPAL_ERROR_LOG(rc); - return rc; - } - opal_list_append(&proc_data->data, &kv->super); - - return OPAL_SUCCESS; -} - -int opal_pmix_base_fetch(const opal_process_name_t *id, - const char *key, opal_list_t *kvs) -{ - opal_pmix_proc_data_t *proc_data; - opal_value_t *kv, *knew; - int rc; - - OPAL_OUTPUT_VERBOSE((5, opal_pmix_base_framework.framework_output, - "%s pmix:hash:fetch: searching for key %s on proc %s", - OPAL_NAME_PRINT(OPAL_PROC_MY_NAME), - (NULL == key) ? "NULL" : key, OPAL_NAME_PRINT(*id))); - - /* lookup the proc data object for this proc */ - if (NULL == (proc_data = lookup_proc(&ptable, *id, true))) { - OPAL_OUTPUT_VERBOSE((5, opal_pmix_base_framework.framework_output, - "%s pmix_hash:fetch data for proc %s not found", - OPAL_NAME_PRINT(OPAL_PROC_MY_NAME), - OPAL_NAME_PRINT(*id))); - return OPAL_ERR_NOT_FOUND; - } - - /* if the key is NULL, that we want everything */ - if (NULL == key) { - /* must provide an output list or this makes no sense */ - if (NULL == kvs) { - OPAL_ERROR_LOG(OPAL_ERR_BAD_PARAM); - return OPAL_ERR_BAD_PARAM; - } - OPAL_LIST_FOREACH(kv, &proc_data->data, opal_value_t) { - /* copy the value */ - if (OPAL_SUCCESS != (rc = opal_dss.copy((void**)&knew, kv, OPAL_VALUE))) { - OPAL_ERROR_LOG(rc); - return rc; - } - OPAL_OUTPUT_VERBOSE((5, opal_pmix_base_framework.framework_output, - "%s pmix:hash:fetch: adding data for key %s on proc %s", - OPAL_NAME_PRINT(OPAL_PROC_MY_NAME), - (NULL == kv->key) ? "NULL" : kv->key, - OPAL_NAME_PRINT(*id))); - - /* add it to the output list */ - opal_list_append(kvs, &knew->super); - } - return OPAL_SUCCESS; - } - - /* find the value */ - if (NULL == (kv = lookup_keyval(proc_data, key))) { - OPAL_OUTPUT_VERBOSE((5, opal_pmix_base_framework.framework_output, - "%s pmix_hash:fetch key %s for proc %s not found", - OPAL_NAME_PRINT(OPAL_PROC_MY_NAME), - (NULL == key) ? "NULL" : key, - OPAL_NAME_PRINT(*id))); - return OPAL_ERR_NOT_FOUND; - } - - /* if the user provided a NULL list object, then they - * just wanted to know if the key was present */ - if (NULL == kvs) { - return OPAL_SUCCESS; - } - - /* create the copy */ - if (OPAL_SUCCESS != (rc = opal_dss.copy((void**)&knew, kv, OPAL_VALUE))) { - OPAL_ERROR_LOG(rc); - return rc; - } - /* add it to the output list */ - opal_list_append(kvs, &knew->super); - - return OPAL_SUCCESS; -} - -int opal_pmix_base_remove(const opal_process_name_t *id, const char *key) -{ - opal_pmix_proc_data_t *proc_data; - opal_value_t *kv; - - /* lookup the specified proc */ - if (NULL == (proc_data = lookup_proc(&ptable, *id, false))) { - /* no data for this proc */ - return OPAL_SUCCESS; - } - - /* if key is NULL, remove all data for this proc */ - if (NULL == key) { - while (NULL != (kv = (opal_value_t *) opal_list_remove_first(&proc_data->data))) { - OBJ_RELEASE(kv); - } - /* remove the proc_data object itself from the jtable */ - opal_proc_table_remove_value(&ptable, *id); - /* cleanup */ - OBJ_RELEASE(proc_data); - return OPAL_SUCCESS; - } - - /* remove this item */ - OPAL_LIST_FOREACH(kv, &proc_data->data, opal_value_t) { - if (0 == strcmp(key, kv->key)) { - opal_list_remove_item(&proc_data->data, &kv->super); - OBJ_RELEASE(kv); - break; - } - } - - return OPAL_SUCCESS; -} diff --git a/opal/mca/pmix/base/pmix_base_hash.h b/opal/mca/pmix/base/pmix_base_hash.h deleted file mode 100644 index 5ab3e0ffa00..00000000000 --- a/opal/mca/pmix/base/pmix_base_hash.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2010 Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2012 Los Alamos National Security, Inc. All rights reserved. - * Copyright (c) 2014-2015 Intel, Inc. All rights reserved. - * Copyright (c) 2014 Research Organization for Information Science - * and Technology (RIST). All rights reserved. - * $COPYRIGHT$ - * - * Additional copyrights may follow - * - * $HEADER$ - */ - -#ifndef OPAL_PMIX_HASH_H -#define OPAL_PMIX_HASH_H - -#include "opal/class/opal_list.h" -#include "opal/class/opal_hash_table.h" -#include "opal/dss/dss.h" -#include "opal/util/proc.h" - -BEGIN_C_DECLS - -OPAL_DECLSPEC void opal_pmix_base_hash_init(void); -OPAL_DECLSPEC void opal_pmix_base_hash_finalize(void); - -OPAL_DECLSPEC int opal_pmix_base_store(const opal_process_name_t *id, - opal_value_t *val); - -OPAL_DECLSPEC int opal_pmix_base_fetch(const opal_process_name_t *id, - const char *key, opal_list_t *kvs); - -OPAL_DECLSPEC int opal_pmix_base_remove(const opal_process_name_t *id, const char *key); - -END_C_DECLS - -#endif /* OPAL_DSTORE_HASH_H */ diff --git a/opal/mca/pmix/base/pmix_base_select.c b/opal/mca/pmix/base/pmix_base_select.c deleted file mode 100644 index 53891f45c49..00000000000 --- a/opal/mca/pmix/base/pmix_base_select.c +++ /dev/null @@ -1,61 +0,0 @@ -/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ -/* - * Copyright (c) 2014-2015 Intel, Inc. All rights reserved. - * Copyright (c) 2015 Los Alamos National Security, LLC. All rights - * reserved. - * Copyright (c) 2016-2018 Cisco Systems, 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 "opal_config.h" - -#include "opal/constants.h" -#include "opal/mca/mca.h" -#include "opal/mca/base/base.h" -#include "opal/mca/pmix/pmix.h" -#include "opal/mca/pmix/base/base.h" -#include "opal/util/opal_environ.h" - -/* - * Globals - */ - -int opal_pmix_base_select(void) -{ - opal_pmix_base_component_t *best_component = NULL; - opal_pmix_base_module_t *best_module = NULL; - - // Set the PMIx component_show_load_errors MCA param based on the - // value of OPAL's mca_base_component_show_load_errors (i.e., the - // bool variable behind Open MPI's mca_component_show_load_errors - // MCA param). - char *pmix_show_load_errors_env = mca_base_component_show_load_errors ? "1" : "0"; - opal_setenv("PMIX_MCA_mca_base_component_show_load_errors", pmix_show_load_errors_env, true, &environ); - - /* - * Select the best component - */ - if( OPAL_SUCCESS != mca_base_select("pmix", opal_pmix_base_framework.framework_output, - &opal_pmix_base_framework.framework_components, - (mca_base_module_t **) &best_module, - (mca_base_component_t **) &best_component, NULL) ) { - /* notify caller that no available component found */ - return OPAL_ERR_NOT_FOUND; - } - - /* Save the winner */ - opal_pmix = *best_module; - - /* do not initialize the module here as the type - * of process determines which init (client or server) - * should be done */ - - return OPAL_SUCCESS; -} diff --git a/opal/mca/pmix/configure.m4 b/opal/mca/pmix/configure.m4 new file mode 100644 index 00000000000..a7f13f6158a --- /dev/null +++ b/opal/mca/pmix/configure.m4 @@ -0,0 +1,109 @@ +dnl -*- shell-script -*- +dnl +dnl Copyright (c) 2010-2017 Cisco Systems, Inc. All rights reserved +dnl Copyright (c) 2019 Intel, Inc. All rights reserved. +dnl $COPYRIGHT$ +dnl +dnl Additional copyrights may follow +dnl +dnl $HEADER$ +dnl + +# There will only be one component used in this framework, and it will +# be selected at configure time by priority. Components must set +# their priorities in their configure.m4 files. They must also set +# the shell variable $opal_pmix_base_include to a header file +# name (relative to the top OMPI source directory) that will be +# included in opal/mca/pmix/pmix-internal.h. + +dnl We only want one winning component (vs. STOP_AT_FIRST_PRIORITY, +dnl which will allow all components of the same priority who succeed to +dnl win) +m4_define(MCA_opal_pmix_CONFIGURE_MODE, STOP_AT_FIRST) + +AC_DEFUN([MCA_opal_pmix_CONFIG],[ + opal_pmix_base_include= + + # See if we want internal vs external pmix + AC_ARG_WITH(pmix, + AC_HELP_STRING([--with-pmix(=DIR)], + [Build pmix support. DIR can take one of three values: "internal", "external", or a valid directory name. "internal" (or no DIR value) forces Open MPI to use its internal copy of pmix. "external" forces Open MPI to use an external installation of pmix. Supplying a valid directory name also forces Open MPI to use an external installation of pmix, and adds DIR/include, DIR/lib, and DIR/lib64 to the search path for headers and libraries. Note that Open MPI no longer supports --without-pmix.])) + + # check for error + AS_IF([test "$with_pmix" = "no"], + [AC_MSG_WARN([Open MPI requires PMIX support. It can be built]) + AC_MSG_WARN([with either its own internal copy of PMIX, or with]) + AC_MSG_WARN([an external copy that you supply.]) + AC_MSG_ERROR([Cannot continue])]) + + # Configure all the components - always have to do this. Note that + # instead of passing in + # the traditional $1 and $2 as the first arguments, we hard-code + # "opal" and "pmix", because this macro is invoked via AC + # REQUIRE. + MCA_CONFIGURE_FRAMEWORK([opal], [pmix], 1) + + # Give a blank line to separate these messages from the last + # component's configure.m4 output. + echo " " + + # If we aren't given a specific component, then we must find one + AS_IF([test "$with_pmix" = ""], [], + [ # STOP_AT_FIRST_PRIORITY will guarantee that we find at most + # one. We need to check here that we found *at least* one. + AS_IF([test "$MCA_opal_pmix_STATIC_COMPONENTS" = ""], + [AC_MSG_WARN([Did not find a suitable static opal pmix component]) + AC_MSG_ERROR([Cannot continue])]) + ]) + + # If we have a winning component, do some more logic + AS_IF([test "$MCA_opal_pmix_STATIC_COMPONENTS" != ""], + [ # We had a winner -- w00t! + # The winning component will have told us where their header file + # is located + AC_MSG_CHECKING([for winning pmix component header file]) + AS_IF([test "$opal_pmix_base_include" = ""], + [AC_MSG_RESULT([missing]) + AC_MSG_WARN([Missing implementation header]) + AC_MSG_ERROR([Cannot continue])]) + AC_MSG_RESULT([$opal_pmix_base_include]) + AC_DEFINE_UNQUOTED([MCA_pmix_IMPLEMENTATION_HEADER], + ["$opal_pmix_base_include"], + [Header to include for pmix implementation]) + + # If we added any -L flags to ADD_LDFLAGS, then we (might) + # need to add those directories to LD_LIBRARY_PATH. + # Otherwise, if we try to AC RUN_IFELSE anything here in + # configure, it might die because it can't find the libraries + # we just linked against. + OPAL_VAR_SCOPE_PUSH([opal_pmix_base_found_l opal_pmix_base_token opal_pmix_base_tmp opal_pmix_base_dir]) + opal_pmix_base_found_l=0 + eval "opal_pmix_base_tmp=\$opal_pmix_${opal_pmix_winner}_ADD_LIBS" + for opal_pmix_base_token in $opal_pmix_base_tmp; do + case $opal_pmix_base_token in + -l*) opal_pmix_base_found_l=1 ;; + esac + done + AS_IF([test $opal_pmix_base_found_l -eq 1], + [eval "opal_pmix_base_tmp=\$opal_pmix_${opal_pmix_winner}_ADD_LDFLAGS" + for opal_pmix_base_token in $opal_pmix_base_tmp; do + case $opal_pmix_base_token in + -L*) + opal_pmix_base_dir=`echo $opal_pmix_base_token | cut -c3-` + export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$opal_pmix_base_dir + AC_MSG_WARN([Adding to LD_LIBRARY_PATH: $opal_pmix_base_dir]) + ;; + esac + done]) + OPAL_VAR_SCOPE_POP + ]) + + # Similar to above, if this m4 is being invoked "early" via AC + # REQUIRE, print out a nice banner that we have now finished + # pre-emption and are returning to the Normal Order Of Things. + AS_IF([test "$opal_pmix_its_time_to_configure" != "1"], + [echo " " + echo "<== Pre-emptive pmix framework configuration complete." + echo "<== We now return you to your regularly scheduled programming." + echo " "]); +]) diff --git a/opal/mca/pmix/cray/Makefile.am b/opal/mca/pmix/cray/Makefile.am deleted file mode 100644 index f90f144c692..00000000000 --- a/opal/mca/pmix/cray/Makefile.am +++ /dev/null @@ -1,46 +0,0 @@ -# -# Copyright (c) 2014 Intel, Inc. All rights reserved. -# Copyright (c) 2016 Los Alamos National Security, LLC. All rights -# reserved. -# Copyright (c) 2017 IBM Corporation. All rights reserved. -# $COPYRIGHT$ -# -# Additional copyrights may follow -# -# $HEADER$ -# - -dist_opaldata_DATA = help-pmix-cray.txt - -sources = \ - pmix_cray.h \ - pmix_cray_component.c \ - pmix_cray_pmap_parser.c \ - pmix_cray_pmap_parser.h \ - pmix_cray.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_opal_pmix_cray_DSO -component_noinst = -component_install = mca_pmix_cray.la -else -component_noinst = libmca_pmix_cray.la -component_install = -endif - -mcacomponentdir = $(opallibdir) -mcacomponent_LTLIBRARIES = $(component_install) -mca_pmix_cray_la_SOURCES = $(sources) -mca_pmix_cray_la_CPPFLAGS = $(pmix_cray_CPPFLAGS) $(pmix_alps_CPPFLAGS) -mca_pmix_cray_la_LDFLAGS = -module -avoid-version $(pmix_cray_LDFLAGS) $(pmix_alps_LDFLAGS) -mca_pmix_cray_la_LIBADD = $(top_builddir)/opal/lib@OPAL_LIB_PREFIX@open-pal.la \ - $(pmix_cray_LIBS) $(pmix_alps_LIBS) - -noinst_LTLIBRARIES = $(component_noinst) -libmca_pmix_cray_la_SOURCES =$(sources) -libmca_pmix_cray_la_CPPFLAGS = $(pmix_cray_CPPFLAGS) $(pmix_alps_CPPFLAGS) -libmca_pmix_cray_la_LDFLAGS = -module -avoid-version $(pmix_cray_LDFLAGS) $(pmix_alps_LDFLAGS) -libmca_pmix_cray_la_LIBADD = $(pmix_cray_LIBS) $(pmix_alps_LIBS) diff --git a/opal/mca/pmix/cray/configure.m4 b/opal/mca/pmix/cray/configure.m4 deleted file mode 100644 index 19b2d49426f..00000000000 --- a/opal/mca/pmix/cray/configure.m4 +++ /dev/null @@ -1,40 +0,0 @@ -# -*- shell-script -*- -# -# Copyright (c) 2014 Intel, Inc. All rights reserved. -# Copyright (c) 2016 Los Alamos National Security, LLC. All rights -# reserved. -# $COPYRIGHT$ -# -# Additional copyrights may follow -# -# $HEADER$ -# - -# MCA_pmix_cray_CONFIG([action-if-found], [action-if-not-found]) -# ----------------------------------------------------------- -AC_DEFUN([MCA_opal_pmix_cray_CONFIG], [ - AC_CONFIG_FILES([opal/mca/pmix/cray/Makefile]) - -# -# check specifically for Cray PMI here -# - OPAL_CHECK_CRAY_PMI([pmix_cray], [pmix_cray_good=1], [pmix_cray_good=0]) - OPAL_CHECK_ALPS([pmix_alps], [pmix_alps_happy=1], [pmix_alps_happy=0]) - - # Evaluate succeed / fail - AS_IF([test "$pmix_cray_good" = 1 && test "$pmix_alps_happy" = 1], - [$1 - # need to set the wrapper flags for static builds - pmix_cray_WRAPPER_EXTRA_LDFLAGS="$pmix_cray_LDFLAGS $pmix_alps_LDFLAGS" - pmix_cray_WRAPPER_EXTRA_LIBS="$pmix_cray_LIBS $pmix_alps_LIBS"], - [$2]) - - # set build flags to use in makefile - AC_SUBST([pmix_cray_CPPFLAGS]) - AC_SUBST([pmix_cray_LDFLAGS]) - AC_SUBST([pmix_cray_LIBS]) - AC_SUBST([pmix_alps_CPPFLAGS]) - AC_SUBST([pmix_alps_LDFLAGS]) - AC_SUBST([pmix_alps_LIBS]) - -]) diff --git a/opal/mca/pmix/cray/help-pmix-cray.txt b/opal/mca/pmix/cray/help-pmix-cray.txt deleted file mode 100644 index c433635b094..00000000000 --- a/opal/mca/pmix/cray/help-pmix-cray.txt +++ /dev/null @@ -1,17 +0,0 @@ - -*- text -*- -# -# Copyright (c) 2010 Cisco Systems, Inc. All rights reserved. -# Copyright (c) 2016 Los Alamos National Security, LLC. All rights -# reserved. -# -# $COPYRIGHT$ -# -# Additional copyrights may follow -# -# $HEADER$ -# -# This is the US/English general help file for OPAL PMIX Cray module. -# -[aprun-not-supported] -Direct launch with aprun only works when either the PMI_NO_FORK environment -variable is set, or Open MPI is built with dlopen support disabled. diff --git a/opal/mca/pmix/cray/owner.txt b/opal/mca/pmix/cray/owner.txt deleted file mode 100644 index 48ac538cbb0..00000000000 --- a/opal/mca/pmix/cray/owner.txt +++ /dev/null @@ -1,7 +0,0 @@ -# -# owner/status file -# owner: institution that is responsible for this package -# status: e.g. active, maintenance, unmaintained -# -owner: LANL -status: active diff --git a/opal/mca/pmix/cray/pmix_cray.c b/opal/mca/pmix/cray/pmix_cray.c deleted file mode 100644 index bf5ad0e0309..00000000000 --- a/opal/mca/pmix/cray/pmix_cray.c +++ /dev/null @@ -1,1065 +0,0 @@ -/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ -/* - * Copyright (c) 2007 The Trustees of Indiana University. - * All rights reserved. - * Copyright (c) 2011-2016 Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2011-2017 Los Alamos National Security, LLC. All - * rights reserved. - * Copyright (c) 2013-2017 Intel, Inc. All rights reserved. - * Copyright (c) 2014-2016 Research Organization for Information Science - * and Technology (RIST). All rights reserved. - * $COPYRIGHT$ - * - * Additional copyrights may follow - * - * $HEADER$ - */ - -#include "opal_config.h" -#include "opal/constants.h" -#include "opal/types.h" -#include "opal_stdint.h" -#include "opal/mca/hwloc/base/base.h" -#include "opal/util/argv.h" -#include "opal/util/opal_environ.h" -#include "opal/util/output.h" -#include "opal/util/proc.h" -#include "opal/util/output.h" -#include "opal/util/show_help.h" -#include "opal/util/opal_getcwd.h" -#include "opal/constants.h" -#include "opal/mca/pmix/base/base.h" -#include "opal/mca/pmix/base/pmix_base_hash.h" -#include "pmix_cray.h" - -static char cray_pmi_version[128]; - -static int cray_init(opal_list_t *ilist); -static int cray_fini(void); -static int cray_initialized(void); -static int cray_abort(int flat, const char *msg, - opal_list_t *procs); -static int cray_spawn(opal_list_t *jobinfo, opal_list_t *apps, opal_jobid_t *jobid); -static int cray_spawn_nb(opal_list_t *jobinfo, opal_list_t *apps, - opal_pmix_spawn_cbfunc_t cbfunc, - void *cbdata); -static int cray_job_connect(opal_list_t *procs); -static int cray_job_disconnect(opal_list_t *procs); -static int cray_job_disconnect_nb(opal_list_t *procs, - opal_pmix_op_cbfunc_t cbfunc, - void *cbdata); -static int cray_resolve_peers(const char *nodename, - opal_jobid_t jobid, - opal_list_t *procs); -static int cray_resolve_nodes(opal_jobid_t jobid, char **nodelist); -static int cray_put(opal_pmix_scope_t scope, opal_value_t *kv); -static int cray_fence(opal_list_t *procs, int collect_data); -static int cray_fencenb(opal_list_t *procs, int collect_data, - opal_pmix_op_cbfunc_t cbfunc, void *cbdata); -static int cray_commit(void); -static int cray_get(const opal_process_name_t *id, - const char *key, opal_list_t *info, - opal_value_t **kv); -static int cray_get_nb(const opal_process_name_t *id, const char *key, - opal_list_t *info, - opal_pmix_value_cbfunc_t cbfunc, void *cbdata); -static int cray_publish(opal_list_t *info); -static int cray_publish_nb(opal_list_t *info, - opal_pmix_op_cbfunc_t cbfunc, void *cbdata); -static int cray_lookup(opal_list_t *data, opal_list_t *info); -static int cray_lookup_nb(char **keys, opal_list_t *info, - opal_pmix_lookup_cbfunc_t cbfunc, void *cbdata); -static int cray_unpublish(char **keys, opal_list_t *info); -static int cray_unpublish_nb(char **keys, opal_list_t *info, - opal_pmix_op_cbfunc_t cbfunc, void *cbdata); -static const char *cray_get_version(void); -static int cray_store_local(const opal_process_name_t *proc, - opal_value_t *val); -static const char *cray_get_nspace(opal_jobid_t jobid); -static void cray_register_jobid(opal_jobid_t jobid, const char *nspace); - -#if 0 -static bool cray_get_attr(const char *attr, opal_value_t **kv); -#endif - -const opal_pmix_base_module_t opal_pmix_cray_module = { - .init = cray_init, - .finalize = cray_fini, - .initialized = cray_initialized, - .abort = cray_abort, - .commit = cray_commit, - .fence = cray_fence, - .fence_nb = cray_fencenb, - .put = cray_put, - .get = cray_get, - .get_nb = cray_get_nb, - .publish = cray_publish, - .publish_nb = cray_publish_nb, - .lookup = cray_lookup, - .lookup_nb = cray_lookup_nb, - .unpublish = cray_unpublish, - .unpublish_nb = cray_unpublish_nb, - .spawn = cray_spawn, - .spawn_nb = cray_spawn_nb, - .connect = cray_job_connect, - .disconnect = cray_job_disconnect, - .disconnect_nb = cray_job_disconnect_nb, - .resolve_peers = cray_resolve_peers, - .resolve_nodes = cray_resolve_nodes, - .get_version = cray_get_version, - .register_evhandler = opal_pmix_base_register_handler, - .deregister_evhandler = opal_pmix_base_deregister_handler, - .store_local = cray_store_local, - .get_nspace = cray_get_nspace, - .register_jobid = cray_register_jobid -}; - -// usage accounting -static int pmix_init_count = 0; - -// local object -typedef struct { - opal_object_t super; - opal_event_t ev; - opal_pmix_op_cbfunc_t opcbfunc; - void *cbdata; -} pmi_opcaddy_t; -static OBJ_CLASS_INSTANCE(pmi_opcaddy_t, - opal_object_t, - NULL, NULL); - -struct fence_result { - volatile int flag; - int status; -}; - -// PMI constant values: -static int pmix_kvslen_max = 0; -static int pmix_keylen_max = 0; -static int pmix_vallen_max = 0; -static int pmix_vallen_threshold = INT_MAX; - -// Job environment description -static int pmix_size = 0; -static int pmix_rank = 0; -static int pmix_lrank = 0; -static int pmix_nrank = 0; -static int pmix_nlranks = 0; -static int pmix_appnum = 0; -static int pmix_usize = 0; -static char *pmix_kvs_name = NULL; -static int *pmix_lranks = NULL; -static opal_process_name_t pmix_pname; -static uint32_t pmix_jobid = -1; - -static char* pmix_error(int pmix_err); -#define OPAL_PMI_ERROR(pmi_err, pmi_func) \ - do { \ - opal_output(0, "%s [%s:%d:%s]: %s\n", \ - pmi_func, __FILE__, __LINE__, __func__, \ - pmix_error(pmi_err)); \ - } while(0); - -#define CRAY_WAIT_FOR_COMPLETION(a) \ - do { \ - while ((a)) { \ - usleep(10); \ - } \ - } while (0) - -static void cray_get_more_info(void) -{ - int alps_status = 0, i; - uint64_t apid; - size_t alps_count; - int lli_ret = 0, place_ret; - alpsAppLayout_t layout; - char *npstring; - char *firstrankstring; - char **nps, **firstranks; - int *base_pe_in_app; - int *pes_in_app; - char pbuf[OPAL_PATH_MAX]; - - /* - * First get our apid - */ - - lli_ret = alps_app_lli_lock(); - if (0 != lli_ret) { - OPAL_OUTPUT_VERBOSE((20, opal_pmix_base_framework.framework_output, - "%s pmix:cray: alps_app_lli_lock returned %d", - OPAL_NAME_PRINT(OPAL_PROC_MY_NAME), lli_ret)); - goto fn_exit; - } - - lli_ret = alps_app_lli_put_request(ALPS_APP_LLI_ALPS_REQ_APID, NULL, 0); - if (ALPS_APP_LLI_ALPS_STAT_OK != lli_ret) { - OPAL_OUTPUT_VERBOSE((20, opal_pmix_base_framework.framework_output, - "%s pmix:cray: alps_app_lli_put_request - APID returned %d", - OPAL_NAME_PRINT(OPAL_PROC_MY_NAME), lli_ret)); - goto fn_exit_w_lock; - } - - lli_ret = alps_app_lli_get_response (&alps_status, &alps_count); - if (ALPS_APP_LLI_ALPS_STAT_OK != alps_status) { - OPAL_OUTPUT_VERBOSE((20, opal_pmix_base_framework.framework_output, - "%s pmix:cray: alps_app_lli_get_response returned %d", - OPAL_NAME_PRINT(OPAL_PROC_MY_NAME), alps_status)); - goto fn_exit_w_lock; - } - - lli_ret = alps_app_lli_get_response_bytes (&apid, sizeof(apid)); - if (ALPS_APP_LLI_ALPS_STAT_OK != lli_ret) { - OPAL_OUTPUT_VERBOSE((20, opal_pmix_base_framework.framework_output, - "%s pmix:cray: alps_app_lli_get_response_bytes returned %d", - OPAL_NAME_PRINT(OPAL_PROC_MY_NAME), lli_ret)); - goto fn_exit_w_lock; - } - - /* - * get some items from alps placement file - */ - - place_ret = alps_get_placement_info(apid, - &layout, - NULL, - NULL, - NULL, - NULL, - NULL, - &base_pe_in_app, - &pes_in_app, - NULL, - NULL); - if (1 != place_ret) { - OPAL_OUTPUT_VERBOSE((20, opal_pmix_base_framework.framework_output, - "%s pmix:cray: alps_get_placement_info returned %d (%s)", - OPAL_NAME_PRINT(OPAL_PROC_MY_NAME), place_ret, strerror(errno))); - goto fn_exit; - } - - OPAL_OUTPUT_VERBOSE((2, opal_pmix_base_framework.framework_output, - "%s pmix:cray: alps_get_placement_info returned %d first pe on node is %d", - OPAL_NAME_PRINT(OPAL_PROC_MY_NAME), place_ret, layout.firstPe)); - - nps = NULL; - firstranks = NULL; - for (i=0; i < layout.numCmds; i++) { - snprintf(pbuf, sizeof(pbuf), "%d", pes_in_app[i]); - opal_argv_append_nosize(&nps, pbuf); - snprintf(pbuf, sizeof(pbuf), "%d", base_pe_in_app[i]); - opal_argv_append_nosize(&firstranks, pbuf); - } - - npstring = opal_argv_join(nps, ' '); - firstrankstring = opal_argv_join(firstranks, ' '); - opal_argv_free(nps); - opal_argv_free(firstranks); - - /* - * stuff values into environment variables - */ - - /* add these envars to prep MPI-2 info pre-defined key/values */ - snprintf(pbuf, sizeof(pbuf), "%d", layout.numCmds); - opal_setenv("OMPI_NUM_APP_CTX", pbuf, true, &environ); - opal_setenv("OMPI_FIRST_RANKS", firstrankstring, true, &environ); - opal_setenv("OMPI_APP_CTX_NUM_PROCS", npstring, true, &environ); - free(firstrankstring); - free(npstring); - free(base_pe_in_app); - free(pes_in_app); - - /* - * ALPS always starts the application in the directory - * where the aprun command was run to do the launch. - * For SLURM, we have to check the SLURM_WORKING_DIR env. - * variable. If it is set, we can't set wdir since - * we can't assume PWD is where we started. - */ - if(getenv("SLURM_WORKING_DIR") == NULL) { - opal_getcwd(pbuf, OPAL_PATH_MAX); - opal_setenv("OMPI_MCA_initial_wdir", pbuf, true, &environ); - } - - fn_exit_w_lock: - lli_ret = alps_app_lli_unlock(); - if (ALPS_APP_LLI_ALPS_STAT_OK != lli_ret) { - OPAL_OUTPUT_VERBOSE((20, opal_pmix_base_framework.framework_output, - "%s pmix:cray: alps_app_lli_unlock returned %d", - OPAL_NAME_PRINT(OPAL_PROC_MY_NAME), lli_ret)); - } - - fn_exit: - return; -} - -static int cray_init(opal_list_t *ilist) -{ - int i, spawned, size, rank, appnum, my_node; - int rc, ret = OPAL_ERROR; - char *pmapping = NULL; - char buf[PMI2_MAX_ATTRVALUE]; - int found; - int major, minor, revision; - uint32_t jobfam; - opal_value_t kv; - opal_process_name_t ldr; - char nmtmp[64]; - char *str, **localranks = NULL; - opal_process_name_t name; - - ++pmix_init_count; - - /* if we can't startup PMI, we can't be used */ - if ( PMI2_Initialized () ) { - opal_output_verbose(10, opal_pmix_base_framework.framework_output, - "%s pmix:cray: pmi already initialized", - OPAL_NAME_PRINT(pmix_pname)); - return OPAL_SUCCESS; - } - size = -1; - rank = -1; - appnum = -1; - if (PMI_SUCCESS != (rc = PMI2_Init(&spawned, &size, &rank, &appnum))) { - opal_show_help("help-pmix-base.txt", "pmix2-init-failed", true, rc); - return OPAL_ERROR; - } - if( size < 0 || rank < 0 ){ - opal_show_help("help-pmix-base.txt", "pmix2-init-returned-bad-values", true); - goto err_exit; - } - - pmix_size = size; - pmix_rank = rank; - pmix_appnum = appnum; - - pmix_vallen_max = PMI2_MAX_VALLEN; - pmix_kvslen_max = PMI2_MAX_VALLEN; // FIX ME: What to put here for versatility? - pmix_keylen_max = PMI2_MAX_KEYLEN; - pmix_vallen_threshold = PMI2_MAX_VALLEN * 3; - pmix_vallen_threshold >>= 2; - - /* - * get the version info - */ - - if (PMI_SUCCESS != PMI_Get_version_info(&major,&minor,&revision)) { - return OPAL_ERROR; - } - - snprintf(cray_pmi_version, sizeof(cray_pmi_version), - "%d.%d.%d", major, minor, revision); - - pmix_kvs_name = (char*)malloc(pmix_kvslen_max); - if( pmix_kvs_name == NULL ){ - PMI2_Finalize(); - ret = OPAL_ERR_OUT_OF_RESOURCE; - goto err_exit; - } - - rc = PMI2_Job_GetId(pmix_kvs_name, pmix_kvslen_max); - if( PMI_SUCCESS != rc ) { - OPAL_PMI_ERROR(rc, "PMI2_Job_GetId"); - goto err_exit; - } - - rc = sscanf(pmix_kvs_name,"kvs_%u",&jobfam); - if (rc != 1) { - opal_output_verbose(10, opal_pmix_base_framework.framework_output, - "%s pmix:cray: pmix_kvs_name %s", - OPAL_NAME_PRINT(pmix_pname), pmix_kvs_name); - rc = OPAL_ERROR; - goto err_exit; - } - - pmix_jobid = jobfam << 16; - - /* store our name in the opal_proc_t so that - * debug messages will make sense - an upper - * layer will eventually overwrite it, but that - * won't do any harm */ - pmix_pname.jobid = pmix_jobid; - pmix_pname.vpid = pmix_rank; - opal_proc_set_name(&pmix_pname); - opal_output_verbose(10, opal_pmix_base_framework.framework_output, - "%s pmix:cray: assigned tmp name %d %d pmix_kvs_name %s", - OPAL_NAME_PRINT(pmix_pname),pmix_pname.jobid,pmix_pname.vpid,pmix_kvs_name); - - pmapping = (char*)malloc(PMI2_MAX_VALLEN); - if( pmapping == NULL ){ - rc = OPAL_ERR_OUT_OF_RESOURCE; - OPAL_ERROR_LOG(rc); - return rc; - } - - rc = PMI2_Info_GetJobAttr("PMI_process_mapping", pmapping, PMI2_MAX_VALLEN, &found); - if( !found || PMI_SUCCESS != rc ) { - OPAL_PMI_ERROR(rc,"PMI2_Info_GetJobAttr"); - return OPAL_ERROR; - } - - pmix_lranks = pmix_cray_parse_pmap(pmapping, pmix_rank, &my_node, &pmix_nlranks); - if (NULL == pmix_lranks) { - rc = OPAL_ERR_OUT_OF_RESOURCE; - OPAL_ERROR_LOG(rc); - return rc; - } - - free(pmapping); - - // setup hash table - opal_pmix_base_hash_init(); - - /* setup a name for retrieving data associated with the job */ - name.jobid = pmix_jobid; - name.vpid = OPAL_VPID_WILDCARD; - - /* save the job size */ - OBJ_CONSTRUCT(&kv, opal_value_t); - kv.key = strdup(OPAL_PMIX_JOB_SIZE); - kv.type = OPAL_UINT32; - kv.data.uint32 = pmix_size; - if (OPAL_SUCCESS != (rc = opal_pmix_base_store(&name, &kv))) { - OPAL_ERROR_LOG(rc); - OBJ_DESTRUCT(&kv); - goto err_exit; - } - OBJ_DESTRUCT(&kv); - - /* save the appnum */ - OBJ_CONSTRUCT(&kv, opal_value_t); - kv.key = strdup(OPAL_PMIX_APPNUM); - kv.type = OPAL_UINT32; - kv.data.uint32 = pmix_appnum; - if (OPAL_SUCCESS != (ret = opal_pmix_base_store(&OPAL_PROC_MY_NAME, &kv))) { - OPAL_ERROR_LOG(ret); - OBJ_DESTRUCT(&kv); - goto err_exit; - } - OBJ_DESTRUCT(&kv); - - rc = PMI2_Info_GetJobAttr("universeSize", buf, 16, &found); - if( PMI_SUCCESS != rc ) { - OPAL_PMI_ERROR(rc, "PMI_Get_universe_size"); - goto err_exit; - } - - pmix_usize = atoi(buf); - - OBJ_CONSTRUCT(&kv, opal_value_t); - kv.key = strdup(OPAL_PMIX_UNIV_SIZE); - kv.type = OPAL_UINT32; - kv.data.uint32 = pmix_usize; - if (OPAL_SUCCESS != (rc = opal_pmix_base_store(&OPAL_PROC_MY_NAME, &kv))) { - OPAL_ERROR_LOG(rc); - OBJ_DESTRUCT(&kv); - goto err_exit; - } - OBJ_DESTRUCT(&kv); - - /* push this into the dstore for subsequent fetches */ - OBJ_CONSTRUCT(&kv, opal_value_t); - kv.key = strdup(OPAL_PMIX_MAX_PROCS); - kv.type = OPAL_UINT32; - kv.data.uint32 = pmix_usize; - if (OPAL_SUCCESS != (ret = opal_pmix_base_store(&name, &kv))) { - OPAL_ERROR_LOG(ret); - OBJ_DESTRUCT(&kv); - goto err_exit; - } - OBJ_DESTRUCT(&kv); - - OBJ_CONSTRUCT(&kv, opal_value_t); - kv.key = strdup(OPAL_PMIX_JOBID); - kv.type = OPAL_UINT32; - kv.data.uint32 = pmix_jobid; - if (OPAL_SUCCESS != (ret = opal_pmix_base_store(&name, &kv))) { - OPAL_ERROR_LOG(ret); - OBJ_DESTRUCT(&kv); - goto err_exit; - } - OBJ_DESTRUCT(&kv); - - /* save the local size */ - OBJ_CONSTRUCT(&kv, opal_value_t); - kv.key = strdup(OPAL_PMIX_LOCAL_SIZE); - kv.type = OPAL_UINT32; - kv.data.uint32 = pmix_nlranks; - if (OPAL_SUCCESS != (rc = opal_pmix_base_store(&name, &kv))) { - OPAL_ERROR_LOG(rc); - OBJ_DESTRUCT(&kv); - goto err_exit; - } - OBJ_DESTRUCT(&kv); - - ldr.vpid = pmix_lranks[0]; - ldr.jobid = pmix_pname.jobid; - - /* find ourselves and build up a string for local peer info */ - memset(nmtmp, 0, 64); - for (i=0; i < pmix_nlranks; i++) { - ret = snprintf(nmtmp, 64, "%d", pmix_lranks[i]); - opal_argv_append_nosize(&localranks, nmtmp); - if (pmix_rank == pmix_lranks[i]) { - pmix_lrank = i; - pmix_nrank = i; - } - } - - str = opal_argv_join(localranks, ','); - opal_argv_free(localranks); - - OBJ_CONSTRUCT(&kv, opal_value_t); - kv.key = strdup(OPAL_PMIX_LOCAL_PEERS); - kv.type = OPAL_STRING; - kv.data.string = str; - if (OPAL_SUCCESS != (ret = opal_pmix_base_store(&name, &kv))) { - OPAL_ERROR_LOG(ret); - OBJ_DESTRUCT(&kv); - goto err_exit; - } - OBJ_DESTRUCT(&kv); - - /* save the local leader */ - OBJ_CONSTRUCT(&kv, opal_value_t); - kv.key = strdup(OPAL_PMIX_LOCALLDR); - kv.type = OPAL_UINT64; - kv.data.uint64 = *(uint64_t*)&ldr; - if (OPAL_SUCCESS != (ret = opal_pmix_base_store(&name, &kv))) { - OPAL_ERROR_LOG(ret); - OBJ_DESTRUCT(&kv); - goto err_exit; - } - - /* save our local rank */ - OBJ_CONSTRUCT(&kv, opal_value_t); - kv.key = strdup(OPAL_PMIX_LOCAL_RANK); - kv.type = OPAL_UINT16; - kv.data.uint16 = pmix_lrank; - if (OPAL_SUCCESS != (ret = opal_pmix_base_store(&OPAL_PROC_MY_NAME, &kv))) { - OPAL_ERROR_LOG(ret); - OBJ_DESTRUCT(&kv); - goto err_exit; - } - - /* and our node rank */ - OBJ_CONSTRUCT(&kv, opal_value_t); - kv.key = strdup(OPAL_PMIX_NODE_RANK); - kv.type = OPAL_UINT16; - kv.data.uint16 = pmix_nrank; - if (OPAL_SUCCESS != (ret = opal_pmix_base_store(&OPAL_PROC_MY_NAME, &kv))) { - OPAL_ERROR_LOG(ret); - OBJ_DESTRUCT(&kv); - goto err_exit; - } - OBJ_DESTRUCT(&kv); - - cray_get_more_info(); - - return OPAL_SUCCESS; -err_exit: - PMI2_Finalize(); - return ret; -} - -static int cray_fini(void) { - - if (0 == pmix_init_count) { - return OPAL_SUCCESS; - } - - if (0 == --pmix_init_count) { - - opal_output_verbose(10, opal_pmix_base_framework.framework_output, - "%s pmix:cray: calling PMI2_Finalize", - OPAL_NAME_PRINT(pmix_pname)); - - PMI2_Finalize(); - - if (NULL != pmix_kvs_name) { - free(pmix_kvs_name); - pmix_kvs_name = NULL; - } - - if (NULL != pmix_lranks) { - free(pmix_lranks); - pmix_lranks = NULL; - } - } - - return OPAL_SUCCESS; -} - -static int cray_initialized(void) -{ - if (0 < pmix_init_count) { - return 1; - } - return 0; -} - -static int cray_abort(int flag, const char *msg, - opal_list_t *procs) -{ - PMI2_Abort(flag, msg); - return OPAL_SUCCESS; -} - -static int cray_spawn(opal_list_t *jobinfo, opal_list_t *apps, opal_jobid_t *jobid) -{ - return OPAL_ERR_NOT_SUPPORTED; -} - -static int cray_spawn_nb(opal_list_t *jobinfo, opal_list_t *apps, - opal_pmix_spawn_cbfunc_t cbfunc, - void *cbdata) -{ - return OPAL_ERR_NOT_SUPPORTED; -} - -static int cray_job_connect(opal_list_t *procs) -{ - return OPAL_ERR_NOT_SUPPORTED; -} - -static int cray_job_disconnect(opal_list_t *procs) -{ - return OPAL_ERR_NOT_SUPPORTED; -} - -static int cray_job_disconnect_nb(opal_list_t *procs, - opal_pmix_op_cbfunc_t cbfunc, - void *cbdata) -{ - return OPAL_ERR_NOT_SUPPORTED; -} - -static int cray_resolve_peers(const char *nodename, - opal_jobid_t jobid, - opal_list_t *procs) -{ - return OPAL_ERR_NOT_IMPLEMENTED; -} - -static int cray_resolve_nodes(opal_jobid_t jobid, char **nodelist) -{ - return OPAL_ERR_NOT_IMPLEMENTED; -} - -static int cray_put(opal_pmix_scope_t scope, - opal_value_t *kv) -{ - int rc; - - opal_output_verbose(10, opal_pmix_base_framework.framework_output, - "%s pmix:cray cray_put key %s scope %d\n", - OPAL_NAME_PRINT(OPAL_PROC_MY_NAME), kv->key, scope); - - if (!pmix_init_count) { - return OPAL_ERROR; - } - - /* - * for now just always just global cache - */ - - if (NULL == mca_pmix_cray_component.cache_global) { - mca_pmix_cray_component.cache_global = OBJ_NEW(opal_buffer_t); - } - - opal_output_verbose(20, opal_pmix_base_framework.framework_output, - "%s pmix:cray put global data for key %s type %d", - OPAL_NAME_PRINT(OPAL_PROC_MY_NAME), kv->key, kv->type); - if (OPAL_SUCCESS != (rc = opal_dss.pack(mca_pmix_cray_component.cache_global, &kv, 1, OPAL_VALUE))) { - OPAL_PMI_ERROR(rc,"pmix:cray opal_dss.pack returned error"); - OPAL_ERROR_LOG(rc); - } - - return rc; -} - -static int cray_commit(void) -{ - return OPAL_SUCCESS; -} - -static void fencenb(int sd, short args, void *cbdata) -{ - pmi_opcaddy_t *op = (pmi_opcaddy_t*)cbdata; - int rc, cnt; - int32_t i; - int *all_lens = NULL; - opal_value_t *kp, kvn; - opal_buffer_t *send_buffer = NULL; - opal_buffer_t *buf = NULL; - void *sbuf_ptr; - char *cptr, *rcv_buff = NULL; - opal_process_name_t id; - typedef struct { - uint32_t pmix_rank; - opal_process_name_t name; - int32_t nbytes; - } bytes_and_rank_t; - int32_t rcv_nbytes_tot; - bytes_and_rank_t s_bytes_and_rank; - bytes_and_rank_t *r_bytes_and_ranks = NULL; - opal_hwloc_locality_t locality; - opal_list_t vals; - char *cpuset = NULL; - - opal_output_verbose(2, opal_pmix_base_framework.framework_output, - "%s pmix:cray executing fence cache_global %p cache_local %p", - OPAL_NAME_PRINT(OPAL_PROC_MY_NAME), - (void *)mca_pmix_cray_component.cache_global, - (void *)mca_pmix_cray_component.cache_local); - - - /* - * "unload" the cache_local/cache_global buffers, first copy - * it so we can continue to use the local buffers if further - * calls to put can be made - */ - - send_buffer = OBJ_NEW(opal_buffer_t); - if (NULL == send_buffer) { - rc = OPAL_ERR_OUT_OF_RESOURCE; - goto fn_exit; - } - - opal_dss.copy_payload(send_buffer, mca_pmix_cray_component.cache_global); - opal_dss.unload(send_buffer, &sbuf_ptr, &s_bytes_and_rank.nbytes); - s_bytes_and_rank.pmix_rank = pmix_rank; - s_bytes_and_rank.name = OPAL_PROC_MY_NAME; - - r_bytes_and_ranks = (bytes_and_rank_t *)malloc(pmix_size * sizeof(bytes_and_rank_t)); - if (NULL == r_bytes_and_ranks) { - rc = OPAL_ERR_OUT_OF_RESOURCE; - goto fn_exit; - } - - /* - * gather up all the buffer sizes and rank order. - * doing this step below since the cray pmi PMI_Allgather doesn't deliver - * the gathered data necessarily in PMI rank order, although the order stays - * the same for the duration of a job - assuming no node failures. - */ - - if (PMI_SUCCESS != (rc = PMI_Allgather(&s_bytes_and_rank,r_bytes_and_ranks,sizeof(bytes_and_rank_t)))) { - OPAL_PMI_ERROR(rc,"PMI_Allgather"); - rc = OPAL_ERR_COMM_FAILURE; - goto fn_exit; - } - - - for (rcv_nbytes_tot=0,i=0; i < pmix_size; i++) { - rcv_nbytes_tot += r_bytes_and_ranks[i].nbytes; - } - - opal_output_verbose(20, opal_pmix_base_framework.framework_output, - "%s pmix:cray total number of bytes to receive %d", - OPAL_NAME_PRINT(OPAL_PROC_MY_NAME), rcv_nbytes_tot); - - rcv_buff = (char *) malloc(rcv_nbytes_tot * sizeof(char)); - if (NULL == rcv_buff) { - rc = OPAL_ERR_OUT_OF_RESOURCE; - goto fn_exit; - } - - all_lens = (int *)malloc(sizeof(int) * pmix_size); - if (NULL == all_lens) { - rc = OPAL_ERR_OUT_OF_RESOURCE; - goto fn_exit; - } - for (i=0; i< pmix_size; i++) { - all_lens[r_bytes_and_ranks[i].pmix_rank] = r_bytes_and_ranks[i].nbytes; - } - - if (PMI_SUCCESS != (rc = PMI_Allgatherv(sbuf_ptr,s_bytes_and_rank.nbytes,rcv_buff,all_lens))) { - OPAL_PMI_ERROR(rc,"PMI_Allgatherv"); - rc = OPAL_ERR_COMM_FAILURE; - goto fn_exit; - } - - OBJ_RELEASE(send_buffer); - send_buffer = NULL; - - buf = OBJ_NEW(opal_buffer_t); - if (buf == NULL) { - rc = OPAL_ERR_OUT_OF_RESOURCE; - goto fn_exit; - } - - for (cptr = rcv_buff, i=0; i < pmix_size; i++) { - - id = r_bytes_and_ranks[i].name; - - buf->base_ptr = NULL; /* TODO: ugh */ - if (OPAL_SUCCESS != (rc = opal_dss.load(buf, (void *)cptr, r_bytes_and_ranks[i].nbytes))) { - OPAL_PMI_ERROR(rc,"pmix:cray opal_dss.load failed"); - goto fn_exit; - } - - /* unpack and stuff in to the dstore */ - cnt = 1; - while (OPAL_SUCCESS == (rc = opal_dss.unpack(buf, &kp, &cnt, OPAL_VALUE))) { - OPAL_OUTPUT_VERBOSE((20, opal_pmix_base_framework.framework_output, - "%s pmix:cray unpacked kp with key %s type(%d) for id %s", - OPAL_NAME_PRINT(OPAL_PROC_MY_NAME), kp->key, kp->type, OPAL_NAME_PRINT(id))); - - if (OPAL_SUCCESS != (rc = opal_pmix_base_store(&id, kp))) { - OPAL_ERROR_LOG(rc); - goto fn_exit; - } - OBJ_RELEASE(kp); - cnt = 1; - } - - cptr += r_bytes_and_ranks[i].nbytes; - - } - - buf->base_ptr = NULL; /* TODO: ugh */ - OBJ_RELEASE(buf); - - opal_output_verbose(2, opal_pmix_base_framework.framework_output, - "%s pmix:cray kvs_fence complete", - OPAL_NAME_PRINT(OPAL_PROC_MY_NAME)); - - /* fetch my cpuset */ - OBJ_CONSTRUCT(&vals, opal_list_t); - if (OPAL_SUCCESS == (rc = opal_pmix_base_fetch(&pmix_pname, - OPAL_PMIX_CPUSET, &vals))) { - kp = (opal_value_t*)opal_list_get_first(&vals); - cpuset = strdup(kp->data.string); - } else { - cpuset = NULL; - } - OPAL_LIST_DESTRUCT(&vals); - - /* Get the modex data from each local process and set the - * localities to avoid having the MPI layer fetch data - * for every process in the job. - * - * we only need to set locality for each local rank as "not found" - * equates to "non-local" - */ - - for (i=0; i < pmix_nlranks; i++) { - id.vpid = pmix_lranks[i]; - id.jobid = pmix_jobid; - OPAL_OUTPUT_VERBOSE((2, opal_pmix_base_framework.framework_output, - "%s checking out if %s is local to me", - OPAL_NAME_PRINT(OPAL_PROC_MY_NAME), - OPAL_NAME_PRINT(id))); - /* fetch cpuset for this vpid */ - OBJ_CONSTRUCT(&vals, opal_list_t); - if (OPAL_SUCCESS != (rc = opal_pmix_base_fetch(&id, - OPAL_PMIX_CPUSET, &vals))) { - OPAL_OUTPUT_VERBOSE((2, opal_pmix_base_framework.framework_output, - "%s cpuset for local proc %s not found", - OPAL_NAME_PRINT(OPAL_PROC_MY_NAME), - OPAL_NAME_PRINT(id))); - OPAL_LIST_DESTRUCT(&vals); - /* even though the cpuset wasn't found, we at least know it is - * on the same node with us */ - locality = OPAL_PROC_ON_CLUSTER | OPAL_PROC_ON_CU | OPAL_PROC_ON_NODE; - } else { - kp = (opal_value_t*)opal_list_get_first(&vals); - if (NULL == kp->data.string) { - /* if we share a node, but we don't know anything more, then - * mark us as on the node as this is all we know - */ - locality = OPAL_PROC_ON_CLUSTER | OPAL_PROC_ON_CU | OPAL_PROC_ON_NODE; - } else { - /* determine relative location on our node */ - locality = opal_hwloc_base_get_relative_locality(opal_hwloc_topology, - cpuset, - kp->data.string); - } - OPAL_LIST_DESTRUCT(&vals); - } - OPAL_OUTPUT_VERBOSE((1, opal_pmix_base_framework.framework_output, - "%s pmix:cray proc %s locality %s", - OPAL_NAME_PRINT(OPAL_PROC_MY_NAME), - OPAL_NAME_PRINT(id), - opal_hwloc_base_print_locality(locality))); - - OBJ_CONSTRUCT(&kvn, opal_value_t); - kvn.key = strdup(OPAL_PMIX_LOCALITY); - kvn.type = OPAL_UINT16; - kvn.data.uint16 = locality; - opal_pmix_base_store(&id, &kvn); - OBJ_DESTRUCT(&kvn); - } - -fn_exit: - if (NULL != cpuset) { - free(cpuset); - } - if (all_lens != NULL) { - free(all_lens); - } - if (rcv_buff != NULL) { - free(rcv_buff); - } - if (r_bytes_and_ranks != NULL) { - free(r_bytes_and_ranks); - } - if (NULL != op->opcbfunc) { - op->opcbfunc(rc, op->cbdata); - } - OBJ_RELEASE(op); - return; -} - -static void fence_release(int status, void *cbdata) -{ - struct fence_result *res = (struct fence_result*)cbdata; - res->status = status; - opal_atomic_wmb(); - res->flag = 0; -} - -static int cray_fence(opal_list_t *procs, int collect_data) -{ - struct fence_result result = { 1, OPAL_SUCCESS }; - cray_fencenb(procs, collect_data, fence_release, (void*)&result); - CRAY_WAIT_FOR_COMPLETION(result.flag); - return result.status; -} - - -static int cray_fencenb(opal_list_t *procs, int collect_data, - opal_pmix_op_cbfunc_t cbfunc, void *cbdata) -{ - pmi_opcaddy_t *op; - - /* thread-shift this so we don't block in Cray's barrier */ - op = OBJ_NEW(pmi_opcaddy_t); - op->opcbfunc = cbfunc; - op->cbdata = cbdata; - event_assign(&op->ev, opal_pmix_base.evbase, -1, - EV_WRITE, fencenb, op); - event_active(&op->ev, EV_WRITE, 1); - - return OPAL_SUCCESS; -} - -static int cray_get(const opal_process_name_t *id, const char *key, opal_list_t *info, opal_value_t **kv) -{ - int rc; - opal_list_t vals; - - OPAL_OUTPUT_VERBOSE((2, opal_pmix_base_framework.framework_output, - "%s pmix:cray getting value for proc %s key %s", - OPAL_NAME_PRINT(OPAL_PROC_MY_NAME), - OPAL_NAME_PRINT(*id), key)); - - OBJ_CONSTRUCT(&vals, opal_list_t); - rc = opal_pmix_base_fetch(id, key, &vals); - if (OPAL_SUCCESS == rc) { - *kv = (opal_value_t*)opal_list_remove_first(&vals); - return OPAL_SUCCESS; - } else { - OPAL_OUTPUT_VERBOSE((2, opal_pmix_base_framework.framework_output, - "%s pmix:cray fetch from dstore failed: %d", - OPAL_NAME_PRINT(OPAL_PROC_MY_NAME), rc)); - } - OPAL_LIST_DESTRUCT(&vals); - - return rc; - -} - -static int cray_get_nb(const opal_process_name_t *id, const char *key, - opal_list_t *info, opal_pmix_value_cbfunc_t cbfunc, void *cbdata) -{ - return OPAL_ERR_NOT_IMPLEMENTED; -} - -static int cray_publish(opal_list_t *info) -{ - return OPAL_ERR_NOT_SUPPORTED; -} - -static int cray_publish_nb(opal_list_t *info, - opal_pmix_op_cbfunc_t cbfunc, void *cbdata) -{ - return OPAL_ERR_NOT_SUPPORTED; -} - -static int cray_lookup(opal_list_t *data, opal_list_t *info) -{ - return OPAL_ERR_NOT_SUPPORTED; -} - -static int cray_lookup_nb(char **keys, opal_list_t *info, - opal_pmix_lookup_cbfunc_t cbfunc, void *cbdata) -{ - return OPAL_ERR_NOT_SUPPORTED; -} - -static int cray_unpublish(char **keys, opal_list_t *info) -{ - return OPAL_ERR_NOT_SUPPORTED; -} - -static int cray_unpublish_nb(char **keys, opal_list_t *info, - opal_pmix_op_cbfunc_t cbfunc, void *cbdata) -{ - return OPAL_ERR_NOT_SUPPORTED; -} - -static const char *cray_get_version(void) -{ - return cray_pmi_version; -} - -static int cray_store_local(const opal_process_name_t *proc, - opal_value_t *val) -{ - opal_pmix_base_store(proc, val); - - return OPAL_SUCCESS; -} - -static const char *cray_get_nspace(opal_jobid_t jobid) -{ - return "N/A"; -} - -static void cray_register_jobid(opal_jobid_t jobid, const char *nspace) -{ - return; -} - -static char* pmix_error(int pmix_err) -{ - char * err_msg; - - switch(pmix_err) { - case PMI_FAIL: err_msg = "Operation failed"; break; - case PMI_ERR_INIT: err_msg = "PMI is not initialized"; break; - case PMI_ERR_NOMEM: err_msg = "Input buffer not large enough"; break; - case PMI_ERR_INVALID_ARG: err_msg = "Invalid argument"; break; - case PMI_ERR_INVALID_KEY: err_msg = "Invalid key argument"; break; - case PMI_ERR_INVALID_KEY_LENGTH: err_msg = "Invalid key length argument"; break; - case PMI_ERR_INVALID_VAL: err_msg = "Invalid value argument"; break; - case PMI_ERR_INVALID_VAL_LENGTH: err_msg = "Invalid value length argument"; break; - case PMI_ERR_INVALID_LENGTH: err_msg = "Invalid length argument"; break; - case PMI_ERR_INVALID_NUM_ARGS: err_msg = "Invalid number of arguments"; break; - case PMI_ERR_INVALID_ARGS: err_msg = "Invalid args argument"; break; - case PMI_ERR_INVALID_NUM_PARSED: err_msg = "Invalid num_parsed length argument"; break; - case PMI_ERR_INVALID_KEYVALP: err_msg = "Invalid keyvalp argument"; break; - case PMI_ERR_INVALID_SIZE: err_msg = "Invalid size argument"; break; -#if defined(PMI_ERR_INVALID_KVS) - /* pmi.h calls this a valid return code but mpich doesn't define it (slurm does). */ - case PMI_ERR_INVALID_KVS: err_msg = "Invalid kvs argument"; break; -#endif - case PMI_SUCCESS: err_msg = "Success"; break; - default: err_msg = "Unkown error"; - } - return err_msg; -} diff --git a/opal/mca/pmix/cray/pmix_cray.h b/opal/mca/pmix/cray/pmix_cray.h deleted file mode 100644 index b6470c92206..00000000000 --- a/opal/mca/pmix/cray/pmix_cray.h +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright (c) 2014 Intel, Inc. All rights reserved. - * Copyright (c) 2016 Los Alamos National Security, LLC. All rights - * reserved. - * $COPYRIGHT$ - * - * Additional copyrights may follow - * - * $HEADER$ - */ - -#ifndef MCA_PMIX_CRAY_H -#define MCA_PMIX_CRAY_H - -#include -#include - -#include "opal_config.h" - -#include "opal/mca/mca.h" -#include "opal/mca/pmix/pmix.h" -#include "opal/mca/pmix/base/pmix_base_fns.h" -#include "opal/util/proc.h" - -#include "alps/alps.h" -#include "alps/alps_toolAssist.h" -#include "alps/libalpsutil.h" -#include "alps/libalpslli.h" - -#include "pmix_cray_pmap_parser.h" - -BEGIN_C_DECLS - -typedef struct { - opal_pmix_base_component_t super; - opal_buffer_t *cache_local; - opal_buffer_t *cache_global; -} opal_pmix_cray_component_t; - -/* - * Globally exported variable - */ - -OPAL_DECLSPEC extern opal_pmix_cray_component_t mca_pmix_cray_component; - -OPAL_DECLSPEC extern const opal_pmix_base_module_t opal_pmix_cray_module; - -/* - * proto-types for cray/pmix kvs component - */ - - -END_C_DECLS - -#endif /* MCA_PMIX_CRAY_H */ diff --git a/opal/mca/pmix/cray/pmix_cray_component.c b/opal/mca/pmix/cray/pmix_cray_component.c deleted file mode 100644 index 3d58a40d0fc..00000000000 --- a/opal/mca/pmix/cray/pmix_cray_component.c +++ /dev/null @@ -1,144 +0,0 @@ -/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ -/* - * Copyright (c) 2014 Intel, Inc. All rights reserved. - * Copyright (c) 2015-2016 Los Alamos National Security, LLC. All rights - * reserved. - * Copyright (c) 2016 Cisco Systems, 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 "opal_config.h" - -#include "opal/constants.h" -#include "opal/mca/pmix/pmix.h" -#include "opal/util/show_help.h" -#include "pmix_cray.h" -#include -#include - -/* - * Public string showing the pmix cray component version number - */ -const char *opal_pmix_cray_component_version_string = - "OPAL cray pmix MCA component version " OPAL_VERSION; - -/* - * Local function - */ -static int pmix_cray_component_open(void); -static int pmix_cray_component_query(mca_base_module_t **module, int *priority); -static int pmix_cray_component_close(void); - - -/* - * Instantiate the public struct with all of our public information - * and pointers to our public functions in it - */ - -opal_pmix_cray_component_t mca_pmix_cray_component = { - { - /* First, the mca_component_t struct containing meta information - about the component itself */ - - .base_version = { - /* Indicate that we are a pmix v1.1.0 component (which also - implies a specific MCA version) */ - - OPAL_PMIX_BASE_VERSION_2_0_0, - - /* Component name and version */ - - .mca_component_name = "cray", - MCA_BASE_MAKE_VERSION(component, OPAL_MAJOR_VERSION, OPAL_MINOR_VERSION, - OPAL_RELEASE_VERSION), - - /* Component open and close functions */ - - .mca_open_component = pmix_cray_component_open, - .mca_close_component = pmix_cray_component_close, - .mca_query_component = pmix_cray_component_query, - }, - /* Next the MCA v1.0.0 component meta data */ - .base_data = { - /* The component is checkpoint ready */ - MCA_BASE_METADATA_PARAM_CHECKPOINT - } - }, - .cache_local = NULL, - .cache_global = NULL, -}; - -static int pmix_cray_component_open(void) -{ - /* - * Turns out that there's a lot of reliance on libevent - * and the default behavior of Cray PMI to fork - * in a constructor breaks libevent. - * - * Open MPI will not launch correctly on Cray XE/XC systems - * under these conditions: - * - * 1) direct launch using aprun, and - * 2) PMI_NO_FORK env. variable is not set, nor was - * 3) --disable-dlopen used as part of configury - * - * Under SLURM, PMI_NO_FORK is always set, so we can combine - * the check for conditions 1) and 2) together - */ - -#if OPAL_ENABLE_DLOPEN_SUPPORT - if (NULL == getenv("PMI_NO_FORK")) { - opal_show_help("help-pmix-cray.txt", "aprun-not-supported", true); - exit(-1); - } -#endif - return OPAL_SUCCESS; -} - -static int pmix_cray_component_query(mca_base_module_t **module, int *priority) -{ - int rc; - const char proc_job_file[]="/proc/job"; - FILE *fd = NULL, *fd_task_is_app = NULL; - char task_is_app_fname[PATH_MAX]; - - /* disqualify ourselves if not running in a Cray PAGG container, or we - were launched by the orte/mpirun launcher */ - fd = fopen(proc_job_file, "r"); - if ((fd == NULL) || (getenv("OMPI_NO_USE_CRAY_PMI") != NULL)) { - *priority = 0; - *module = NULL; - rc = OPAL_ERROR; - } else { - snprintf(task_is_app_fname,sizeof(task_is_app_fname), - "/proc/self/task/%ld/task_is_app",syscall(SYS_gettid)); - fd_task_is_app = fopen(task_is_app_fname, "r"); - if (fd_task_is_app != NULL) { /* okay we're in a PAGG container, - and we are an app task (not just a process - running on a mom node, for example), - so we should give cray pmi a shot. */ - *priority = 90; - *module = (mca_base_module_t *)&opal_pmix_cray_module; - fclose(fd_task_is_app); - rc = OPAL_SUCCESS; - } - fclose(fd); - } - - return rc; -} - -static int pmix_cray_component_close(void) -{ - return OPAL_SUCCESS; -} diff --git a/opal/mca/pmix/cray/pmix_cray_pmap_parser.c b/opal/mca/pmix/cray/pmix_cray_pmap_parser.c deleted file mode 100644 index 63a811a6dd0..00000000000 --- a/opal/mca/pmix/cray/pmix_cray_pmap_parser.c +++ /dev/null @@ -1,243 +0,0 @@ -/* -*- Mode: C; c-basic-offset:4 ; -*- */ -/* - * - * Copyright (c) 2013 Mellanox Technologies, Inc. - * All rights reserved. - * Copyright (c) 2014 Intel, Inc. All rights reserved. - * Copyright (c) 2016 Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2016 Los Alamos National Security, LLC. All rights - * reserved. - * $COPYRIGHT$ - * Additional copyrights may follow - * - * $HEADER$ - * - */ - -#include "pmix_cray_pmap_parser.h" - -/** - pmi2 process mapping is returned as a - comma separated list of tuples: -ex: (vector,(0,4,4),(0,4,1)) -slurm cyclic distro of 4 ranks over 2 nodes: -(vector,(0,2,1),(0,2,1)) -slurm block distro of 4 ranks over 2 nodes: -(vector,(0,2,2)) - - - Format of each tuple is (base, H, L), where - H is number of nodes spawned by tuple, - L is number of ranks per node, - base is offset from node 0. - - Tuple can be visualized as a rectangle on two - dimensional (Hosts, Local Ranks) plane: - - ------------------------------------ Hosts -> - | H - | +--------+ - |<- base -->| | - | | | L - | +--------+ - Local Ranks - V - -Note that ranks increase by column. Tuple (0,2,3) looks like: -0 3 -1 4 -2 5 - -*/ -#include -#include -#include -static int find_my_node(char *map, int me) -{ - int abs_rank; - int base, H, L; - char *p; - - p = map; - abs_rank = 0; - while (NULL != (p = strstr(p+1, ",("))) { - if (3 != sscanf(p, ",(%d,%d,%d)", &base, &H, &L)) { - return -1; - } - if (me >= abs_rank && me < abs_rank + H*L) { - /* found my rectangle, compute node */ - return base + (me - abs_rank)/L; - } - abs_rank += H*L; - } - return -1; -} - -static int *find_lrs(char *map, int my_node, int *nlrs) -{ - int abs_rank; - int base, H, L; - char *p; - int *lrs; - int max_lr; - int i; - - p = map; - abs_rank = 0; - *nlrs = 0; - max_lr = 16; - lrs = malloc(max_lr * sizeof(int)); - while (NULL != (p = strstr(p+1, ",("))) { - if (3 != sscanf(p, ",(%d,%d,%d)", &base, &H, &L)) { - free(lrs); - return NULL; - } - if (base <= my_node && my_node < base + H) { - if (*nlrs + L >= max_lr) { - lrs = realloc(lrs, (max_lr + L) * sizeof(int)); - if (NULL == lrs) { - *nlrs = 0; - free(lrs); - return NULL; - } - max_lr += L; - } - /* skip (my_node - base) columns of L elems, - * numbers in my column are local to me - */ - for (i = 0; i < L; i++) { - lrs[*nlrs] = (my_node - base) * L + i + abs_rank; - (*nlrs) ++; - } - } - abs_rank += H*L; - } - - if (0 == *nlrs) { - free(lrs); - lrs = 0; - } - return lrs; -} - -/** - * @param pmap process map as returned by PMI_process_mapping - * attribute - * @param my_rank - * @param node set to my node id - * @param nlrs set to the number of local ranks returned - * - * @return array that contains ranks local to my_rank or NULL - * on failure. Array must be freed by the caller. - */ -int *pmix_cray_parse_pmap(char *pmap, int my_rank, - int *node, int *nlrs) -{ - char *p; - - p = strstr(pmap, "(vector"); - if (NULL == p) { - return NULL; - } - - *node = find_my_node(p, my_rank); - if (0 > *node) { - return NULL; - } - - return find_lrs(p, *node, nlrs); -} - - -#ifdef STANDALONE_TEST -#include -static void dump_lrs(int *lrs, int me, int node, int n) -{ - int i; - - printf("Total %d ranks/node, node %d me %d\n", n, node, me); - for (i = 0; i < n; i++) { - printf("%d ", lrs[i]); - } - printf("\n"); - free(lrs); -} - -int main(int argc, char **argv) -{ - int me, n, node; - int *lrs; - char *pmap; - int a1[] = {0, 1}; - int a2[] = {2, 3}; - int a3[] = {0, 2}; - int a4[] = {1, 3}; - int a5[] = {0,1,3,2,16,17}; - int a6[] = {8,9,10,11,19}; - - - if (argc == 3) { - me = atoi(argv[1]); - lrs = orte_grpcomm_pmi2_parse_pmap(argv[2], me, &node, &n); - if (NULL == lrs) { - printf("can not parse pmap\n"); - exit(1); - } - dump_lrs(lrs, me, node, n); - exit(0); - } - /* built in cases */ - - pmap = "(vector,(0,2,2))"; - me = 1; - lrs = orte_grpcomm_pmi2_parse_pmap(pmap, me, &node, &n); - assert(lrs); - assert(n == 2); - assert(memcmp(lrs, a1, 2) == 0); - free(lrs); - - - pmap = "(vector,(0,2,2))"; - me = 2; - lrs = orte_grpcomm_pmi2_parse_pmap(pmap, me, &node, &n); - assert(lrs); - assert(n == 2); - assert(memcmp(lrs, a2, 2) == 0); - free(lrs); - - - /* cyclic distro which skips node 0 */ - pmap = "(vector,(1,2,1),(1,2,1))"; - me = 0; - lrs = orte_grpcomm_pmi2_parse_pmap(pmap, me, &node, &n); - assert(lrs); - assert(n == 2); - assert(memcmp(lrs, a3, n) == 0); - free(lrs); - - pmap = "(vector,(1,2,1),(1,2,1))"; - me = 3; - lrs = orte_grpcomm_pmi2_parse_pmap(pmap, me, &node, &n); - assert(lrs); - assert(n == 2); - assert(memcmp(lrs, a4, n) == 0); - free(lrs); - - pmap = "(vector,(0,4,4),(0,1,2),(1,3,1))"; - me = 3; - lrs = orte_grpcomm_pmi2_parse_pmap(pmap, me, &node, &n); - assert(lrs); - assert(n == 6); - assert(memcmp(lrs, a5, n) == 0); - free(lrs); - - pmap = "(vector,(0,4,4),(0,1,2),(1,3,1))"; - me = 10; - lrs = orte_grpcomm_pmi2_parse_pmap(pmap, me, &node, &n); - assert(lrs); - assert(n == 5); - assert(memcmp(lrs, a6, n) == 0); - free(lrs); - return 0; -} -#endif diff --git a/opal/mca/pmix/cray/pmix_cray_pmap_parser.h b/opal/mca/pmix/cray/pmix_cray_pmap_parser.h deleted file mode 100644 index 433bf5adac8..00000000000 --- a/opal/mca/pmix/cray/pmix_cray_pmap_parser.h +++ /dev/null @@ -1,18 +0,0 @@ -/* -*- Mode: C; c-basic-offset:4 ; -*- */ -/* - * - * Copyright (c) 2013 Mellanox Technologies, Inc. - * All rights reserved. - * Copyright (c) 2014 Intel, Inc. All rights reserved. - * $COPYRIGHT$ - * Additional copyrights may follow - * - * $HEADER$ - * - */ -#ifndef PMIX_CRAY_PMAP_PARSER_H -#define PMIX_CRAY_PMAP_PARSER_H - -int *pmix_cray_parse_pmap(char *pmap, int my_rank, - int *node, int *nlrs); -#endif diff --git a/opal/mca/pmix/ext1x/Makefile.am b/opal/mca/pmix/ext1x/Makefile.am deleted file mode 100644 index 6e8eb170fa7..00000000000 --- a/opal/mca/pmix/ext1x/Makefile.am +++ /dev/null @@ -1,50 +0,0 @@ -# -# Copyright (c) 2014-2018 Intel, Inc. All rights reserved. -# Copyright (c) 2015 Cisco Systems, Inc. All rights reserved. -# Copyright (c) 2014-2015 Mellanox Technologies, Inc. -# All rights reserved. -# Copyright (c) 2017 Research Organization for Information Science -# and Technology (RIST). All rights reserved. -# Copyright (c) 2017 IBM Corporation. All rights reserved. -# $COPYRIGHT$ -# -# Additional copyrights may follow -# -# $HEADER$ -# - -sources = \ - pmix1x.h \ - pmix1x_component.c \ - pmix1x.c \ - pmix1x_client.c \ - pmix1x_server_south.c \ - pmix1x_server_north.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_opal_pmix_ext1x_DSO -component_noinst = -component_install = mca_pmix_ext1x.la -else -component_noinst = libmca_pmix_ext1x.la -component_install = -endif - -mcacomponentdir = $(opallibdir) -mcacomponent_LTLIBRARIES = $(component_install) -mca_pmix_ext1x_la_SOURCES = $(sources) -mca_pmix_ext1x_la_CFLAGS = -mca_pmix_ext1x_la_CPPFLAGS = $(opal_pmix_ext1x_CPPFLAGS) -mca_pmix_ext1x_la_LDFLAGS = -module -avoid-version $(opal_pmix_ext1x_LDFLAGS) -mca_pmix_ext1x_la_LIBADD = $(top_builddir)/opal/lib@OPAL_LIB_PREFIX@open-pal.la \ - $(opal_pmix_ext1x_LIBS) - -noinst_LTLIBRARIES = $(component_noinst) -libmca_pmix_ext1x_la_SOURCES =$(sources) -libmca_pmix_ext1x_la_CFLAGS = -libmca_pmix_ext1x_la_CPPFLAGS = $(opal_pmix_ext1x_CPPFLAGS) -libmca_pmix_ext1x_la_LDFLAGS = -module -avoid-version $(opal_pmix_ext1x_LDFLAGS) -libmca_pmix_ext1x_la_LIBADD = $(opal_pmix_ext1x_LIBS) diff --git a/opal/mca/pmix/ext1x/configure.m4 b/opal/mca/pmix/ext1x/configure.m4 deleted file mode 100644 index abbca782eaa..00000000000 --- a/opal/mca/pmix/ext1x/configure.m4 +++ /dev/null @@ -1,68 +0,0 @@ -# -*- shell-script -*- -# -# 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) 2011-2013 Los Alamos National Security, LLC. -# All rights reserved. -# Copyright (c) 2010-2015 Cisco Systems, Inc. All rights reserved. -# Copyright (c) 2013-2018 Intel, Inc. All rights reserved. -# Copyright (c) 2015-2017 Research Organization for Information Science -# and Technology (RIST). All rights reserved. -# Copyright (c) 2014-2015 Mellanox Technologies, Inc. -# All rights reserved. -# $COPYRIGHT$ -# -# Additional copyrights may follow -# -# $HEADER$ -# - -# MCA_pmix_ext1x_CONFIG([action-if-found], [action-if-not-found]) -# ----------------------------------------------------------- -AC_DEFUN([MCA_opal_pmix_ext1x_CONFIG],[ - AC_CONFIG_FILES([opal/mca/pmix/ext1x/Makefile]) - - AS_IF([test "$opal_external_pmix_happy" = "yes"], - [ # check for the 1.x version ( >= 1.1.4 ?) - AC_MSG_CHECKING([if external component is version 1.x]) - AS_IF([test "$opal_external_pmix_version" = "1x"], - [AC_MSG_RESULT([yes]) - AS_IF([test "$opal_event_external_support" != "yes"], - [AC_MSG_WARN([EXTERNAL PMIX SUPPORT REQUIRES USE OF EXTERNAL LIBEVENT]) - AC_MSG_WARN([LIBRARY. THIS LIBRARY MUST POINT TO THE SAME ONE USED]) - AC_MSG_WARN([TO BUILD PMIX OR ELSE UNPREDICTABLE BEHAVIOR MAY RESULT]) - AC_MSG_ERROR([PLEASE CORRECT THE CONFIGURE COMMAND LINE AND REBUILD])]) - AS_IF([test "$opal_hwloc_external_support" != "yes"], - [AC_MSG_WARN([EXTERNAL PMIX SUPPORT REQUIRES USE OF EXTERNAL HWLOC]) - AC_MSG_WARN([LIBRARY THIS LIBRARY MUST POINT TO THE SAME ONE USED ]) - AC_MSG_WARN([TO BUILD PMIX OR ELSE UNPREDICTABLE BEHAVIOR MAY RESULT]) - AC_MSG_ERROR([PLEASE CORRECT THE CONFIGURE COMMAND LINE AND REBUILD])]) - opal_pmix_external_1x_happy=yes], - [AC_MSG_RESULT([no]) - opal_pmix_external_1x_happy=no]) - - AS_IF([test "$opal_pmix_external_1x_happy" = "yes"], - [$1 - # need to set the wrapper flags for static builds - pmix_ext1x_WRAPPER_EXTRA_LDFLAGS=$opal_external_pmix_LDFLAGS - pmix_ext1x_WRAPPER_EXTRA_LIBS=$opal_external_pmix_LIBS], - [$2])], - [$2]) - - opal_pmix_ext1x_CPPFLAGS=$opal_external_pmix_CPPFLAGS - opal_pmix_ext1x_LDFLAGS=$opal_external_pmix_LDFLAGS - opal_pmix_ext1x_LIBS=$opal_external_pmix_LIBS - - AC_SUBST([opal_pmix_ext1x_CPPFLAGS]) - AC_SUBST([opal_pmix_ext1x_LDFLAGS]) - AC_SUBST([opal_pmix_ext1x_LIBS]) - -])dnl diff --git a/opal/mca/pmix/ext1x/pmix1x.c b/opal/mca/pmix/ext1x/pmix1x.c deleted file mode 100644 index eaac380e752..00000000000 --- a/opal/mca/pmix/ext1x/pmix1x.c +++ /dev/null @@ -1,586 +0,0 @@ -/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ -/* - * Copyright (c) 2014-2018 Intel, Inc. All rights reserved. - * Copyright (c) 2014-2017 Research Organization for Information Science - * and Technology (RIST). All rights reserved. - * Copyright (c) 2014-2015 Mellanox Technologies, Inc. - * All rights reserved. - * Copyright (c) 2016 Cisco Systems, Inc. All rights reserved. - * $COPYRIGHT$ - * - * Additional copyrights may follow - * - * $HEADER$ - */ - -#include "opal_config.h" -#include "opal/constants.h" -#include "opal/types.h" - -#ifdef HAVE_STRING_H -#include -#endif -#ifdef HAVE_UNISTD_H -#include -#endif - -#include "opal/dss/dss.h" -#include "opal/mca/event/event.h" -#include "opal/mca/hwloc/base/base.h" -#include "opal/runtime/opal.h" -#include "opal/runtime/opal_progress_threads.h" -#include "opal/util/argv.h" -#include "opal/util/error.h" -#include "opal/util/output.h" -#include "opal/util/proc.h" -#include "opal/util/show_help.h" -#include "opal/util/string_copy.h" - -#include "pmix1x.h" -#include "opal/mca/pmix/base/base.h" -#include "opal/mca/pmix/pmix_types.h" - -#include - -/**** C.O.M.M.O.N I.N.T.E.R.F.A.C.E.S ****/ - -/* These are functions used by both client and server to - * access common functions in the embedded PMIx library */ - -static const char *pmix1_get_nspace(opal_jobid_t jobid); -static void pmix1_register_jobid(opal_jobid_t jobid, const char *nspace); -static bool legacy_get(void) -{ - return true; -} - -const opal_pmix_base_module_t opal_pmix_ext1x_module = { - .legacy_get = legacy_get, - /* client APIs */ - .init = pmix1_client_init, - .finalize = pmix1_client_finalize, - .initialized = pmix1_initialized, - .abort = pmix1_abort, - .commit = pmix1_commit, - .fence = pmix1_fence, - .fence_nb = pmix1_fencenb, - .put = pmix1_put, - .get = pmix1_get, - .get_nb = pmix1_getnb, - .publish = pmix1_publish, - .publish_nb = pmix1_publishnb, - .lookup = pmix1_lookup, - .lookup_nb = pmix1_lookupnb, - .unpublish = pmix1_unpublish, - .unpublish_nb = pmix1_unpublishnb, - .spawn = pmix1_spawn, - .spawn_nb = pmix1_spawnnb, - .connect = pmix1_connect, - .connect_nb = pmix1_connectnb, - .disconnect = pmix1_disconnect, - .disconnect_nb = pmix1_disconnectnb, - .resolve_peers = pmix1_resolve_peers, - .resolve_nodes = pmix1_resolve_nodes, - /* server APIs */ - .server_init = pmix1_server_init, - .server_finalize = pmix1_server_finalize, - .generate_regex = pmix1_server_gen_regex, - .generate_ppn = pmix1_server_gen_ppn, - .server_register_nspace = pmix1_server_register_nspace, - .server_deregister_nspace = pmix1_server_deregister_nspace, - .server_register_client = pmix1_server_register_client, - .server_deregister_client = pmix1_server_deregister_client, - .server_setup_fork = pmix1_server_setup_fork, - .server_dmodex_request = pmix1_server_dmodex, - .server_notify_event = pmix1_server_notify_error, - /* utility APIs */ - .get_version = PMIx_Get_version, - .register_evhandler = opal_pmix_base_register_handler, - .deregister_evhandler = opal_pmix_base_deregister_handler, - .store_local = pmix1_store_local, - .get_nspace = pmix1_get_nspace, - .register_jobid = pmix1_register_jobid -}; - -static const char *pmix1_get_nspace(opal_jobid_t jobid) -{ - opal_pmix1_jobid_trkr_t *jptr; - - OPAL_LIST_FOREACH(jptr, &mca_pmix_ext1x_component.jobids, opal_pmix1_jobid_trkr_t) { - if (jptr->jobid == jobid) { - return jptr->nspace; - } - } - return NULL; -} - -static void pmix1_register_jobid(opal_jobid_t jobid, const char *nspace) -{ - opal_pmix1_jobid_trkr_t *jptr; - - /* if we don't already have it, add this to our jobid tracker */ - OPAL_LIST_FOREACH(jptr, &mca_pmix_ext1x_component.jobids, opal_pmix1_jobid_trkr_t) { - if (jptr->jobid == jobid) { - return; - } - } - jptr = OBJ_NEW(opal_pmix1_jobid_trkr_t); - (void)opal_string_copy(jptr->nspace, nspace, PMIX_MAX_NSLEN); - jptr->jobid = jobid; - opal_list_append(&mca_pmix_ext1x_component.jobids, &jptr->super); -} - -pmix_status_t pmix1_convert_opalrc(int rc) -{ - switch (rc) { - case OPAL_ERR_UNPACK_READ_PAST_END_OF_BUFFER: - return PMIX_ERR_UNPACK_READ_PAST_END_OF_BUFFER; - case OPAL_ERR_COMM_FAILURE: - return PMIX_ERR_COMM_FAILURE; - case OPAL_ERR_NOT_IMPLEMENTED: - return PMIX_ERR_NOT_IMPLEMENTED; - case OPAL_ERR_NOT_SUPPORTED: - return PMIX_ERR_NOT_SUPPORTED; - case OPAL_ERR_NOT_FOUND: - return PMIX_ERR_NOT_FOUND; - case OPAL_ERR_SERVER_NOT_AVAIL: - return PMIX_ERR_SERVER_NOT_AVAIL; - - case OPAL_ERR_BAD_PARAM: - return PMIX_ERR_BAD_PARAM; - case OPAL_ERR_OUT_OF_RESOURCE: - return PMIX_ERR_NOMEM; - - case OPAL_ERR_DATA_VALUE_NOT_FOUND: - return PMIX_ERR_DATA_VALUE_NOT_FOUND; - case OPAL_ERR_IN_ERRNO: - return PMIX_ERR_IN_ERRNO; - case OPAL_ERR_UNREACH: - return PMIX_ERR_UNREACH; - case OPAL_ERR_TIMEOUT: - return PMIX_ERR_TIMEOUT; - case OPAL_ERR_PERM: - return PMIX_ERR_NO_PERMISSIONS; - case OPAL_ERR_PACK_MISMATCH: - return PMIX_ERR_PACK_MISMATCH; - case OPAL_ERR_PACK_FAILURE: - return PMIX_ERR_PACK_FAILURE; - - case OPAL_ERR_UNPACK_FAILURE: - return PMIX_ERR_UNPACK_FAILURE; - case OPAL_ERR_UNPACK_INADEQUATE_SPACE: - return PMIX_ERR_UNPACK_INADEQUATE_SPACE; - case OPAL_ERR_TYPE_MISMATCH: - return PMIX_ERR_TYPE_MISMATCH; - case OPAL_ERR_PROC_ENTRY_NOT_FOUND: - return PMIX_ERR_PROC_ENTRY_NOT_FOUND; - case OPAL_ERR_UNKNOWN_DATA_TYPE: - return PMIX_ERR_UNKNOWN_DATA_TYPE; - case OPAL_ERR_WOULD_BLOCK: - return PMIX_ERR_WOULD_BLOCK; - case OPAL_EXISTS: - return PMIX_EXISTS; - - case OPAL_ERR_SILENT: - return PMIX_ERR_SILENT; - case OPAL_ERROR: - return PMIX_ERROR; - case OPAL_SUCCESS: - case OPAL_OPERATION_SUCCEEDED: - return PMIX_SUCCESS; - default: - return PMIX_ERROR; - } -} - -int pmix1_convert_rc(pmix_status_t rc) -{ - switch (rc) { - case PMIX_ERR_UNPACK_READ_PAST_END_OF_BUFFER: - return OPAL_ERR_UNPACK_READ_PAST_END_OF_BUFFER; - case PMIX_ERR_COMM_FAILURE: - return OPAL_ERR_COMM_FAILURE; - case PMIX_ERR_NOT_IMPLEMENTED: - return OPAL_ERR_NOT_IMPLEMENTED; - case PMIX_ERR_NOT_SUPPORTED: - return OPAL_ERR_NOT_SUPPORTED; - case PMIX_ERR_NOT_FOUND: - return OPAL_ERR_NOT_FOUND; - case PMIX_ERR_SERVER_NOT_AVAIL: - return OPAL_ERR_SERVER_NOT_AVAIL; - - case PMIX_ERR_INVALID_NAMESPACE: - case PMIX_ERR_INVALID_SIZE: - case PMIX_ERR_INVALID_KEYVALP: - case PMIX_ERR_INVALID_NUM_PARSED: - case PMIX_ERR_INVALID_ARGS: - case PMIX_ERR_INVALID_NUM_ARGS: - case PMIX_ERR_INVALID_LENGTH: - case PMIX_ERR_INVALID_VAL_LENGTH: - case PMIX_ERR_INVALID_VAL: - case PMIX_ERR_INVALID_KEY_LENGTH: - case PMIX_ERR_INVALID_KEY: - case PMIX_ERR_INVALID_ARG: - return OPAL_ERR_BAD_PARAM; - case PMIX_ERR_NOMEM: - return OPAL_ERR_OUT_OF_RESOURCE; - case PMIX_ERR_INIT: - return OPAL_ERROR; - - case PMIX_ERR_DATA_VALUE_NOT_FOUND: - return OPAL_ERR_DATA_VALUE_NOT_FOUND; - case PMIX_ERR_OUT_OF_RESOURCE: - return OPAL_ERR_OUT_OF_RESOURCE; - case PMIX_ERR_RESOURCE_BUSY: - return OPAL_ERR_TEMP_OUT_OF_RESOURCE; - case PMIX_ERR_BAD_PARAM: - return OPAL_ERR_BAD_PARAM; - case PMIX_ERR_IN_ERRNO: - return OPAL_ERR_IN_ERRNO; - case PMIX_ERR_UNREACH: - return OPAL_ERR_UNREACH; - case PMIX_ERR_TIMEOUT: - return OPAL_ERR_TIMEOUT; - case PMIX_ERR_NO_PERMISSIONS: - return OPAL_ERR_PERM; - case PMIX_ERR_PACK_MISMATCH: - return OPAL_ERR_PACK_MISMATCH; - case PMIX_ERR_PACK_FAILURE: - return OPAL_ERR_PACK_FAILURE; - - case PMIX_ERR_UNPACK_FAILURE: - return OPAL_ERR_UNPACK_FAILURE; - case PMIX_ERR_UNPACK_INADEQUATE_SPACE: - return OPAL_ERR_UNPACK_INADEQUATE_SPACE; - case PMIX_ERR_TYPE_MISMATCH: - return OPAL_ERR_TYPE_MISMATCH; - case PMIX_ERR_PROC_ENTRY_NOT_FOUND: - return OPAL_ERR_PROC_ENTRY_NOT_FOUND; - case PMIX_ERR_UNKNOWN_DATA_TYPE: - return OPAL_ERR_UNKNOWN_DATA_TYPE; - case PMIX_ERR_WOULD_BLOCK: - return OPAL_ERR_WOULD_BLOCK; - case PMIX_ERR_READY_FOR_HANDSHAKE: - case PMIX_ERR_HANDSHAKE_FAILED: - case PMIX_ERR_INVALID_CRED: - return OPAL_ERR_COMM_FAILURE; - case PMIX_EXISTS: - return OPAL_EXISTS; - - case PMIX_ERR_SILENT: - return OPAL_ERR_SILENT; - case PMIX_ERROR: - return OPAL_ERROR; - case PMIX_SUCCESS: - return OPAL_SUCCESS; - default: - return OPAL_ERROR; - } -} - -pmix_scope_t pmix1_convert_opalscope(opal_pmix_scope_t scope) { - switch(scope) { - case OPAL_PMIX_LOCAL: - return PMIX_LOCAL; - case OPAL_PMIX_REMOTE: - return PMIX_REMOTE; - case OPAL_PMIX_GLOBAL: - return PMIX_GLOBAL; - default: - return PMIX_SCOPE_UNDEF; - } -} - -void pmix1_value_load(pmix_value_t *v, - opal_value_t *kv) -{ - int ival; - unsigned int ui; - - switch(kv->type) { - case OPAL_UNDEF: - v->type = PMIX_UNDEF; - break; - case OPAL_BOOL: - v->type = PMIX_BOOL; - memcpy(&(v->data.flag), &kv->data.flag, 1); - break; - case OPAL_BYTE: - v->type = PMIX_BYTE; - memcpy(&(v->data.byte), &kv->data.byte, 1); - break; - case OPAL_STRING: - v->type = PMIX_STRING; - if (NULL != kv->data.string) { - v->data.string = strdup(kv->data.string); - } else { - v->data.string = NULL; - } - break; - case OPAL_SIZE: - v->type = PMIX_SIZE; - v->data.size = (size_t)kv->data.size; - break; - case OPAL_PID: - v->type = PMIX_PID; - memcpy(&(v->data.pid), &kv->data.pid, sizeof(pid_t)); - break; - case OPAL_INT: - case OPAL_STATUS: - v->type = PMIX_INT; - memcpy(&(v->data.integer), &kv->data.integer, sizeof(int)); - break; - case OPAL_INT8: - v->type = PMIX_INT8; - memcpy(&(v->data.int8), &kv->data.int8, 1); - break; - case OPAL_INT16: - v->type = PMIX_INT16; - memcpy(&(v->data.int16), &kv->data.int16, 2); - break; - case OPAL_INT32: - v->type = PMIX_INT32; - memcpy(&(v->data.int32), &kv->data.int32, 4); - break; - case OPAL_INT64: - v->type = PMIX_INT64; - memcpy(&(v->data.int64), &kv->data.int64, 8); - break; - case OPAL_UINT: - v->type = PMIX_UINT; - memcpy(&(v->data.uint), &kv->data.uint, sizeof(int)); - break; - case OPAL_UINT8: - case OPAL_PROC_STATE: - v->type = PMIX_UINT8; - memcpy(&(v->data.uint8), &kv->data.uint8, 1); - break; - case OPAL_UINT16: - v->type = PMIX_UINT16; - memcpy(&(v->data.uint16), &kv->data.uint16, 2); - break; - case OPAL_UINT32: - case OPAL_INFO_DIRECTIVES: - v->type = PMIX_UINT32; - memcpy(&(v->data.uint32), &kv->data.uint32, 4); - break; - case OPAL_UINT64: - v->type = PMIX_UINT64; - memcpy(&(v->data.uint64), &kv->data.uint64, 8); - break; - case OPAL_FLOAT: - v->type = PMIX_FLOAT; - memcpy(&(v->data.fval), &kv->data.fval, sizeof(float)); - break; - case OPAL_DOUBLE: - v->type = PMIX_DOUBLE; - memcpy(&(v->data.dval), &kv->data.dval, sizeof(double)); - break; - case OPAL_TIMEVAL: - v->type = PMIX_TIMEVAL; - memcpy(&(v->data.tv), &kv->data.tv, sizeof(struct timeval)); - break; - case OPAL_BYTE_OBJECT: - v->type = PMIX_BYTE_OBJECT; - if (NULL != kv->data.bo.bytes) { - v->data.bo.bytes = (char*)malloc(kv->data.bo.size); - memcpy(v->data.bo.bytes, kv->data.bo.bytes, kv->data.bo.size); - v->data.bo.size = (size_t)kv->data.bo.size; - } else { - v->data.bo.bytes = NULL; - v->data.bo.size = 0; - } - break; - case OPAL_VPID: - v->type = PMIX_UINT32; - memcpy(&(v->data.uint32), &kv->data.name.vpid, 4); - break; - case OPAL_PERSIST: - v->type = PMIX_INT; - /* the value is in the uint8_t field, so convert it first */ - ival = (int)kv->data.uint8; - memcpy(&(v->data.integer), &ival, sizeof(int)); - break; - case OPAL_SCOPE: - case OPAL_DATA_RANGE: - v->type = PMIX_UINT; - ui = (unsigned int)kv->data.uint8; - memcpy(&(v->data.uint), &ui, sizeof(unsigned int)); - break; - default: - /* silence warnings */ - v->type = PMIX_UNDEF; - break; - } -} - -int pmix1_value_unload(opal_value_t *kv, - const pmix_value_t *v) -{ - int rc=OPAL_SUCCESS; - - - switch(v->type) { - case PMIX_UNDEF: - rc = OPAL_ERR_UNKNOWN_DATA_TYPE; - break; - case PMIX_BOOL: - kv->type = OPAL_BOOL; - memcpy(&kv->data.flag, &(v->data.flag), 1); - break; - case PMIX_BYTE: - kv->type = OPAL_BYTE; - memcpy(&kv->data.byte, &(v->data.byte), 1); - break; - case PMIX_STRING: - kv->type = OPAL_STRING; - if (NULL != v->data.string) { - kv->data.string = strdup(v->data.string); - } - break; - case PMIX_SIZE: - kv->type = OPAL_SIZE; - kv->data.size = (int)v->data.size; - break; - case PMIX_PID: - kv->type = OPAL_PID; - memcpy(&kv->data.pid, &(v->data.pid), sizeof(pid_t)); - break; - case PMIX_INT: - kv->type = OPAL_INT; - memcpy(&kv->data.integer, &(v->data.integer), sizeof(int)); - break; - case PMIX_INT8: - kv->type = OPAL_INT8; - memcpy(&kv->data.int8, &(v->data.int8), 1); - break; - case PMIX_INT16: - kv->type = OPAL_INT16; - memcpy(&kv->data.int16, &(v->data.int16), 2); - break; - case PMIX_INT32: - kv->type = OPAL_INT32; - memcpy(&kv->data.int32, &(v->data.int32), 4); - break; - case PMIX_INT64: - kv->type = OPAL_INT64; - memcpy(&kv->data, &(v->data.int64), 8); - break; - case PMIX_UINT: - kv->type = OPAL_UINT; - memcpy(&kv->data, &(v->data.uint), sizeof(int)); - break; - case PMIX_UINT8: - kv->type = OPAL_UINT8; - memcpy(&kv->data, &(v->data.uint8), 1); - break; - case PMIX_UINT16: - kv->type = OPAL_UINT16; - memcpy(&kv->data, &(v->data.uint16), 2); - break; - case PMIX_UINT32: - kv->type = OPAL_UINT32; - memcpy(&kv->data, &(v->data.uint32), 4); - break; - case PMIX_UINT64: - kv->type = OPAL_UINT64; - memcpy(&kv->data, &(v->data.uint64), 8); - break; - case PMIX_FLOAT: - kv->type = OPAL_FLOAT; - memcpy(&kv->data, &(v->data.fval), sizeof(float)); - break; - case PMIX_DOUBLE: - kv->type = OPAL_DOUBLE; - memcpy(&kv->data, &(v->data.dval), sizeof(double)); - break; - case PMIX_TIMEVAL: - kv->type = OPAL_TIMEVAL; - memcpy(&kv->data, &(v->data.tv), sizeof(struct timeval)); - break; - case PMIX_BYTE_OBJECT: - kv->type = OPAL_BYTE_OBJECT; - if (NULL != v->data.bo.bytes && 0 < v->data.bo.size) { - kv->data.bo.bytes = (uint8_t*)malloc(v->data.bo.size); - memcpy(kv->data.bo.bytes, v->data.bo.bytes, v->data.bo.size); - kv->data.bo.size = (int)v->data.bo.size; - } else { - kv->data.bo.bytes = NULL; - kv->data.bo.size = 0; - } - break; - default: - /* silence warnings */ - rc = OPAL_ERROR; - break; - } - return rc; -} - - -/**** INSTANTIATE INTERNAL CLASSES ****/ -OBJ_CLASS_INSTANCE(opal_pmix1_jobid_trkr_t, - opal_list_item_t, - NULL, NULL); - -static void opcon(pmix1_opcaddy_t *p) -{ - memset(&p->p, 0, sizeof(pmix_proc_t)); - p->procs = NULL; - p->nprocs = 0; - p->error_procs = NULL; - p->nerror_procs = 0; - p->info = NULL; - p->ninfo = 0; - p->apps = NULL; - p->sz = 0; - p->active = false; - p->opcbfunc = NULL; - p->mdxcbfunc = NULL; - p->valcbfunc = NULL; - p->lkcbfunc = NULL; - p->spcbfunc = NULL; - p->cbdata = NULL; -} -static void opdes(pmix1_opcaddy_t *p) -{ - if (NULL != p->procs) { - PMIX_PROC_FREE(p->procs, p->nprocs); - } - if (NULL != p->error_procs) { - PMIX_PROC_FREE(p->error_procs, p->nerror_procs); - } - if (NULL != p->info) { - PMIX_INFO_FREE(p->info, p->sz); - } - if (NULL != p->apps) { - PMIX_APP_FREE(p->apps, p->sz); - } -} -OBJ_CLASS_INSTANCE(pmix1_opcaddy_t, - opal_object_t, - opcon, opdes); - -static void ocadcon(pmix1_opalcaddy_t *p) -{ - OBJ_CONSTRUCT(&p->procs, opal_list_t); - OBJ_CONSTRUCT(&p->info, opal_list_t); - OBJ_CONSTRUCT(&p->apps, opal_list_t); - p->opcbfunc = NULL; - p->dmdxfunc = NULL; - p->mdxcbfunc = NULL; - p->lkupcbfunc = NULL; - p->spwncbfunc = NULL; - p->cbdata = NULL; - p->odmdxfunc = NULL; - p->ocbdata = NULL; -} -static void ocaddes(pmix1_opalcaddy_t *p) -{ - OPAL_LIST_DESTRUCT(&p->procs); - OPAL_LIST_DESTRUCT(&p->info); - OPAL_LIST_DESTRUCT(&p->apps); -} -OBJ_CLASS_INSTANCE(pmix1_opalcaddy_t, - opal_object_t, - ocadcon, ocaddes); diff --git a/opal/mca/pmix/ext1x/pmix1x.h b/opal/mca/pmix/ext1x/pmix1x.h deleted file mode 100644 index 3222045a39a..00000000000 --- a/opal/mca/pmix/ext1x/pmix1x.h +++ /dev/null @@ -1,180 +0,0 @@ -/* - * Copyright (c) 2014-2018 Intel, Inc. All rights reserved. - * Copyright (c) 2014-2015 Mellanox Technologies, Inc. - * All rights reserved. - * Copyright (c) 2016-2017 Research Organization for Information Science - * and Technology (RIST). All rights reserved. - * $COPYRIGHT$ - * - * Additional copyrights may follow - * - * $HEADER$ - */ - -#ifndef MCA_PMIX_EXT11_H -#define MCA_PMIX_EXT11_H - -#include "opal_config.h" - -#ifdef HAVE_SYS_SOCKET_H -#include -#endif -#ifdef HAVE_SYS_UN_H -#include -#endif - -#include "opal/mca/mca.h" -#include "opal/mca/event/event.h" -#include "opal/util/proc.h" - -#include "opal/mca/pmix/pmix.h" -#include "pmix_server.h" -#include "pmix/pmix_common.h" - -BEGIN_C_DECLS - -typedef struct { - opal_pmix_base_component_t super; - opal_list_t jobids; - opal_list_t values; - bool native_launch; -} mca_pmix_ext1x_component_t; - -OPAL_DECLSPEC extern mca_pmix_ext1x_component_t mca_pmix_ext1x_component; - -OPAL_DECLSPEC extern const opal_pmix_base_module_t opal_pmix_ext1x_module; - -/**** INTERNAL OBJECTS ****/ -typedef struct { - opal_list_item_t super; - opal_jobid_t jobid; - char nspace[PMIX_MAX_NSLEN + 1]; -} opal_pmix1_jobid_trkr_t; -OBJ_CLASS_DECLARATION(opal_pmix1_jobid_trkr_t); - -typedef struct { - opal_object_t super; - pmix_proc_t p; - pmix_proc_t *procs; - size_t nprocs; - pmix_proc_t *error_procs; - size_t nerror_procs; - pmix_info_t *info; - size_t ninfo; - pmix_app_t *apps; - size_t sz; - volatile bool active; - opal_pmix_op_cbfunc_t opcbfunc; - opal_pmix_modex_cbfunc_t mdxcbfunc; - opal_pmix_value_cbfunc_t valcbfunc; - opal_pmix_lookup_cbfunc_t lkcbfunc; - opal_pmix_spawn_cbfunc_t spcbfunc; - void *cbdata; -} pmix1_opcaddy_t; -OBJ_CLASS_DECLARATION(pmix1_opcaddy_t); - -typedef struct { - opal_object_t super; - opal_list_t procs; - opal_list_t info; - opal_list_t apps; - pmix_op_cbfunc_t opcbfunc; - pmix_dmodex_response_fn_t dmdxfunc; - pmix_modex_cbfunc_t mdxcbfunc; - pmix_lookup_cbfunc_t lkupcbfunc; - pmix_spawn_cbfunc_t spwncbfunc; - void *cbdata; - opal_pmix_release_cbfunc_t odmdxfunc; - void *ocbdata; -} pmix1_opalcaddy_t; -OBJ_CLASS_DECLARATION(pmix1_opalcaddy_t); - - -/**** CLIENT FUNCTIONS ****/ -OPAL_MODULE_DECLSPEC int pmix1_client_init(opal_list_t *ilist); -OPAL_MODULE_DECLSPEC int pmix1_client_finalize(void); -OPAL_MODULE_DECLSPEC int pmix1_initialized(void); -OPAL_MODULE_DECLSPEC int pmix1_abort(int flag, const char *msg, - opal_list_t *procs); -OPAL_MODULE_DECLSPEC int pmix1_commit(void); -OPAL_MODULE_DECLSPEC int pmix1_fence(opal_list_t *procs, int collect_data); -OPAL_MODULE_DECLSPEC int pmix1_fencenb(opal_list_t *procs, int collect_data, - opal_pmix_op_cbfunc_t cbfunc, void *cbdata); -OPAL_MODULE_DECLSPEC int pmix1_put(opal_pmix_scope_t scope, - opal_value_t *val); -OPAL_MODULE_DECLSPEC int pmix1_get(const opal_process_name_t *proc, const char *key, - opal_list_t *info, opal_value_t **val); -OPAL_MODULE_DECLSPEC int pmix1_getnb(const opal_process_name_t *proc, const char *key, - opal_list_t *info, - opal_pmix_value_cbfunc_t cbfunc, void *cbdata); -OPAL_MODULE_DECLSPEC int pmix1_publish(opal_list_t *info); -OPAL_MODULE_DECLSPEC int pmix1_publishnb(opal_list_t *info, - opal_pmix_op_cbfunc_t cbfunc, void *cbdata); -OPAL_MODULE_DECLSPEC int pmix1_lookup(opal_list_t *data, opal_list_t *info); -OPAL_MODULE_DECLSPEC int pmix1_lookupnb(char **keys, opal_list_t *info, - opal_pmix_lookup_cbfunc_t cbfunc, void *cbdata); -OPAL_MODULE_DECLSPEC int pmix1_unpublish(char **keys, opal_list_t *info); -OPAL_MODULE_DECLSPEC int pmix1_unpublishnb(char **keys, opal_list_t *info, - opal_pmix_op_cbfunc_t cbfunc, void *cbdata); -OPAL_MODULE_DECLSPEC int pmix1_spawn(opal_list_t *job_info, opal_list_t *apps, opal_jobid_t *jobid); -OPAL_MODULE_DECLSPEC int pmix1_spawnnb(opal_list_t *job_info, opal_list_t *apps, - opal_pmix_spawn_cbfunc_t cbfunc, void *cbdata); -OPAL_MODULE_DECLSPEC int pmix1_connect(opal_list_t *procs); -OPAL_MODULE_DECLSPEC int pmix1_connectnb(opal_list_t *procs, - opal_pmix_op_cbfunc_t cbfunc, - void *cbdata); -OPAL_MODULE_DECLSPEC int pmix1_disconnect(opal_list_t *procs); -OPAL_MODULE_DECLSPEC int pmix1_disconnectnb(opal_list_t *procs, - opal_pmix_op_cbfunc_t cbfunc, - void *cbdata); -OPAL_MODULE_DECLSPEC int pmix1_resolve_peers(const char *nodename, opal_jobid_t jobid, - opal_list_t *procs); -OPAL_MODULE_DECLSPEC int pmix1_resolve_nodes(opal_jobid_t jobid, char **nodelist); - -/**** COMMON FUNCTIONS ****/ -OPAL_MODULE_DECLSPEC int pmix1_store_local(const opal_process_name_t *proc, - opal_value_t *val); - -/**** SERVER SOUTHBOUND FUNCTIONS ****/ -OPAL_MODULE_DECLSPEC int pmix1_server_init(opal_pmix_server_module_t *module, - opal_list_t *info); -OPAL_MODULE_DECLSPEC int pmix1_server_finalize(void); -OPAL_MODULE_DECLSPEC int pmix1_server_gen_regex(const char *input, char **regex); -OPAL_MODULE_DECLSPEC int pmix1_server_gen_ppn(const char *input, char **ppn); -OPAL_MODULE_DECLSPEC int pmix1_server_register_nspace(opal_jobid_t jobid, - int nlocalprocs, - opal_list_t *info, - opal_pmix_op_cbfunc_t cbfunc, - void *cbdata); -OPAL_MODULE_DECLSPEC void pmix1_server_deregister_nspace(opal_jobid_t jobid, - opal_pmix_op_cbfunc_t cbfunc, - void *cbdata); -OPAL_MODULE_DECLSPEC int pmix1_server_register_client(const opal_process_name_t *proc, - uid_t uid, gid_t gid, - void *server_object, - opal_pmix_op_cbfunc_t cbfunc, - void *cbdata); -OPAL_MODULE_DECLSPEC void pmix1_server_deregister_client(const opal_process_name_t *proc, - opal_pmix_op_cbfunc_t cbfunc, - void *cbdata); -OPAL_MODULE_DECLSPEC int pmix1_server_setup_fork(const opal_process_name_t *proc, char ***env); -OPAL_MODULE_DECLSPEC int pmix1_server_dmodex(const opal_process_name_t *proc, - opal_pmix_modex_cbfunc_t cbfunc, void *cbdata); -OPAL_MODULE_DECLSPEC int pmix1_server_notify_error(int status, - const opal_process_name_t *source, - opal_list_t *info, - opal_pmix_op_cbfunc_t cbfunc, void *cbdata); - - -/**** COMPONENT UTILITY FUNCTIONS ****/ -OPAL_MODULE_DECLSPEC pmix_status_t pmix1_convert_opalrc(int rc); -OPAL_MODULE_DECLSPEC int pmix1_convert_rc(pmix_status_t rc); -OPAL_MODULE_DECLSPEC pmix_scope_t pmix1_convert_opalscope(opal_pmix_scope_t scope); -OPAL_MODULE_DECLSPEC void pmix1_value_load(pmix_value_t *v, - opal_value_t *kv); -OPAL_MODULE_DECLSPEC int pmix1_value_unload(opal_value_t *kv, - const pmix_value_t *v); - -END_C_DECLS - -#endif /* MCA_PMIX_EXTERNAL_H */ diff --git a/opal/mca/pmix/ext1x/pmix1x_client.c b/opal/mca/pmix/ext1x/pmix1x_client.c deleted file mode 100644 index d06bc5791af..00000000000 --- a/opal/mca/pmix/ext1x/pmix1x_client.c +++ /dev/null @@ -1,1346 +0,0 @@ -/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ -/* - * Copyright (c) 2014-2018 Intel, Inc. All rights reserved. - * Copyright (c) 2014-2018 Research Organization for Information Science - * and Technology (RIST). All rights reserved. - * Copyright (c) 2014-2015 Mellanox Technologies, Inc. - * All rights reserved. - * Copyright (c) 2016 Cisco Systems, Inc. All rights reserved. - * $COPYRIGHT$ - * - * Additional copyrights may follow - * - * $HEADER$ - */ - -#include "opal_config.h" -#include "opal/constants.h" -#include "opal/types.h" - -#ifdef HAVE_STRING_H -#include -#endif -#ifdef HAVE_UNISTD_H -#include -#endif - -#include "opal/util/argv.h" -#include "opal/util/proc.h" -#include "opal/util/string_copy.h" - -#include "opal/mca/pmix/base/base.h" -#include "pmix1x.h" -#include "pmix.h" - -static pmix_proc_t my_proc; -static char *dbgvalue=NULL; -static int errhdler_ref = 0; - -#define PMIX_WAIT_FOR_COMPLETION(a) \ - do { \ - while ((a)) { \ - usleep(10); \ - } \ - } while (0) - - -static void completion_handler(int status, opal_list_t *results, - opal_pmix_op_cbfunc_t cbfunc, void *thiscbdata, - void *notification_cbdata) { - int * cond = (int *)notification_cbdata; - *cond = 0; -} - -static void myerr(pmix_status_t status, - pmix_proc_t procs[], size_t nprocs, - pmix_info_t info[], size_t ninfo) -{ - int rc; - opal_list_t plist, ilist; - opal_namelist_t *nm; - opal_value_t *iptr; - size_t n; - volatile int cond = 1; - - /* convert the incoming status */ - rc = pmix1_convert_rc(status); - - /* convert the array of procs */ - OBJ_CONSTRUCT(&plist, opal_list_t); - for (n=0; n < nprocs; n++) { - nm = OBJ_NEW(opal_namelist_t); - nm->name.jobid = strtoul(procs[n].nspace, NULL, 10); - nm->name.vpid = procs[n].rank; - opal_list_append(&plist, &nm->super); - } - - /* convert the array of info */ - OBJ_CONSTRUCT(&ilist, opal_list_t); - for (n=0; n < ninfo; n++) { - iptr = OBJ_NEW(opal_value_t); - iptr->key = strdup(info[n].key); - pmix1_value_unload(iptr, &info[n].value); - opal_list_append(&plist, &iptr->super); - } - - /* call the base errhandler */ - opal_pmix_base_evhandler(rc, &OPAL_PROC_MY_NAME, &plist, &ilist, completion_handler, (void *)&cond); - PMIX_WAIT_FOR_COMPLETION(cond); - - OPAL_LIST_DESTRUCT(&plist); - OPAL_LIST_DESTRUCT(&ilist); -} - -static void errreg_cbfunc (pmix_status_t status, - int errhandler_ref, - void *cbdata) -{ - errhdler_ref = errhandler_ref; - opal_output_verbose(5, opal_pmix_base_framework.framework_output, - "PMIX client errreg_cbfunc - error handler registered status=%d, reference=%d", - status, errhandler_ref); -} - -int pmix1_client_init(opal_list_t *ilist) -{ - opal_process_name_t pname; - pmix_status_t rc; - int dbg; - opal_pmix1_jobid_trkr_t *job; - - opal_output_verbose(1, opal_pmix_base_framework.framework_output, - "PMIx_client init"); - - if (0 < (dbg = opal_output_get_verbosity(opal_pmix_base_framework.framework_output))) { - asprintf(&dbgvalue, "PMIX_DEBUG=%d", dbg); - putenv(dbgvalue); - } - - rc = PMIx_Init(&my_proc); - if (PMIX_SUCCESS != rc) { - return pmix1_convert_rc(rc); - } - - /* store our jobid and rank */ - if (NULL != getenv(OPAL_MCA_PREFIX"orte_launch")) { - /* if we were launched by the OMPI RTE, then - * the jobid is in a special format - so get it */ - mca_pmix_ext1x_component.native_launch = true; - opal_convert_string_to_jobid(&pname.jobid, my_proc.nspace); - } else { - /* we were launched by someone else, so make the - * jobid just be the hash of the nspace */ - OPAL_HASH_JOBID(my_proc.nspace, pname.jobid); - } - /* insert this into our list of jobids - it will be the - * first, and so we'll check it first */ - job = OBJ_NEW(opal_pmix1_jobid_trkr_t); - (void)opal_string_copy(job->nspace, my_proc.nspace, PMIX_MAX_NSLEN); - job->jobid = pname.jobid; - opal_list_append(&mca_pmix_ext1x_component.jobids, &job->super); - - pname.vpid = my_proc.rank; - opal_proc_set_name(&pname); - - /* register the errhandler */ - PMIx_Register_errhandler(NULL, 0, myerr, errreg_cbfunc, NULL ); - return OPAL_SUCCESS; - -} - -int pmix1_client_finalize(void) -{ - pmix_status_t rc; - - opal_output_verbose(1, opal_pmix_base_framework.framework_output, - "PMIx_client finalize"); - - /* deregister the errhandler */ - PMIx_Deregister_errhandler(errhdler_ref, NULL, NULL); - - rc = PMIx_Finalize(); - return pmix1_convert_rc(rc); -} - -int pmix1_initialized(void) -{ - opal_output_verbose(1, opal_pmix_base_framework.framework_output, - "PMIx_client initialized"); - - return PMIx_Initialized(); -} - -int pmix1_abort(int flag, const char *msg, - opal_list_t *procs) -{ - pmix_status_t rc; - pmix_proc_t *parray=NULL; - size_t n, cnt=0; - opal_namelist_t *ptr; - opal_pmix1_jobid_trkr_t *job, *jptr; - - opal_output_verbose(1, opal_pmix_base_framework.framework_output, - "PMIx_client abort"); - - /* convert the list of procs to an array - * of pmix_proc_t */ - if (NULL != procs && 0 < (cnt = opal_list_get_size(procs))) { - PMIX_PROC_CREATE(parray, cnt); - n=0; - OPAL_LIST_FOREACH(ptr, procs, opal_namelist_t) { - /* look thru our list of jobids and find the - * corresponding nspace */ - job = NULL; - OPAL_LIST_FOREACH(jptr, &mca_pmix_ext1x_component.jobids, opal_pmix1_jobid_trkr_t) { - if (jptr->jobid == ptr->name.jobid) { - job = jptr; - break; - } - } - if (NULL == job) { - return OPAL_ERR_NOT_FOUND; - } - (void)opal_string_copy(parray[n].nspace, job->nspace, PMIX_MAX_NSLEN); - parray[n].rank = ptr->name.vpid; - ++n; - } - } - - /* call the library abort */ - rc = PMIx_Abort(flag, msg, parray, cnt); - - /* release the array */ - PMIX_PROC_FREE(parray, cnt); - - return pmix1_convert_rc(rc); -} - -int pmix1_store_local(const opal_process_name_t *proc, opal_value_t *val) -{ - pmix_value_t kv; - pmix_status_t rc; - pmix_proc_t p; - opal_pmix1_jobid_trkr_t *job, *jptr; - opal_value_t *hack; - - if (NULL != proc) { - /* look thru our list of jobids and find the - * corresponding nspace */ - job = NULL; - OPAL_LIST_FOREACH(jptr, &mca_pmix_ext1x_component.jobids, opal_pmix1_jobid_trkr_t) { - if (jptr->jobid == proc->jobid) { - job = jptr; - break; - } - } - if (NULL == job) { - /* if we don't know about the job, then neither will the internal - * storage routine in PMIx. In this older version of PMIx, there - * is no way to insert an nspace into the client, and so we cannot - * get around the problem there. Instead, we need to hold such - * values locally in the component. Sadly, we cannot just use - * the input val param as it might not be dynamic, so copy it here */ - opal_dss.copy((void**)&hack, val, OPAL_VALUE); - opal_list_append(&mca_pmix_ext1x_component.values, &hack->super); - return OPAL_SUCCESS; - } - (void)opal_string_copy(p.nspace, job->nspace, PMIX_MAX_NSLEN); - p.rank = proc->vpid; - } else { - /* use our name */ - (void)opal_string_copy(p.nspace, my_proc.nspace, PMIX_MAX_NSLEN); - p.rank = OPAL_PROC_MY_NAME.vpid; - } - - PMIX_VALUE_CONSTRUCT(&kv); - pmix1_value_load(&kv, val); - - rc = PMIx_Store_internal(&p, val->key, &kv); - PMIX_VALUE_DESTRUCT(&kv); - - return pmix1_convert_rc(rc); -} - -int pmix1_commit(void) -{ - pmix_status_t rc; - - rc = PMIx_Commit(); - return pmix1_convert_rc(rc); -} - -static void opcbfunc(pmix_status_t status, void *cbdata) -{ - pmix1_opcaddy_t *op = (pmix1_opcaddy_t*)cbdata; - - if (NULL != op->opcbfunc) { - op->opcbfunc(pmix1_convert_rc(status), op->cbdata); - } - OBJ_RELEASE(op); -} - -int pmix1_fence(opal_list_t *procs, int collect_data) -{ - pmix_status_t rc; - pmix_proc_t *parray=NULL; - size_t n, cnt=0; - opal_namelist_t *ptr; - pmix_info_t info, *iptr; - opal_pmix1_jobid_trkr_t *job, *jptr; - - opal_output_verbose(1, opal_pmix_base_framework.framework_output, - "PMIx_client fence"); - - /* convert the list of procs to an array - * of pmix_proc_t */ - if (NULL != procs && 0 < (cnt = opal_list_get_size(procs))) { - PMIX_PROC_CREATE(parray, cnt); - n=0; - OPAL_LIST_FOREACH(ptr, procs, opal_namelist_t) { - /* look thru our list of jobids and find the - * corresponding nspace */ - job = NULL; - OPAL_LIST_FOREACH(jptr, &mca_pmix_ext1x_component.jobids, opal_pmix1_jobid_trkr_t) { - if (jptr->jobid == ptr->name.jobid) { - job = jptr; - break; - } - } - if (NULL == job) { - return OPAL_ERR_NOT_FOUND; - } - (void)opal_string_copy(parray[n].nspace, job->nspace, PMIX_MAX_NSLEN); - parray[n].rank = ptr->name.vpid; - ++n; - } - } - if (collect_data) { - PMIX_INFO_CONSTRUCT(&info); - (void)opal_string_copy(info.key, PMIX_COLLECT_DATA, PMIX_MAX_KEYLEN); - info.value.type = PMIX_BOOL; - info.value.data.flag = true; - iptr = &info; - n = 1; - } else { - iptr = NULL; - n = 0; - } - - /* call the library function */ - rc = PMIx_Fence(parray, cnt, iptr, n); - - /* release the array */ - PMIX_PROC_FREE(parray, cnt); - if (NULL != iptr) { - PMIX_INFO_DESTRUCT(&info); - } - - return pmix1_convert_rc(rc); - -} - -int pmix1_fencenb(opal_list_t *procs, int collect_data, - opal_pmix_op_cbfunc_t cbfunc, void *cbdata) -{ - pmix_status_t rc; - pmix_proc_t *parray=NULL; - size_t n, cnt=0; - opal_namelist_t *ptr; - pmix1_opcaddy_t *op; - pmix_info_t info, *iptr; - opal_pmix1_jobid_trkr_t *job, *jptr; - - opal_output_verbose(1, opal_pmix_base_framework.framework_output, - "PMIx_client fence_nb"); - - /* convert the list of procs to an array - * of pmix_proc_t */ - if (NULL != procs && 0 < (cnt = opal_list_get_size(procs))) { - PMIX_PROC_CREATE(parray, cnt); - n=0; - OPAL_LIST_FOREACH(ptr, procs, opal_namelist_t) { - /* look thru our list of jobids and find the - * corresponding nspace */ - job = NULL; - OPAL_LIST_FOREACH(jptr, &mca_pmix_ext1x_component.jobids, opal_pmix1_jobid_trkr_t) { - if (jptr->jobid == ptr->name.jobid) { - job = jptr; - break; - } - } - if (NULL == job) { - return OPAL_ERR_NOT_FOUND; - } - (void)opal_string_copy(parray[n].nspace, job->nspace, PMIX_MAX_NSLEN); - parray[n].rank = ptr->name.vpid; - ++n; - } - } - - if (collect_data) { - PMIX_INFO_CONSTRUCT(&info); - (void)opal_string_copy(info.key, PMIX_COLLECT_DATA, PMIX_MAX_KEYLEN); - info.value.type = PMIX_BOOL; - info.value.data.flag = true; - iptr = &info; - n = 1; - } else { - iptr = NULL; - n = 0; - } - - /* create the caddy */ - op = OBJ_NEW(pmix1_opcaddy_t); - op->opcbfunc = cbfunc; - op->cbdata = cbdata; - op->procs = parray; - op->nprocs = cnt; - - /* call the library function */ - rc = PMIx_Fence_nb(parray, cnt, iptr, n, opcbfunc, op); - if (PMIX_SUCCESS != rc) { - OBJ_RELEASE(op); - } - - return pmix1_convert_rc(rc); - -} - -int pmix1_put(opal_pmix_scope_t opal_scope, - opal_value_t *val) -{ - pmix_value_t kv; - pmix_scope_t pmix_scope = pmix1_convert_opalscope(opal_scope); - pmix_status_t rc; - - opal_output_verbose(1, opal_pmix_base_framework.framework_output, - "PMIx_client put"); - - PMIX_VALUE_CONSTRUCT(&kv); - pmix1_value_load(&kv, val); - - rc = PMIx_Put(pmix_scope, val->key, &kv); - PMIX_VALUE_DESTRUCT(&kv); - return pmix1_convert_rc(rc); -} - -int pmix1_get(const opal_process_name_t *proc, const char *key, - opal_list_t *info, opal_value_t **val) -{ - int ret; - pmix_value_t *kv; - pmix_status_t rc; - pmix_proc_t p, *pptr; - size_t ninfo, n; - pmix_info_t *pinfo; - opal_value_t *ival; - opal_pmix1_jobid_trkr_t *job, *jptr; - - opal_output_verbose(1, opal_pmix_base_framework.framework_output, - "%s PMIx_client get on proc %s key %s", - OPAL_NAME_PRINT(OPAL_PROC_MY_NAME), - (NULL == proc) ? "NULL" : OPAL_NAME_PRINT(*proc), key); - - /* prep default response */ - *val = NULL; - if (NULL != proc) { - /* look thru our list of jobids and find the - * corresponding nspace */ - job = NULL; - OPAL_LIST_FOREACH(jptr, &mca_pmix_ext1x_component.jobids, opal_pmix1_jobid_trkr_t) { - if (jptr->jobid == proc->jobid) { - job = jptr; - break; - } - } - if (NULL == job) { - /* see if we have this key on our local value list */ - OPAL_LIST_FOREACH(ival, &mca_pmix_ext1x_component.values, opal_value_t) { - if (0 == strcmp(key, ival->key)) { - /* got it */ - opal_dss.copy((void**)val, ival, OPAL_VALUE); - return OPAL_SUCCESS; - } - } - /* otherwise, we can't find it */ - return OPAL_ERR_NOT_FOUND; - } - (void)opal_string_copy(p.nspace, job->nspace, PMIX_MAX_NSLEN); - if (OPAL_VPID_WILDCARD == proc->vpid) { - p.rank = my_proc.rank; - } else { - p.rank = proc->vpid; - } - pptr = &p; - } else { - /* if they are asking for our jobid, then return it */ - if (0 == strcmp(key, OPAL_PMIX_JOBID)) { - (*val) = OBJ_NEW(opal_value_t); - (*val)->type = OPAL_UINT32; - (*val)->data.uint32 = OPAL_PROC_MY_NAME.jobid; - return OPAL_SUCCESS; - } else if (0 == strcmp(key, OPAL_PMIX_RANK)) { - (*val) = OBJ_NEW(opal_value_t); - (*val)->type = OPAL_INT; - (*val)->data.integer = my_proc.rank; - return OPAL_SUCCESS; - } - pptr = NULL; - } - - if (NULL != info && 0 < (ninfo = opal_list_get_size(info))) { - PMIX_INFO_CREATE(pinfo, ninfo); - n=0; - OPAL_LIST_FOREACH(ival, info, opal_value_t) { - if (0 == strcmp(ival->key, OPAL_PMIX_IMMEDIATE)) { - (void)opal_string_copy(pinfo[n].key, OPAL_PMIX_OPTIONAL, PMIX_MAX_KEYLEN); - pmix1_value_load(&pinfo[n].value, ival); - } else { - (void)opal_string_copy(pinfo[n].key, ival->key, PMIX_MAX_KEYLEN); - pmix1_value_load(&pinfo[n].value, ival); - } - ++n; - } - } else { - pinfo = NULL; - ninfo = 0; - } - - /* pass the request down */ - rc = PMIx_Get(pptr, key, pinfo, ninfo, &kv); - if (PMIX_SUCCESS == rc) { - if (NULL == kv) { - ret = OPAL_SUCCESS; - } else { - *val = OBJ_NEW(opal_value_t); - if (NULL != key) { - (*val)->key = strdup(key); - } - ret = pmix1_value_unload(*val, kv); - PMIX_VALUE_FREE(kv, 1); - } - } else { - ret = pmix1_convert_rc(rc); - } - PMIX_INFO_FREE(pinfo, ninfo); - return ret; -} - -static void val_cbfunc(pmix_status_t status, - pmix_value_t *kv, void *cbdata) -{ - pmix1_opcaddy_t *op = (pmix1_opcaddy_t*)cbdata; - int rc; - opal_value_t val, *v=NULL; - - rc = pmix1_convert_opalrc(status); - if (PMIX_SUCCESS == status && NULL != kv) { - rc = pmix1_value_unload(&val, kv); - v = &val; - } - - if (NULL != op->valcbfunc) { - op->valcbfunc(rc, v, op->cbdata); - } - OBJ_RELEASE(op); -} - -int pmix1_getnb(const opal_process_name_t *proc, const char *key, - opal_list_t *info, - opal_pmix_value_cbfunc_t cbfunc, void *cbdata) -{ - pmix1_opcaddy_t *op; - pmix_status_t rc; - size_t n; - opal_value_t *ival; - opal_pmix1_jobid_trkr_t *job, *jptr; - - opal_output_verbose(1, opal_pmix_base_framework.framework_output, - "%s PMIx_client get_nb on proc %s key %s", - OPAL_NAME_PRINT(OPAL_PROC_MY_NAME), - (NULL == proc) ? "NULL" : OPAL_NAME_PRINT(*proc), key); - - /* create the caddy */ - op = OBJ_NEW(pmix1_opcaddy_t); - op->valcbfunc = cbfunc; - op->cbdata = cbdata; - - if (NULL != proc) { - /* look thru our list of jobids and find the - * corresponding nspace */ - job = NULL; - OPAL_LIST_FOREACH(jptr, &mca_pmix_ext1x_component.jobids, opal_pmix1_jobid_trkr_t) { - if (jptr->jobid == proc->jobid) { - job = jptr; - break; - } - } - if (NULL == job) { - return OPAL_ERR_NOT_FOUND; - } - (void)opal_string_copy(op->p.nspace, job->nspace, PMIX_MAX_NSLEN); - op->p.rank = proc->vpid; - } else { - (void)opal_string_copy(op->p.nspace, my_proc.nspace, PMIX_MAX_NSLEN); - op->p.rank = PMIX_RANK_WILDCARD; - } - - if (NULL != info && 0 < (op->sz = opal_list_get_size(info))) { - PMIX_INFO_CREATE(op->info, op->sz); - n=0; - OPAL_LIST_FOREACH(ival, info, opal_value_t) { - if (0 == strcmp(ival->key, OPAL_PMIX_IMMEDIATE)) { - (void)opal_string_copy(op->info[n].key, OPAL_PMIX_OPTIONAL, PMIX_MAX_KEYLEN); - pmix1_value_load(&op->info[n].value, ival); - } else { - (void)opal_string_copy(op->info[n].key, ival->key, PMIX_MAX_KEYLEN); - pmix1_value_load(&op->info[n].value, ival); - } - ++n; - } - } - - /* call the library function */ - rc = PMIx_Get_nb(&op->p, key, op->info, op->sz, val_cbfunc, op); - if (PMIX_SUCCESS != rc) { - OBJ_RELEASE(op); - } - - return pmix1_convert_rc(rc); -} - -int pmix1_publish(opal_list_t *info) -{ - pmix_info_t *pinfo; - pmix_status_t ret; - opal_value_t *iptr; - size_t sz, n; - - opal_output_verbose(1, opal_pmix_base_framework.framework_output, - "PMIx_client publish"); - - if (NULL == info) { - return OPAL_ERR_BAD_PARAM; - } - - sz = opal_list_get_size(info); - if (0 < sz) { - PMIX_INFO_CREATE(pinfo, sz); - n=0; - OPAL_LIST_FOREACH(iptr, info, opal_value_t) { - (void)opal_string_copy(pinfo[n].key, iptr->key, PMIX_MAX_KEYLEN); - pmix1_value_load(&pinfo[n].value, iptr); - ++n; - } - } else { - pinfo = NULL; - } - - ret = PMIx_Publish(pinfo, sz); - if (0 < sz) { - PMIX_INFO_FREE(pinfo, sz); - } - - return pmix1_convert_rc(ret); -} - -int pmix1_publishnb(opal_list_t *info, - opal_pmix_op_cbfunc_t cbfunc, void *cbdata) -{ - pmix_status_t ret; - opal_value_t *iptr; - size_t n; - pmix1_opcaddy_t *op; - - opal_output_verbose(1, opal_pmix_base_framework.framework_output, - "PMIx_client publish_nb"); - - if (NULL == info) { - return OPAL_ERR_BAD_PARAM; - } - - /* create the caddy */ - op = OBJ_NEW(pmix1_opcaddy_t); - op->opcbfunc = cbfunc; - op->cbdata = cbdata; - - op->sz = opal_list_get_size(info); - if (0 < op->sz) { - PMIX_INFO_CREATE(op->info, op->sz); - n=0; - OPAL_LIST_FOREACH(iptr, info, opal_value_t) { - (void)opal_string_copy(op->info[n].key, iptr->key, PMIX_MAX_KEYLEN); - pmix1_value_load(&op->info[n].value, iptr); - ++n; - } - } - - ret = PMIx_Publish_nb(op->info, op->sz, opcbfunc, op); - if (0 < op->sz) { - PMIX_INFO_FREE(op->info, op->sz); - } - - return pmix1_convert_rc(ret); -} - -int pmix1_lookup(opal_list_t *data, opal_list_t *info) -{ - pmix_pdata_t *pdata; - pmix_info_t *pinfo; - size_t sz, ninfo, n; - int rc; - pmix_status_t ret; - opal_pmix_pdata_t *d; - opal_value_t *iptr; - opal_pmix1_jobid_trkr_t *job, *jptr; - - opal_output_verbose(1, opal_pmix_base_framework.framework_output, - "PMIx_client lookup"); - - if (NULL == data) { - return OPAL_ERR_BAD_PARAM; - } - - sz = opal_list_get_size(data); - PMIX_PDATA_CREATE(pdata, sz); - n=0; - OPAL_LIST_FOREACH(d, data, opal_pmix_pdata_t) { - (void)opal_string_copy(pdata[n++].key, d->value.key, PMIX_MAX_KEYLEN); - } - - if (NULL != info && (0 < (ninfo = opal_list_get_size(info)))) { - PMIX_INFO_CREATE(pinfo, ninfo); - n=0; - OPAL_LIST_FOREACH(iptr, info, opal_value_t) { - (void)opal_string_copy(pinfo[n].key, iptr->key, PMIX_MAX_KEYLEN); - pmix1_value_load(&pinfo[n].value, iptr); - ++n; - } - } else { - pinfo = NULL; - ninfo = 0; - } - - ret = PMIx_Lookup(pdata, sz, pinfo, ninfo); - PMIX_INFO_FREE(pinfo, ninfo); - - if (PMIX_SUCCESS == ret) { - /* transfer the data back */ - n=0; - OPAL_LIST_FOREACH(d, data, opal_pmix_pdata_t) { - if (mca_pmix_ext1x_component.native_launch) { - /* if we were launched by the OMPI RTE, then - * the jobid is in a special format - so get it */ - opal_convert_string_to_jobid(&d->proc.jobid, pdata[n].proc.nspace); - } else { - /* we were launched by someone else, so make the - * jobid just be the hash of the nspace */ - OPAL_HASH_JOBID(pdata[n].proc.nspace, d->proc.jobid); - } - /* if we don't already have it, add this to our jobid tracker */ - job = NULL; - OPAL_LIST_FOREACH(jptr, &mca_pmix_ext1x_component.jobids, opal_pmix1_jobid_trkr_t) { - if (jptr->jobid == d->proc.jobid) { - job = jptr; - break; - } - } - if (NULL == job) { - job = OBJ_NEW(opal_pmix1_jobid_trkr_t); - (void)opal_string_copy(job->nspace, pdata[n].proc.nspace, PMIX_MAX_NSLEN); - job->jobid = d->proc.jobid; - opal_list_append(&mca_pmix_ext1x_component.jobids, &job->super); - } - if (PMIX_RANK_WILDCARD == pdata[n].proc.rank) { - d->proc.vpid = OPAL_VPID_WILDCARD; - } else { - d->proc.vpid = pdata[n].proc.rank; - } - rc = pmix1_value_unload(&d->value, &pdata[n].value); - if (OPAL_SUCCESS != rc) { - OPAL_ERROR_LOG(rc); - PMIX_PDATA_FREE(pdata, sz); - return OPAL_ERR_BAD_PARAM; - } - ++n; - } - } - - return pmix1_convert_rc(ret); -} - -static void lk_cbfunc(pmix_status_t status, - pmix_pdata_t data[], size_t ndata, - void *cbdata) -{ - pmix1_opcaddy_t *op = (pmix1_opcaddy_t*)cbdata; - opal_pmix_pdata_t *d; - opal_list_t results, *r = NULL; - int rc; - size_t n; - opal_pmix1_jobid_trkr_t *job, *jptr; - - if (NULL == op->lkcbfunc) { - OBJ_RELEASE(op); - return; - } - - rc = pmix1_convert_rc(status); - if (OPAL_SUCCESS == rc) { - OBJ_CONSTRUCT(&results, opal_list_t); - for (n=0; n < ndata; n++) { - d = OBJ_NEW(opal_pmix_pdata_t); - opal_list_append(&results, &d->super); - if (mca_pmix_ext1x_component.native_launch) { - /* if we were launched by the OMPI RTE, then - * the jobid is in a special format - so get it */ - opal_convert_string_to_jobid(&d->proc.jobid, data[n].proc.nspace); - } else { - /* we were launched by someone else, so make the - * jobid just be the hash of the nspace */ - OPAL_HASH_JOBID(data[n].proc.nspace, d->proc.jobid); - } - /* if we don't already have it, add this to our jobid tracker */ - job = NULL; - OPAL_LIST_FOREACH(jptr, &mca_pmix_ext1x_component.jobids, opal_pmix1_jobid_trkr_t) { - if (jptr->jobid == d->proc.jobid) { - job = jptr; - break; - } - } - if (NULL == job) { - job = OBJ_NEW(opal_pmix1_jobid_trkr_t); - (void)opal_string_copy(job->nspace, data[n].proc.nspace, PMIX_MAX_NSLEN); - job->jobid = d->proc.jobid; - opal_list_append(&mca_pmix_ext1x_component.jobids, &job->super); - } - if (PMIX_RANK_WILDCARD == data[n].proc.rank) { - d->proc.vpid = OPAL_VPID_WILDCARD; - } else { - d->proc.vpid = data[n].proc.rank; - } - d->value.key = strdup(data[n].key); - rc = pmix1_value_unload(&d->value, &data[n].value); - if (OPAL_SUCCESS != rc) { - rc = OPAL_ERR_BAD_PARAM; - OPAL_ERROR_LOG(rc); - goto release; - } - } - r = &results; - } -release: - /* execute the callback */ - op->lkcbfunc(rc, r, op->cbdata); - - if (NULL != r) { - OPAL_LIST_DESTRUCT(&results); - } - OBJ_RELEASE(op); -} - -int pmix1_lookupnb(char **keys, opal_list_t *info, - opal_pmix_lookup_cbfunc_t cbfunc, void *cbdata) -{ - pmix_status_t ret; - pmix1_opcaddy_t *op; - opal_value_t *iptr; - size_t n; - - - opal_output_verbose(1, opal_pmix_base_framework.framework_output, - "PMIx_client lookup_nb"); - - /* create the caddy */ - op = OBJ_NEW(pmix1_opcaddy_t); - op->lkcbfunc = cbfunc; - op->cbdata = cbdata; - - if (NULL != info && 0 < (op->sz = opal_list_get_size(info))) { - PMIX_INFO_CREATE(op->info, op->sz); - n=0; - OPAL_LIST_FOREACH(iptr, info, opal_value_t) { - (void)opal_string_copy(op->info[n].key, iptr->key, PMIX_MAX_KEYLEN); - pmix1_value_load(&op->info[n].value, iptr); - ++n; - } - } - - ret = PMIx_Lookup_nb(keys, op->info, op->sz, lk_cbfunc, op); - - return pmix1_convert_rc(ret); -} - -int pmix1_unpublish(char **keys, opal_list_t *info) -{ - pmix_status_t ret; - size_t ninfo, n; - pmix_info_t *pinfo; - opal_value_t *iptr; - - if (NULL != info && 0 < (ninfo = opal_list_get_size(info))) { - PMIX_INFO_CREATE(pinfo, ninfo); - n=0; - OPAL_LIST_FOREACH(iptr, info, opal_value_t) { - (void)opal_string_copy(pinfo[n].key, iptr->key, PMIX_MAX_KEYLEN); - pmix1_value_load(&pinfo[n].value, iptr); - ++n; - } - } else { - pinfo = NULL; - ninfo = 0; - } - - ret = PMIx_Unpublish(keys, pinfo, ninfo); - PMIX_INFO_FREE(pinfo, ninfo); - - return pmix1_convert_rc(ret); -} - -int pmix1_unpublishnb(char **keys, opal_list_t *info, - opal_pmix_op_cbfunc_t cbfunc, void *cbdata) -{ - pmix_status_t ret; - pmix1_opcaddy_t *op; - opal_value_t *iptr; - size_t n; - - /* create the caddy */ - op = OBJ_NEW(pmix1_opcaddy_t); - op->opcbfunc = cbfunc; - op->cbdata = cbdata; - - if (NULL != info && 0 < (op->sz = opal_list_get_size(info))) { - PMIX_INFO_CREATE(op->info, op->sz); - n=0; - OPAL_LIST_FOREACH(iptr, info, opal_value_t) { - (void)opal_string_copy(op->info[n].key, iptr->key, PMIX_MAX_KEYLEN); - pmix1_value_load(&op->info[n].value, iptr); - ++n; - } - } - - ret = PMIx_Unpublish_nb(keys, op->info, op->sz, opcbfunc, op); - - return pmix1_convert_rc(ret); -} - -int pmix1_spawn(opal_list_t *job_info, opal_list_t *apps, opal_jobid_t *jobid) -{ - pmix_status_t ret; - pmix_info_t *pinfo = NULL; - pmix_app_t *papps; - size_t napps, n, m, ninfo = 0; - char nspace[PMIX_MAX_NSLEN+1]; - opal_value_t *info; - opal_pmix_app_t *app; - opal_pmix1_jobid_trkr_t *job; - - if (NULL != job_info && 0 < (ninfo = opal_list_get_size(job_info))) { - PMIX_INFO_CREATE(pinfo, ninfo); - n=0; - OPAL_LIST_FOREACH(info, job_info, opal_value_t) { - (void)opal_string_copy(pinfo[n].key, info->key, PMIX_MAX_KEYLEN); - pmix1_value_load(&pinfo[n].value, info); - ++n; - } - } - - napps = opal_list_get_size(apps); - PMIX_APP_CREATE(papps, napps); - n=0; - OPAL_LIST_FOREACH(app, apps, opal_pmix_app_t) { - papps[n].cmd = strdup(app->cmd); - papps[n].argc = opal_argv_count(app->argv); - papps[n].argv = opal_argv_copy(app->argv); - papps[n].env = opal_argv_copy(app->env); - papps[n].maxprocs = app->maxprocs; - if (0 < (papps[n].ninfo = opal_list_get_size(&app->info))) { - PMIX_INFO_CREATE(papps[n].info, papps[n].ninfo); - m=0; - OPAL_LIST_FOREACH(info, &app->info, opal_value_t) { - (void)opal_string_copy(papps[n].info[m].key, info->key, PMIX_MAX_KEYLEN); - pmix1_value_load(&papps[n].info[m].value, info); - ++m; - } - } - ++n; - } - - ret = PMIx_Spawn(pinfo, ninfo, papps, napps, nspace); - if (PMIX_SUCCESS == ret) { - if (mca_pmix_ext1x_component.native_launch) { - /* if we were launched by the OMPI RTE, then - * the jobid is in a special format - so get it */ - opal_convert_string_to_jobid(jobid, nspace); - } else { - /* we were launched by someone else, so make the - * jobid just be the hash of the nspace */ - OPAL_HASH_JOBID(nspace, *jobid); - } - /* add this to our jobid tracker */ - job = OBJ_NEW(opal_pmix1_jobid_trkr_t); - (void)opal_string_copy(job->nspace, nspace, PMIX_MAX_NSLEN); - job->jobid = *jobid; - opal_list_append(&mca_pmix_ext1x_component.jobids, &job->super); - } - if (0 < ninfo) { - PMIX_INFO_FREE(pinfo, ninfo); - } - PMIX_APP_FREE(papps, napps); - - return pmix1_convert_rc(ret); -} - -static void spcbfunc(pmix_status_t status, - char *nspace, void *cbdata) -{ - pmix1_opcaddy_t *op = (pmix1_opcaddy_t*)cbdata; - int rc; - opal_jobid_t jobid=OPAL_JOBID_INVALID; - opal_pmix1_jobid_trkr_t *job; - - rc = pmix1_convert_rc(status); - if (PMIX_SUCCESS == status) { - if (mca_pmix_ext1x_component.native_launch) { - /* if we were launched by the OMPI RTE, then - * the jobid is in a special format - so get it */ - opal_convert_string_to_jobid(&jobid, nspace); - } else { - /* we were launched by someone else, so make the - * jobid just be the hash of the nspace */ - OPAL_HASH_JOBID(nspace, jobid); - } - /* add this to our jobid tracker */ - job = OBJ_NEW(opal_pmix1_jobid_trkr_t); - (void)opal_string_copy(job->nspace, nspace, PMIX_MAX_NSLEN); - job->jobid = jobid; - opal_list_append(&mca_pmix_ext1x_component.jobids, &job->super); - } - - op->spcbfunc(rc, jobid, op->cbdata); - OBJ_RELEASE(op); -} - -int pmix1_spawnnb(opal_list_t *job_info, opal_list_t *apps, - opal_pmix_spawn_cbfunc_t cbfunc, void *cbdata) -{ - pmix_status_t ret; - pmix1_opcaddy_t *op; - size_t n, m; - opal_value_t *info; - opal_pmix_app_t *app; - - /* create the caddy */ - op = OBJ_NEW(pmix1_opcaddy_t); - op->spcbfunc = cbfunc; - op->cbdata = cbdata; - - if (NULL != job_info && 0 < (op->ninfo = opal_list_get_size(job_info))) { - PMIX_INFO_CREATE(op->info, op->ninfo); - n=0; - OPAL_LIST_FOREACH(info, job_info, opal_value_t) { - (void)opal_string_copy(op->info[n].key, info->key, PMIX_MAX_KEYLEN); - pmix1_value_load(&op->info[n].value, info); - ++n; - } - } - - op->sz = opal_list_get_size(apps); - PMIX_APP_CREATE(op->apps, op->sz); - n=0; - OPAL_LIST_FOREACH(app, apps, opal_pmix_app_t) { - op->apps[n].cmd = strdup(app->cmd); - op->apps[n].argc = opal_argv_count(app->argv); - op->apps[n].argv = opal_argv_copy(app->argv); - op->apps[n].env = opal_argv_copy(app->env); - op->apps[n].maxprocs = app->maxprocs; - if (0 < (op->apps[n].ninfo = opal_list_get_size(&app->info))) { - PMIX_INFO_CREATE(op->apps[n].info, op->apps[n].ninfo); - m=0; - OPAL_LIST_FOREACH(info, &app->info, opal_value_t) { - (void)opal_string_copy(op->apps[n].info[m].key, info->key, PMIX_MAX_KEYLEN); - pmix1_value_load(&op->apps[n].info[m].value, info); - ++m; - } - } - ++n; - } - - ret = PMIx_Spawn_nb(op->info, op->ninfo, op->apps, op->sz, spcbfunc, op); - - return pmix1_convert_rc(ret); -} - -int pmix1_connect(opal_list_t *procs) -{ - pmix_status_t ret; - pmix_proc_t *parray=NULL; - size_t n, cnt=0; - opal_namelist_t *ptr; - opal_pmix1_jobid_trkr_t *job, *jptr; - - /* protect against bozo error */ - if (NULL == procs || 0 == (cnt = opal_list_get_size(procs))) { - return OPAL_ERR_BAD_PARAM; - } - - /* convert the list of procs to an array - * of pmix_proc_t */ - PMIX_PROC_CREATE(parray, cnt); - n=0; - OPAL_LIST_FOREACH(ptr, procs, opal_namelist_t) { - /* look thru our list of jobids and find the - * corresponding nspace */ - job = NULL; - OPAL_LIST_FOREACH(jptr, &mca_pmix_ext1x_component.jobids, opal_pmix1_jobid_trkr_t) { - if (jptr->jobid == ptr->name.jobid) { - job = jptr; - break; - } - } - if (NULL == job) { - OPAL_ERROR_LOG(OPAL_ERR_NOT_FOUND); - return OPAL_ERR_NOT_FOUND; - } - (void)opal_string_copy(parray[n].nspace, job->nspace, PMIX_MAX_NSLEN); - if (OPAL_VPID_WILDCARD == ptr->name.vpid) { - parray[n].rank = PMIX_RANK_WILDCARD; - } else { - parray[n].rank = ptr->name.vpid; - } - ++n; - } - - ret = PMIx_Connect(parray, cnt, NULL, 0); - PMIX_PROC_FREE(parray, cnt); - - return pmix1_convert_rc(ret); -} - -int pmix1_connectnb(opal_list_t *procs, - opal_pmix_op_cbfunc_t cbfunc, - void *cbdata) -{ - pmix_status_t ret; - size_t n, cnt=0; - opal_namelist_t *ptr; - pmix1_opcaddy_t *op; - opal_pmix1_jobid_trkr_t *job; - - /* protect against bozo error */ - if (NULL == procs || 0 == (cnt = opal_list_get_size(procs))) { - return OPAL_ERR_BAD_PARAM; - } - - /* create the caddy */ - op = OBJ_NEW(pmix1_opcaddy_t); - op->opcbfunc = cbfunc; - op->cbdata = cbdata; - op->nprocs = cnt; - - /* convert the list of procs to an array - * of pmix_proc_t */ - PMIX_PROC_CREATE(op->procs, op->nprocs); - n=0; - OPAL_LIST_FOREACH(ptr, procs, opal_namelist_t) { - /* look thru our list of jobids and find the - * corresponding nspace */ - OPAL_LIST_FOREACH(job, &mca_pmix_ext1x_component.jobids, opal_pmix1_jobid_trkr_t) { - if (job->jobid == ptr->name.jobid) { - (void)opal_string_copy(op->procs[n].nspace, job->nspace, PMIX_MAX_NSLEN); - break; - } - } - if (OPAL_VPID_WILDCARD == ptr->name.vpid) { - op->procs[n].rank = PMIX_RANK_WILDCARD; - } else { - op->procs[n].rank = ptr->name.vpid; - } - ++n; - } - - ret = PMIx_Connect_nb(op->procs, op->nprocs, NULL, 0, opcbfunc, op); - - return pmix1_convert_rc(ret); -} - -int pmix1_disconnect(opal_list_t *procs) -{ - pmix_status_t ret; - pmix_proc_t *parray=NULL; - size_t n, cnt=0; - opal_namelist_t *ptr; - opal_pmix1_jobid_trkr_t *job; - - /* protect against bozo error */ - if (NULL == procs || 0 == (cnt = opal_list_get_size(procs))) { - return OPAL_ERR_BAD_PARAM; - } - - /* convert the list of procs to an array - * of pmix_proc_t */ - PMIX_PROC_CREATE(parray, cnt); - n=0; - OPAL_LIST_FOREACH(ptr, procs, opal_namelist_t) { - /* look thru our list of jobids and find the - * corresponding nspace */ - OPAL_LIST_FOREACH(job, &mca_pmix_ext1x_component.jobids, opal_pmix1_jobid_trkr_t) { - if (job->jobid == ptr->name.jobid) { - (void)opal_string_copy(parray[n].nspace, job->nspace, PMIX_MAX_NSLEN); - break; - } - } - if (OPAL_VPID_WILDCARD == ptr->name.vpid) { - parray[n].rank = PMIX_RANK_WILDCARD; - } else { - parray[n].rank = ptr->name.vpid; - } - ++n; - } - - ret = PMIx_Disconnect(parray, cnt, NULL, 0); - PMIX_PROC_FREE(parray, cnt); - - return pmix1_convert_rc(ret); -} - -int pmix1_disconnectnb(opal_list_t *procs, - opal_pmix_op_cbfunc_t cbfunc, - void *cbdata) -{ - pmix_status_t ret; - size_t n, cnt=0; - opal_namelist_t *ptr; - pmix1_opcaddy_t *op; - opal_pmix1_jobid_trkr_t *job; - - /* protect against bozo error */ - if (NULL == procs || 0 == (cnt = opal_list_get_size(procs))) { - return OPAL_ERR_BAD_PARAM; - } - - /* create the caddy */ - op = OBJ_NEW(pmix1_opcaddy_t); - op->opcbfunc = cbfunc; - op->cbdata = cbdata; - op->nprocs = cnt; - - /* convert the list of procs to an array - * of pmix_proc_t */ - PMIX_PROC_CREATE(op->procs, op->nprocs); - n=0; - OPAL_LIST_FOREACH(ptr, procs, opal_namelist_t) { - /* look thru our list of jobids and find the - * corresponding nspace */ - OPAL_LIST_FOREACH(job, &mca_pmix_ext1x_component.jobids, opal_pmix1_jobid_trkr_t) { - if (job->jobid == ptr->name.jobid) { - (void)opal_string_copy(op->procs[n].nspace, job->nspace, PMIX_MAX_NSLEN); - break; - } - } - if (OPAL_VPID_WILDCARD == ptr->name.vpid) { - op->procs[n].rank = PMIX_RANK_WILDCARD; - } else { - op->procs[n].rank = ptr->name.vpid; - } - ++n; - } - - ret = PMIx_Disconnect_nb(op->procs, op->nprocs, NULL, 0, opcbfunc, op); - - return pmix1_convert_rc(ret); -} - - -int pmix1_resolve_peers(const char *nodename, opal_jobid_t jobid, - opal_list_t *procs) -{ - char *nspace; - pmix_proc_t *array=NULL; - size_t nprocs, n; - opal_namelist_t *nm; - int rc; - pmix_status_t ret; - opal_pmix1_jobid_trkr_t *job, *jptr; - - if (OPAL_JOBID_WILDCARD == jobid) { - nspace = NULL; - } else { - job = NULL; - OPAL_LIST_FOREACH(jptr, &mca_pmix_ext1x_component.jobids, opal_pmix1_jobid_trkr_t) { - if (jptr->jobid == jobid) { - job = jptr; - break; - } - } - if (NULL == job) { - return OPAL_ERR_NOT_FOUND; - } - nspace = job->nspace; - } - - ret = PMIx_Resolve_peers(nodename, nspace, &array, &nprocs); - rc = pmix1_convert_rc(ret); - - if (NULL != array && 0 < nprocs) { - for (n=0; n < nprocs; n++) { - nm = OBJ_NEW(opal_namelist_t); - opal_list_append(procs, &nm->super); - if (mca_pmix_ext1x_component.native_launch) { - /* if we were launched by the OMPI RTE, then - * the jobid is in a special format - so get it */ - opal_convert_string_to_jobid(&nm->name.jobid, array[n].nspace); - } else { - /* we were launched by someone else, so make the - * jobid just be the hash of the nspace */ - OPAL_HASH_JOBID(array[n].nspace, nm->name.jobid); - } - /* if we don't already have it, add this to our jobid tracker */ - job = NULL; - OPAL_LIST_FOREACH(jptr, &mca_pmix_ext1x_component.jobids, opal_pmix1_jobid_trkr_t) { - if (jptr->jobid == nm->name.jobid) { - job = jptr; - break; - } - } - if (NULL == job) { - job = OBJ_NEW(opal_pmix1_jobid_trkr_t); - (void)opal_string_copy(job->nspace, nspace, PMIX_MAX_NSLEN); - job->jobid = jobid; - opal_list_append(&mca_pmix_ext1x_component.jobids, &job->super); - } - nm->name.vpid = array[n].rank; - } - } - PMIX_PROC_FREE(array, nprocs); - - return rc; -} - -int pmix1_resolve_nodes(opal_jobid_t jobid, char **nodelist) -{ - pmix_status_t ret; - char *nspace=NULL; - opal_pmix1_jobid_trkr_t *job, *jptr; - - if (OPAL_JOBID_WILDCARD != jobid) { - /* look thru our list of jobids and find the - * corresponding nspace */ - job = NULL; - OPAL_LIST_FOREACH(jptr, &mca_pmix_ext1x_component.jobids, opal_pmix1_jobid_trkr_t) { - if (jptr->jobid == jobid) { - job = jptr; - break; - } - } - if (NULL == job) { - return OPAL_ERR_NOT_FOUND; - } - nspace = job->nspace; - } - - ret = PMIx_Resolve_nodes(nspace, nodelist); - - return pmix1_convert_rc(ret);; -} diff --git a/opal/mca/pmix/ext1x/pmix1x_component.c b/opal/mca/pmix/ext1x/pmix1x_component.c deleted file mode 100644 index 87932116705..00000000000 --- a/opal/mca/pmix/ext1x/pmix1x_component.c +++ /dev/null @@ -1,141 +0,0 @@ -/* - * Copyright (c) 2014-2018 Intel, Inc. All rights reserved. - * Copyright (c) 2014-2018 Research Organization for Information Science - * and Technology (RIST). All rights reserved. - * Copyright (c) 2016-2018 Cisco Systems, 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 "opal_config.h" - -#include "opal/constants.h" -#include "opal/class/opal_list.h" -#include "opal/util/proc.h" -#include "opal/util/show_help.h" -#include "opal/mca/pmix/pmix.h" -#include "pmix1x.h" - -/* - * Public string showing the pmix ext1x component version number - */ -const char *opal_pmix_ext1x_component_version_string = - "OPAL external pmix1.1.4 MCA component version " OPAL_VERSION; - -/* - * Local function - */ -static int external_register(void); -static int external_open(void); -static int external_close(void); -static int external_component_query(mca_base_module_t **module, int *priority); - -/* - * Local variable - */ -static char *pmix_library_version = NULL; - - -/* - * Instantiate the public struct with all of our public information - * and pointers to our public functions in it - */ - -mca_pmix_ext1x_component_t mca_pmix_ext1x_component = { - { - /* First, the mca_component_t struct containing meta information - * about the component itself */ - - .base_version = { - /* Indicate that we are a pmix v1.1.0 component (which also - * implies a specific MCA version) */ - - OPAL_PMIX_BASE_VERSION_2_0_0, - - /* Component name and version */ - - .mca_component_name = "ext1x", - MCA_BASE_MAKE_VERSION(component, OPAL_MAJOR_VERSION, OPAL_MINOR_VERSION, - OPAL_RELEASE_VERSION), - - /* Component open and close functions */ - - .mca_open_component = external_open, - .mca_close_component = external_close, - .mca_query_component = external_component_query, - .mca_register_component_params = external_register - }, - /* Next the MCA v1.0.0 component meta data */ - .base_data = { - /* The component is checkpoint ready */ - MCA_BASE_METADATA_PARAM_CHECKPOINT - } - }, - .native_launch = false -}; - -static int external_register(void) -{ - mca_base_component_t *component = &mca_pmix_ext1x_component.super.base_version; - - asprintf(&pmix_library_version, "PMIx library version %s", PMIx_Get_version()); - (void) mca_base_component_var_register(component, "library_version", - "Version of the underlying PMIx library", - MCA_BASE_VAR_TYPE_STRING, - NULL, 0, 0, - OPAL_INFO_LVL_4, - MCA_BASE_VAR_SCOPE_CONSTANT, - &pmix_library_version); - - return OPAL_SUCCESS; -} - -static int external_open(void) -{ - const char *version; - - OBJ_CONSTRUCT(&mca_pmix_ext1x_component.jobids, opal_list_t); - OBJ_CONSTRUCT(&mca_pmix_ext1x_component.values, opal_list_t); - - version = PMIx_Get_version(); - if (0 != strncmp(version, "1.2", 3)) { - opal_show_help("help-pmix-base.txt", - "old-pmix", true, version, "v1.2"); - return OPAL_ERROR; - } - return OPAL_SUCCESS; -} - -static int external_close(void) -{ - OPAL_LIST_DESTRUCT(&mca_pmix_ext1x_component.jobids); - OPAL_LIST_DESTRUCT(&mca_pmix_ext1x_component.values); - return OPAL_SUCCESS; -} - - -static int external_component_query(mca_base_module_t **module, int *priority) -{ - char *t, *id; - - /* see if a PMIx server is present */ - if (NULL != (t = getenv("PMIX_SERVER_URI")) || - NULL != (id = getenv("PMIX_ID"))) { - /* if PMIx is present, then we are a client and need to use it */ - *priority = 100; - } else { - /* we could be a server, so we still need to be considered */ - *priority = 5; - } - *module = (mca_base_module_t *)&opal_pmix_ext1x_module; - return OPAL_SUCCESS; -} diff --git a/opal/mca/pmix/ext1x/pmix1x_server_north.c b/opal/mca/pmix/ext1x/pmix1x_server_north.c deleted file mode 100644 index 61791427c17..00000000000 --- a/opal/mca/pmix/ext1x/pmix1x_server_north.c +++ /dev/null @@ -1,783 +0,0 @@ -/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ -/* - * Copyright (c) 2014-2018 Intel, Inc. All rights reserved. - * Copyright (c) 2014-2017 Research Organization for Information Science - * and Technology (RIST). All rights reserved. - * Copyright (c) 2014-2015 Mellanox Technologies, Inc. - * All rights reserved. - * Copyright (c) 2016 Cisco Systems, Inc. All rights reserved. - * $COPYRIGHT$ - * - * Additional copyrights may follow - * - * $HEADER$ - */ - -#include "opal_config.h" -#include "opal/constants.h" -#include "opal/types.h" - -#ifdef HAVE_STRING_H -#include -#endif -#ifdef HAVE_UNISTD_H -#include -#endif - -#include "opal/dss/dss.h" -#include "opal/mca/event/event.h" -#include "opal/mca/hwloc/base/base.h" -#include "opal/runtime/opal.h" -#include "opal/runtime/opal_progress_threads.h" -#include "opal/util/argv.h" -#include "opal/util/error.h" -#include "opal/util/output.h" -#include "opal/util/proc.h" -#include "opal/util/show_help.h" -#include "opal/util/string_copy.h" -#include "opal/mca/pmix/base/base.h" -#include "pmix1x.h" - -#include "pmix.h" -#include "pmix_server.h" - -/**** N.O.R.T.H.B.O.U.N.D I.N.T.E.R.F.A.C.E.S ****/ - -/* These are the interfaces used by the embedded PMIx server - * to call up into ORTE for service requests */ - - static pmix_status_t server_client_connected_fn(const pmix_proc_t *proc, void* server_object); -static pmix_status_t server_client_finalized_fn(const pmix_proc_t *proc, void* server_object, - pmix_op_cbfunc_t cbfunc, void *cbdata); -static pmix_status_t server_abort_fn(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); -static pmix_status_t server_fencenb_fn(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); -static pmix_status_t server_dmodex_req_fn(const pmix_proc_t *proc, - const pmix_info_t info[], size_t ninfo, - pmix_modex_cbfunc_t cbfunc, void *cbdata); -static pmix_status_t server_publish_fn(const pmix_proc_t *proc, - const pmix_info_t info[], size_t ninfo, - pmix_op_cbfunc_t cbfunc, void *cbdata); -static pmix_status_t server_lookup_fn(const pmix_proc_t *proc, char **keys, - const pmix_info_t info[], size_t ninfo, - pmix_lookup_cbfunc_t cbfunc, void *cbdata); -static pmix_status_t server_unpublish_fn(const pmix_proc_t *proc, char **keys, - const pmix_info_t info[], size_t ninfo, - pmix_op_cbfunc_t cbfunc, void *cbdata); -static pmix_status_t server_spawn_fn(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); -static pmix_status_t server_connect_fn(const pmix_proc_t procs[], size_t nprocs, - const pmix_info_t info[], size_t ninfo, - pmix_op_cbfunc_t cbfunc, void *cbdata); -static pmix_status_t server_disconnect_fn(const pmix_proc_t procs[], size_t nprocs, - const pmix_info_t info[], size_t ninfo, - pmix_op_cbfunc_t cbfunc, void *cbdata); -static pmix_status_t server_register_events(const pmix_info_t info[], size_t ninfo, - pmix_op_cbfunc_t cbfunc, void *cbdata); -static pmix_status_t server_deregister_events(const pmix_info_t info[], size_t ninfo, - pmix_op_cbfunc_t cbfunc, void *cbdata); -static pmix_status_t server_listener_fn(int listening_sd, - pmix_connection_cbfunc_t cbfunc); - -pmix_server_module_t mymodule = { - .client_connected = server_client_connected_fn, - .client_finalized = server_client_finalized_fn, - .abort = server_abort_fn, - .fence_nb = server_fencenb_fn, - .direct_modex = server_dmodex_req_fn, - .publish = server_publish_fn, - .lookup = server_lookup_fn, - .unpublish = server_unpublish_fn, - .spawn = server_spawn_fn, - .connect = server_connect_fn, - .disconnect = server_disconnect_fn, - .register_events = server_register_events, - .deregister_events = server_deregister_events, - .listener = server_listener_fn -}; - -opal_pmix_server_module_t *host_module = NULL; - - -static void opal_opcbfunc(int status, void *cbdata) -{ - pmix1_opalcaddy_t *opalcaddy = (pmix1_opalcaddy_t*)cbdata; - - if (NULL != opalcaddy->opcbfunc) { - opalcaddy->opcbfunc(pmix1_convert_opalrc(status), opalcaddy->cbdata); - } - OBJ_RELEASE(opalcaddy); -} - -static pmix_status_t server_client_connected_fn(const pmix_proc_t *p, void *server_object) -{ - int rc; - opal_process_name_t proc; - - if (NULL == host_module || NULL == host_module->client_connected) { - return PMIX_SUCCESS; - } - - /* convert the nspace/rank to an opal_process_name_t */ - if (OPAL_SUCCESS != (rc = opal_convert_string_to_jobid(&proc.jobid, p->nspace))) { - return pmix1_convert_opalrc(rc); - } - proc.vpid = p->rank; - - /* pass it up */ - rc = host_module->client_connected(&proc, server_object, - NULL, NULL); - return pmix1_convert_opalrc(rc); -} - -static pmix_status_t server_client_finalized_fn(const pmix_proc_t *p, void* server_object, - pmix_op_cbfunc_t cbfunc, void *cbdata) -{ - int rc; - pmix1_opalcaddy_t *opalcaddy; - opal_process_name_t proc; - - if (NULL == host_module || NULL == host_module->client_finalized) { - return PMIX_SUCCESS; - } - - /* convert the nspace/rank to an opal_process_name_t */ - if (OPAL_SUCCESS != (rc = opal_convert_string_to_jobid(&proc.jobid, p->nspace))) { - return pmix1_convert_opalrc(rc); - } - proc.vpid = p->rank; - - /* setup the caddy */ - opalcaddy = OBJ_NEW(pmix1_opalcaddy_t); - opalcaddy->opcbfunc = cbfunc; - opalcaddy->cbdata = cbdata; - - /* pass it up */ - rc = host_module->client_finalized(&proc, server_object, opal_opcbfunc, opalcaddy); - if (OPAL_SUCCESS != rc) { - OBJ_RELEASE(opalcaddy); - } - return pmix1_convert_opalrc(rc); -} - -static pmix_status_t server_abort_fn(const pmix_proc_t *p, void *server_object, - int status, const char msg[], - pmix_proc_t procs[], size_t nprocs, - pmix_op_cbfunc_t cbfunc, void *cbdata) -{ - size_t n; - opal_namelist_t *nm; - opal_process_name_t proc; - int rc; - pmix1_opalcaddy_t *opalcaddy; - - if (NULL == host_module || NULL == host_module->abort) { - return PMIX_ERR_NOT_SUPPORTED; - } - - /* convert the nspace/rank to an opal_process_name_t */ - if (OPAL_SUCCESS != (rc = opal_convert_string_to_jobid(&proc.jobid, p->nspace))) { - return pmix1_convert_opalrc(rc); - } - proc.vpid = p->rank; - - /* setup the caddy */ - opalcaddy = OBJ_NEW(pmix1_opalcaddy_t); - opalcaddy->opcbfunc = cbfunc; - opalcaddy->cbdata = cbdata; - - /* convert the array of pmix_proc_t to the list of procs */ - for (n=0; n < nprocs; n++) { - nm = OBJ_NEW(opal_namelist_t); - opal_list_append(&opalcaddy->procs, &nm->super); - if (OPAL_SUCCESS != (rc = opal_convert_string_to_jobid(&nm->name.jobid, procs[n].nspace))) { - OBJ_RELEASE(opalcaddy); - return pmix1_convert_opalrc(rc); - } - if (PMIX_RANK_WILDCARD == procs[n].rank) { - nm->name.vpid = OPAL_VPID_WILDCARD; - } else { - nm->name.vpid = procs[n].rank; - } - } - - /* pass it up */ - rc = host_module->abort(&proc, server_object, status, msg, - &opalcaddy->procs, opal_opcbfunc, opalcaddy); - if (OPAL_SUCCESS != rc) { - OBJ_RELEASE(opalcaddy); - } - return pmix1_convert_opalrc(rc); -} - -static void _data_release(void *cbdata) -{ - pmix1_opalcaddy_t *opalcaddy = (pmix1_opalcaddy_t*)cbdata; - - if (NULL != opalcaddy->odmdxfunc) { - opalcaddy->odmdxfunc(opalcaddy->ocbdata); - } - OBJ_RELEASE(opalcaddy); -} - -static void opmdx_response(int status, const char *data, size_t sz, void *cbdata, - opal_pmix_release_cbfunc_t relcbfunc, void *relcbdata) -{ - pmix_status_t rc; - pmix1_opalcaddy_t *opalcaddy = (pmix1_opalcaddy_t*)cbdata; - - rc = pmix1_convert_rc(status); - if (NULL != opalcaddy->mdxcbfunc) { - opalcaddy->odmdxfunc = relcbfunc; - opalcaddy->ocbdata = relcbdata; - opalcaddy->mdxcbfunc(rc, data, sz, opalcaddy->cbdata, - _data_release, opalcaddy); - } else { - OBJ_RELEASE(opalcaddy); - } -} - -static pmix_status_t server_fencenb_fn(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) -{ - pmix1_opalcaddy_t *opalcaddy; - size_t n; - opal_namelist_t *nm; - opal_value_t *iptr; - int rc; - - if (NULL == host_module || NULL == host_module->fence_nb) { - return PMIX_ERR_NOT_SUPPORTED; - } - - /* setup the caddy */ - opalcaddy = OBJ_NEW(pmix1_opalcaddy_t); - opalcaddy->mdxcbfunc = cbfunc; - opalcaddy->cbdata = cbdata; - - /* convert the array of pmix_proc_t to the list of procs */ - for (n=0; n < nprocs; n++) { - nm = OBJ_NEW(opal_namelist_t); - opal_list_append(&opalcaddy->procs, &nm->super); - if (OPAL_SUCCESS != (rc = opal_convert_string_to_jobid(&nm->name.jobid, procs[n].nspace))) { - OBJ_RELEASE(opalcaddy); - return pmix1_convert_opalrc(rc); - } - if (PMIX_RANK_WILDCARD == procs[n].rank) { - nm->name.vpid = OPAL_VPID_WILDCARD; - } else { - nm->name.vpid = procs[n].rank; - } - } - - /* convert the array of pmix_info_t to the list of info */ - for (n=0; n < ninfo; n++) { - iptr = OBJ_NEW(opal_value_t); - opal_list_append(&opalcaddy->info, &iptr->super); - iptr->key = strdup(info[n].key); - if (OPAL_SUCCESS != (rc = pmix1_value_unload(iptr, &info[n].value))) { - OBJ_RELEASE(opalcaddy); - return pmix1_convert_opalrc(rc); - } - } - - /* pass it up */ - rc = host_module->fence_nb(&opalcaddy->procs, &opalcaddy->info, - data, ndata, opmdx_response, opalcaddy); - if (OPAL_SUCCESS != rc) { - OBJ_RELEASE(opalcaddy); - } - return pmix1_convert_opalrc(rc); -} - -static pmix_status_t server_dmodex_req_fn(const pmix_proc_t *p, - const pmix_info_t info[], size_t ninfo, - pmix_modex_cbfunc_t cbfunc, void *cbdata) -{ - int rc; - pmix1_opalcaddy_t *opalcaddy; - opal_process_name_t proc; - opal_value_t *iptr; - size_t n; - - if (NULL == host_module || NULL == host_module->direct_modex) { - return PMIX_ERR_NOT_SUPPORTED; - } - - /* convert the nspace/rank to an opal_process_name_t */ - if (OPAL_SUCCESS != (rc = opal_convert_string_to_jobid(&proc.jobid, p->nspace))) { - return pmix1_convert_opalrc(rc); - } - if (PMIX_RANK_WILDCARD == p->rank) { - proc.vpid = OPAL_VPID_WILDCARD; - } else { - proc.vpid = p->rank; - } - - /* setup the caddy */ - opalcaddy = OBJ_NEW(pmix1_opalcaddy_t); - opalcaddy->mdxcbfunc = cbfunc; - opalcaddy->cbdata = cbdata; - - /* convert the array of pmix_info_t to the list of info */ - for (n=0; n < ninfo; n++) { - iptr = OBJ_NEW(opal_value_t); - opal_list_append(&opalcaddy->info, &iptr->super); - iptr->key = strdup(info[n].key); - if (OPAL_SUCCESS != (rc = pmix1_value_unload(iptr, &info[n].value))) { - OBJ_RELEASE(opalcaddy); - return pmix1_convert_opalrc(rc); - } - } - - /* pass it up */ - rc = host_module->direct_modex(&proc, &opalcaddy->info, opmdx_response, opalcaddy); - if (OPAL_SUCCESS != rc && OPAL_ERR_IN_PROCESS != rc) { - OBJ_RELEASE(opalcaddy); - } - if (OPAL_ERR_IN_PROCESS == rc) { - rc = OPAL_SUCCESS; - } - return pmix1_convert_opalrc(rc); -} - -static pmix_status_t server_publish_fn(const pmix_proc_t *p, - const pmix_info_t info[], size_t ninfo, - pmix_op_cbfunc_t cbfunc, void *cbdata) -{ - int rc; - size_t n; - pmix1_opalcaddy_t *opalcaddy; - opal_process_name_t proc; - opal_value_t *oinfo; - - if (NULL == host_module || NULL == host_module->publish) { - return PMIX_ERR_NOT_SUPPORTED; - } - - /* convert the nspace/rank to an opal_process_name_t */ - if (OPAL_SUCCESS != (rc = opal_convert_string_to_jobid(&proc.jobid, p->nspace))) { - return pmix1_convert_opalrc(rc); - } - if (PMIX_RANK_WILDCARD == p->rank) { - proc.vpid = OPAL_VPID_WILDCARD; - } else { - proc.vpid = p->rank; - } - - /* setup the caddy */ - opalcaddy = OBJ_NEW(pmix1_opalcaddy_t); - opalcaddy->opcbfunc = cbfunc; - opalcaddy->cbdata = cbdata; - - /* convert the info array */ - for (n=0; n < ninfo; n++) { - oinfo = OBJ_NEW(opal_value_t); - opal_list_append(&opalcaddy->info, &oinfo->super); - oinfo->key = strdup(info[n].key); - if (OPAL_SUCCESS != (rc = pmix1_value_unload(oinfo, &info[n].value))) { - OBJ_RELEASE(opalcaddy); - return pmix1_convert_opalrc(rc); - } - } - - /* pass it up */ - rc = host_module->publish(&proc, &opalcaddy->info, opal_opcbfunc, opalcaddy); - if (OPAL_SUCCESS != rc) { - OBJ_RELEASE(opalcaddy); - } - - return pmix1_convert_opalrc(rc); -} - -static void opal_lkupcbfunc(int status, - opal_list_t *data, - void *cbdata) -{ - pmix1_opalcaddy_t *opalcaddy = (pmix1_opalcaddy_t*)cbdata; - pmix_status_t rc; - pmix_pdata_t *d=NULL; - size_t nd=0, n; - opal_pmix_pdata_t *p; - - if (NULL != opalcaddy->lkupcbfunc) { - rc = pmix1_convert_opalrc(status); - /* convert any returned data */ - if (NULL != data) { - nd = opal_list_get_size(data); - PMIX_PDATA_CREATE(d, nd); - n=0; - OPAL_LIST_FOREACH(p, data, opal_pmix_pdata_t) { - /* convert the jobid */ - (void)opal_snprintf_jobid(d[n].proc.nspace, PMIX_MAX_NSLEN, p->proc.jobid); - d[n].proc.rank = p->proc.vpid; - (void)opal_string_copy(d[n].key, p->value.key, PMIX_MAX_KEYLEN); - pmix1_value_load(&d[n].value, &p->value); - } - } - opalcaddy->lkupcbfunc(rc, d, nd, opalcaddy->cbdata); - PMIX_PDATA_FREE(d, nd); - } - OBJ_RELEASE(opalcaddy); -} - -static pmix_status_t server_lookup_fn(const pmix_proc_t *p, char **keys, - const pmix_info_t info[], size_t ninfo, - pmix_lookup_cbfunc_t cbfunc, void *cbdata) -{ - int rc; - pmix1_opalcaddy_t *opalcaddy; - opal_process_name_t proc; - opal_value_t *iptr; - size_t n; - - if (NULL == host_module || NULL == host_module->lookup) { - return PMIX_ERR_NOT_SUPPORTED; - } - - /* convert the nspace/rank to an opal_process_name_t */ - if (OPAL_SUCCESS != (rc = opal_convert_string_to_jobid(&proc.jobid, p->nspace))) { - return pmix1_convert_opalrc(rc); - } - if (PMIX_RANK_WILDCARD == p->rank) { - proc.vpid = OPAL_VPID_WILDCARD; - } else { - proc.vpid = p->rank; - } - - /* setup the caddy */ - opalcaddy = OBJ_NEW(pmix1_opalcaddy_t); - opalcaddy->lkupcbfunc = cbfunc; - opalcaddy->cbdata = cbdata; - - /* convert the array of pmix_info_t to the list of info */ - for (n=0; n < ninfo; n++) { - iptr = OBJ_NEW(opal_value_t); - opal_list_append(&opalcaddy->info, &iptr->super); - iptr->key = strdup(info[n].key); - if (OPAL_SUCCESS != (rc = pmix1_value_unload(iptr, &info[n].value))) { - OBJ_RELEASE(opalcaddy); - return pmix1_convert_opalrc(rc); - } - } - - /* pass it up */ - rc = host_module->lookup(&proc, keys, &opalcaddy->info, opal_lkupcbfunc, opalcaddy); - if (OPAL_SUCCESS != rc) { - OBJ_RELEASE(opalcaddy); - } - - return pmix1_convert_opalrc(rc); -} - - -static pmix_status_t server_unpublish_fn(const pmix_proc_t *p, char **keys, - const pmix_info_t info[], size_t ninfo, - pmix_op_cbfunc_t cbfunc, void *cbdata) -{ - int rc; - pmix1_opalcaddy_t *opalcaddy; - opal_process_name_t proc; - opal_value_t *iptr; - size_t n; - - if (NULL == host_module || NULL == host_module->unpublish) { - return PMIX_SUCCESS; - } - - /* convert the nspace/rank to an opal_process_name_t */ - if (OPAL_SUCCESS != (rc = opal_convert_string_to_jobid(&proc.jobid, p->nspace))) { - return pmix1_convert_opalrc(rc); - } - if (PMIX_RANK_WILDCARD == p->rank) { - proc.vpid = OPAL_VPID_WILDCARD; - } else { - proc.vpid = p->rank; - } - - /* setup the caddy */ - opalcaddy = OBJ_NEW(pmix1_opalcaddy_t); - opalcaddy->opcbfunc = cbfunc; - opalcaddy->cbdata = cbdata; - - /* convert the array of pmix_info_t to the list of info */ - for (n=0; n < ninfo; n++) { - iptr = OBJ_NEW(opal_value_t); - opal_list_append(&opalcaddy->info, &iptr->super); - iptr->key = strdup(info[n].key); - if (OPAL_SUCCESS != (rc = pmix1_value_unload(iptr, &info[n].value))) { - OBJ_RELEASE(opalcaddy); - return pmix1_convert_opalrc(rc); - } - } - - /* pass it up */ - rc = host_module->unpublish(&proc, keys, &opalcaddy->info, opal_opcbfunc, opalcaddy); - if (OPAL_SUCCESS != rc) { - OBJ_RELEASE(opalcaddy); - } - - return pmix1_convert_opalrc(rc); -} - -static void opal_spncbfunc(int status, opal_jobid_t jobid, void *cbdata) -{ - pmix1_opalcaddy_t *opalcaddy = (pmix1_opalcaddy_t*)cbdata; - pmix_status_t rc; - char nspace[PMIX_MAX_NSLEN]; - - if (NULL != opalcaddy->spwncbfunc) { - rc = pmix1_convert_opalrc(status); - /* convert the jobid */ - (void)opal_snprintf_jobid(nspace, PMIX_MAX_NSLEN, jobid); - opalcaddy->spwncbfunc(rc, nspace, opalcaddy->cbdata); - } - OBJ_RELEASE(opalcaddy); -} - -static pmix_status_t server_spawn_fn(const pmix_proc_t *p, - const pmix_info_t job_info[], size_t ninfo, - const pmix_app_t apps[], size_t napps, - pmix_spawn_cbfunc_t cbfunc, void *cbdata) -{ - pmix1_opalcaddy_t *opalcaddy; - opal_process_name_t proc; - opal_pmix_app_t *app; - opal_value_t *oinfo; - size_t k, n; - int rc; - - if (NULL == host_module || NULL == host_module->spawn) { - return PMIX_ERR_NOT_SUPPORTED; - } - - /* convert the nspace/rank to an opal_process_name_t */ - if (OPAL_SUCCESS != (rc = opal_convert_string_to_jobid(&proc.jobid, p->nspace))) { - return pmix1_convert_opalrc(rc); - } - if (PMIX_RANK_WILDCARD == p->rank) { - proc.vpid = OPAL_VPID_WILDCARD; - } else { - proc.vpid = p->rank; - } - - /* setup the caddy */ - opalcaddy = OBJ_NEW(pmix1_opalcaddy_t); - opalcaddy->spwncbfunc = cbfunc; - opalcaddy->cbdata = cbdata; - - /* convert the job info */ - for (k=0; k < ninfo; k++) { - oinfo = OBJ_NEW(opal_value_t); - opal_list_append(&opalcaddy->info, &oinfo->super); - oinfo->key = strdup(job_info[k].key); - if (OPAL_SUCCESS != (rc = pmix1_value_unload(oinfo, &job_info[k].value))) { - OBJ_RELEASE(opalcaddy); - return pmix1_convert_opalrc(rc); - } - } - - /* convert the apps */ - for (n=0; n < napps; n++) { - app = OBJ_NEW(opal_pmix_app_t); - opal_list_append(&opalcaddy->apps, &app->super); - if (NULL != apps[n].cmd) { - app->cmd = strdup(apps[n].cmd); - } - if (NULL != apps[n].argv) { - app->argv = opal_argv_copy(apps[n].argv); - } - if (NULL != apps[n].env) { - app->env = opal_argv_copy(apps[n].env); - } - app->maxprocs = apps[n].maxprocs; - for (k=0; k < apps[n].ninfo; k++) { - oinfo = OBJ_NEW(opal_value_t); - opal_list_append(&app->info, &oinfo->super); - oinfo->key = strdup(apps[n].info[k].key); - if (OPAL_SUCCESS != (rc = pmix1_value_unload(oinfo, &apps[n].info[k].value))) { - OBJ_RELEASE(opalcaddy); - return pmix1_convert_opalrc(rc); - } - } - } - - /* pass it up */ - rc = host_module->spawn(&proc, &opalcaddy->info, &opalcaddy->apps, opal_spncbfunc, opalcaddy); - if (OPAL_SUCCESS != rc) { - OPAL_ERROR_LOG(rc); - OBJ_RELEASE(opalcaddy); - } - - return pmix1_convert_opalrc(rc); -} - - -static pmix_status_t server_connect_fn(const pmix_proc_t procs[], size_t nprocs, - const pmix_info_t info[], size_t ninfo, - pmix_op_cbfunc_t cbfunc, void *cbdata) -{ - int rc; - pmix1_opalcaddy_t *opalcaddy; - opal_namelist_t *nm; - size_t n; - opal_value_t *oinfo; - - if (NULL == host_module || NULL == host_module->connect) { - return PMIX_ERR_NOT_SUPPORTED; - } - - /* setup the caddy */ - opalcaddy = OBJ_NEW(pmix1_opalcaddy_t); - opalcaddy->opcbfunc = cbfunc; - opalcaddy->cbdata = cbdata; - - /* convert the array of pmix_proc_t to the list of procs */ - for (n=0; n < nprocs; n++) { - nm = OBJ_NEW(opal_namelist_t); - opal_list_append(&opalcaddy->procs, &nm->super); - if (OPAL_SUCCESS != (rc = opal_convert_string_to_jobid(&nm->name.jobid, procs[n].nspace))) { - OBJ_RELEASE(opalcaddy); - return pmix1_convert_opalrc(rc); - } - if (PMIX_RANK_WILDCARD == procs[n].rank) { - nm->name.vpid = OPAL_VPID_WILDCARD; - } else { - nm->name.vpid = procs[n].rank; - } - } - - /* convert the info */ - for (n=0; n < ninfo; n++) { - oinfo = OBJ_NEW(opal_value_t); - opal_list_append(&opalcaddy->info, &oinfo->super); - oinfo->key = strdup(info[n].key); - if (OPAL_SUCCESS != (rc = pmix1_value_unload(oinfo, &info[n].value))) { - OBJ_RELEASE(opalcaddy); - return pmix1_convert_opalrc(rc); - } - } - - /* pass it up */ - rc = host_module->connect(&opalcaddy->procs, &opalcaddy->info, opal_opcbfunc, opalcaddy); - if (OPAL_SUCCESS != rc) { - OBJ_RELEASE(opalcaddy); - } - - return pmix1_convert_opalrc(rc); -} - - -static pmix_status_t server_disconnect_fn(const pmix_proc_t procs[], size_t nprocs, - const pmix_info_t info[], size_t ninfo, - pmix_op_cbfunc_t cbfunc, void *cbdata) -{ - int rc; - pmix1_opalcaddy_t *opalcaddy; - opal_namelist_t *nm; - size_t n; - opal_value_t *oinfo; - - if (NULL == host_module || NULL == host_module->disconnect) { - return PMIX_ERR_NOT_SUPPORTED; - } - - /* setup the caddy */ - opalcaddy = OBJ_NEW(pmix1_opalcaddy_t); - opalcaddy->opcbfunc = cbfunc; - opalcaddy->cbdata = cbdata; - - /* convert the array of pmix_proc_t to the list of procs */ - for (n=0; n < nprocs; n++) { - nm = OBJ_NEW(opal_namelist_t); - opal_list_append(&opalcaddy->procs, &nm->super); - if (OPAL_SUCCESS != (rc = opal_convert_string_to_jobid(&nm->name.jobid, procs[n].nspace))) { - OBJ_RELEASE(opalcaddy); - return pmix1_convert_opalrc(rc); - } - if (PMIX_RANK_WILDCARD == procs[n].rank) { - nm->name.vpid = OPAL_VPID_WILDCARD; - } else { - nm->name.vpid = procs[n].rank; - } - } - - /* convert the info */ - for (n=0; n < ninfo; n++) { - oinfo = OBJ_NEW(opal_value_t); - opal_list_append(&opalcaddy->info, &oinfo->super); - oinfo->key = strdup(info[n].key); - if (OPAL_SUCCESS != (rc = pmix1_value_unload(oinfo, &info[n].value))) { - OBJ_RELEASE(opalcaddy); - return pmix1_convert_opalrc(rc); - } - } - - /* pass it up */ - rc = host_module->disconnect(&opalcaddy->procs, &opalcaddy->info, opal_opcbfunc, opalcaddy); - if (OPAL_SUCCESS != rc) { - OBJ_RELEASE(opalcaddy); - } - - return pmix1_convert_opalrc(rc); -} - -static pmix_status_t server_register_events(const pmix_info_t info[], size_t ninfo, - pmix_op_cbfunc_t cbfunc, void *cbdata) -{ - pmix1_opalcaddy_t *opalcaddy; - size_t n; - opal_value_t *oinfo; - int rc; - - /* setup the caddy */ - opalcaddy = OBJ_NEW(pmix1_opalcaddy_t); - opalcaddy->opcbfunc = cbfunc; - opalcaddy->cbdata = cbdata; - - /* convert the info */ - for (n=0; n < ninfo; n++) { - oinfo = OBJ_NEW(opal_value_t); - opal_list_append(&opalcaddy->info, &oinfo->super); - oinfo->key = strdup(info[n].key); - if (OPAL_SUCCESS != (rc = pmix1_value_unload(oinfo, &info[n].value))) { - OBJ_RELEASE(opalcaddy); - return pmix1_convert_opalrc(rc); - } - } - - /* pass it up */ - rc = host_module->register_events(&opalcaddy->info, opal_opcbfunc, opalcaddy); - if (OPAL_SUCCESS != rc) { - OBJ_RELEASE(opalcaddy); - } - - return pmix1_convert_opalrc(rc); -} - -static pmix_status_t server_deregister_events(const pmix_info_t info[], size_t ninfo, - pmix_op_cbfunc_t cbfunc, void *cbdata) -{ - return PMIX_ERR_NOT_IMPLEMENTED; -} -static pmix_status_t server_listener_fn(int listening_sd, - pmix_connection_cbfunc_t cbfunc) -{ - int rc; - - if (NULL == host_module || NULL == host_module->listener) { - return PMIX_ERR_NOT_SUPPORTED; - } - - rc = host_module->listener(listening_sd, cbfunc); - return pmix1_convert_opalrc(rc); -} diff --git a/opal/mca/pmix/ext1x/pmix1x_server_south.c b/opal/mca/pmix/ext1x/pmix1x_server_south.c deleted file mode 100644 index 189476a326f..00000000000 --- a/opal/mca/pmix/ext1x/pmix1x_server_south.c +++ /dev/null @@ -1,454 +0,0 @@ -/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ -/* - * Copyright (c) 2014-2018 Intel, Inc. All rights reserved. - * Copyright (c) 2014-2017 Research Organization for Information Science - * and Technology (RIST). All rights reserved. - * Copyright (c) 2014-2015 Intel, Inc. All rights reserved. - * Copyright (c) 2014-2017 Mellanox Technologies, Inc. - * All rights reserved. - * Copyright (c) 2016 Cisco Systems, Inc. All rights reserved. - * $COPYRIGHT$ - * - * Additional copyrights may follow - * - * $HEADER$ - */ - -#include "opal_config.h" -#include "opal/constants.h" -#include "opal/types.h" - -#ifdef HAVE_STRING_H -#include -#endif -#ifdef HAVE_UNISTD_H -#include -#endif - -#include "opal/dss/dss.h" -#include "opal/mca/event/event.h" -#include "opal/mca/hwloc/base/base.h" -#include "opal/runtime/opal.h" -#include "opal/runtime/opal_progress_threads.h" -#include "opal/util/argv.h" -#include "opal/util/error.h" -#include "opal/util/output.h" -#include "opal/util/proc.h" -#include "opal/util/show_help.h" -#include "opal/util/string_copy.h" -#include "opal/mca/pmix/base/base.h" -#include "pmix1x.h" - -#include "pmix.h" -#include "pmix_server.h" - -/**** S.O.U.T.H.B.O.U.N.D I.N.T.E.R.F.A.C.E.S ****/ - -/* These are the interfaces used by the OMPI/ORTE/OPAL layer to call - * down into the embedded PMIx server. */ - -extern pmix_server_module_t mymodule; -extern opal_pmix_server_module_t *host_module; -static char *dbgvalue=NULL; -static int errhdler_ref = 0; - -static void completion_handler(int status, opal_list_t *results, - opal_pmix_op_cbfunc_t cbfunc, void *thiscbdata, - void *notification_cbdata) { - int * cond = (int *)notification_cbdata; - *cond = 0; -} - -#define PMIX_WAIT_FOR_COMPLETION(a) \ - do { \ - while ((a)) { \ - usleep(10); \ - } \ - } while (0); - -static void myerr(pmix_status_t status, - pmix_proc_t procs[], size_t nprocs, - pmix_info_t info[], size_t ninfo) -{ - int rc; - opal_list_t plist, ilist; - opal_namelist_t *nm; - opal_value_t *iptr; - volatile int cond = 1; - size_t n; - - /* convert the incoming status */ - rc = pmix1_convert_rc(status); - - /* convert the array of procs */ - OBJ_CONSTRUCT(&plist, opal_list_t); - for (n=0; n < nprocs; n++) { - nm = OBJ_NEW(opal_namelist_t); - nm->name.jobid = strtoul(procs[n].nspace, NULL, 10); - nm->name.vpid = procs[n].rank; - opal_list_append(&plist, &nm->super); - } - - /* convert the array of info */ - OBJ_CONSTRUCT(&ilist, opal_list_t); - for (n=0; n < ninfo; n++) { - iptr = OBJ_NEW(opal_value_t); - iptr->key = strdup(info[n].key); - pmix1_value_unload(iptr, &info[n].value); - opal_list_append(&plist, &iptr->super); - } - - /* call the base errhandler */ - opal_pmix_base_evhandler(rc, &OPAL_PROC_MY_NAME, &plist, &ilist, completion_handler, (void *)&cond); - PMIX_WAIT_FOR_COMPLETION(cond); - - OPAL_LIST_DESTRUCT(&plist); - OPAL_LIST_DESTRUCT(&ilist); -} - -static void errreg_cbfunc(pmix_status_t status, - int errhandler_ref, - void *cbdata) -{ - errhdler_ref = errhandler_ref; - opal_output_verbose(5, opal_pmix_base_framework.framework_output, - "PMIX server errreg_cbfunc - error handler registered status=%d, reference=%d", - status, errhandler_ref); -} - -static void op2cbfunc(pmix_status_t status, void *cbdata) -{ - volatile bool *active = (volatile bool*)cbdata; - if (active) - *active = false; -} - -int pmix1_server_init(opal_pmix_server_module_t *module, - opal_list_t *info) -{ - pmix_status_t rc; - int dbg; - opal_value_t *kv; - pmix_info_t *pinfo; - size_t sz, n; - opal_pmix1_jobid_trkr_t *job; - volatile bool active; - - if (0 < (dbg = opal_output_get_verbosity(opal_pmix_base_framework.framework_output))) { - asprintf(&dbgvalue, "PMIX_DEBUG=%d", dbg); - putenv(dbgvalue); - } - - /* convert the list to an array of pmix_info_t */ - if (NULL != info && 0 < (sz = opal_list_get_size(info))) { - PMIX_INFO_CREATE(pinfo, sz); - n = 0; - OPAL_LIST_FOREACH(kv, info, opal_value_t) { - (void)opal_string_copy(pinfo[n].key, kv->key, PMIX_MAX_KEYLEN); - pmix1_value_load(&pinfo[n].value, kv); - ++n; - } - } else { - sz = 0; - pinfo = NULL; - } - - /* insert this into our list of jobids - it will be the - * first, and so we'll check it first */ - job = OBJ_NEW(opal_pmix1_jobid_trkr_t); - (void)opal_snprintf_jobid(job->nspace, PMIX_MAX_NSLEN, OPAL_PROC_MY_NAME.jobid); - job->jobid = OPAL_PROC_MY_NAME.jobid; - opal_list_append(&mca_pmix_ext1x_component.jobids, &job->super); - - if (PMIX_SUCCESS != (rc = PMIx_server_init(&mymodule, pinfo, sz))) { - PMIX_INFO_FREE(pinfo, sz); - return pmix1_convert_rc(rc); - } - PMIX_INFO_FREE(pinfo, sz); - - /* record the host module */ - host_module = module; - - /* register the errhandler */ - PMIx_Register_errhandler(NULL, 0, myerr, errreg_cbfunc, NULL); - - /* as we might want to use some client-side functions, be sure - * to register our own nspace */ - active = true; - PMIx_server_register_nspace(job->nspace, 1, NULL, 0, op2cbfunc, (void*)&active); - PMIX_WAIT_FOR_COMPLETION(active); - - return OPAL_SUCCESS; -} - -int pmix1_server_finalize(void) -{ - pmix_status_t rc; - - /* deregister the errhandler */ - PMIx_Deregister_errhandler(errhdler_ref, NULL, NULL); - - rc = PMIx_server_finalize(); - return pmix1_convert_rc(rc); -} - -int pmix1_server_gen_regex(const char *input, char **regex) -{ - pmix_status_t rc; - - rc = PMIx_generate_regex(input, regex); - return pmix1_convert_rc(rc); -} - - -int pmix1_server_gen_ppn(const char *input, char **ppn) -{ - pmix_status_t rc; - - rc = PMIx_generate_ppn(input, ppn); - return pmix1_convert_rc(rc); -} - -static void opcbfunc(pmix_status_t status, void *cbdata) -{ - pmix1_opcaddy_t *op = (pmix1_opcaddy_t*)cbdata; - - if (NULL != op->opcbfunc) { - op->opcbfunc(pmix1_convert_rc(status), op->cbdata); - } - if (op->active) { - op->active = false; - } else { - OBJ_RELEASE(op); - } -} - -int pmix1_server_register_nspace(opal_jobid_t jobid, - int nlocalprocs, - opal_list_t *info, - opal_pmix_op_cbfunc_t cbfunc, - void *cbdata) -{ - opal_value_t *kv, *k2; - pmix_info_t *pinfo, *pmap; - size_t sz, szmap, m, n; - char nspace[PMIX_MAX_NSLEN]; - pmix_status_t rc; - pmix1_opcaddy_t op; - opal_list_t *pmapinfo; - opal_pmix1_jobid_trkr_t *job; - - /* convert the jobid */ - (void)opal_snprintf_jobid(nspace, PMIX_MAX_NSLEN, jobid); - - /* store this job in our list of known nspaces */ - job = OBJ_NEW(opal_pmix1_jobid_trkr_t); - (void)opal_string_copy(job->nspace, nspace, PMIX_MAX_NSLEN); - job->jobid = jobid; - opal_list_append(&mca_pmix_ext1x_component.jobids, &job->super); - - /* convert the list to an array of pmix_info_t */ - if (NULL != info && 0 < (sz = opal_list_get_size(info))) { - PMIX_INFO_CREATE(pinfo, sz); - n = 0; - OPAL_LIST_FOREACH(kv, info, opal_value_t) { - (void)opal_string_copy(pinfo[n].key, kv->key, PMIX_MAX_KEYLEN); - if (0 == strcmp(kv->key, OPAL_PMIX_PROC_DATA)) { - pinfo[n].value.type = PMIX_INFO_ARRAY; - /* the value contains a list of values - convert - * that list to another array */ - pmapinfo = (opal_list_t*)kv->data.ptr; - szmap = opal_list_get_size(pmapinfo); - if (0 < szmap) { - PMIX_INFO_CREATE(pmap, szmap); - pinfo[n].value.data.array.array = (struct pmix_info_t*)pmap; - pinfo[n].value.data.array.size = szmap; - m = 0; - OPAL_LIST_FOREACH(k2, pmapinfo, opal_value_t) { - (void)opal_string_copy(pmap[m].key, k2->key, PMIX_MAX_KEYLEN); - pmix1_value_load(&pmap[m].value, k2); - ++m; - } - } - OPAL_LIST_RELEASE(pmapinfo); - } else { - pmix1_value_load(&pinfo[n].value, kv); - } - ++n; - } - } else { - sz = 0; - pinfo = NULL; - } - - /* setup the caddy */ - OBJ_CONSTRUCT(&op, pmix1_opcaddy_t); - op.info = pinfo; - op.sz = sz; - op.opcbfunc = cbfunc; - op.cbdata = cbdata; - op.active = true; - rc = PMIx_server_register_nspace(nspace, nlocalprocs, pinfo, sz, - opcbfunc, &op); - if (PMIX_SUCCESS == rc) { - PMIX_WAIT_FOR_COMPLETION(op.active); - } - PMIX_INFO_FREE(pinfo, sz); - return pmix1_convert_rc(rc); -} - -void pmix1_server_deregister_nspace(opal_jobid_t jobid, - opal_pmix_op_cbfunc_t cbfunc, - void *cbdata) -{ - opal_pmix1_jobid_trkr_t *jptr; - - /* if we don't already have it, we can ignore this */ - OPAL_LIST_FOREACH(jptr, &mca_pmix_ext1x_component.jobids, opal_pmix1_jobid_trkr_t) { - if (jptr->jobid == jobid) { - /* found it - tell the server to deregister */ - PMIx_server_deregister_nspace(jptr->nspace); - /* now get rid of it from our list */ - opal_list_remove_item(&mca_pmix_ext1x_component.jobids, &jptr->super); - OBJ_RELEASE(jptr); - return; - } - } -} - -int pmix1_server_register_client(const opal_process_name_t *proc, - uid_t uid, gid_t gid, - void *server_object, - opal_pmix_op_cbfunc_t cbfunc, - void *cbdata) -{ - pmix_status_t rc; - pmix1_opcaddy_t *op; - - /* setup the caddy */ - op = OBJ_NEW(pmix1_opcaddy_t); - op->opcbfunc = cbfunc; - op->cbdata = cbdata; - - /* convert the jobid */ - (void)opal_snprintf_jobid(op->p.nspace, PMIX_MAX_NSLEN, proc->jobid); - op->p.rank = proc->vpid; - - rc = PMIx_server_register_client(&op->p, uid, gid, server_object, - opcbfunc, op); - if (PMIX_SUCCESS != rc) { - OBJ_RELEASE(op); - } - return pmix1_convert_rc(rc); -} - -void pmix1_server_deregister_client(const opal_process_name_t *proc, - opal_pmix_op_cbfunc_t cbfunc, - void *cbdata) -{ - opal_pmix1_jobid_trkr_t *jptr; - pmix_proc_t p; - - /* if we don't already have it, we can ignore this */ - OPAL_LIST_FOREACH(jptr, &mca_pmix_ext1x_component.jobids, opal_pmix1_jobid_trkr_t) { - if (jptr->jobid == proc->jobid) { - /* found it - tell the server to deregister */ - (void)opal_string_copy(p.nspace, jptr->nspace, PMIX_MAX_NSLEN); - p.rank = proc->vpid; - PMIx_server_deregister_client(&p); - return; - } - } -} - - -int pmix1_server_setup_fork(const opal_process_name_t *proc, char ***env) -{ - pmix_status_t rc; - pmix_proc_t p; - - /* convert the jobid */ - (void)opal_snprintf_jobid(p.nspace, PMIX_MAX_NSLEN, proc->jobid); - p.rank = proc->vpid; - - rc = PMIx_server_setup_fork(&p, env); - return pmix1_convert_rc(rc); -} - -/* this is the call back up from the embedded PMIx server that - * will contain the returned data. Note that the embedded server - * "owns" the data and will free it upon return from this function */ -static void dmdx_response(pmix_status_t status, char *data, size_t sz, void *cbdata) -{ - int rc; - pmix1_opcaddy_t *op = (pmix1_opcaddy_t*)cbdata; - - rc = pmix1_convert_rc(status); - if (NULL != op->mdxcbfunc) { - op->mdxcbfunc(rc, data, sz, op->cbdata, NULL, NULL); - } - OBJ_RELEASE(op); -} - -int pmix1_server_dmodex(const opal_process_name_t *proc, - opal_pmix_modex_cbfunc_t cbfunc, void *cbdata) -{ - pmix1_opcaddy_t *op; - pmix_status_t rc; - - /* setup the caddy */ - op = OBJ_NEW(pmix1_opcaddy_t); - op->mdxcbfunc = cbfunc; - op->cbdata = cbdata; - - /* convert the jobid */ - (void)opal_snprintf_jobid(op->p.nspace, PMIX_MAX_NSLEN, proc->jobid); - op->p.rank = proc->vpid; - - /* find the internally-cached data for this proc */ - rc = PMIx_server_dmodex_request(&op->p, dmdx_response, op); - if (PMIX_SUCCESS != rc) { - OBJ_RELEASE(op); - } - return pmix1_convert_rc(rc); -} - -int pmix1_server_notify_error(int status, - const opal_process_name_t *source, - opal_list_t *info, - opal_pmix_op_cbfunc_t cbfunc, void *cbdata) -{ - opal_value_t *kv; - pmix_info_t *pinfo; - size_t sz, n; - pmix_status_t rc; - pmix1_opcaddy_t *op; - - /* setup the caddy */ - op = OBJ_NEW(pmix1_opcaddy_t); - op->opcbfunc = cbfunc; - op->cbdata = cbdata; - - /* convert the list to an array of pmix_info_t */ - if (NULL != info && 0 < (sz = opal_list_get_size(info))) { - PMIX_INFO_CREATE(pinfo, sz); - n = 0; - OPAL_LIST_FOREACH(kv, info, opal_value_t) { - (void)opal_string_copy(pinfo[n].key, kv->key, PMIX_MAX_KEYLEN); - pmix1_value_load(&pinfo[n].value, kv); - } - } else { - sz = 0; - pinfo = NULL; - } - op->info = pinfo; - op->sz = sz; - - rc = pmix1_convert_opalrc(status); - rc = PMIx_Notify_error(rc, NULL, 0, NULL, 0, - pinfo, sz, opcbfunc, op); - if (PMIX_SUCCESS != rc) { - OBJ_RELEASE(op); - } - return pmix1_convert_rc(rc); -} diff --git a/opal/mca/pmix/ext2x/Makefile.am b/opal/mca/pmix/ext2x/Makefile.am deleted file mode 100644 index e99b0f03a3b..00000000000 --- a/opal/mca/pmix/ext2x/Makefile.am +++ /dev/null @@ -1,53 +0,0 @@ -# -# Copyright (c) 2014-2017 Intel, Inc. All rights reserved. -# Copyright (c) 2015 Cisco Systems, Inc. All rights reserved. -# Copyright (c) 2015-2018 Research Organization for Information Science -# and Technology (RIST). All rights reserved. -# Copyright (c) 2017 IBM Corporation. All rights reserved. -# $COPYRIGHT$ -# -# Additional copyrights may follow -# -# $HEADER$ -# - -dist_opaldata_DATA = help-pmix-ext2x.txt - -sources = \ - ext2x_local.c \ - ext2x.c \ - ext2x_client.c \ - ext2x_component.c \ - ext2x_server_north.c \ - ext2x_server_south.c - -headers = \ - ext2x.h - -# 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_opal_pmix_ext2x_DSO -component_noinst = -component_install = mca_pmix_ext2x.la -else -component_noinst = libmca_pmix_ext2x.la -component_install = -endif - -mcacomponentdir = $(opallibdir) -mcacomponent_LTLIBRARIES = $(component_install) -mca_pmix_ext2x_la_SOURCES = $(sources) $(headers) -mca_pmix_ext2x_la_CFLAGS = $(opal_pmix_ext2x_CFLAGS) -mca_pmix_ext2x_la_CPPFLAGS =$(opal_pmix_ext2x_CPPFLAGS) -mca_pmix_ext2x_la_LDFLAGS = -module -avoid-version $(opal_pmix_ext2x_LDFLAGS) -mca_pmix_ext2x_la_LIBADD = $(top_builddir)/opal/lib@OPAL_LIB_PREFIX@open-pal.la \ - $(opal_pmix_ext2x_LIBS) - -noinst_LTLIBRARIES = $(component_noinst) -libmca_pmix_ext2x_la_SOURCES =$(sources) $(headers) -libmca_pmix_ext2x_la_CFLAGS = $(opal_pmix_ext2x_CFLAGS) -libmca_pmix_ext2x_la_CPPFLAGS = $(opal_pmix_ext2x_CPPFLAGS) -libmca_pmix_ext2x_la_LDFLAGS = -module -avoid-version $(opal_pmix_ext2x_LDFLAGS) -libmca_pmix_ext2x_la_LIBADD = $(opal_pmix_ext2x_LIBS) diff --git a/opal/mca/pmix/ext2x/common_sym_whitelist.txt b/opal/mca/pmix/ext2x/common_sym_whitelist.txt deleted file mode 100644 index 7a60b367d69..00000000000 --- a/opal/mca/pmix/ext2x/common_sym_whitelist.txt +++ /dev/null @@ -1,6 +0,0 @@ -# Ignore symbols in this component that are auto-generated and we -# can't do anything about them (e.g., flex/bison symbols). -pmix_util_keyval_yyleng -pmix_util_keyval_yytext -pmix_show_help_yyleng -pmix_show_help_yytext diff --git a/opal/mca/pmix/ext2x/configure.m4 b/opal/mca/pmix/ext2x/configure.m4 deleted file mode 100644 index 171f735f3b7..00000000000 --- a/opal/mca/pmix/ext2x/configure.m4 +++ /dev/null @@ -1,63 +0,0 @@ -# -*- shell-script -*- -# -# 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) 2011-2013 Los Alamos National Security, LLC. -# All rights reserved. -# Copyright (c) 2010-2015 Cisco Systems, Inc. All rights reserved. -# Copyright (c) 2013-2017 Intel, Inc. All rights reserved. -# Copyright (c) 2015-2017 Research Organization for Information Science -# and Technology (RIST). All rights reserved. -# Copyright (c) 2014-2015 Mellanox Technologies, Inc. -# All rights reserved. -# $COPYRIGHT$ -# -# Additional copyrights may follow -# -# $HEADER$ -# - -# MCA_pmix_ext2x_CONFIG([action-if-found], [action-if-not-found]) -# ----------------------------------------------------------- -AC_DEFUN([MCA_opal_pmix_ext2x_CONFIG],[ - AC_CONFIG_FILES([opal/mca/pmix/ext2x/Makefile]) - - AS_IF([test "$opal_external_pmix_happy" = "yes"], - [ # check for the 2.x version - AC_MSG_CHECKING([if external component is version 2.x]) - AS_IF([test "$opal_external_pmix_version" = "2x"], - [AC_MSG_RESULT([yes]) - AS_IF([test "$opal_event_external_support" != "yes"], - [AC_MSG_WARN([EXTERNAL PMIX SUPPORT REQUIRES USE OF EXTERNAL LIBEVENT]) - AC_MSG_WARN([LIBRARY. THIS LIBRARY MUST POINT TO THE SAME ONE USED]) - AC_MSG_WARN([TO BUILD PMIX OR ELSE UNPREDICTABLE BEHAVIOR MAY RESULT]) - AC_MSG_ERROR([PLEASE CORRECT THE CONFIGURE COMMAND LINE AND REBUILD])]) - opal_pmix_external_2x_happy=yes], - [AC_MSG_RESULT([no]) - opal_pmix_external_2x_happy=no]) - - AS_IF([test "$opal_pmix_external_2x_happy" = "yes"], - [$1 - # need to set the wrapper flags for static builds - pmix_ext2x_WRAPPER_EXTRA_LDFLAGS=$opal_external_pmix_LDFLAGS - pmix_ext2x_WRAPPER_EXTRA_LIBS=$opal_external_pmix_LIBS], - [$2])], - [$2]) - - opal_pmix_ext2x_CPPFLAGS=$opal_external_pmix_CPPFLAGS - opal_pmix_ext2x_LDFLAGS=$opal_external_pmix_LDFLAGS - opal_pmix_ext2x_LIBS=$opal_external_pmix_LIBS - - AC_SUBST([opal_pmix_ext2x_CPPFLAGS]) - AC_SUBST([opal_pmix_ext2x_LDFLAGS]) - AC_SUBST([opal_pmix_ext2x_LIBS]) - -])dnl diff --git a/opal/mca/pmix/ext2x/ext2x.c b/opal/mca/pmix/ext2x/ext2x.c deleted file mode 100644 index ce8324978f4..00000000000 --- a/opal/mca/pmix/ext2x/ext2x.c +++ /dev/null @@ -1,1555 +0,0 @@ -/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ -/* - * Copyright (c) 2014-2018 Intel, Inc. All rights reserved. - * Copyright (c) 2014-2017 Research Organization for Information Science - * and Technology (RIST). All rights reserved. - * Copyright (c) 2014-2015 Mellanox Technologies, Inc. - * All rights reserved. - * Copyright (c) 2016 Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2017 Los Alamos National Security, LLC. All rights - * reserved. - * $COPYRIGHT$ - * - * Additional copyrights may follow - * - * $HEADER$ - */ - -#include "opal_config.h" -#include "opal/constants.h" -#include "opal/types.h" - -#ifdef HAVE_STRING_H -#include -#endif -#ifdef HAVE_UNISTD_H -#include -#endif - -#include "opal/dss/dss.h" -#include "opal/mca/event/event.h" -#include "opal/mca/hwloc/base/base.h" -#include "opal/runtime/opal.h" -#include "opal/runtime/opal_progress_threads.h" -#include "opal/threads/threads.h" -#include "opal/util/argv.h" -#include "opal/util/error.h" -#include "opal/util/opal_environ.h" -#include "opal/util/output.h" -#include "opal/util/proc.h" -#include "opal/util/show_help.h" -#include "opal/util/string_copy.h" - -#include "ext2x.h" -#include "opal/mca/pmix/base/base.h" -#include "opal/mca/pmix/pmix_types.h" - -#include -#include - -/**** C.O.M.M.O.N I.N.T.E.R.F.A.C.E.S ****/ - -/* These are functions used by both client and server to - * access common functions in the embedded PMIx library */ -static bool legacy_get(void); -static const char *ext2x_get_nspace(opal_jobid_t jobid); -static void ext2x_register_jobid(opal_jobid_t jobid, const char *nspace); -static void register_handler(opal_list_t *event_codes, - opal_list_t *info, - opal_pmix_notification_fn_t evhandler, - opal_pmix_evhandler_reg_cbfunc_t cbfunc, - void *cbdata); -static void deregister_handler(size_t evhandler, - opal_pmix_op_cbfunc_t cbfunc, - void *cbdata); -static int notify_event(int status, - const opal_process_name_t *source, - opal_pmix_data_range_t range, - opal_list_t *info, - opal_pmix_op_cbfunc_t cbfunc, void *cbdata); -static void ext2x_query(opal_list_t *queries, - opal_pmix_info_cbfunc_t cbfunc, void *cbdata); -static void ext2x_log(opal_list_t *info, - opal_pmix_op_cbfunc_t cbfunc, void *cbdata); - -const opal_pmix_base_module_t opal_pmix_ext2x_module = { - .legacy_get = legacy_get, - /* client APIs */ - .init = ext2x_client_init, - .finalize = ext2x_client_finalize, - .initialized = ext2x_initialized, - .abort = ext2x_abort, - .commit = ext2x_commit, - .fence = ext2x_fence, - .fence_nb = ext2x_fencenb, - .put = ext2x_put, - .get = ext2x_get, - .get_nb = ext2x_getnb, - .publish = ext2x_publish, - .publish_nb = ext2x_publishnb, - .lookup = ext2x_lookup, - .lookup_nb = ext2x_lookupnb, - .unpublish = ext2x_unpublish, - .unpublish_nb = ext2x_unpublishnb, - .spawn = ext2x_spawn, - .spawn_nb = ext2x_spawnnb, - .connect = ext2x_connect, - .connect_nb = ext2x_connectnb, - .disconnect = ext2x_disconnect, - .disconnect_nb = ext2x_disconnectnb, - .resolve_peers = ext2x_resolve_peers, - .resolve_nodes = ext2x_resolve_nodes, - .query = ext2x_query, - .log = ext2x_log, - .allocate = ext2x_allocate, - .job_control = ext2x_job_control, - /* server APIs */ - .server_init = ext2x_server_init, - .server_finalize = ext2x_server_finalize, - .generate_regex = ext2x_server_gen_regex, - .generate_ppn = ext2x_server_gen_ppn, - .server_register_nspace = ext2x_server_register_nspace, - .server_deregister_nspace = ext2x_server_deregister_nspace, - .server_register_client = ext2x_server_register_client, - .server_deregister_client = ext2x_server_deregister_client, - .server_setup_fork = ext2x_server_setup_fork, - .server_dmodex_request = ext2x_server_dmodex, - .server_notify_event = ext2x_server_notify_event, - /* tool APIs */ - .tool_init = ext2x_tool_init, - .tool_finalize = ext2x_tool_fini, - /* utility APIs */ - .get_version = PMIx_Get_version, - .register_evhandler = register_handler, - .deregister_evhandler = deregister_handler, - .notify_event = notify_event, - .store_local = ext2x_store_local, - .get_nspace = ext2x_get_nspace, - .register_jobid = ext2x_register_jobid -}; - -static bool legacy_get(void) -{ - return mca_pmix_ext2x_component.legacy_get; -} - -static void opcbfunc(pmix_status_t status, void *cbdata) -{ - ext2x_opcaddy_t *op = (ext2x_opcaddy_t*)cbdata; - - OPAL_ACQUIRE_OBJECT(op); - - if (NULL != op->opcbfunc) { - op->opcbfunc(ext2x_convert_rc(status), op->cbdata); - } - OBJ_RELEASE(op); -} - - -static const char *ext2x_get_nspace(opal_jobid_t jobid) -{ - opal_ext2x_jobid_trkr_t *jptr; - - OPAL_PMIX_ACQUIRE_THREAD(&opal_pmix_base.lock); - - OPAL_LIST_FOREACH(jptr, &mca_pmix_ext2x_component.jobids, opal_ext2x_jobid_trkr_t) { - if (jptr->jobid == jobid) { - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - return jptr->nspace; - } - } - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - return NULL; -} - -static void ext2x_register_jobid(opal_jobid_t jobid, const char *nspace) -{ - opal_ext2x_jobid_trkr_t *jptr; - - OPAL_PMIX_ACQUIRE_THREAD(&opal_pmix_base.lock); - - /* if we don't already have it, add this to our jobid tracker */ - OPAL_LIST_FOREACH(jptr, &mca_pmix_ext2x_component.jobids, opal_ext2x_jobid_trkr_t) { - if (jptr->jobid == jobid) { - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - return; - } - } - jptr = OBJ_NEW(opal_ext2x_jobid_trkr_t); - (void)opal_string_copy(jptr->nspace, nspace, PMIX_MAX_NSLEN); - jptr->jobid = jobid; - opal_list_append(&mca_pmix_ext2x_component.jobids, &jptr->super); - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); -} - -static void event_hdlr_complete(pmix_status_t status, void *cbdata) -{ - ext2x_opcaddy_t *op = (ext2x_opcaddy_t*)cbdata; - - OBJ_RELEASE(op); -} - -static void return_local_event_hdlr(int status, opal_list_t *results, - opal_pmix_op_cbfunc_t cbfunc, void *thiscbdata, - void *notification_cbdata) -{ - ext2x_threadshift_t *cd = (ext2x_threadshift_t*)notification_cbdata; - ext2x_opcaddy_t *op; - opal_value_t *kv; - pmix_status_t pstatus; - size_t n; - - OPAL_ACQUIRE_OBJECT(cd); - if (NULL != cd->pmixcbfunc) { - op = OBJ_NEW(ext2x_opcaddy_t); - - if (NULL != results && 0 < (op->ninfo = opal_list_get_size(results))) { - /* convert the list of results to an array of info */ - PMIX_INFO_CREATE(op->info, op->ninfo); - n=0; - OPAL_LIST_FOREACH(kv, cd->info, opal_value_t) { - (void)opal_string_copy(op->info[n].key, kv->key, PMIX_MAX_KEYLEN); - ext2x_value_load(&op->info[n].value, kv); - ++n; - } - } - /* convert the status */ - pstatus = ext2x_convert_opalrc(status); - /* call the library's callback function */ - cd->pmixcbfunc(pstatus, op->info, op->ninfo, event_hdlr_complete, op, cd->cbdata); - } - - /* release the threadshift object */ - if (NULL != cd->info) { - OPAL_LIST_RELEASE(cd->info); - } - OBJ_RELEASE(cd); - - /* release the caller */ - if (NULL != cbfunc) { - cbfunc(OPAL_SUCCESS, thiscbdata); - } -} - -/* this function will be called by the PMIx client library - * whenever it receives notification of an event. The - * notification can come from an ORTE daemon (when launched - * by mpirun), directly from a RM (when direct launched), or - * from another process (via the local daemon). - * The call will occur in the PMIx event base */ -void ext2x_event_hdlr(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) -{ - ext2x_threadshift_t *cd; - int rc; - opal_value_t *iptr; - size_t n; - opal_ext2x_event_t *event; - - opal_output_verbose(2, opal_pmix_base_framework.framework_output, - "%s RECEIVED NOTIFICATION OF STATUS %d", - OPAL_NAME_PRINT(OPAL_PROC_MY_NAME), status); - - OPAL_PMIX_ACQUIRE_THREAD(&opal_pmix_base.lock); - - cd = OBJ_NEW(ext2x_threadshift_t); - cd->id = evhdlr_registration_id; - cd->pmixcbfunc = cbfunc; - cd->cbdata = cbdata; - - /* convert the incoming status */ - cd->status = ext2x_convert_rc(status); - opal_output_verbose(2, opal_pmix_base_framework.framework_output, - "%s CONVERTED STATUS %d TO STATUS %d", - OPAL_NAME_PRINT(OPAL_PROC_MY_NAME), status, cd->status); - - /* convert the nspace/rank to an opal_process_name_t */ - if (NULL == source) { - cd->pname.jobid = OPAL_NAME_INVALID->jobid; - cd->pname.vpid = OPAL_NAME_INVALID->vpid; - } else { - if (OPAL_SUCCESS != (rc = opal_convert_string_to_jobid(&cd->pname.jobid, source->nspace))) { - OPAL_ERROR_LOG(rc); - cd->pname.jobid = OPAL_NAME_INVALID->jobid; - } - cd->pname.vpid = ext2x_convert_rank(source->rank); - } - - /* convert the array of info */ - if (NULL != info) { - cd->info = OBJ_NEW(opal_list_t); - for (n=0; n < ninfo; n++) { - iptr = OBJ_NEW(opal_value_t); - iptr->key = strdup(info[n].key); - if (OPAL_SUCCESS != (rc = ext2x_value_unload(iptr, &info[n].value))) { - OPAL_ERROR_LOG(rc); - OBJ_RELEASE(iptr); - continue; - } - opal_list_append(cd->info, &iptr->super); - } - } - - /* convert the array of prior results */ - if (NULL != results) { - for (n=0; n < nresults; n++) { - iptr = OBJ_NEW(opal_value_t); - iptr->key = strdup(results[n].key); - if (OPAL_SUCCESS != (rc = ext2x_value_unload(iptr, &results[n].value))) { - OPAL_ERROR_LOG(rc); - OBJ_RELEASE(iptr); - continue; - } - opal_list_append(&cd->results, &iptr->super); - } - } - - /* cycle thru the registrations */ - OPAL_LIST_FOREACH(event, &mca_pmix_ext2x_component.events, opal_ext2x_event_t) { - if (evhdlr_registration_id == event->index) { - /* found it - invoke the handler, pointing its - * callback function to our callback function */ - opal_output_verbose(2, opal_pmix_base_framework.framework_output, - "%s _EVENT_HDLR CALLING EVHDLR", - OPAL_NAME_PRINT(OPAL_PROC_MY_NAME)); - if (NULL != event->handler) { - OBJ_RETAIN(event); - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - event->handler(cd->status, &cd->pname, - cd->info, &cd->results, - return_local_event_hdlr, cd); - OBJ_RELEASE(event); - return; - } - } - } - - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - - /* if we didn't find a match, we still have to call their final callback */ - if (NULL != cbfunc) { - cbfunc(PMIX_SUCCESS, NULL, 0, NULL, NULL, cbdata); - } - OPAL_LIST_RELEASE(cd->info); - OBJ_RELEASE(cd); - return; -} - -opal_vpid_t ext2x_convert_rank(pmix_rank_t rank) -{ - switch(rank) { - case PMIX_RANK_UNDEF: - return OPAL_VPID_INVALID; - case PMIX_RANK_WILDCARD: - return OPAL_VPID_WILDCARD; - default: - return (opal_vpid_t)rank; - } -} - -pmix_rank_t ext2x_convert_opalrank(opal_vpid_t vpid) -{ - switch(vpid) { - case OPAL_VPID_WILDCARD: - return PMIX_RANK_WILDCARD; - case OPAL_VPID_INVALID: - return PMIX_RANK_UNDEF; - default: - return (pmix_rank_t)vpid; - } -} - -pmix_status_t ext2x_convert_opalrc(int rc) -{ - switch (rc) { - case OPAL_ERR_DEBUGGER_RELEASE: - return PMIX_ERR_DEBUGGER_RELEASE; - - case OPAL_ERR_HANDLERS_COMPLETE: - return PMIX_EVENT_ACTION_COMPLETE; - - case OPAL_ERR_PROC_ABORTED: - return PMIX_ERR_PROC_ABORTED; - - case OPAL_ERR_PROC_REQUESTED_ABORT: - return PMIX_ERR_PROC_REQUESTED_ABORT; - - case OPAL_ERR_PROC_ABORTING: - return PMIX_ERR_PROC_ABORTING; - - case OPAL_ERR_NODE_DOWN: - return PMIX_ERR_NODE_DOWN; - - case OPAL_ERR_NODE_OFFLINE: - return PMIX_ERR_NODE_OFFLINE; - - case OPAL_ERR_JOB_TERMINATED: - return PMIX_ERR_JOB_TERMINATED; - - case OPAL_ERR_PROC_RESTART: - return PMIX_ERR_PROC_RESTART; - - case OPAL_ERR_PROC_CHECKPOINT: - return PMIX_ERR_PROC_CHECKPOINT; - - case OPAL_ERR_PROC_MIGRATE: - return PMIX_ERR_PROC_MIGRATE; - - case OPAL_ERR_EVENT_REGISTRATION: - return PMIX_ERR_EVENT_REGISTRATION; - - case OPAL_ERR_NOT_IMPLEMENTED: - case OPAL_ERR_NOT_SUPPORTED: - return PMIX_ERR_NOT_SUPPORTED; - - case OPAL_ERR_NOT_FOUND: - return PMIX_ERR_NOT_FOUND; - - case OPAL_ERR_PERM: - case OPAL_ERR_UNREACH: - case OPAL_ERR_SERVER_NOT_AVAIL: - return PMIX_ERR_UNREACH; - - case OPAL_ERR_BAD_PARAM: - return PMIX_ERR_BAD_PARAM; - - case OPAL_ERR_OUT_OF_RESOURCE: - return PMIX_ERR_OUT_OF_RESOURCE; - - case OPAL_ERR_DATA_VALUE_NOT_FOUND: - return PMIX_ERR_DATA_VALUE_NOT_FOUND; - - case OPAL_ERR_TIMEOUT: - return PMIX_ERR_TIMEOUT; - - case OPAL_ERR_WOULD_BLOCK: - return PMIX_ERR_WOULD_BLOCK; - - case OPAL_EXISTS: - return PMIX_EXISTS; - - case OPAL_ERR_PARTIAL_SUCCESS: - return PMIX_QUERY_PARTIAL_SUCCESS; - - case OPAL_ERR_MODEL_DECLARED: - return PMIX_MODEL_DECLARED; - - case OPAL_ERROR: - return PMIX_ERROR; - case OPAL_SUCCESS: - case OPAL_OPERATION_SUCCEEDED: - return PMIX_SUCCESS; - default: - return rc; - } -} - -int ext2x_convert_rc(pmix_status_t rc) -{ - switch (rc) { - case PMIX_ERR_DEBUGGER_RELEASE: - return OPAL_ERR_DEBUGGER_RELEASE; - - case PMIX_EVENT_ACTION_COMPLETE: - return OPAL_ERR_HANDLERS_COMPLETE; - - case PMIX_ERR_PROC_ABORTED: - return OPAL_ERR_PROC_ABORTED; - - case PMIX_ERR_PROC_REQUESTED_ABORT: - return OPAL_ERR_PROC_REQUESTED_ABORT; - - case PMIX_ERR_PROC_ABORTING: - return OPAL_ERR_PROC_ABORTING; - - case PMIX_ERR_NODE_DOWN: - return OPAL_ERR_NODE_DOWN; - - case PMIX_ERR_NODE_OFFLINE: - return OPAL_ERR_NODE_OFFLINE; - - case PMIX_ERR_JOB_TERMINATED: - return OPAL_ERR_JOB_TERMINATED; - - case PMIX_ERR_PROC_RESTART: - return OPAL_ERR_PROC_RESTART; - - case PMIX_ERR_PROC_CHECKPOINT: - return OPAL_ERR_PROC_CHECKPOINT; - - case PMIX_ERR_PROC_MIGRATE: - return OPAL_ERR_PROC_MIGRATE; - - case PMIX_ERR_EVENT_REGISTRATION: - return OPAL_ERR_EVENT_REGISTRATION; - - case PMIX_ERR_NOT_SUPPORTED: - return OPAL_ERR_NOT_SUPPORTED; - - case PMIX_ERR_NOT_FOUND: - return OPAL_ERR_NOT_FOUND; - - case PMIX_ERR_OUT_OF_RESOURCE: - return OPAL_ERR_OUT_OF_RESOURCE; - - case PMIX_ERR_INIT: - return OPAL_ERROR; - - case PMIX_ERR_BAD_PARAM: - return OPAL_ERR_BAD_PARAM; - - case PMIX_ERR_UNREACH: - case PMIX_ERR_NO_PERMISSIONS: - return OPAL_ERR_UNREACH; - - case PMIX_ERR_TIMEOUT: - return OPAL_ERR_TIMEOUT; - - case PMIX_ERR_WOULD_BLOCK: - return OPAL_ERR_WOULD_BLOCK; - - case PMIX_ERR_LOST_CONNECTION_TO_SERVER: - case PMIX_ERR_LOST_PEER_CONNECTION: - case PMIX_ERR_LOST_CONNECTION_TO_CLIENT: - return OPAL_ERR_COMM_FAILURE; - - case PMIX_EXISTS: - return OPAL_EXISTS; - - case PMIX_QUERY_PARTIAL_SUCCESS: - return OPAL_ERR_PARTIAL_SUCCESS; - - case PMIX_MONITOR_HEARTBEAT_ALERT: - return OPAL_ERR_HEARTBEAT_ALERT; - - case PMIX_MONITOR_FILE_ALERT: - return OPAL_ERR_FILE_ALERT; - - case PMIX_MODEL_DECLARED: - return OPAL_ERR_MODEL_DECLARED; - - - case PMIX_ERROR: - return OPAL_ERROR; - case PMIX_SUCCESS: - return OPAL_SUCCESS; - default: - return rc; - } -} - -opal_pmix_scope_t ext2x_convert_scope(pmix_scope_t scope) -{ - switch(scope) { - case PMIX_SCOPE_UNDEF: - return OPAL_PMIX_SCOPE_UNDEF; - case PMIX_LOCAL: - return OPAL_PMIX_LOCAL; - case PMIX_REMOTE: - return OPAL_PMIX_REMOTE; - case PMIX_GLOBAL: - return OPAL_PMIX_GLOBAL; - default: - return OPAL_PMIX_SCOPE_UNDEF; - } -} - -pmix_scope_t ext2x_convert_opalscope(opal_pmix_scope_t scope) { - switch(scope) { - case OPAL_PMIX_LOCAL: - return PMIX_LOCAL; - case OPAL_PMIX_REMOTE: - return PMIX_REMOTE; - case OPAL_PMIX_GLOBAL: - return PMIX_GLOBAL; - default: - return PMIX_SCOPE_UNDEF; - } -} - -pmix_data_range_t ext2x_convert_opalrange(opal_pmix_data_range_t range) { - switch(range) { - case OPAL_PMIX_RANGE_UNDEF: - return PMIX_RANGE_UNDEF; - case OPAL_PMIX_RANGE_LOCAL: - return PMIX_RANGE_LOCAL; - case OPAL_PMIX_RANGE_NAMESPACE: - return PMIX_RANGE_NAMESPACE; - case OPAL_PMIX_RANGE_SESSION: - return PMIX_RANGE_SESSION; - case OPAL_PMIX_RANGE_GLOBAL: - return PMIX_RANGE_GLOBAL; - case OPAL_PMIX_RANGE_CUSTOM: - return PMIX_RANGE_CUSTOM; - default: - return PMIX_SCOPE_UNDEF; - } -} - -opal_pmix_data_range_t ext2x_convert_range(pmix_data_range_t range) { - switch(range) { - case PMIX_RANGE_UNDEF: - return OPAL_PMIX_RANGE_UNDEF; - case PMIX_RANGE_LOCAL: - return OPAL_PMIX_RANGE_LOCAL; - case PMIX_RANGE_NAMESPACE: - return OPAL_PMIX_RANGE_NAMESPACE; - case PMIX_RANGE_SESSION: - return OPAL_PMIX_RANGE_SESSION; - case PMIX_RANGE_GLOBAL: - return OPAL_PMIX_RANGE_GLOBAL; - case PMIX_RANGE_CUSTOM: - return OPAL_PMIX_RANGE_CUSTOM; - default: - return OPAL_PMIX_RANGE_UNDEF; - } -} - -opal_pmix_persistence_t ext2x_convert_persist(pmix_persistence_t persist) -{ - switch(persist) { - case PMIX_PERSIST_INDEF: - return OPAL_PMIX_PERSIST_INDEF; - case PMIX_PERSIST_FIRST_READ: - return OPAL_PMIX_PERSIST_FIRST_READ; - case PMIX_PERSIST_PROC: - return OPAL_PMIX_PERSIST_PROC; - case PMIX_PERSIST_APP: - return OPAL_PMIX_PERSIST_APP; - case PMIX_PERSIST_SESSION: - return OPAL_PMIX_PERSIST_SESSION; - default: - return OPAL_PMIX_PERSIST_INDEF; - } -} - -pmix_persistence_t ext2x_convert_opalpersist(opal_pmix_persistence_t persist) -{ - switch(persist) { - case OPAL_PMIX_PERSIST_INDEF: - return PMIX_PERSIST_INDEF; - case OPAL_PMIX_PERSIST_FIRST_READ: - return PMIX_PERSIST_FIRST_READ; - case OPAL_PMIX_PERSIST_PROC: - return PMIX_PERSIST_PROC; - case OPAL_PMIX_PERSIST_APP: - return PMIX_PERSIST_APP; - case OPAL_PMIX_PERSIST_SESSION: - return PMIX_PERSIST_SESSION; - default: - return PMIX_PERSIST_INDEF; - } -} - -char* ext2x_convert_jobid(opal_jobid_t jobid) -{ - opal_ext2x_jobid_trkr_t *jptr; - - /* look thru our list of jobids and find the - * corresponding nspace */ - OPAL_LIST_FOREACH(jptr, &mca_pmix_ext2x_component.jobids, opal_ext2x_jobid_trkr_t) { - if (jptr->jobid == jobid) { - return jptr->nspace; - } - } - return NULL; -} - -/**** RHC: NEED TO ADD SUPPORT FOR NEW PMIX DATA TYPES, INCLUDING - **** CONVERSION OF PROC STATES ****/ - -void ext2x_value_load(pmix_value_t *v, - opal_value_t *kv) -{ - opal_ext2x_jobid_trkr_t *job; - bool found; - opal_list_t *list; - opal_value_t *val; - pmix_info_t *info; - size_t n; - - switch(kv->type) { - case OPAL_UNDEF: - v->type = PMIX_UNDEF; - break; - case OPAL_BOOL: - v->type = PMIX_BOOL; - memcpy(&(v->data.flag), &kv->data.flag, 1); - break; - case OPAL_BYTE: - v->type = PMIX_BYTE; - memcpy(&(v->data.byte), &kv->data.byte, 1); - break; - case OPAL_STRING: - v->type = PMIX_STRING; - if (NULL != kv->data.string) { - v->data.string = strdup(kv->data.string); - } else { - v->data.string = NULL; - } - break; - case OPAL_SIZE: - v->type = PMIX_SIZE; - memcpy(&(v->data.size), &kv->data.size, sizeof(size_t)); - break; - case OPAL_PID: - v->type = PMIX_PID; - memcpy(&(v->data.pid), &kv->data.pid, sizeof(pid_t)); - break; - case OPAL_INT: - v->type = PMIX_INT; - memcpy(&(v->data.integer), &kv->data.integer, sizeof(int)); - break; - case OPAL_INT8: - v->type = PMIX_INT8; - memcpy(&(v->data.int8), &kv->data.int8, 1); - break; - case OPAL_INT16: - v->type = PMIX_INT16; - memcpy(&(v->data.int16), &kv->data.int16, 2); - break; - case OPAL_INT32: - v->type = PMIX_INT32; - memcpy(&(v->data.int32), &kv->data.int32, 4); - break; - case OPAL_INT64: - v->type = PMIX_INT64; - memcpy(&(v->data.int64), &kv->data.int64, 8); - break; - case OPAL_UINT: - v->type = PMIX_UINT; - memcpy(&(v->data.uint), &kv->data.uint, sizeof(int)); - break; - case OPAL_UINT8: - v->type = PMIX_UINT8; - memcpy(&(v->data.uint8), &kv->data.uint8, 1); - break; - case OPAL_UINT16: - v->type = PMIX_UINT16; - memcpy(&(v->data.uint16), &kv->data.uint16, 2); - break; - case OPAL_UINT32: - v->type = PMIX_UINT32; - memcpy(&(v->data.uint32), &kv->data.uint32, 4); - break; - case OPAL_UINT64: - v->type = PMIX_UINT64; - memcpy(&(v->data.uint64), &kv->data.uint64, 8); - break; - case OPAL_FLOAT: - v->type = PMIX_FLOAT; - memcpy(&(v->data.fval), &kv->data.fval, sizeof(float)); - break; - case OPAL_DOUBLE: - v->type = PMIX_DOUBLE; - memcpy(&(v->data.dval), &kv->data.dval, sizeof(double)); - break; - case OPAL_TIMEVAL: - v->type = PMIX_TIMEVAL; - memcpy(&(v->data.tv), &kv->data.tv, sizeof(struct timeval)); - break; - case OPAL_TIME: - v->type = PMIX_TIME; - memcpy(&(v->data.time), &kv->data.time, sizeof(time_t)); - break; - case OPAL_STATUS: - v->type = PMIX_STATUS; - v->data.status = ext2x_convert_opalrc(kv->data.status); - break; - case OPAL_VPID: - v->type = PMIX_PROC_RANK; - v->data.rank = ext2x_convert_opalrank(kv->data.name.vpid); - break; - case OPAL_NAME: - v->type = PMIX_PROC; - /* have to stringify the jobid */ - PMIX_PROC_CREATE(v->data.proc, 1); - /* see if this job is in our list of known nspaces */ - found = false; - OPAL_LIST_FOREACH(job, &mca_pmix_ext2x_component.jobids, opal_ext2x_jobid_trkr_t) { - if (job->jobid == kv->data.name.jobid) { - (void)opal_string_copy(v->data.proc->nspace, job->nspace, PMIX_MAX_NSLEN); - found = true; - break; - } - } - if (!found) { - (void)opal_snprintf_jobid(v->data.proc->nspace, PMIX_MAX_NSLEN, kv->data.name.jobid); - } - v->data.proc->rank = ext2x_convert_opalrank(kv->data.name.vpid); - break; - case OPAL_BYTE_OBJECT: - v->type = PMIX_BYTE_OBJECT; - if (NULL != kv->data.bo.bytes) { - v->data.bo.bytes = (char*)malloc(kv->data.bo.size); - memcpy(v->data.bo.bytes, kv->data.bo.bytes, kv->data.bo.size); - v->data.bo.size = (size_t)kv->data.bo.size; - } else { - v->data.bo.bytes = NULL; - v->data.bo.size = 0; - } - break; - case OPAL_PERSIST: - v->type = PMIX_PERSIST; - v->data.persist = ext2x_convert_opalpersist((opal_pmix_persistence_t)kv->data.uint8); - break; - case OPAL_SCOPE: - v->type = PMIX_SCOPE; - v->data.scope = ext2x_convert_opalscope((opal_pmix_scope_t)kv->data.uint8); - break; - case OPAL_DATA_RANGE: - v->type = PMIX_DATA_RANGE; - v->data.range = ext2x_convert_opalrange((opal_pmix_data_range_t)kv->data.uint8); - break; - case OPAL_PROC_STATE: - v->type = PMIX_PROC_STATE; - /* the OPAL layer doesn't have any concept of proc state, - * so the ORTE layer is responsible for converting it */ - memcpy(&v->data.state, &kv->data.uint8, sizeof(uint8_t)); - break; - case OPAL_PTR: - /* if someone returned a pointer, it must be to a list of - * opal_value_t's that we need to convert to a pmix_data_array - * of pmix_info_t structures */ - list = (opal_list_t*)kv->data.ptr; - v->type = PMIX_DATA_ARRAY; - v->data.darray = (pmix_data_array_t*)malloc(sizeof(pmix_data_array_t)); - v->data.darray->type = PMIX_INFO; - v->data.darray->size = opal_list_get_size(list); - if (0 < v->data.darray->size) { - PMIX_INFO_CREATE(info, v->data.darray->size); - v->data.darray->array = info; - n=0; - OPAL_LIST_FOREACH(val, list, opal_value_t) { - (void)opal_string_copy(info[n].key, val->key, PMIX_MAX_KEYLEN); - ext2x_value_load(&info[n].value, val); - ++n; - } - } else { - v->data.darray->array = NULL; - } - break; - default: - /* silence warnings */ - break; - } -} - -int ext2x_value_unload(opal_value_t *kv, - const pmix_value_t *v) -{ - int rc=OPAL_SUCCESS; - bool found; - opal_ext2x_jobid_trkr_t *job; - opal_list_t *lt; - opal_value_t *ival; - size_t n; - - switch(v->type) { - case PMIX_UNDEF: - kv->type = OPAL_UNDEF; - break; - case PMIX_BOOL: - kv->type = OPAL_BOOL; - memcpy(&kv->data.flag, &(v->data.flag), 1); - break; - case PMIX_BYTE: - kv->type = OPAL_BYTE; - memcpy(&kv->data.byte, &(v->data.byte), 1); - break; - case PMIX_STRING: - kv->type = OPAL_STRING; - if (NULL != v->data.string) { - kv->data.string = strdup(v->data.string); - } - break; - case PMIX_SIZE: - kv->type = OPAL_SIZE; - memcpy(&kv->data.size, &(v->data.size), sizeof(size_t)); - break; - case PMIX_PID: - kv->type = OPAL_PID; - memcpy(&kv->data.pid, &(v->data.pid), sizeof(pid_t)); - break; - case PMIX_INT: - kv->type = OPAL_INT; - memcpy(&kv->data.integer, &(v->data.integer), sizeof(int)); - break; - case PMIX_INT8: - kv->type = OPAL_INT8; - memcpy(&kv->data.int8, &(v->data.int8), 1); - break; - case PMIX_INT16: - kv->type = OPAL_INT16; - memcpy(&kv->data.int16, &(v->data.int16), 2); - break; - case PMIX_INT32: - kv->type = OPAL_INT32; - memcpy(&kv->data.int32, &(v->data.int32), 4); - break; - case PMIX_INT64: - kv->type = OPAL_INT64; - memcpy(&kv->data.int64, &(v->data.int64), 8); - break; - case PMIX_UINT: - kv->type = OPAL_UINT; - memcpy(&kv->data.uint, &(v->data.uint), sizeof(int)); - break; - case PMIX_UINT8: - kv->type = OPAL_UINT8; - memcpy(&kv->data.uint8, &(v->data.uint8), 1); - break; - case PMIX_UINT16: - kv->type = OPAL_UINT16; - memcpy(&kv->data.uint16, &(v->data.uint16), 2); - break; - case PMIX_UINT32: - kv->type = OPAL_UINT32; - memcpy(&kv->data.uint32, &(v->data.uint32), 4); - break; - case PMIX_UINT64: - kv->type = OPAL_UINT64; - memcpy(&kv->data.uint64, &(v->data.uint64), 8); - break; - case PMIX_FLOAT: - kv->type = OPAL_FLOAT; - memcpy(&kv->data.fval, &(v->data.fval), sizeof(float)); - break; - case PMIX_DOUBLE: - kv->type = OPAL_DOUBLE; - memcpy(&kv->data.dval, &(v->data.dval), sizeof(double)); - break; - case PMIX_TIMEVAL: - kv->type = OPAL_TIMEVAL; - memcpy(&kv->data.tv, &(v->data.tv), sizeof(struct timeval)); - break; - case PMIX_TIME: - kv->type = OPAL_TIME; - memcpy(&kv->data.time, &(v->data.time), sizeof(time_t)); - break; - case PMIX_STATUS: - kv->type = OPAL_STATUS; - kv->data.status = ext2x_convert_rc(v->data.status); - break; - case PMIX_PROC_RANK: - kv->type = OPAL_VPID; - kv->data.name.vpid = ext2x_convert_rank(v->data.rank); - break; - case PMIX_PROC: - kv->type = OPAL_NAME; - /* see if this job is in our list of known nspaces */ - found = false; - OPAL_LIST_FOREACH(job, &mca_pmix_ext2x_component.jobids, opal_ext2x_jobid_trkr_t) { - if (0 == strncmp(job->nspace, v->data.proc->nspace, PMIX_MAX_NSLEN)) { - kv->data.name.jobid = job->jobid; - found = true; - break; - } - } - if (!found) { - if (OPAL_SUCCESS != (rc = opal_convert_string_to_jobid(&kv->data.name.jobid, v->data.proc->nspace))) { - return ext2x_convert_opalrc(rc); - } - } - kv->data.name.vpid = ext2x_convert_rank(v->data.proc->rank); - break; - case PMIX_BYTE_OBJECT: - kv->type = OPAL_BYTE_OBJECT; - if (NULL != v->data.bo.bytes && 0 < v->data.bo.size) { - kv->data.bo.bytes = (uint8_t*)malloc(v->data.bo.size); - memcpy(kv->data.bo.bytes, v->data.bo.bytes, v->data.bo.size); - kv->data.bo.size = (int)v->data.bo.size; - } else { - kv->data.bo.bytes = NULL; - kv->data.bo.size = 0; - } - break; - case PMIX_PERSIST: - kv->type = OPAL_PERSIST; - kv->data.uint8 = ext2x_convert_persist(v->data.persist); - break; - case PMIX_SCOPE: - kv->type = OPAL_SCOPE; - kv->data.uint8 = ext2x_convert_scope(v->data.scope); - break; - case PMIX_DATA_RANGE: - kv->type = OPAL_DATA_RANGE; - kv->data.uint8 = ext2x_convert_range(v->data.range); - break; - case PMIX_PROC_STATE: - kv->type = OPAL_PROC_STATE; - /* the OPAL layer doesn't have any concept of proc state, - * so the ORTE layer is responsible for converting it */ - memcpy(&kv->data.uint8, &v->data.state, sizeof(uint8_t)); - break; - case PMIX_POINTER: - kv->type = OPAL_PTR; - kv->data.ptr = v->data.ptr; - break; - case PMIX_DATA_ARRAY: - if (NULL == v->data.darray || NULL == v->data.darray->array) { - kv->data.ptr = NULL; - break; - } - lt = OBJ_NEW(opal_list_t); - kv->type = OPAL_PTR; - kv->data.ptr = (void*)lt; - for (n=0; n < v->data.darray->size; n++) { - ival = OBJ_NEW(opal_value_t); - opal_list_append(lt, &ival->super); - /* handle the various types */ - if (PMIX_INFO == v->data.darray->type) { - pmix_info_t *iptr = (pmix_info_t*)v->data.darray->array; - ival->key = strdup(iptr[n].key); - rc = ext2x_value_unload(ival, &iptr[n].value); - if (OPAL_SUCCESS != rc) { - OPAL_LIST_RELEASE(lt); - kv->type = OPAL_UNDEF; - kv->data.ptr = NULL; - break; - } - } - } - break; - default: - /* silence warnings */ - rc = OPAL_ERROR; - break; - } - return rc; -} - -static void errreg_cbfunc (pmix_status_t status, - size_t errhandler_ref, - void *cbdata) -{ - ext2x_opcaddy_t *op = (ext2x_opcaddy_t*)cbdata; - - OPAL_ACQUIRE_OBJECT(op); - op->event->index = errhandler_ref; - opal_output_verbose(5, opal_pmix_base_framework.framework_output, - "PMIX2x errreg_cbfunc - error handler registered status=%d, reference=%lu", - status, (unsigned long)errhandler_ref); - if (NULL != op->evregcbfunc) { - op->evregcbfunc(ext2x_convert_rc(status), errhandler_ref, op->cbdata); - } - OBJ_RELEASE(op); -} - -static void register_handler(opal_list_t *event_codes, - opal_list_t *info, - opal_pmix_notification_fn_t evhandler, - opal_pmix_evhandler_reg_cbfunc_t cbfunc, - void *cbdata) -{ - ext2x_opcaddy_t *op = (ext2x_opcaddy_t*)cbdata; - size_t n; - opal_value_t *kv; - - OPAL_PMIX_ACQUIRE_THREAD(&opal_pmix_base.lock); - if (0 >= opal_pmix_base.initialized) { - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - if (NULL != cbfunc) { - cbfunc(OPAL_ERR_NOT_INITIALIZED, 0, cbdata); - } - return; - } - - op = OBJ_NEW(ext2x_opcaddy_t); - op->evregcbfunc = cbfunc; - op->cbdata = cbdata; - - /* convert the event codes */ - if (NULL != event_codes) { - op->ncodes = opal_list_get_size(event_codes); - op->pcodes = (pmix_status_t*)malloc(op->ncodes * sizeof(pmix_status_t)); - n=0; - OPAL_LIST_FOREACH(kv, event_codes, opal_value_t) { - op->pcodes[n] = ext2x_convert_opalrc(kv->data.integer); - ++n; - } - } - - /* convert the list of info to an array of pmix_info_t */ - if (NULL != info && 0 < (op->ninfo = opal_list_get_size(info))) { - PMIX_INFO_CREATE(op->info, op->ninfo); - n=0; - OPAL_LIST_FOREACH(kv, info, opal_value_t) { - (void)opal_string_copy(op->info[n].key, kv->key, PMIX_MAX_KEYLEN); - ext2x_value_load(&op->info[n].value, kv); - ++n; - } - } - - /* register the event */ - op->event = OBJ_NEW(opal_ext2x_event_t); - op->event->handler = evhandler; - opal_list_append(&mca_pmix_ext2x_component.events, &op->event->super); - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - - PMIx_Register_event_handler(op->pcodes, op->ncodes, - op->info, op->ninfo, - ext2x_event_hdlr, errreg_cbfunc, op); - return; -} - -static void deregister_handler(size_t evhandler, - opal_pmix_op_cbfunc_t cbfunc, - void *cbdata) -{ - ext2x_opcaddy_t *op; - opal_ext2x_event_t *event; - - OPAL_PMIX_ACQUIRE_THREAD(&opal_pmix_base.lock); - if (0 >= opal_pmix_base.initialized) { - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - if (NULL != cbfunc) { - cbfunc(OPAL_ERR_NOT_INITIALIZED, cbdata); - } - return; - } - - /* look for this event */ - OPAL_LIST_FOREACH(event, &mca_pmix_ext2x_component.events, opal_ext2x_event_t) { - if (evhandler == event->index) { - opal_list_remove_item(&mca_pmix_ext2x_component.events, &event->super); - OBJ_RELEASE(event); - break; - } - } - - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - - op = OBJ_NEW(ext2x_opcaddy_t); - op->opcbfunc = cbfunc; - op->cbdata = cbdata; - - /* tell the library to deregister this handler */ - PMIx_Deregister_event_handler(evhandler, opcbfunc, op); - return; -} - -static void notify_complete(pmix_status_t status, void *cbdata) -{ - ext2x_opcaddy_t *op = (ext2x_opcaddy_t*)cbdata; - if (NULL != op->opcbfunc) { - op->opcbfunc(ext2x_convert_rc(status), op->cbdata); - } - OBJ_RELEASE(op); -} - -static int notify_event(int status, - const opal_process_name_t *source, - opal_pmix_data_range_t range, - opal_list_t *info, - opal_pmix_op_cbfunc_t cbfunc, void *cbdata) -{ - ext2x_opcaddy_t *op; - opal_value_t *kv; - pmix_proc_t p, *pptr; - pmix_status_t pstatus; - size_t n; - pmix_data_range_t prange; - char *nsptr; - - OPAL_PMIX_ACQUIRE_THREAD(&opal_pmix_base.lock); - if (0 >= opal_pmix_base.initialized) { - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - return OPAL_ERR_NOT_INITIALIZED; - } - - op = OBJ_NEW(ext2x_opcaddy_t); - op->opcbfunc = cbfunc; - op->cbdata = cbdata; - - /* convert the status */ - pstatus = ext2x_convert_opalrc(status); - - /* convert the source */ - if (NULL == source) { - pptr = NULL; - } else { - if (NULL == (nsptr = ext2x_convert_jobid(source->jobid))) { - OBJ_RELEASE(op); - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - return OPAL_ERR_NOT_FOUND; - } - (void)opal_string_copy(p.nspace, nsptr, PMIX_MAX_NSLEN); - p.rank = ext2x_convert_opalrank(source->vpid); - pptr = &p; - } - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - - /* convert the range */ - prange = ext2x_convert_opalrange(range); - - /* convert the list of info */ - if (NULL != info && 0 < (op->ninfo = opal_list_get_size(info))) { - PMIX_INFO_CREATE(op->info, op->ninfo); - n=0; - OPAL_LIST_FOREACH(kv, info, opal_value_t) { - (void)opal_string_copy(op->info[n].key, kv->key, PMIX_MAX_KEYLEN); - /* little dicey here as we need to convert a status, if - * provided, and it will be an int coming down to us */ - if (0 == strcmp(kv->key, OPAL_PMIX_JOB_TERM_STATUS)) { - op->info[n].value.type = PMIX_STATUS; - op->info[n].value.data.status = ext2x_convert_opalrc(kv->data.integer); - } else { - ext2x_value_load(&op->info[n].value, kv); - } - ++n; - } - } - - /* ask the library to notify our clients */ - pstatus = PMIx_Notify_event(pstatus, pptr, prange, op->info, op->ninfo, notify_complete, op); - - return ext2x_convert_rc(pstatus); -} - -static void relcbfunc(void *cbdata) -{ - opal_list_t *results = (opal_list_t*)cbdata; - if (NULL != results) { - OPAL_LIST_RELEASE(results); - } -} - -static void infocbfunc(pmix_status_t status, - pmix_info_t *info, size_t ninfo, - void *cbdata, - pmix_release_cbfunc_t release_fn, - void *release_cbdata) -{ - ext2x_opcaddy_t *cd = (ext2x_opcaddy_t*)cbdata; - int rc = OPAL_SUCCESS; - opal_list_t *results = NULL; - opal_value_t *iptr; - size_t n; - - OPAL_ACQUIRE_OBJECT(cd); - - /* convert the array of pmix_info_t to the list of info */ - if (NULL != info) { - results = OBJ_NEW(opal_list_t); - for (n=0; n < ninfo; n++) { - iptr = OBJ_NEW(opal_value_t); - opal_list_append(results, &iptr->super); - iptr->key = strdup(info[n].key); - if (OPAL_SUCCESS != (rc = ext2x_value_unload(iptr, &info[n].value))) { - OPAL_LIST_RELEASE(results); - results = NULL; - break; - } - } - } - - if (NULL != release_fn) { - release_fn(release_cbdata); - } - - /* return the values to the original requestor */ - if (NULL != cd->qcbfunc) { - cd->qcbfunc(rc, results, cd->cbdata, relcbfunc, results); - } - OBJ_RELEASE(cd); -} - -static void ext2x_query(opal_list_t *queries, - opal_pmix_info_cbfunc_t cbfunc, void *cbdata) -{ - int rc; - opal_value_t *ival; - size_t n, nqueries, nq; - ext2x_opcaddy_t *cd; - pmix_status_t prc; - opal_pmix_query_t *q; - - OPAL_PMIX_ACQUIRE_THREAD(&opal_pmix_base.lock); - if (0 >= opal_pmix_base.initialized) { - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - if (NULL != cbfunc) { - cbfunc(OPAL_ERR_NOT_INITIALIZED, NULL, cbdata, NULL, NULL); - } - return; - } - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - - /* create the caddy */ - cd = OBJ_NEW(ext2x_opcaddy_t); - - /* bozo check */ - if (NULL == queries || 0 == (nqueries = opal_list_get_size(queries))) { - rc = OPAL_ERR_BAD_PARAM; - goto CLEANUP; - } - - /* setup the operation */ - cd->qcbfunc = cbfunc; - cd->cbdata = cbdata; - cd->nqueries = nqueries; - - /* convert the list to an array of query objects */ - PMIX_QUERY_CREATE(cd->queries, cd->nqueries); - n=0; - OPAL_LIST_FOREACH(q, queries, opal_pmix_query_t) { - cd->queries[n].keys = opal_argv_copy(q->keys); - cd->queries[n].nqual = opal_list_get_size(&q->qualifiers); - if (0 < cd->queries[n].nqual) { - PMIX_INFO_CREATE(cd->queries[n].qualifiers, cd->queries[n].nqual); - nq = 0; - OPAL_LIST_FOREACH(ival, &q->qualifiers, opal_value_t) { - (void)opal_string_copy(cd->queries[n].qualifiers[nq].key, ival->key, PMIX_MAX_KEYLEN); - ext2x_value_load(&cd->queries[n].qualifiers[nq].value, ival); - ++nq; - } - } - ++n; - } - - /* pass it down */ - if (PMIX_SUCCESS != (prc = PMIx_Query_info_nb(cd->queries, cd->nqueries, - infocbfunc, cd))) { - /* do not hang! */ - rc = ext2x_convert_rc(prc); - goto CLEANUP; - } - - return; - - CLEANUP: - if (NULL != cbfunc) { - cbfunc(rc, NULL, cbdata, NULL, NULL); - } - OBJ_RELEASE(cd); - return; -} - -static void ext2x_log(opal_list_t *info, - opal_pmix_op_cbfunc_t cbfunc, void *cbdata) -{ - int rc; - opal_value_t *ival; - size_t n, ninfo; - ext2x_opcaddy_t *cd; - pmix_status_t prc; - - OPAL_PMIX_ACQUIRE_THREAD(&opal_pmix_base.lock); - if (0 >= opal_pmix_base.initialized) { - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - if (NULL != cbfunc) { - cbfunc(OPAL_ERR_NOT_INITIALIZED, cbdata); - } - return; - } - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - - /* create the caddy */ - cd = OBJ_NEW(ext2x_opcaddy_t); - - /* bozo check */ - if (NULL == info || 0 == (ninfo = opal_list_get_size(info))) { - rc = OPAL_ERR_BAD_PARAM; - goto CLEANUP; - } - - /* setup the operation */ - cd->opcbfunc = cbfunc; - cd->cbdata = cbdata; - cd->ninfo = ninfo; - - /* convert the list to an array of info objects */ - PMIX_INFO_CREATE(cd->info, cd->ninfo); - n=0; - OPAL_LIST_FOREACH(ival, info, opal_value_t) { - (void)opal_string_copy(cd->info[n].key, ival->key, PMIX_MAX_KEYLEN); - ext2x_value_load(&cd->info[n].value, ival); - ++n; - } - - /* pass it down */ - if (PMIX_SUCCESS != (prc = PMIx_Log_nb(cd->info, cd->ninfo, NULL, 0, - opcbfunc, cd))) { - /* do not hang! */ - rc = ext2x_convert_rc(prc); - goto CLEANUP; - } - - return; - - CLEANUP: - if (NULL != cbfunc) { - cbfunc(rc, cbdata); - } - OBJ_RELEASE(cd); -} - -opal_pmix_alloc_directive_t ext2x_convert_allocdir(pmix_alloc_directive_t dir) -{ - switch (dir) { - case PMIX_ALLOC_NEW: - return OPAL_PMIX_ALLOC_NEW; - case PMIX_ALLOC_EXTEND: - return OPAL_PMIX_ALLOC_EXTEND; - case PMIX_ALLOC_RELEASE: - return OPAL_PMIX_ALLOC_RELEASE; - case PMIX_ALLOC_REAQUIRE: - return OPAL_PMIX_ALLOC_REAQCUIRE; - default: - return OPAL_PMIX_ALLOC_UNDEF; - } -} - -/**** INSTANTIATE INTERNAL CLASSES ****/ -OBJ_CLASS_INSTANCE(opal_ext2x_jobid_trkr_t, - opal_list_item_t, - NULL, NULL); - -static void evcon(opal_ext2x_event_t *p) -{ - OPAL_PMIX_CONSTRUCT_LOCK(&p->lock); - p->handler = NULL; - p->cbdata = NULL; -} -static void evdes(opal_ext2x_event_t *p) -{ - OPAL_PMIX_DESTRUCT_LOCK(&p->lock); -} -OBJ_CLASS_INSTANCE(opal_ext2x_event_t, - opal_list_item_t, - evcon, evdes); - -static void opcon(ext2x_opcaddy_t *p) -{ - memset(&p->p, 0, sizeof(pmix_proc_t)); - p->nspace = NULL; - p->procs = NULL; - p->nprocs = 0; - p->pdata = NULL; - p->npdata = 0; - p->error_procs = NULL; - p->nerror_procs = 0; - p->info = NULL; - p->ninfo = 0; - p->apps = NULL; - p->sz = 0; - OPAL_PMIX_CONSTRUCT_LOCK(&p->lock); - p->codes = NULL; - p->pcodes = NULL; - p->ncodes = 0; - p->queries = NULL; - p->nqueries = 0; - p->event = NULL; - p->opcbfunc = NULL; - p->mdxcbfunc = NULL; - p->valcbfunc = NULL; - p->lkcbfunc = NULL; - p->spcbfunc = NULL; - p->evregcbfunc = NULL; - p->qcbfunc = NULL; - p->cbdata = NULL; -} -static void opdes(ext2x_opcaddy_t *p) -{ - OPAL_PMIX_DESTRUCT_LOCK(&p->lock); - if (NULL != p->nspace) { - free(p->nspace); - } - if (NULL != p->procs) { - PMIX_PROC_FREE(p->procs, p->nprocs); - } - if (NULL != p->pdata) { - PMIX_PDATA_FREE(p->pdata, p->npdata); - } - if (NULL != p->error_procs) { - PMIX_PROC_FREE(p->error_procs, p->nerror_procs); - } - if (NULL != p->info) { - PMIX_INFO_FREE(p->info, p->ninfo); - } - if (NULL != p->apps) { - PMIX_APP_FREE(p->apps, p->sz); - } - if (NULL != p->pcodes) { - free(p->pcodes); - } - if (NULL != p->queries) { - PMIX_QUERY_FREE(p->queries, p->nqueries); - } -} -OBJ_CLASS_INSTANCE(ext2x_opcaddy_t, - opal_object_t, - opcon, opdes); - -static void ocadcon(ext2x_opalcaddy_t *p) -{ - OBJ_CONSTRUCT(&p->procs, opal_list_t); - OBJ_CONSTRUCT(&p->info, opal_list_t); - OBJ_CONSTRUCT(&p->apps, opal_list_t); - p->opcbfunc = NULL; - p->dmdxfunc = NULL; - p->mdxcbfunc = NULL; - p->lkupcbfunc = NULL; - p->spwncbfunc = NULL; - p->cbdata = NULL; - p->odmdxfunc = NULL; - p->infocbfunc = NULL; - p->toolcbfunc = NULL; - p->ocbdata = NULL; -} -static void ocaddes(ext2x_opalcaddy_t *p) -{ - OPAL_LIST_DESTRUCT(&p->procs); - OPAL_LIST_DESTRUCT(&p->info); - OPAL_LIST_DESTRUCT(&p->apps); -} -OBJ_CLASS_INSTANCE(ext2x_opalcaddy_t, - opal_object_t, - ocadcon, ocaddes); - -static void tscon(ext2x_threadshift_t *p) -{ - OPAL_PMIX_CONSTRUCT_LOCK(&p->lock); - p->msg = NULL; - p->strings = NULL; - p->source = NULL; - p->event_codes = NULL; - p->info = NULL; - OBJ_CONSTRUCT(&p->results, opal_list_t); - p->evhandler = NULL; - p->nondefault = false; - p->cbfunc = NULL; - p->opcbfunc = NULL; - p->cbdata = NULL; -} -static void tsdes(ext2x_threadshift_t *p) -{ - OPAL_PMIX_DESTRUCT_LOCK(&p->lock); - if (NULL != p->strings) { - free(p->strings); - } - OPAL_LIST_DESTRUCT(&p->results); -} -OBJ_CLASS_INSTANCE(ext2x_threadshift_t, - opal_object_t, - tscon, tsdes); - -static void dmcon(opal_ext2x_dmx_trkr_t *p) -{ - p->nspace = NULL; - p->cbfunc = NULL; - p->cbdata = NULL; -} -static void dmdes(opal_ext2x_dmx_trkr_t *p) -{ - if (NULL != p->nspace) { - free(p->nspace); - } -} -OBJ_CLASS_INSTANCE(opal_ext2x_dmx_trkr_t, - opal_list_item_t, - dmcon, dmdes); diff --git a/opal/mca/pmix/ext2x/ext2x.h b/opal/mca/pmix/ext2x/ext2x.h deleted file mode 100644 index 8e2012906c7..00000000000 --- a/opal/mca/pmix/ext2x/ext2x.h +++ /dev/null @@ -1,341 +0,0 @@ -/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ -/* - * Copyright (c) 2014-2018 Intel, Inc. All rights reserved. - * Copyright (c) 2014-2015 Mellanox Technologies, Inc. - * All rights reserved. - * Copyright (c) 2016 Research Organization for Information Science - * and Technology (RIST). All rights reserved. - * Copyright (c) 2017 Los Alamos National Security, LLC. All rights - * reserved. - * $COPYRIGHT$ - * - * Additional copyrights may follow - * - * $HEADER$ - */ - -#ifndef MCA_PMIX_PMIX2X_H -#define MCA_PMIX_PMIX2X_H - -#include "opal_config.h" - -#ifdef HAVE_SYS_SOCKET_H -#include -#endif -#ifdef HAVE_SYS_UN_H -#include -#endif - -#include "opal/class/opal_list.h" -#include "opal/mca/mca.h" -#include "opal/mca/event/event.h" -#include "opal/util/proc.h" - -#include "opal/mca/pmix/base/base.h" -#include "pmix_server.h" -#include "pmix_common.h" - -BEGIN_C_DECLS - -#ifdef OPAL_C_HAVE_VISIBILITY -#define PMIX_HAVE_VISIBILITY 1 -#else -#undef PMIX_HAVE_VISIBILITY -#endif - -typedef struct { - opal_pmix_base_component_t super; - bool legacy_get; - opal_list_t jobids; - bool native_launch; - size_t evindex; - opal_list_t events; - int cache_size; - opal_list_t cache; - opal_list_t dmdx; - bool silence_warning; -} mca_pmix_ext2x_component_t; - -OPAL_DECLSPEC extern mca_pmix_ext2x_component_t mca_pmix_ext2x_component; - -OPAL_DECLSPEC extern const opal_pmix_base_module_t opal_pmix_ext2x_module; - -/**** INTERNAL OBJECTS ****/ -typedef struct { - opal_list_item_t super; - opal_jobid_t jobid; - char nspace[PMIX_MAX_NSLEN + 1]; -} opal_ext2x_jobid_trkr_t; -OBJ_CLASS_DECLARATION(opal_ext2x_jobid_trkr_t); - -typedef struct { - opal_list_item_t super; - opal_pmix_lock_t lock; - size_t index; - opal_pmix_notification_fn_t handler; - void *cbdata; -} opal_ext2x_event_t; -OBJ_CLASS_DECLARATION(opal_ext2x_event_t); - -typedef struct { - opal_list_item_t super; - char *nspace; - pmix_modex_cbfunc_t cbfunc; - void *cbdata; -} opal_ext2x_dmx_trkr_t; -OBJ_CLASS_DECLARATION(opal_ext2x_dmx_trkr_t); - -typedef struct { - opal_object_t super; - opal_event_t ev; - pmix_status_t status; - char *nspace; - pmix_proc_t p; - pmix_proc_t *procs; - size_t nprocs; - pmix_pdata_t *pdata; - size_t npdata; - pmix_proc_t *error_procs; - size_t nerror_procs; - pmix_info_t *info; - size_t ninfo; - pmix_app_t *apps; - size_t sz; - opal_pmix_lock_t lock; - opal_list_t *codes; - pmix_status_t *pcodes; - size_t ncodes; - pmix_query_t *queries; - size_t nqueries; - opal_ext2x_event_t *event; - opal_pmix_op_cbfunc_t opcbfunc; - opal_pmix_modex_cbfunc_t mdxcbfunc; - opal_pmix_value_cbfunc_t valcbfunc; - opal_pmix_lookup_cbfunc_t lkcbfunc; - opal_pmix_spawn_cbfunc_t spcbfunc; - opal_pmix_evhandler_reg_cbfunc_t evregcbfunc; - opal_pmix_info_cbfunc_t qcbfunc; - void *cbdata; -} ext2x_opcaddy_t; -OBJ_CLASS_DECLARATION(ext2x_opcaddy_t); - -typedef struct { - opal_object_t super; - opal_list_t procs; - opal_list_t info; - opal_list_t apps; - pmix_op_cbfunc_t opcbfunc; - pmix_dmodex_response_fn_t dmdxfunc; - pmix_modex_cbfunc_t mdxcbfunc; - pmix_lookup_cbfunc_t lkupcbfunc; - pmix_spawn_cbfunc_t spwncbfunc; - pmix_info_cbfunc_t infocbfunc; - pmix_tool_connection_cbfunc_t toolcbfunc; - void *cbdata; - opal_pmix_release_cbfunc_t odmdxfunc; - void *ocbdata; -} ext2x_opalcaddy_t; -OBJ_CLASS_DECLARATION(ext2x_opalcaddy_t); - -typedef struct { - opal_object_t super; - opal_event_t ev; - opal_pmix_lock_t lock; - const char *msg; - char *strings; - size_t id; - int status; - opal_process_name_t pname; - opal_jobid_t jobid; - const opal_process_name_t *source; - opal_pmix_data_range_t range; - bool nondefault; - size_t handler; - opal_value_t *val; - opal_list_t *event_codes; - opal_list_t *info; - opal_list_t results; - opal_pmix_notification_fn_t evhandler; - opal_pmix_evhandler_reg_cbfunc_t cbfunc; - opal_pmix_op_cbfunc_t opcbfunc; - pmix_event_notification_cbfunc_fn_t pmixcbfunc; - opal_pmix_value_cbfunc_t valcbfunc; - opal_pmix_lookup_cbfunc_t lkcbfunc; - void *cbdata; -} ext2x_threadshift_t; -OBJ_CLASS_DECLARATION(ext2x_threadshift_t); - -#define OPAL_PMIX_OP_THREADSHIFT(e, fn, cb, cd) \ - do { \ - ext2x_threadshift_t *_cd; \ - _cd = OBJ_NEW(ext2x_threadshift_t); \ - _cd->handler = (e); \ - _cd->opcbfunc = (cb); \ - _cd->cbdata = (cd); \ - opal_event_assign(&((_cd)->ev), opal_pmix_base.evbase, \ - -1, EV_WRITE, (fn), (_cd)); \ - OPAL_POST_OBJECT(_cd); \ - opal_event_active(&((_cd)->ev), EV_WRITE, 1); \ - } while(0) - -#define OPAL_PMIX_THREADSHIFT(e, i, eh, fn, cb, cd) \ - do { \ - ext2x_threadshift_t *_cd; \ - _cd = OBJ_NEW(ext2x_threadshift_t); \ - _cd->event_codes = (e); \ - _cd->info = (i); \ - _cd->evhandler = (eh); \ - _cd->cbfunc = (cb); \ - _cd->cbdata = (cd); \ - opal_event_assign(&((_cd)->ev), opal_pmix_base.evbase, \ - -1, EV_WRITE, (fn), (_cd)); \ - OPAL_POST_OBJECT(_cd); \ - opal_event_active(&((_cd)->ev), EV_WRITE, 1); \ - } while(0) - -#define OPAL_PMIX_NOTIFY_THREADSHIFT(s, sr, r, i, fn, cb, cd) \ - do { \ - ext2x_threadshift_t *_cd; \ - _cd = OBJ_NEW(ext2x_threadshift_t); \ - _cd->status = (s); \ - _cd->source = (sr); \ - _cd->range = (r); \ - _cd->info = (i); \ - _cd->opcbfunc = (cb); \ - _cd->cbdata = (cd); \ - opal_event_assign(&((_cd)->ev), opal_pmix_base.evbase, \ - -1, EV_WRITE, (fn), (_cd)); \ - OPAL_POST_OBJECT(_cd); \ - opal_event_active(&((_cd)->ev), EV_WRITE, 1); \ - } while(0) - -#define OPAL_PMIX2X_THREADSHIFT(p, cb) \ - do { \ - opal_event_assign(&((p)->ev), opal_pmix_base.evbase, \ - -1, EV_WRITE, (cb), (p)); \ - OPAL_POST_OBJECT(p); \ - opal_event_active(&((p)->ev), EV_WRITE, 1); \ - } while(0) - -/**** CLIENT FUNCTIONS ****/ -OPAL_MODULE_DECLSPEC int ext2x_client_init(opal_list_t *ilist); -OPAL_MODULE_DECLSPEC int ext2x_client_finalize(void); -OPAL_MODULE_DECLSPEC int ext2x_initialized(void); -OPAL_MODULE_DECLSPEC int ext2x_abort(int flag, const char *msg, - opal_list_t *procs); -OPAL_MODULE_DECLSPEC int ext2x_commit(void); -OPAL_MODULE_DECLSPEC int ext2x_fence(opal_list_t *procs, int collect_data); -OPAL_MODULE_DECLSPEC int ext2x_fencenb(opal_list_t *procs, int collect_data, - opal_pmix_op_cbfunc_t cbfunc, void *cbdata); -OPAL_MODULE_DECLSPEC int ext2x_put(opal_pmix_scope_t scope, - opal_value_t *val); -OPAL_MODULE_DECLSPEC int ext2x_get(const opal_process_name_t *proc, const char *key, - opal_list_t *info, opal_value_t **val); -OPAL_MODULE_DECLSPEC int ext2x_getnb(const opal_process_name_t *proc, const char *key, - opal_list_t *info, - opal_pmix_value_cbfunc_t cbfunc, void *cbdata); -OPAL_MODULE_DECLSPEC int ext2x_publish(opal_list_t *info); -OPAL_MODULE_DECLSPEC int ext2x_publishnb(opal_list_t *info, - opal_pmix_op_cbfunc_t cbfunc, void *cbdata); -OPAL_MODULE_DECLSPEC int ext2x_lookup(opal_list_t *data, opal_list_t *info); -OPAL_MODULE_DECLSPEC int ext2x_lookupnb(char **keys, opal_list_t *info, - opal_pmix_lookup_cbfunc_t cbfunc, void *cbdata); -OPAL_MODULE_DECLSPEC int ext2x_unpublish(char **keys, opal_list_t *info); -OPAL_MODULE_DECLSPEC int ext2x_unpublishnb(char **keys, opal_list_t *info, - opal_pmix_op_cbfunc_t cbfunc, void *cbdata); -OPAL_MODULE_DECLSPEC int ext2x_spawn(opal_list_t *job_info, opal_list_t *apps, opal_jobid_t *jobid); -OPAL_MODULE_DECLSPEC int ext2x_spawnnb(opal_list_t *job_info, opal_list_t *apps, - opal_pmix_spawn_cbfunc_t cbfunc, void *cbdata); -OPAL_MODULE_DECLSPEC int ext2x_connect(opal_list_t *procs); -OPAL_MODULE_DECLSPEC int ext2x_connectnb(opal_list_t *procs, - opal_pmix_op_cbfunc_t cbfunc, - void *cbdata); -OPAL_MODULE_DECLSPEC int ext2x_disconnect(opal_list_t *procs); -OPAL_MODULE_DECLSPEC int ext2x_disconnectnb(opal_list_t *procs, - opal_pmix_op_cbfunc_t cbfunc, - void *cbdata); -OPAL_MODULE_DECLSPEC int ext2x_resolve_peers(const char *nodename, opal_jobid_t jobid, - opal_list_t *procs); -OPAL_MODULE_DECLSPEC int ext2x_resolve_nodes(opal_jobid_t jobid, char **nodelist); -OPAL_MODULE_DECLSPEC int ext2x_allocate(opal_pmix_alloc_directive_t directive, - opal_list_t *info, - opal_pmix_info_cbfunc_t cbfunc, void *cbdata); -OPAL_MODULE_DECLSPEC int ext2x_job_control(opal_list_t *targets, - opal_list_t *directives, - opal_pmix_info_cbfunc_t cbfunc, void *cbdata); - -/**** TOOL FUNCTIONS ****/ -OPAL_MODULE_DECLSPEC int ext2x_tool_init(opal_list_t *info); -OPAL_MODULE_DECLSPEC int ext2x_tool_fini(void); - -/**** COMMON FUNCTIONS ****/ -OPAL_MODULE_DECLSPEC int ext2x_store_local(const opal_process_name_t *proc, - opal_value_t *val); - -/**** SERVER SOUTHBOUND FUNCTIONS ****/ -OPAL_MODULE_DECLSPEC int ext2x_server_init(opal_pmix_server_module_t *module, - opal_list_t *info); -OPAL_MODULE_DECLSPEC int ext2x_server_finalize(void); -OPAL_MODULE_DECLSPEC int ext2x_server_gen_regex(const char *input, char **regex); -OPAL_MODULE_DECLSPEC int ext2x_server_gen_ppn(const char *input, char **ppn); -OPAL_MODULE_DECLSPEC int ext2x_server_register_nspace(opal_jobid_t jobid, - int nlocalprocs, - opal_list_t *info, - opal_pmix_op_cbfunc_t cbfunc, - void *cbdata); -OPAL_MODULE_DECLSPEC void ext2x_server_deregister_nspace(opal_jobid_t jobid, - opal_pmix_op_cbfunc_t cbfunc, - void *cbdata); -OPAL_MODULE_DECLSPEC int ext2x_server_register_client(const opal_process_name_t *proc, - uid_t uid, gid_t gid, - void *server_object, - opal_pmix_op_cbfunc_t cbfunc, - void *cbdata); -OPAL_MODULE_DECLSPEC void ext2x_server_deregister_client(const opal_process_name_t *proc, - opal_pmix_op_cbfunc_t cbfunc, - void *cbdata); -OPAL_MODULE_DECLSPEC int ext2x_server_setup_fork(const opal_process_name_t *proc, char ***env); -OPAL_MODULE_DECLSPEC int ext2x_server_dmodex(const opal_process_name_t *proc, - opal_pmix_modex_cbfunc_t cbfunc, void *cbdata); -OPAL_MODULE_DECLSPEC int ext2x_server_notify_event(int status, - const opal_process_name_t *source, - opal_list_t *info, - opal_pmix_op_cbfunc_t cbfunc, void *cbdata); - - -/**** COMPONENT UTILITY FUNCTIONS ****/ -OPAL_MODULE_DECLSPEC int opal_pmix_ext2x_check_evars(void); - -OPAL_MODULE_DECLSPEC void ext2x_event_hdlr(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); -OPAL_MODULE_DECLSPEC pmix_status_t ext2x_convert_opalrc(int rc); -OPAL_MODULE_DECLSPEC int ext2x_convert_rc(pmix_status_t rc); - -OPAL_MODULE_DECLSPEC opal_vpid_t ext2x_convert_rank(pmix_rank_t rank); -OPAL_MODULE_DECLSPEC pmix_rank_t ext2x_convert_opalrank(opal_vpid_t vpid); - -OPAL_MODULE_DECLSPEC opal_pmix_scope_t ext2x_convert_scope(pmix_scope_t scope); -OPAL_MODULE_DECLSPEC pmix_scope_t ext2x_convert_opalscope(opal_pmix_scope_t scope); - -OPAL_MODULE_DECLSPEC pmix_data_range_t ext2x_convert_opalrange(opal_pmix_data_range_t range); -OPAL_MODULE_DECLSPEC opal_pmix_data_range_t ext2x_convert_range(pmix_data_range_t range); - -OPAL_MODULE_DECLSPEC opal_pmix_persistence_t ext2x_convert_persist(pmix_persistence_t scope); -OPAL_MODULE_DECLSPEC pmix_persistence_t ext2x_convert_opalpersist(opal_pmix_persistence_t scope); - -OPAL_MODULE_DECLSPEC void ext2x_value_load(pmix_value_t *v, - opal_value_t *kv); -OPAL_MODULE_DECLSPEC int ext2x_value_unload(opal_value_t *kv, - const pmix_value_t *v); - -OPAL_MODULE_DECLSPEC opal_pmix_alloc_directive_t ext2x_convert_allocdir(pmix_alloc_directive_t dir); - -OPAL_MODULE_DECLSPEC char* ext2x_convert_jobid(opal_jobid_t jobid); - -END_C_DECLS - -#endif /* MCA_PMIX_EXTERNAL_H */ diff --git a/opal/mca/pmix/ext2x/ext2x_client.c b/opal/mca/pmix/ext2x/ext2x_client.c deleted file mode 100644 index 8e01e7a1ac7..00000000000 --- a/opal/mca/pmix/ext2x/ext2x_client.c +++ /dev/null @@ -1,1673 +0,0 @@ -/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ -/* - * Copyright (c) 2014-2018 Intel, Inc. All rights reserved. - * Copyright (c) 2014-2017 Research Organization for Information Science - * and Technology (RIST). All rights reserved. - * Copyright (c) 2014-2017 Mellanox Technologies, Inc. - * All rights reserved. - * Copyright (c) 2016 Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2016 Los Alamos National Security, LLC. All rights - * reserved. - * Copyright (c) 2018 The University of Tennessee and The University - * of Tennessee Research Foundation. All rights - * reserved. - * $COPYRIGHT$ - * - * Additional copyrights may follow - * - * $HEADER$ - */ - -#include "opal_config.h" -#include "opal/constants.h" -#include "opal/types.h" - -#ifdef HAVE_STRING_H -#include -#endif -#ifdef HAVE_UNISTD_H -#include -#endif - -#include "opal/hash_string.h" -#include "opal/threads/threads.h" -#include "opal/util/argv.h" -#include "opal/util/opal_environ.h" -#include "opal/util/proc.h" -#include "opal/util/show_help.h" -#include "opal/util/string_copy.h" - -#include "opal/mca/pmix/base/base.h" -#include "ext2x.h" -#include "pmix.h" -#include "pmix_tool.h" - -static pmix_proc_t my_proc; -static char *dbgvalue=NULL; - -static void errreg_cbfunc (pmix_status_t status, - size_t errhandler_ref, - void *cbdata) -{ - opal_ext2x_event_t *event = (opal_ext2x_event_t*)cbdata; - - OPAL_ACQUIRE_OBJECT(event); - - event->index = errhandler_ref; - opal_output_verbose(5, opal_pmix_base_framework.framework_output, - "PMIX client errreg_cbfunc - error handler registered status=%d, reference=%lu", - status, (unsigned long)errhandler_ref); - OPAL_POST_OBJECT(event); - OPAL_PMIX_WAKEUP_THREAD(&event->lock); -} - -int ext2x_client_init(opal_list_t *ilist) -{ - opal_process_name_t pname; - pmix_status_t rc; - int dbg; - opal_ext2x_jobid_trkr_t *job; - opal_ext2x_event_t *event; - pmix_info_t *pinfo; - size_t ninfo, n; - opal_value_t *ival; - - opal_output_verbose(1, opal_pmix_base_framework.framework_output, - "PMIx_client init"); - - OPAL_PMIX_ACQUIRE_THREAD(&opal_pmix_base.lock); - - if (0 == opal_pmix_base.initialized) { - if (0 < (dbg = opal_output_get_verbosity(opal_pmix_base_framework.framework_output))) { - asprintf(&dbgvalue, "PMIX_DEBUG=%d", dbg); - putenv(dbgvalue); - } - /* check the evars for a mismatch */ - if (OPAL_SUCCESS != (dbg = opal_pmix_ext2x_check_evars())) { - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - return dbg; - } - } - - /* convert the incoming list to info structs */ - if (NULL != ilist && 0 < (ninfo = opal_list_get_size(ilist))) { - PMIX_INFO_CREATE(pinfo, ninfo); - n=0; - OPAL_LIST_FOREACH(ival, ilist, opal_value_t) { - (void)opal_string_copy(pinfo[n].key, ival->key, PMIX_MAX_KEYLEN); - ext2x_value_load(&pinfo[n].value, ival); - ++n; - } - } else { - pinfo = NULL; - ninfo = 0; - } - - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - rc = PMIx_Init(&my_proc, pinfo, ninfo); - if (NULL != pinfo) { - PMIX_INFO_FREE(pinfo, ninfo); - } - if (PMIX_SUCCESS != rc) { - dbg = ext2x_convert_rc(rc); - OPAL_ERROR_LOG(dbg); - return dbg; - } - OPAL_PMIX_ACQUIRE_THREAD(&opal_pmix_base.lock); - - ++opal_pmix_base.initialized; - if (1 < opal_pmix_base.initialized) { - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - return OPAL_SUCCESS; - } - - /* store our jobid and rank */ - if (NULL != getenv(OPAL_MCA_PREFIX"orte_launch")) { - /* if we were launched by the OMPI RTE, then - * the jobid is in a special format - so get it */ - mca_pmix_ext2x_component.native_launch = true; - opal_convert_string_to_jobid(&pname.jobid, my_proc.nspace); - } else { - /* we were launched by someone else, so make the - * jobid just be the hash of the nspace */ - OPAL_HASH_JOBID(my_proc.nspace, pname.jobid); - } - /* insert this into our list of jobids - it will be the - * first, and so we'll check it first */ - job = OBJ_NEW(opal_ext2x_jobid_trkr_t); - (void)opal_string_copy(job->nspace, my_proc.nspace, PMIX_MAX_NSLEN); - job->jobid = pname.jobid; - opal_list_append(&mca_pmix_ext2x_component.jobids, &job->super); - - pname.vpid = ext2x_convert_rank(my_proc.rank); - opal_proc_set_name(&pname); - - /* release the thread in case the event handler fires when - * registered */ - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - - /* register the default event handler */ - event = OBJ_NEW(opal_ext2x_event_t); - opal_list_append(&mca_pmix_ext2x_component.events, &event->super); - PMIX_INFO_CREATE(pinfo, 1); - PMIX_INFO_LOAD(&pinfo[0], PMIX_EVENT_HDLR_NAME, "OPAL-PMIX-2X-DEFAULT", PMIX_STRING); - PMIx_Register_event_handler(NULL, 0, NULL, 0, ext2x_event_hdlr, errreg_cbfunc, event); - OPAL_PMIX_WAIT_THREAD(&event->lock); - PMIX_INFO_FREE(pinfo, 1); - - return OPAL_SUCCESS; - -} - -static void dereg_cbfunc(pmix_status_t st, void *cbdata) -{ - opal_ext2x_event_t *ev = (opal_ext2x_event_t*)cbdata; - OPAL_PMIX_WAKEUP_THREAD(&ev->lock); -} - -int ext2x_client_finalize(void) -{ - pmix_status_t rc; - opal_ext2x_event_t *event, *ev2; - opal_list_t evlist; - OBJ_CONSTRUCT(&evlist, opal_list_t); - - opal_output_verbose(1, opal_pmix_base_framework.framework_output, - "PMIx_client finalize"); - - OPAL_PMIX_ACQUIRE_THREAD(&opal_pmix_base.lock); - --opal_pmix_base.initialized; - - if (0 == opal_pmix_base.initialized) { - /* deregister all event handlers */ - OPAL_LIST_FOREACH_SAFE(event, ev2, &mca_pmix_ext2x_component.events, opal_ext2x_event_t) { - OPAL_PMIX_DESTRUCT_LOCK(&event->lock); - OPAL_PMIX_CONSTRUCT_LOCK(&event->lock); - PMIx_Deregister_event_handler(event->index, dereg_cbfunc, (void*)event); - opal_list_remove_item(&mca_pmix_ext2x_component.events, &event->super); - /* wait and release outside the loop to avoid double mutex - * interlock */ - opal_list_append(&evlist, &event->super); - } - } - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - OPAL_LIST_FOREACH_SAFE(event, ev2, &evlist, opal_ext2x_event_t) { - OPAL_PMIX_WAIT_THREAD(&event->lock); - opal_list_remove_item(&evlist, &event->super); - OBJ_RELEASE(event); - } - OBJ_DESTRUCT(&evlist); - rc = PMIx_Finalize(NULL, 0); - - return ext2x_convert_rc(rc); -} - -int ext2x_tool_init(opal_list_t *info) -{ - pmix_info_t *pinfo; - size_t ninfo, n; - opal_ext2x_jobid_trkr_t *job; - opal_value_t *val; - pmix_status_t rc; - int ret; - opal_process_name_t pname = {OPAL_JOBID_INVALID, OPAL_VPID_INVALID}; - opal_ext2x_event_t *event; - - opal_output_verbose(1, opal_pmix_base_framework.framework_output, - "PMIx_tool init"); - - OPAL_PMIX_ACQUIRE_THREAD(&opal_pmix_base.lock); - - /* convert the incoming list to info structs */ - if (NULL != info && 0 < (ninfo = opal_list_get_size(info))) { - PMIX_INFO_CREATE(pinfo, ninfo); - n=0; - OPAL_LIST_FOREACH(val, info, opal_value_t) { - (void)opal_string_copy(pinfo[n].key, val->key, PMIX_MAX_KEYLEN); - ext2x_value_load(&pinfo[n].value, val); - ++n; - /* check to see if our name is being given from above */ - if (0 == strcmp(val->key, OPAL_PMIX_TOOL_NSPACE)) { - opal_convert_string_to_jobid(&pname.jobid, val->data.string); - (void)opal_string_copy(my_proc.nspace, val->data.string, PMIX_MAX_NSLEN); - } else if (0 == strcmp(val->key, OPAL_PMIX_TOOL_RANK)) { - pname.vpid = val->data.name.vpid; - my_proc.rank = pname.vpid; - } - } - } else { - pinfo = NULL; - ninfo = 0; - } - /* we are going to get our name from the server, or we were given it by the tool, - * so mark as native launch so we don't convert back/forth */ - mca_pmix_ext2x_component.native_launch = true; - - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - rc = PMIx_tool_init(&my_proc, pinfo, ninfo); - if (NULL != pinfo) { - PMIX_INFO_FREE(pinfo, ninfo); - } - if (PMIX_SUCCESS != rc) { - ret = ext2x_convert_rc(rc); - OPAL_ERROR_LOG(ret); - return ret; - } - OPAL_PMIX_ACQUIRE_THREAD(&opal_pmix_base.lock); - - ++opal_pmix_base.initialized; - if (1 < opal_pmix_base.initialized) { - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - return OPAL_SUCCESS; - } - - /* store our jobid and rank */ - opal_convert_string_to_jobid(&pname.jobid, my_proc.nspace); - pname.vpid = ext2x_convert_rank(my_proc.rank); - - /* insert this into our list of jobids - it will be the - * first, and so we'll check it first */ - job = OBJ_NEW(opal_ext2x_jobid_trkr_t); - (void)opal_string_copy(job->nspace, my_proc.nspace, PMIX_MAX_NSLEN); - job->jobid = pname.jobid; - opal_list_append(&mca_pmix_ext2x_component.jobids, &job->super); - - opal_proc_set_name(&pname); - - /* release the thread in case the event handler fires when - * registered */ - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - - /* register the default event handler */ - event = OBJ_NEW(opal_ext2x_event_t); - opal_list_append(&mca_pmix_ext2x_component.events, &event->super); - PMIX_INFO_CREATE(pinfo, 1); - PMIX_INFO_LOAD(&pinfo[0], PMIX_EVENT_HDLR_NAME, "OPAL-PMIX-2X-DEFAULT", PMIX_STRING); - PMIx_Register_event_handler(NULL, 0, NULL, 0, ext2x_event_hdlr, errreg_cbfunc, event); - OPAL_PMIX_WAIT_THREAD(&event->lock); - PMIX_INFO_FREE(pinfo, 1); - - return OPAL_SUCCESS; -} - -int ext2x_tool_fini(void) -{ - pmix_status_t rc; - opal_ext2x_event_t *event, *ev2; - - opal_output_verbose(1, opal_pmix_base_framework.framework_output, - "PMIx_tool finalize"); - - OPAL_PMIX_ACQUIRE_THREAD(&opal_pmix_base.lock); - --opal_pmix_base.initialized; - - if (0 == opal_pmix_base.initialized) { - /* deregister all event handlers */ - OPAL_LIST_FOREACH_SAFE(event, ev2, &mca_pmix_ext2x_component.events, opal_ext2x_event_t) { - OPAL_PMIX_DESTRUCT_LOCK(&event->lock); - OPAL_PMIX_CONSTRUCT_LOCK(&event->lock); - PMIx_Deregister_event_handler(event->index, dereg_cbfunc, (void*)event); - OPAL_PMIX_WAIT_THREAD(&event->lock); - opal_list_remove_item(&mca_pmix_ext2x_component.events, &event->super); - OBJ_RELEASE(event); - } - } - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - rc = PMIx_tool_finalize(); - - return ext2x_convert_rc(rc); -} - - -int ext2x_initialized(void) -{ - int init; - - opal_output_verbose(1, opal_pmix_base_framework.framework_output, - "PMIx_client initialized"); - - OPAL_PMIX_ACQUIRE_THREAD(&opal_pmix_base.lock); - init = opal_pmix_base.initialized; - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - - return init; -} - -int ext2x_abort(int flag, const char *msg, - opal_list_t *procs) -{ - pmix_status_t rc; - pmix_proc_t *parray=NULL; - size_t n, cnt=0; - opal_namelist_t *ptr; - char *nsptr; - - opal_output_verbose(1, opal_pmix_base_framework.framework_output, - "PMIx_client abort"); - - OPAL_PMIX_ACQUIRE_THREAD(&opal_pmix_base.lock); - if (0 >= opal_pmix_base.initialized) { - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - return OPAL_ERR_NOT_INITIALIZED; - } - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - - /* convert the list of procs to an array - * of pmix_proc_t */ - if (NULL != procs && 0 < (cnt = opal_list_get_size(procs))) { - PMIX_PROC_CREATE(parray, cnt); - n=0; - OPAL_LIST_FOREACH(ptr, procs, opal_namelist_t) { - if (NULL == (nsptr = ext2x_convert_jobid(ptr->name.jobid))) { - PMIX_PROC_FREE(parray, cnt); - return OPAL_ERR_NOT_FOUND; - } - (void)opal_string_copy(parray[n].nspace, nsptr, PMIX_MAX_NSLEN); - parray[n].rank = ext2x_convert_opalrank(ptr->name.vpid); - ++n; - } - } - - /* call the library abort - this is a blocking call */ - rc = PMIx_Abort(flag, msg, parray, cnt); - - /* release the array */ - PMIX_PROC_FREE(parray, cnt); - - return ext2x_convert_rc(rc); -} - -int ext2x_store_local(const opal_process_name_t *proc, opal_value_t *val) -{ - pmix_value_t kv; - pmix_status_t rc; - pmix_proc_t p; - char *nsptr; - opal_ext2x_jobid_trkr_t *job; - - OPAL_PMIX_ACQUIRE_THREAD(&opal_pmix_base.lock); - - if (0 >= opal_pmix_base.initialized) { - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - return OPAL_ERR_NOT_INITIALIZED; - } - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - - if (NULL != proc) { - if (NULL == (nsptr = ext2x_convert_jobid(proc->jobid))) { - job = OBJ_NEW(opal_ext2x_jobid_trkr_t); - (void)opal_snprintf_jobid(job->nspace, PMIX_MAX_NSLEN, proc->jobid); - job->jobid = proc->jobid; - OPAL_PMIX_ACQUIRE_THREAD(&opal_pmix_base.lock); - opal_list_append(&mca_pmix_ext2x_component.jobids, &job->super); - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - nsptr = job->nspace; - } - (void)opal_string_copy(p.nspace, nsptr, PMIX_MAX_NSLEN); - p.rank = ext2x_convert_opalrank(proc->vpid); - } else { - /* use our name */ - (void)opal_string_copy(p.nspace, my_proc.nspace, PMIX_MAX_NSLEN); - p.rank = ext2x_convert_opalrank(OPAL_PROC_MY_NAME.vpid); - } - - PMIX_VALUE_CONSTRUCT(&kv); - ext2x_value_load(&kv, val); - /* call the library - this is a blocking call */ - rc = PMIx_Store_internal(&p, val->key, &kv); - PMIX_VALUE_DESTRUCT(&kv); - - return ext2x_convert_rc(rc); -} - -int ext2x_commit(void) -{ - pmix_status_t rc; - - OPAL_PMIX_ACQUIRE_THREAD(&opal_pmix_base.lock); - if (0 >= opal_pmix_base.initialized) { - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - return OPAL_ERR_NOT_INITIALIZED; - } - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - - rc = PMIx_Commit(); - return ext2x_convert_rc(rc); -} - -static void opcbfunc(pmix_status_t status, void *cbdata) -{ - ext2x_opcaddy_t *op = (ext2x_opcaddy_t*)cbdata; - - OPAL_ACQUIRE_OBJECT(op); - if (NULL != op->opcbfunc) { - op->opcbfunc(ext2x_convert_rc(status), op->cbdata); - } - OBJ_RELEASE(op); -} - -int ext2x_fence(opal_list_t *procs, int collect_data) -{ - pmix_status_t rc; - opal_namelist_t *ptr; - char *nsptr; - size_t cnt = 0, n; - pmix_proc_t *parray = NULL; - pmix_info_t info, *iptr; - - opal_output_verbose(1, opal_pmix_base_framework.framework_output, - "PMIx_client fence"); - - OPAL_PMIX_ACQUIRE_THREAD(&opal_pmix_base.lock); - if (0 >= opal_pmix_base.initialized) { - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - return OPAL_ERR_NOT_INITIALIZED; - } - - /* convert the list of procs to an array - * of pmix_proc_t */ - if (NULL != procs && 0 < (cnt = opal_list_get_size(procs))) { - PMIX_PROC_CREATE(parray, cnt); - n=0; - OPAL_LIST_FOREACH(ptr, procs, opal_namelist_t) { - if (NULL == (nsptr = ext2x_convert_jobid(ptr->name.jobid))) { - PMIX_PROC_FREE(parray, cnt); - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - return OPAL_ERR_NOT_FOUND; - } - (void)opal_string_copy(parray[n].nspace, nsptr, PMIX_MAX_NSLEN); - parray[n].rank = ext2x_convert_opalrank(ptr->name.vpid); - ++n; - } - } - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - - if (collect_data) { - PMIX_INFO_CONSTRUCT(&info); - (void)opal_string_copy(info.key, PMIX_COLLECT_DATA, PMIX_MAX_KEYLEN); - info.value.type = PMIX_BOOL; - info.value.data.flag = true; - iptr = &info; - n = 1; - } else { - iptr = NULL; - n = 0; - } - - rc = PMIx_Fence(parray, cnt, iptr, n); - if (collect_data) { - PMIX_INFO_DESTRUCT(&info); - } - if (NULL != parray) { - PMIX_PROC_FREE(parray, cnt); - } - - return ext2x_convert_rc(rc); -} - -int ext2x_fencenb(opal_list_t *procs, int collect_data, - opal_pmix_op_cbfunc_t cbfunc, void *cbdata) -{ - pmix_status_t rc; - pmix_proc_t *parray=NULL; - size_t n, cnt=0; - opal_namelist_t *ptr; - ext2x_opcaddy_t *op; - char *nsptr; - - opal_output_verbose(1, opal_pmix_base_framework.framework_output, - "PMIx_client fencenb"); - - OPAL_PMIX_ACQUIRE_THREAD(&opal_pmix_base.lock); - if (0 >= opal_pmix_base.initialized) { - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - return OPAL_ERR_NOT_INITIALIZED; - } - - /* convert the list of procs to an array - * of pmix_proc_t */ - if (NULL != procs && 0 < (cnt = opal_list_get_size(procs))) { - PMIX_PROC_CREATE(parray, cnt); - n=0; - OPAL_LIST_FOREACH(ptr, procs, opal_namelist_t) { - if (NULL == (nsptr = ext2x_convert_jobid(ptr->name.jobid))) { - PMIX_PROC_FREE(parray, cnt); - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - return OPAL_ERR_NOT_FOUND; - } - (void)opal_string_copy(parray[n].nspace, nsptr, PMIX_MAX_NSLEN); - parray[n].rank = ext2x_convert_opalrank(ptr->name.vpid); - ++n; - } - } - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - - /* create the caddy */ - op = OBJ_NEW(ext2x_opcaddy_t); - op->opcbfunc = cbfunc; - op->cbdata = cbdata; - op->procs = parray; - op->nprocs = cnt; - - if (collect_data) { - op->ninfo = 1; - PMIX_INFO_CREATE(op->info, op->ninfo); - PMIX_INFO_LOAD(&op->info[0], PMIX_COLLECT_DATA, NULL, PMIX_BOOL); - } - - /* call the library function */ - rc = PMIx_Fence_nb(op->procs, op->nprocs, op->info, op->ninfo, opcbfunc, op); - return ext2x_convert_rc(rc); -} - -int ext2x_put(opal_pmix_scope_t opal_scope, - opal_value_t *val) -{ - pmix_value_t kv; - pmix_scope_t pmix_scope = ext2x_convert_opalscope(opal_scope); - pmix_status_t rc; - - opal_output_verbose(1, opal_pmix_base_framework.framework_output, - "PMIx_client put"); - - OPAL_PMIX_ACQUIRE_THREAD(&opal_pmix_base.lock); - if (0 >= opal_pmix_base.initialized) { - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - return OPAL_ERR_NOT_INITIALIZED; - } - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - - PMIX_VALUE_CONSTRUCT(&kv); - ext2x_value_load(&kv, val); - - rc = PMIx_Put(pmix_scope, val->key, &kv); - PMIX_VALUE_DESTRUCT(&kv); - return ext2x_convert_rc(rc); -} - -int ext2x_get(const opal_process_name_t *proc, const char *key, - opal_list_t *info, opal_value_t **val) -{ - pmix_status_t rc; - pmix_proc_t p; - char *nsptr; - pmix_info_t *pinfo = NULL; - size_t sz = 0, n; - opal_value_t *ival; - pmix_value_t *pval = NULL; - int ret; - - opal_output_verbose(1, opal_pmix_base_framework.framework_output, - "%s ext2x:client get on proc %s key %s", - OPAL_NAME_PRINT(OPAL_PROC_MY_NAME), - (NULL == proc) ? "NULL" : OPAL_NAME_PRINT(*proc), key); - - OPAL_PMIX_ACQUIRE_THREAD(&opal_pmix_base.lock); - if (0 >= opal_pmix_base.initialized) { - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - return OPAL_ERR_NOT_INITIALIZED; - } - - if (NULL == proc && NULL != key) { - /* if they are asking for our jobid, then return it */ - if (0 == strcmp(key, OPAL_PMIX_JOBID)) { - (*val) = OBJ_NEW(opal_value_t); - (*val)->key = strdup(key); - (*val)->type = OPAL_UINT32; - (*val)->data.uint32 = OPAL_PROC_MY_NAME.jobid; - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - return OPAL_SUCCESS; - } - /* if they are asking for our rank, return it */ - if (0 == strcmp(key, OPAL_PMIX_RANK)) { - (*val) = OBJ_NEW(opal_value_t); - (*val)->key = strdup(key); - (*val)->type = OPAL_INT; - (*val)->data.integer = ext2x_convert_rank(my_proc.rank); - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - return OPAL_SUCCESS; - } - } - *val = NULL; - - if (NULL == proc) { - (void)opal_string_copy(p.nspace, my_proc.nspace, PMIX_MAX_NSLEN); - p.rank = ext2x_convert_rank(PMIX_RANK_WILDCARD); - } else { - if (NULL == (nsptr = ext2x_convert_jobid(proc->jobid))) { - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - return OPAL_ERR_NOT_FOUND; - } - (void)opal_string_copy(p.nspace, nsptr, PMIX_MAX_NSLEN); - p.rank = ext2x_convert_opalrank(proc->vpid); - } - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - - if (NULL != info && 0 < (sz = opal_list_get_size(info))) { - PMIX_INFO_CREATE(pinfo, sz); - n=0; - OPAL_LIST_FOREACH(ival, info, opal_value_t) { - (void)opal_string_copy(pinfo[n].key, ival->key, PMIX_MAX_KEYLEN); - ext2x_value_load(&pinfo[n].value, ival); - ++n; - } - } - - rc = PMIx_Get(&p, key, pinfo, sz, &pval); - if (PMIX_SUCCESS == rc) { - ival = OBJ_NEW(opal_value_t); - if (NULL != key) { - ival->key = strdup(key); - } - if (OPAL_SUCCESS != (ret = ext2x_value_unload(ival, pval))) { - rc = ext2x_convert_opalrc(ret); - } else { - *val = ival; - } - PMIX_VALUE_FREE(pval, 1); - } - PMIX_INFO_FREE(pinfo, sz); - - return ext2x_convert_rc(rc); -} - -static void val_cbfunc(pmix_status_t status, - pmix_value_t *kv, void *cbdata) -{ - ext2x_opcaddy_t *op = (ext2x_opcaddy_t*)cbdata; - int rc; - opal_value_t val, *v=NULL; - - OPAL_ACQUIRE_OBJECT(op); - OBJ_CONSTRUCT(&val, opal_value_t); - if (NULL != op->nspace) { - val.key = strdup(op->nspace); - } - rc = ext2x_convert_opalrc(status); - if (PMIX_SUCCESS == status && NULL != kv) { - rc = ext2x_value_unload(&val, kv); - v = &val; - } - - if (NULL != op->valcbfunc) { - op->valcbfunc(rc, v, op->cbdata); - } - OBJ_DESTRUCT(&val); - OBJ_RELEASE(op); -} - -int ext2x_getnb(const opal_process_name_t *proc, const char *key, - opal_list_t *info, - opal_pmix_value_cbfunc_t cbfunc, void *cbdata) -{ - ext2x_opcaddy_t *op; - opal_value_t *val; - pmix_status_t rc; - char *nsptr; - size_t n; - - opal_output_verbose(1, opal_pmix_base_framework.framework_output, - "%s PMIx_client get_nb on proc %s key %s", - OPAL_NAME_PRINT(OPAL_PROC_MY_NAME), - (NULL == proc) ? "NULL" : OPAL_NAME_PRINT(*proc), key); - - OPAL_PMIX_ACQUIRE_THREAD(&opal_pmix_base.lock); - if (0 >= opal_pmix_base.initialized) { - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - return OPAL_ERR_NOT_INITIALIZED; - } - - if (NULL == proc) { - /* if they are asking for our jobid, then return it */ - if (0 == strcmp(key, OPAL_PMIX_JOBID)) { - if (NULL != cbfunc) { - val = OBJ_NEW(opal_value_t); - val->key = strdup(key); - val->type = OPAL_UINT32; - val->data.uint32 = OPAL_PROC_MY_NAME.jobid; - cbfunc(OPAL_SUCCESS, val, cbdata); - } - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - return OPAL_SUCCESS; - } - /* if they are asking for our rank, return it */ - if (0 == strcmp(key, OPAL_PMIX_RANK)) { - if (NULL != cbfunc) { - val = OBJ_NEW(opal_value_t); - val->key = strdup(key); - val->type = OPAL_INT; - val->data.integer = ext2x_convert_rank(my_proc.rank); - cbfunc(OPAL_SUCCESS, val, cbdata); - } - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - return OPAL_SUCCESS; - } - } - - /* create the caddy */ - op = OBJ_NEW(ext2x_opcaddy_t); - op->valcbfunc = cbfunc; - op->cbdata = cbdata; - if (NULL != key) { - op->nspace = strdup(key); - } - if (NULL == proc) { - (void)opal_string_copy(op->p.nspace, my_proc.nspace, PMIX_MAX_NSLEN); - op->p.rank = ext2x_convert_rank(PMIX_RANK_WILDCARD); - } else { - if (NULL == (nsptr = ext2x_convert_jobid(proc->jobid))) { - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - return OPAL_ERR_NOT_FOUND; - } - (void)opal_string_copy(op->p.nspace, nsptr, PMIX_MAX_NSLEN); - op->p.rank = ext2x_convert_opalrank(proc->vpid); - } - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - - if (NULL != info && 0 < (op->sz = opal_list_get_size(info))) { - PMIX_INFO_CREATE(op->info, op->sz); - n=0; - OPAL_LIST_FOREACH(val, info, opal_value_t) { - (void)opal_string_copy(op->info[n].key, val->key, PMIX_MAX_KEYLEN); - ext2x_value_load(&op->info[n].value, val); - ++n; - } - } - - /* call the library function */ - rc = PMIx_Get_nb(&op->p, key, op->info, op->sz, val_cbfunc, op); - if (PMIX_SUCCESS != rc) { - OBJ_RELEASE(op); - } - - return ext2x_convert_rc(rc); -} - -int ext2x_publish(opal_list_t *info) -{ - pmix_info_t *pinfo; - pmix_status_t ret; - opal_value_t *iptr; - size_t sz, n; - - opal_output_verbose(1, opal_pmix_base_framework.framework_output, - "PMIx_client publish"); - - OPAL_PMIX_ACQUIRE_THREAD(&opal_pmix_base.lock); - if (0 >= opal_pmix_base.initialized) { - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - return OPAL_ERR_NOT_INITIALIZED; - } - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - - if (NULL == info) { - return OPAL_ERR_BAD_PARAM; - } - - sz = opal_list_get_size(info); - if (0 < sz) { - PMIX_INFO_CREATE(pinfo, sz); - n=0; - OPAL_LIST_FOREACH(iptr, info, opal_value_t) { - (void)opal_string_copy(pinfo[n].key, iptr->key, PMIX_MAX_KEYLEN); - ext2x_value_load(&pinfo[n].value, iptr); - ++n; - } - } else { - pinfo = NULL; - } - - ret = PMIx_Publish(pinfo, sz); - if (0 < sz) { - PMIX_INFO_FREE(pinfo, sz); - } - - return ext2x_convert_rc(ret); -} - -int ext2x_publishnb(opal_list_t *info, - opal_pmix_op_cbfunc_t cbfunc, void *cbdata) -{ - pmix_status_t ret; - opal_value_t *iptr; - size_t n; - ext2x_opcaddy_t *op; - - opal_output_verbose(1, opal_pmix_base_framework.framework_output, - "PMIx_client publish_nb"); - - OPAL_PMIX_ACQUIRE_THREAD(&opal_pmix_base.lock); - if (0 >= opal_pmix_base.initialized) { - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - return OPAL_ERR_NOT_INITIALIZED; - } - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - - if (NULL == info) { - return OPAL_ERR_BAD_PARAM; - } - - /* create the caddy */ - op = OBJ_NEW(ext2x_opcaddy_t); - op->opcbfunc = cbfunc; - op->cbdata = cbdata; - - op->sz = opal_list_get_size(info); - if (0 < op->sz) { - PMIX_INFO_CREATE(op->info, op->sz); - n=0; - OPAL_LIST_FOREACH(iptr, info, opal_value_t) { - (void)opal_string_copy(op->info[n].key, iptr->key, PMIX_MAX_KEYLEN); - ext2x_value_load(&op->info[n].value, iptr); - ++n; - } - } - - ret = PMIx_Publish_nb(op->info, op->sz, opcbfunc, op); - - return ext2x_convert_rc(ret); -} - -int ext2x_lookup(opal_list_t *data, opal_list_t *info) -{ - opal_pmix_pdata_t *d; - pmix_pdata_t *pdata; - pmix_info_t *pinfo = NULL; - pmix_status_t rc; - size_t cnt, n, sz = 0; - opal_value_t *iptr; - opal_ext2x_jobid_trkr_t *jptr, *job; - int ret; - - opal_output_verbose(1, opal_pmix_base_framework.framework_output, - "ext2x:client lookup"); - - OPAL_PMIX_ACQUIRE_THREAD(&opal_pmix_base.lock); - if (0 >= opal_pmix_base.initialized) { - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - return OPAL_ERR_NOT_INITIALIZED; - } - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - - if (NULL == data || 0 == (cnt = opal_list_get_size(data))) { - return OPAL_ERR_BAD_PARAM; - } - PMIX_PDATA_CREATE(pdata, cnt); - n = 0; - OPAL_LIST_FOREACH(d, data, opal_pmix_pdata_t) { - (void)opal_string_copy(pdata[n].key, d->value.key, PMIX_MAX_KEYLEN); - ++n; - } - - if (NULL != info && 0 < (sz = opal_list_get_size(info))) { - PMIX_INFO_CREATE(pinfo, sz); - n=0; - OPAL_LIST_FOREACH(iptr, info, opal_value_t) { - (void)opal_string_copy(pinfo[n].key, iptr->key, PMIX_MAX_KEYLEN); - ext2x_value_load(&pinfo[n].value, iptr); - ++n; - } - } - - rc = PMIx_Lookup(pdata, cnt, pinfo, sz); - if (PMIX_SUCCESS == rc) { - /* load the answers back into the list */ - n=0; - OPAL_PMIX_ACQUIRE_THREAD(&opal_pmix_base.lock); - OPAL_LIST_FOREACH(d, data, opal_pmix_pdata_t) { - if (mca_pmix_ext2x_component.native_launch) { - /* if we were launched by the OMPI RTE, then - * the jobid is in a special format - so get it */ - opal_convert_string_to_jobid(&d->proc.jobid, pdata[n].proc.nspace); - } else { - /* we were launched by someone else, so make the - * jobid just be the hash of the nspace */ - OPAL_HASH_JOBID(pdata[n].proc.nspace, d->proc.jobid); - } - /* if we don't already have it, add this to our jobid tracker */ - job = NULL; - OPAL_LIST_FOREACH(jptr, &mca_pmix_ext2x_component.jobids, opal_ext2x_jobid_trkr_t) { - if (jptr->jobid == d->proc.jobid) { - job = jptr; - break; - } - } - if (NULL == job) { - job = OBJ_NEW(opal_ext2x_jobid_trkr_t); - (void)opal_string_copy(job->nspace, pdata[n].proc.nspace, PMIX_MAX_NSLEN); - job->jobid = d->proc.jobid; - opal_list_append(&mca_pmix_ext2x_component.jobids, &job->super); - } - d->proc.vpid = ext2x_convert_rank(pdata[n].proc.rank); - if (OPAL_SUCCESS != (ret = ext2x_value_unload(&d->value, &pdata[n].value))) { - OPAL_ERROR_LOG(ret); - } - } - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - } - PMIX_PDATA_FREE(pdata, cnt); - if (NULL != pinfo) { - PMIX_INFO_FREE(pinfo, sz); - } - return ext2x_convert_rc(rc); -} - -static void lk_cbfunc(pmix_status_t status, - pmix_pdata_t data[], size_t ndata, - void *cbdata) -{ - ext2x_opcaddy_t *op = (ext2x_opcaddy_t*)cbdata; - opal_pmix_pdata_t *d; - opal_list_t results, *r = NULL; - int rc; - size_t n; - opal_ext2x_jobid_trkr_t *job, *jptr; - - OPAL_ACQUIRE_OBJECT(op); - - if (NULL == op->lkcbfunc) { - OBJ_RELEASE(op); - return; - } - - rc = ext2x_convert_rc(op->status); - if (OPAL_SUCCESS == rc) { - OPAL_PMIX_ACQUIRE_THREAD(&opal_pmix_base.lock); - OBJ_CONSTRUCT(&results, opal_list_t); - for (n=0; n < ndata; n++) { - d = OBJ_NEW(opal_pmix_pdata_t); - opal_list_append(&results, &d->super); - if (mca_pmix_ext2x_component.native_launch) { - /* if we were launched by the OMPI RTE, then - * the jobid is in a special format - so get it */ - opal_convert_string_to_jobid(&d->proc.jobid, data[n].proc.nspace); - } else { - /* we were launched by someone else, so make the - * jobid just be the hash of the nspace */ - OPAL_HASH_JOBID(data[n].proc.nspace, d->proc.jobid); - } - /* if we don't already have it, add this to our jobid tracker */ - job = NULL; - OPAL_LIST_FOREACH(jptr, &mca_pmix_ext2x_component.jobids, opal_ext2x_jobid_trkr_t) { - if (jptr->jobid == d->proc.jobid) { - job = jptr; - break; - } - } - if (NULL == job) { - job = OBJ_NEW(opal_ext2x_jobid_trkr_t); - (void)opal_string_copy(job->nspace, data[n].proc.nspace, PMIX_MAX_NSLEN); - job->jobid = d->proc.jobid; - opal_list_append(&mca_pmix_ext2x_component.jobids, &job->super); - } - d->proc.vpid = ext2x_convert_rank(data[n].proc.rank); - d->value.key = strdup(data[n].key); - rc = ext2x_value_unload(&d->value, &data[n].value); - if (OPAL_SUCCESS != rc) { - rc = OPAL_ERR_BAD_PARAM; - OPAL_ERROR_LOG(rc); - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - goto release; - } - } - r = &results; - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - } - - release: - /* execute the callback */ - op->lkcbfunc(rc, r, op->cbdata); - - if (NULL != r) { - OPAL_LIST_DESTRUCT(&results); - } - OBJ_RELEASE(op); -} - -int ext2x_lookupnb(char **keys, opal_list_t *info, - opal_pmix_lookup_cbfunc_t cbfunc, void *cbdata) -{ - pmix_status_t ret; - ext2x_opcaddy_t *op; - opal_value_t *iptr; - size_t n; - - - opal_output_verbose(1, opal_pmix_base_framework.framework_output, - "ext2x:client lookup_nb"); - - OPAL_PMIX_ACQUIRE_THREAD(&opal_pmix_base.lock); - if (0 >= opal_pmix_base.initialized) { - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - return OPAL_ERR_NOT_INITIALIZED; - } - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - - /* create the caddy */ - op = OBJ_NEW(ext2x_opcaddy_t); - op->lkcbfunc = cbfunc; - op->cbdata = cbdata; - - if (NULL != info && 0 < (op->sz = opal_list_get_size(info))) { - PMIX_INFO_CREATE(op->info, op->sz); - n=0; - OPAL_LIST_FOREACH(iptr, info, opal_value_t) { - (void)opal_string_copy(op->info[n].key, iptr->key, PMIX_MAX_KEYLEN); - ext2x_value_load(&op->info[n].value, iptr); - ++n; - } - } - ret = PMIx_Lookup_nb(keys, op->info, op->sz, lk_cbfunc, op); - - return ext2x_convert_rc(ret); -} - -int ext2x_unpublish(char **keys, opal_list_t *info) -{ - pmix_status_t ret; - size_t ninfo, n; - pmix_info_t *pinfo; - opal_value_t *iptr; - - OPAL_PMIX_ACQUIRE_THREAD(&opal_pmix_base.lock); - if (0 >= opal_pmix_base.initialized) { - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - return OPAL_ERR_NOT_INITIALIZED; - } - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - - if (NULL != info && 0 < (ninfo = opal_list_get_size(info))) { - PMIX_INFO_CREATE(pinfo, ninfo); - n=0; - OPAL_LIST_FOREACH(iptr, info, opal_value_t) { - (void)opal_string_copy(pinfo[n].key, iptr->key, PMIX_MAX_KEYLEN); - ext2x_value_load(&pinfo[n].value, iptr); - ++n; - } - } else { - pinfo = NULL; - ninfo = 0; - } - - ret = PMIx_Unpublish(keys, pinfo, ninfo); - PMIX_INFO_FREE(pinfo, ninfo); - - return ext2x_convert_rc(ret); -} - -int ext2x_unpublishnb(char **keys, opal_list_t *info, - opal_pmix_op_cbfunc_t cbfunc, void *cbdata) -{ - pmix_status_t ret; - ext2x_opcaddy_t *op; - opal_value_t *iptr; - size_t n; - - OPAL_PMIX_ACQUIRE_THREAD(&opal_pmix_base.lock); - if (0 >= opal_pmix_base.initialized) { - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - return OPAL_ERR_NOT_INITIALIZED; - } - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - - /* create the caddy */ - op = OBJ_NEW(ext2x_opcaddy_t); - op->opcbfunc = cbfunc; - op->cbdata = cbdata; - - if (NULL != info && 0 < (op->sz = opal_list_get_size(info))) { - PMIX_INFO_CREATE(op->info, op->sz); - n=0; - OPAL_LIST_FOREACH(iptr, info, opal_value_t) { - (void)opal_string_copy(op->info[n].key, iptr->key, PMIX_MAX_KEYLEN); - ext2x_value_load(&op->info[n].value, iptr); - ++n; - } - } - - ret = PMIx_Unpublish_nb(keys, op->info, op->sz, opcbfunc, op); - - return ext2x_convert_rc(ret); -} - -int ext2x_spawn(opal_list_t *job_info, opal_list_t *apps, opal_jobid_t *jobid) -{ - pmix_status_t rc; - pmix_info_t *info = NULL; - pmix_app_t *papps; - size_t ninfo = 0, napps, n, m; - opal_value_t *ival; - opal_pmix_app_t *app; - char nspace[PMIX_MAX_NSLEN+1]; - opal_ext2x_jobid_trkr_t *job; - - OPAL_PMIX_ACQUIRE_THREAD(&opal_pmix_base.lock); - if (0 >= opal_pmix_base.initialized) { - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - return OPAL_ERR_NOT_INITIALIZED; - } - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - - *jobid = OPAL_JOBID_INVALID; - - if (NULL != job_info && 0 < (ninfo = opal_list_get_size(job_info))) { - PMIX_INFO_CREATE(info, ninfo); - n=0; - OPAL_LIST_FOREACH(ival, job_info, opal_value_t) { - (void)opal_string_copy(info[n].key, ival->key, PMIX_MAX_KEYLEN); - ext2x_value_load(&info[n].value, ival); - ++n; - } - } - - napps = opal_list_get_size(apps); - PMIX_APP_CREATE(papps, napps); - n=0; - OPAL_LIST_FOREACH(app, apps, opal_pmix_app_t) { - papps[n].cmd = strdup(app->cmd); - if (NULL != app->argv) { - papps[n].argv = opal_argv_copy(app->argv); - } - if (NULL != app->env) { - papps[n].env = opal_argv_copy(app->env); - } - if (NULL != app->cwd) { - papps[n].cwd = strdup(app->cwd); - } - papps[n].maxprocs = app->maxprocs; - if (0 < (papps[n].ninfo = opal_list_get_size(&app->info))) { - PMIX_INFO_CREATE(papps[n].info, papps[n].ninfo); - m=0; - OPAL_LIST_FOREACH(ival, &app->info, opal_value_t) { - (void)opal_string_copy(papps[n].info[m].key, ival->key, PMIX_MAX_KEYLEN); - ext2x_value_load(&papps[n].info[m].value, ival); - ++m; - } - } - ++n; - } - - rc = PMIx_Spawn(info, ninfo, papps, napps, nspace); - if (PMIX_SUCCESS == rc) { - OPAL_PMIX_ACQUIRE_THREAD(&opal_pmix_base.lock); - if (mca_pmix_ext2x_component.native_launch) { - /* if we were launched by the OMPI RTE, then - * the jobid is in a special format - so get it */ - opal_convert_string_to_jobid(jobid, nspace); - } else { - /* we were launched by someone else, so make the - * jobid just be the hash of the nspace */ - OPAL_HASH_JOBID(nspace, *jobid); - } - /* add this to our jobid tracker */ - job = OBJ_NEW(opal_ext2x_jobid_trkr_t); - (void)opal_string_copy(job->nspace, nspace, PMIX_MAX_NSLEN); - job->jobid = *jobid; - opal_list_append(&mca_pmix_ext2x_component.jobids, &job->super); - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - } - return rc; -} - -static void spcbfunc(pmix_status_t status, - char *nspace, void *cbdata) -{ - ext2x_opcaddy_t *op = (ext2x_opcaddy_t*)cbdata; - opal_ext2x_jobid_trkr_t *job; - opal_jobid_t jobid = OPAL_JOBID_INVALID; - int rc; - - OPAL_ACQUIRE_OBJECT(op); - - rc = ext2x_convert_rc(status); - if (PMIX_SUCCESS == status) { - /* this is in the PMIx local thread - need to protect - * the framework-level data */ - OPAL_PMIX_ACQUIRE_THREAD(&opal_pmix_base.lock); - if (mca_pmix_ext2x_component.native_launch) { - /* if we were launched by the OMPI RTE, then - * the jobid is in a special format - so get it */ - opal_convert_string_to_jobid(&jobid, nspace); - } else { - /* we were launched by someone else, so make the - * jobid just be the hash of the nspace */ - OPAL_HASH_JOBID(nspace, jobid); - } - /* add this to our jobid tracker */ - job = OBJ_NEW(opal_ext2x_jobid_trkr_t); - (void)opal_string_copy(job->nspace, nspace, PMIX_MAX_NSLEN); - job->jobid = jobid; - opal_list_append(&mca_pmix_ext2x_component.jobids, &job->super); - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - } - - op->spcbfunc(rc, jobid, op->cbdata); - OBJ_RELEASE(op); -} - -int ext2x_spawnnb(opal_list_t *job_info, opal_list_t *apps, - opal_pmix_spawn_cbfunc_t cbfunc, void *cbdata) -{ - pmix_status_t ret; - ext2x_opcaddy_t *op; - size_t n, m; - opal_value_t *info; - opal_pmix_app_t *app; - - OPAL_PMIX_ACQUIRE_THREAD(&opal_pmix_base.lock); - if (0 >= opal_pmix_base.initialized) { - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - return OPAL_ERR_NOT_INITIALIZED; - } - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - - /* create the caddy */ - op = OBJ_NEW(ext2x_opcaddy_t); - op->spcbfunc = cbfunc; - op->cbdata = cbdata; - - if (NULL != job_info && 0 < (op->ninfo = opal_list_get_size(job_info))) { - PMIX_INFO_CREATE(op->info, op->ninfo); - n=0; - OPAL_LIST_FOREACH(info, job_info, opal_value_t) { - (void)opal_string_copy(op->info[n].key, info->key, PMIX_MAX_KEYLEN); - ext2x_value_load(&op->info[n].value, info); - ++n; - } - } - - op->sz = opal_list_get_size(apps); - PMIX_APP_CREATE(op->apps, op->sz); - n=0; - OPAL_LIST_FOREACH(app, apps, opal_pmix_app_t) { - op->apps[n].cmd = strdup(app->cmd); - if (NULL != app->argv) { - op->apps[n].argv = opal_argv_copy(app->argv); - } - if (NULL != app->env) { - op->apps[n].env = opal_argv_copy(app->env); - } - op->apps[n].maxprocs = app->maxprocs; - if (0 < (op->apps[n].ninfo = opal_list_get_size(&app->info))) { - PMIX_INFO_CREATE(op->apps[n].info, op->apps[n].ninfo); - m=0; - OPAL_LIST_FOREACH(info, &app->info, opal_value_t) { - (void)opal_string_copy(op->apps[n].info[m].key, info->key, PMIX_MAX_KEYLEN); - ext2x_value_load(&op->apps[n].info[m].value, info); - ++m; - } - } - ++n; - } - - ret = PMIx_Spawn_nb(op->info, op->ninfo, op->apps, op->sz, spcbfunc, op); - - return ext2x_convert_rc(ret); -} - -int ext2x_connect(opal_list_t *procs) -{ - pmix_proc_t *p; - size_t nprocs; - opal_namelist_t *ptr; - pmix_status_t ret; - char *nsptr; - size_t n; - - opal_output_verbose(1, opal_pmix_base_framework.framework_output, - "ext2x:client connect"); - - /* protect against bozo error */ - if (NULL == procs || 0 == (nprocs = opal_list_get_size(procs))) { - return OPAL_ERR_BAD_PARAM; - } - - OPAL_PMIX_ACQUIRE_THREAD(&opal_pmix_base.lock); - if (0 >= opal_pmix_base.initialized) { - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - return OPAL_ERR_NOT_INITIALIZED; - } - - /* convert the list of procs to an array - * of pmix_proc_t */ - PMIX_PROC_CREATE(p, nprocs); - n=0; - OPAL_LIST_FOREACH(ptr, procs, opal_namelist_t) { - if (NULL == (nsptr = ext2x_convert_jobid(ptr->name.jobid))) { - PMIX_PROC_FREE(p, nprocs); - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - return OPAL_ERR_NOT_FOUND; - } - (void)opal_string_copy(p[n].nspace, nsptr, PMIX_MAX_NSLEN); - p[n].rank = ext2x_convert_opalrank(ptr->name.vpid); - ++n; - } - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - - ret = PMIx_Connect(p, nprocs, NULL, 0); - PMIX_PROC_FREE(p, nprocs); - - return ext2x_convert_rc(ret); -} - -int ext2x_connectnb(opal_list_t *procs, - opal_pmix_op_cbfunc_t cbfunc, - void *cbdata) -{ - ext2x_opcaddy_t *op; - opal_namelist_t *ptr; - pmix_status_t ret; - char *nsptr; - size_t n; - - opal_output_verbose(1, opal_pmix_base_framework.framework_output, - "ext2x:client connect NB"); - - /* protect against bozo error */ - if (NULL == procs || 0 == opal_list_get_size(procs)) { - return OPAL_ERR_BAD_PARAM; - } - - OPAL_PMIX_ACQUIRE_THREAD(&opal_pmix_base.lock); - if (0 >= opal_pmix_base.initialized) { - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - return OPAL_ERR_NOT_INITIALIZED; - } - - /* create the caddy */ - op = OBJ_NEW(ext2x_opcaddy_t); - op->opcbfunc = cbfunc; - op->cbdata = cbdata; - op->nprocs = opal_list_get_size(procs); - - /* convert the list of procs to an array - * of pmix_proc_t */ - PMIX_PROC_CREATE(op->procs, op->nprocs); - n=0; - OPAL_LIST_FOREACH(ptr, procs, opal_namelist_t) { - if (NULL == (nsptr = ext2x_convert_jobid(ptr->name.jobid))) { - OBJ_RELEASE(op); - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - return OPAL_ERR_NOT_FOUND; - } - (void)opal_string_copy(op->procs[n].nspace, nsptr, PMIX_MAX_NSLEN); - op->procs[n].rank = ext2x_convert_opalrank(ptr->name.vpid); - ++n; - } - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - - ret = PMIx_Connect_nb(op->procs, op->nprocs, NULL, 0, opcbfunc, op); - if (PMIX_SUCCESS != ret) { - OBJ_RELEASE(op); - } - return ext2x_convert_rc(ret); -} - -int ext2x_disconnect(opal_list_t *procs) -{ - pmix_proc_t *p; - size_t nprocs; - opal_namelist_t *ptr; - pmix_status_t ret; - char *nsptr; - size_t n; - - opal_output_verbose(1, opal_pmix_base_framework.framework_output, - "ext2x:client disconnect"); - - /* protect against bozo error */ - if (NULL == procs || 0 == (nprocs = opal_list_get_size(procs))) { - return OPAL_ERR_BAD_PARAM; - } - - OPAL_PMIX_ACQUIRE_THREAD(&opal_pmix_base.lock); - if (0 >= opal_pmix_base.initialized) { - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - return OPAL_ERR_NOT_INITIALIZED; - } - - /* convert the list of procs to an array - * of pmix_proc_t */ - PMIX_PROC_CREATE(p, nprocs); - n=0; - OPAL_LIST_FOREACH(ptr, procs, opal_namelist_t) { - if (NULL == (nsptr = ext2x_convert_jobid(ptr->name.jobid))) { - PMIX_PROC_FREE(p, nprocs); - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - return OPAL_ERR_NOT_FOUND; - } - (void)opal_string_copy(p[n].nspace, nsptr, PMIX_MAX_NSLEN); - p[n].rank = ext2x_convert_opalrank(ptr->name.vpid); - ++n; - } - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - - ret = PMIx_Disconnect(p, nprocs, NULL, 0); - PMIX_PROC_FREE(p, nprocs); - - return ext2x_convert_rc(ret); -} - -int ext2x_disconnectnb(opal_list_t *procs, - opal_pmix_op_cbfunc_t cbfunc, - void *cbdata) -{ - ext2x_opcaddy_t *op; - opal_namelist_t *ptr; - pmix_status_t ret; - char *nsptr; - size_t n; - - opal_output_verbose(1, opal_pmix_base_framework.framework_output, - "ext2x:client disconnect NB"); - - /* protect against bozo error */ - if (NULL == procs || 0 == opal_list_get_size(procs)) { - return OPAL_ERR_BAD_PARAM; - } - - OPAL_PMIX_ACQUIRE_THREAD(&opal_pmix_base.lock); - if (0 >= opal_pmix_base.initialized) { - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - return OPAL_ERR_NOT_INITIALIZED; - } - - /* create the caddy */ - op = OBJ_NEW(ext2x_opcaddy_t); - op->opcbfunc = cbfunc; - op->cbdata = cbdata; - op->nprocs = opal_list_get_size(procs); - - /* convert the list of procs to an array - * of pmix_proc_t */ - PMIX_PROC_CREATE(op->procs, op->nprocs); - n=0; - OPAL_LIST_FOREACH(ptr, procs, opal_namelist_t) { - if (NULL == (nsptr = ext2x_convert_jobid(ptr->name.jobid))) { - OBJ_RELEASE(op); - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - return OPAL_ERR_NOT_FOUND; - } - (void)opal_string_copy(op->procs[n].nspace, nsptr, PMIX_MAX_NSLEN); - op->procs[n].rank = ext2x_convert_opalrank(ptr->name.vpid); - ++n; - } - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - - ret = PMIx_Disconnect_nb(op->procs, op->nprocs, NULL, 0, opcbfunc, op); - if (PMIX_SUCCESS != ret) { - OBJ_RELEASE(op); - } - return ext2x_convert_rc(ret); -} - -int ext2x_resolve_peers(const char *nodename, - opal_jobid_t jobid, - opal_list_t *procs) -{ - pmix_status_t ret; - char *nspace; - pmix_proc_t *array=NULL; - size_t nprocs, n; - opal_namelist_t *nm; - opal_ext2x_jobid_trkr_t *job; - - OPAL_PMIX_ACQUIRE_THREAD(&opal_pmix_base.lock); - if (0 >= opal_pmix_base.initialized) { - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - return OPAL_ERR_NOT_INITIALIZED; - } - - if (OPAL_JOBID_WILDCARD != jobid) { - if (NULL == (nspace = ext2x_convert_jobid(jobid))) { - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - return OPAL_ERR_NOT_FOUND; - } - } else { - nspace = NULL; - } - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - - ret = PMIx_Resolve_peers(nodename, nspace, &array, &nprocs); - - if (NULL != array && 0 < nprocs) { - OPAL_PMIX_ACQUIRE_THREAD(&opal_pmix_base.lock); - for (n=0; n < nprocs; n++) { - nm = OBJ_NEW(opal_namelist_t); - opal_list_append(procs, &nm->super); - if (mca_pmix_ext2x_component.native_launch) { - /* if we were launched by the OMPI RTE, then - * the jobid is in a special format - so get it */ - opal_convert_string_to_jobid(&nm->name.jobid, array[n].nspace); - } else { - /* we were launched by someone else, so make the - * jobid just be the hash of the nspace */ - OPAL_HASH_JOBID(array[n].nspace, nm->name.jobid); - } - /* if we don't already have it, add this to our jobid tracker */ - if (NULL == ext2x_convert_jobid(nm->name.jobid)) { - job = OBJ_NEW(opal_ext2x_jobid_trkr_t); - (void)opal_string_copy(job->nspace, array[n].nspace, PMIX_MAX_NSLEN); - job->jobid = nm->name.jobid; - opal_list_append(&mca_pmix_ext2x_component.jobids, &job->super); - } - nm->name.vpid = ext2x_convert_rank(array[n].rank); - } - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - } - PMIX_PROC_FREE(array, nprocs); - return ext2x_convert_rc(ret); -} - -int ext2x_resolve_nodes(opal_jobid_t jobid, char **nodelist) -{ - pmix_status_t ret; - char *nsptr; - - OPAL_PMIX_ACQUIRE_THREAD(&opal_pmix_base.lock); - if (0 >= opal_pmix_base.initialized) { - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - return OPAL_ERR_NOT_INITIALIZED; - } - - if (NULL == (nsptr = ext2x_convert_jobid(jobid))) { - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - return OPAL_ERR_NOT_FOUND; - } - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - - ret = PMIx_Resolve_nodes(nsptr, nodelist); - - return ext2x_convert_rc(ret); -} - -static void relcbfunc(void *cbdata) -{ - ext2x_opcaddy_t *op = (ext2x_opcaddy_t*)cbdata; - OBJ_RELEASE(op); -} - -static void infocbfunc(pmix_status_t status, - pmix_info_t *info, size_t ninfo, - void *cbdata, - pmix_release_cbfunc_t release_fn, - void *release_cbdata) -{ - ext2x_opcaddy_t *op = (ext2x_opcaddy_t*)cbdata; - int rc; - - if (NULL != release_fn) { - release_fn(release_cbdata); - } - rc = ext2x_convert_rc(status); - if (NULL != op->qcbfunc) { - op->qcbfunc(rc, NULL, op->cbdata, relcbfunc, op); - } else { - OBJ_RELEASE(op); - } -} - -int ext2x_allocate(opal_pmix_alloc_directive_t directive, - opal_list_t *info, - opal_pmix_info_cbfunc_t cbfunc, void *cbdata) -{ - return OPAL_ERR_NOT_SUPPORTED; -} - -int ext2x_job_control(opal_list_t *targets, - opal_list_t *directives, - opal_pmix_info_cbfunc_t cbfunc, void *cbdata) -{ - ext2x_opcaddy_t *op; - size_t n; - opal_namelist_t *ptr; - opal_value_t *iptr; - pmix_status_t rc; - char *nsptr; - - OPAL_PMIX_ACQUIRE_THREAD(&opal_pmix_base.lock); - if (0 >= opal_pmix_base.initialized) { - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - return OPAL_ERR_NOT_INITIALIZED; - } - - /* create the caddy */ - op = OBJ_NEW(ext2x_opcaddy_t); - op->qcbfunc = cbfunc; - op->cbdata = cbdata; - if (NULL != targets) { - op->nprocs = opal_list_get_size(targets); - - /* convert the list of procs to an array - * of pmix_proc_t */ - PMIX_PROC_CREATE(op->procs, op->nprocs); - n=0; - OPAL_LIST_FOREACH(ptr, targets, opal_namelist_t) { - if (NULL == (nsptr = ext2x_convert_jobid(ptr->name.jobid))) { - OBJ_RELEASE(op); - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - return OPAL_ERR_NOT_FOUND; - } - (void)opal_string_copy(op->procs[n].nspace, nsptr, PMIX_MAX_NSLEN); - op->procs[n].rank = ext2x_convert_opalrank(ptr->name.vpid); - ++n; - } - } - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - - if (NULL != directives && 0 < (op->ninfo = opal_list_get_size(directives))) { - PMIX_INFO_CREATE(op->info, op->ninfo); - n=0; - OPAL_LIST_FOREACH(iptr, directives, opal_value_t) { - (void)opal_string_copy(op->info[n].key, iptr->key, PMIX_MAX_KEYLEN); - ext2x_value_load(&op->info[n].value, iptr); - ++n; - } - } - - rc = PMIx_Job_control_nb(op->procs,op->nprocs, op->info, op->ninfo, infocbfunc, op); - if (PMIX_SUCCESS != rc) { - OBJ_RELEASE(op); - } - return ext2x_convert_rc(rc); -} diff --git a/opal/mca/pmix/ext2x/ext2x_component.c b/opal/mca/pmix/ext2x/ext2x_component.c deleted file mode 100644 index cf60a7ee8f3..00000000000 --- a/opal/mca/pmix/ext2x/ext2x_component.c +++ /dev/null @@ -1,158 +0,0 @@ -/* - * Copyright (c) 2014-2018 Intel, Inc. All rights reserved. - * Copyright (c) 2014-2015 Research Organization for Information Science - * and Technology (RIST). All rights reserved. - * Copyright (c) 2016-2018 Cisco Systems, 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 "opal_config.h" - -#include "opal/constants.h" -#include "opal/class/opal_list.h" -#include "opal/util/proc.h" -#include "opal/util/show_help.h" -#include "opal/mca/pmix/pmix.h" -#include "ext2x.h" - -/* - * Public string showing the pmix external component version number - */ -const char *opal_pmix_ext2x_component_version_string = - "OPAL ext2x MCA component version " OPAL_VERSION; - -/* - * Local function - */ -static int external_register(void); -static int external_open(void); -static int external_close(void); -static int external_component_query(mca_base_module_t **module, int *priority); - -/* - * Local variable - */ -static char *pmix_library_version = NULL; - - -/* - * Instantiate the public struct with all of our public information - * and pointers to our public functions in it - */ - -mca_pmix_ext2x_component_t mca_pmix_ext2x_component = { - { - /* First, the mca_component_t struct containing meta information - about the component itself */ - - .base_version = { - /* Indicate that we are a pmix v1.1.0 component (which also - implies a specific MCA version) */ - - OPAL_PMIX_BASE_VERSION_2_0_0, - - /* Component name and version */ - - .mca_component_name = "ext2x", - MCA_BASE_MAKE_VERSION(component, OPAL_MAJOR_VERSION, OPAL_MINOR_VERSION, - OPAL_RELEASE_VERSION), - - /* Component open and close functions */ - - .mca_open_component = external_open, - .mca_close_component = external_close, - .mca_query_component = external_component_query, - .mca_register_component_params = external_register - }, - /* Next the MCA v1.0.0 component meta data */ - .base_data = { - /* The component is checkpoint ready */ - MCA_BASE_METADATA_PARAM_CHECKPOINT - } - }, - .legacy_get = true, - .native_launch = false -}; - -static int external_register(void) -{ - mca_base_component_t *component = &mca_pmix_ext2x_component.super.base_version; - - mca_pmix_ext2x_component.silence_warning = false; - (void) mca_base_component_var_register (component, "silence_warning", - "Silence warning about PMIX_INSTALL_PREFIX", - MCA_BASE_VAR_TYPE_BOOL, NULL, 0, 0, - OPAL_INFO_LVL_4, - MCA_BASE_VAR_SCOPE_READONLY, - &mca_pmix_ext2x_component.silence_warning); - - asprintf(&pmix_library_version, "PMIx library version %s", PMIx_Get_version()); - (void) mca_base_component_var_register(component, "library_version", - "Version of the underlying PMIx library", - MCA_BASE_VAR_TYPE_STRING, - NULL, 0, 0, - OPAL_INFO_LVL_4, - MCA_BASE_VAR_SCOPE_CONSTANT, - &pmix_library_version); - - return OPAL_SUCCESS; -} - -static int external_open(void) -{ - const char *version; - - mca_pmix_ext2x_component.evindex = 0; - OBJ_CONSTRUCT(&mca_pmix_ext2x_component.jobids, opal_list_t); - OBJ_CONSTRUCT(&mca_pmix_ext2x_component.events, opal_list_t); - OBJ_CONSTRUCT(&mca_pmix_ext2x_component.dmdx, opal_list_t); - - version = PMIx_Get_version(); - if ('2' > version[0]) { - opal_show_help("help-pmix-base.txt", - "incorrect-pmix", true, version, "v2.x"); - return OPAL_ERROR; - } - if (0 != strncmp(version, "2.0", 3)) { - mca_pmix_ext2x_component.legacy_get = false; - } - - return OPAL_SUCCESS; -} - -static int external_close(void) -{ - OPAL_LIST_DESTRUCT(&mca_pmix_ext2x_component.jobids); - OPAL_LIST_DESTRUCT(&mca_pmix_ext2x_component.events); - OPAL_LIST_DESTRUCT(&mca_pmix_ext2x_component.dmdx); - return OPAL_SUCCESS; -} - - -static int external_component_query(mca_base_module_t **module, int *priority) -{ - char *t, *id; - - /* see if a PMIx server is present */ - if (NULL != (t = getenv("PMIX_SERVER_URI")) || - NULL != (t = getenv("PMIX_SERVER_URI2")) || - NULL != (id = getenv("PMIX_ID"))) { - /* if PMIx is present, then we are a client and need to use it */ - *priority = 100; - } else { - /* we could be a server, so we still need to be considered */ - *priority = 5; - } - *module = (mca_base_module_t *)&opal_pmix_ext2x_module; - return OPAL_SUCCESS; -} diff --git a/opal/mca/pmix/ext2x/ext2x_local.c b/opal/mca/pmix/ext2x/ext2x_local.c deleted file mode 100644 index 0c7e9074685..00000000000 --- a/opal/mca/pmix/ext2x/ext2x_local.c +++ /dev/null @@ -1,27 +0,0 @@ -/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ -/* - * Copyright (c) 2014-2017 Intel, Inc. All rights reserved. - * Copyright (c) 2014-2017 Research Organization for Information Science - * and Technology (RIST). All rights reserved. - * Copyright (c) 2014-2015 Mellanox Technologies, Inc. - * All rights reserved. - * Copyright (c) 2016 Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2017 Los Alamos National Security, LLC. All rights - * reserved. - * $COPYRIGHT$ - * - * Additional copyrights may follow - * - * $HEADER$ - */ - -#include "opal_config.h" -#include "opal/constants.h" - -#include "ext2x.h" - -int opal_pmix_ext2x_check_evars(void) -{ - /* a dummy function */ - return OPAL_SUCCESS; -} diff --git a/opal/mca/pmix/ext2x/ext2x_server_north.c b/opal/mca/pmix/ext2x/ext2x_server_north.c deleted file mode 100644 index be406eb6bf7..00000000000 --- a/opal/mca/pmix/ext2x/ext2x_server_north.c +++ /dev/null @@ -1,1264 +0,0 @@ -/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ -/* - * Copyright (c) 2014-2017 Intel, Inc. All rights reserved. - * Copyright (c) 2014-2017 Research Organization for Information Science - * and Technology (RIST). All rights reserved. - * Copyright (c) 2014-2015 Mellanox Technologies, Inc. - * All rights reserved. - * Copyright (c) 2016 Cisco Systems, Inc. All rights reserved. - * $COPYRIGHT$ - * - * Additional copyrights may follow - * - * $HEADER$ - */ - -#include "opal_config.h" -#include "opal/constants.h" -#include "opal/types.h" - -#ifdef HAVE_STRING_H -#include -#endif -#ifdef HAVE_UNISTD_H -#include -#endif - -#include "opal/dss/dss.h" -#include "opal/mca/event/event.h" -#include "opal/mca/hwloc/base/base.h" -#include "opal/runtime/opal.h" -#include "opal/runtime/opal_progress_threads.h" -#include "opal/threads/threads.h" -#include "opal/util/argv.h" -#include "opal/util/error.h" -#include "opal/util/output.h" -#include "opal/util/proc.h" -#include "opal/util/show_help.h" -#include "opal/util/string_copy.h" -#include "opal/mca/pmix/base/base.h" -#include "ext2x.h" - -#include "pmix.h" -#include "pmix_server.h" - -/**** N.O.R.T.H.B.O.U.N.D I.N.T.E.R.F.A.C.E.S ****/ - -/* These are the interfaces used by the embedded PMIx server - * to call up into ORTE for service requests */ - -static pmix_status_t server_client_connected_fn(const pmix_proc_t *proc, void* server_object, - pmix_op_cbfunc_t cbfunc, void *cbdata); -static pmix_status_t server_client_finalized_fn(const pmix_proc_t *proc, void* server_object, - pmix_op_cbfunc_t cbfunc, void *cbdata); -static pmix_status_t server_abort_fn(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); -static pmix_status_t server_fencenb_fn(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); -static pmix_status_t server_dmodex_req_fn(const pmix_proc_t *proc, - const pmix_info_t info[], size_t ninfo, - pmix_modex_cbfunc_t cbfunc, void *cbdata); -static pmix_status_t server_publish_fn(const pmix_proc_t *proc, - const pmix_info_t info[], size_t ninfo, - pmix_op_cbfunc_t cbfunc, void *cbdata); -static pmix_status_t server_lookup_fn(const pmix_proc_t *proc, char **keys, - const pmix_info_t info[], size_t ninfo, - pmix_lookup_cbfunc_t cbfunc, void *cbdata); -static pmix_status_t server_unpublish_fn(const pmix_proc_t *proc, char **keys, - const pmix_info_t info[], size_t ninfo, - pmix_op_cbfunc_t cbfunc, void *cbdata); -static pmix_status_t server_spawn_fn(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); -static pmix_status_t server_connect_fn(const pmix_proc_t procs[], size_t nprocs, - const pmix_info_t info[], size_t ninfo, - pmix_op_cbfunc_t cbfunc, void *cbdata); -static pmix_status_t server_disconnect_fn(const pmix_proc_t procs[], size_t nprocs, - const pmix_info_t info[], size_t ninfo, - pmix_op_cbfunc_t cbfunc, void *cbdata); -static pmix_status_t server_register_events(pmix_status_t *codes, size_t ncodes, - const pmix_info_t info[], size_t ninfo, - pmix_op_cbfunc_t cbfunc, void *cbdata); -static pmix_status_t server_deregister_events(pmix_status_t *codes, size_t ncodes, - pmix_op_cbfunc_t cbfunc, void *cbdata); -static pmix_status_t server_notify_event(pmix_status_t code, - const pmix_proc_t *source, - pmix_data_range_t range, - pmix_info_t info[], size_t ninfo, - pmix_op_cbfunc_t cbfunc, void *cbdata); -static pmix_status_t server_query(pmix_proc_t *proct, - pmix_query_t *queryies, size_t nqueries, - pmix_info_cbfunc_t cbfunc, - void *cbdata); -static void server_tool_connection(pmix_info_t *info, size_t ninfo, - pmix_tool_connection_cbfunc_t cbfunc, - void *cbdata); -static void server_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); - -static pmix_status_t server_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); - -static pmix_status_t server_job_control(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); - -pmix_server_module_t mymodule = { - .client_connected = server_client_connected_fn, - .client_finalized = server_client_finalized_fn, - .abort = server_abort_fn, - .fence_nb = server_fencenb_fn, - .direct_modex = server_dmodex_req_fn, - .publish = server_publish_fn, - .lookup = server_lookup_fn, - .unpublish = server_unpublish_fn, - .spawn = server_spawn_fn, - .connect = server_connect_fn, - .disconnect = server_disconnect_fn, - .register_events = server_register_events, - .deregister_events = server_deregister_events, - .notify_event = server_notify_event, - .query = server_query, - .tool_connected = server_tool_connection, - .log = server_log, - .allocate = server_allocate, - .job_control = server_job_control - /* we do not support monitoring, but use the - * PMIx internal monitoring capability */ -}; - -opal_pmix_server_module_t *host_module = NULL; - - -static void opal_opcbfunc(int status, void *cbdata) -{ - ext2x_opalcaddy_t *opalcaddy = (ext2x_opalcaddy_t*)cbdata; - - OPAL_ACQUIRE_OBJECT(opalcaddy); - if (NULL != opalcaddy->opcbfunc) { - opalcaddy->opcbfunc(ext2x_convert_opalrc(status), opalcaddy->cbdata); - } - OBJ_RELEASE(opalcaddy); -} - -static pmix_status_t server_client_connected_fn(const pmix_proc_t *p, void *server_object, - pmix_op_cbfunc_t cbfunc, void *cbdata) -{ - int rc; - opal_process_name_t proc; - ext2x_opalcaddy_t *opalcaddy; - - if (NULL == host_module || NULL == host_module->client_connected) { - return PMIX_SUCCESS; - } - - opalcaddy = OBJ_NEW(ext2x_opalcaddy_t); - opalcaddy->opcbfunc = cbfunc; - opalcaddy->cbdata = cbdata; - - /* convert the nspace/rank to an opal_process_name_t */ - if (OPAL_SUCCESS != (rc = opal_convert_string_to_jobid(&proc.jobid, p->nspace))) { - return ext2x_convert_opalrc(rc); - } - proc.vpid = ext2x_convert_rank(p->rank); - - /* pass it up */ - rc = host_module->client_connected(&proc, server_object, - opal_opcbfunc, opalcaddy); - return ext2x_convert_opalrc(rc); -} - -static pmix_status_t server_client_finalized_fn(const pmix_proc_t *p, void* server_object, - pmix_op_cbfunc_t cbfunc, void *cbdata) -{ - int rc; - ext2x_opalcaddy_t *opalcaddy; - opal_process_name_t proc; - - if (NULL == host_module || NULL == host_module->client_finalized) { - return PMIX_SUCCESS; - } - - /* convert the nspace/rank to an opal_process_name_t */ - if (OPAL_SUCCESS != (rc = opal_convert_string_to_jobid(&proc.jobid, p->nspace))) { - return ext2x_convert_opalrc(rc); - } - proc.vpid = ext2x_convert_rank(p->rank); - - /* setup the caddy */ - opalcaddy = OBJ_NEW(ext2x_opalcaddy_t); - opalcaddy->opcbfunc = cbfunc; - opalcaddy->cbdata = cbdata; - - /* pass it up */ - opal_output_verbose(3, opal_pmix_base_framework.framework_output, - "%s CLIENT %s FINALIZED", - OPAL_NAME_PRINT(OPAL_PROC_MY_NAME), - OPAL_NAME_PRINT(proc)); - rc = host_module->client_finalized(&proc, server_object, opal_opcbfunc, opalcaddy); - if (OPAL_SUCCESS != rc) { - OBJ_RELEASE(opalcaddy); - } - return ext2x_convert_opalrc(rc); -} - -static pmix_status_t server_abort_fn(const pmix_proc_t *p, void *server_object, - int status, const char msg[], - pmix_proc_t procs[], size_t nprocs, - pmix_op_cbfunc_t cbfunc, void *cbdata) -{ - size_t n; - opal_namelist_t *nm; - opal_process_name_t proc; - int rc; - ext2x_opalcaddy_t *opalcaddy; - - if (NULL == host_module || NULL == host_module->abort) { - return PMIX_ERR_NOT_SUPPORTED; - } - - /* convert the nspace/rank to an opal_process_name_t */ - if (OPAL_SUCCESS != (rc = opal_convert_string_to_jobid(&proc.jobid, p->nspace))) { - return ext2x_convert_opalrc(rc); - } - proc.vpid = ext2x_convert_rank(p->rank); - - opal_output_verbose(3, opal_pmix_base_framework.framework_output, - "%s CLIENT %s CALLED ABORT", - OPAL_NAME_PRINT(OPAL_PROC_MY_NAME), - OPAL_NAME_PRINT(proc)); - - /* setup the caddy */ - opalcaddy = OBJ_NEW(ext2x_opalcaddy_t); - opalcaddy->opcbfunc = cbfunc; - opalcaddy->cbdata = cbdata; - - /* convert the array of pmix_proc_t to the list of procs */ - for (n=0; n < nprocs; n++) { - nm = OBJ_NEW(opal_namelist_t); - opal_list_append(&opalcaddy->procs, &nm->super); - if (OPAL_SUCCESS != (rc = opal_convert_string_to_jobid(&nm->name.jobid, procs[n].nspace))) { - OBJ_RELEASE(opalcaddy); - return ext2x_convert_opalrc(rc); - } - nm->name.vpid = ext2x_convert_rank(procs[n].rank); - } - - /* pass it up */ - rc = host_module->abort(&proc, server_object, status, msg, - &opalcaddy->procs, opal_opcbfunc, opalcaddy); - if (OPAL_SUCCESS != rc) { - OBJ_RELEASE(opalcaddy); - } - return ext2x_convert_opalrc(rc); -} - -static void _data_release(void *cbdata) -{ - ext2x_opalcaddy_t *opalcaddy = (ext2x_opalcaddy_t*)cbdata; - - if (NULL != opalcaddy->odmdxfunc) { - opalcaddy->odmdxfunc(opalcaddy->ocbdata); - } - OBJ_RELEASE(opalcaddy); -} - -static void opmdx_response(int status, const char *data, size_t sz, void *cbdata, - opal_pmix_release_cbfunc_t relcbfunc, void *relcbdata) -{ - pmix_status_t rc; - ext2x_opalcaddy_t *opalcaddy = (ext2x_opalcaddy_t*)cbdata; - opal_ext2x_dmx_trkr_t *dmdx; - - rc = ext2x_convert_rc(status); - if (NULL != opalcaddy->mdxcbfunc) { - opalcaddy->odmdxfunc = relcbfunc; - opalcaddy->ocbdata = relcbdata; - opalcaddy->mdxcbfunc(rc, data, sz, opalcaddy->cbdata, - _data_release, opalcaddy); - /* if we were collecting all data, then check for any pending - * dmodx requests that we cached and notify them that the - * data has arrived */ - OPAL_PMIX_ACQUIRE_THREAD(&opal_pmix_base.lock); - while (NULL != (dmdx = (opal_ext2x_dmx_trkr_t*)opal_list_remove_first(&mca_pmix_ext2x_component.dmdx))) { - dmdx->cbfunc(PMIX_SUCCESS, NULL, 0, dmdx->cbdata, NULL, NULL); - OBJ_RELEASE(dmdx); - } - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - } else { - OBJ_RELEASE(opalcaddy); - } -} - -static pmix_status_t server_fencenb_fn(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) -{ - ext2x_opalcaddy_t *opalcaddy; - size_t n; - opal_namelist_t *nm; - opal_value_t *iptr; - int rc; - - opal_output_verbose(3, opal_pmix_base_framework.framework_output, - "%s FENCE CALLED", OPAL_NAME_PRINT(OPAL_PROC_MY_NAME)); - - if (NULL == host_module || NULL == host_module->fence_nb) { - return PMIX_ERR_NOT_SUPPORTED; - } - /* setup the caddy */ - opalcaddy = OBJ_NEW(ext2x_opalcaddy_t); - opalcaddy->mdxcbfunc = cbfunc; - opalcaddy->cbdata = cbdata; - - /* convert the array of pmix_proc_t to the list of procs */ - for (n=0; n < nprocs; n++) { - nm = OBJ_NEW(opal_namelist_t); - opal_list_append(&opalcaddy->procs, &nm->super); - if (OPAL_SUCCESS != (rc = opal_convert_string_to_jobid(&nm->name.jobid, procs[n].nspace))) { - OBJ_RELEASE(opalcaddy); - return ext2x_convert_opalrc(rc); - } - nm->name.vpid = ext2x_convert_rank(procs[n].rank); - } - - /* convert the array of pmix_info_t to the list of info */ - for (n=0; n < ninfo; n++) { - iptr = OBJ_NEW(opal_value_t); - opal_list_append(&opalcaddy->info, &iptr->super); - iptr->key = strdup(info[n].key); - if (OPAL_SUCCESS != (rc = ext2x_value_unload(iptr, &info[n].value))) { - OBJ_RELEASE(opalcaddy); - return ext2x_convert_opalrc(rc); - } - } - - /* pass it up */ - rc = host_module->fence_nb(&opalcaddy->procs, &opalcaddy->info, - data, ndata, opmdx_response, opalcaddy); - if (OPAL_SUCCESS != rc) { - OBJ_RELEASE(opalcaddy); - } - return ext2x_convert_opalrc(rc); -} - -static pmix_status_t server_dmodex_req_fn(const pmix_proc_t *p, - const pmix_info_t info[], size_t ninfo, - pmix_modex_cbfunc_t cbfunc, void *cbdata) -{ - int rc; - ext2x_opalcaddy_t *opalcaddy; - opal_process_name_t proc; - opal_value_t *iptr; - size_t n; - opal_ext2x_dmx_trkr_t *dmdx; - - if (NULL == host_module || NULL == host_module->direct_modex) { - return PMIX_ERR_NOT_SUPPORTED; - } - - /* convert the nspace/rank to an opal_process_name_t */ - if (OPAL_SUCCESS != (rc = opal_convert_string_to_jobid(&proc.jobid, p->nspace))) { - return ext2x_convert_opalrc(rc); - } - proc.vpid = ext2x_convert_rank(p->rank); - - opal_output_verbose(3, opal_pmix_base_framework.framework_output, - "%s CLIENT %s CALLED DMODX", - OPAL_NAME_PRINT(OPAL_PROC_MY_NAME), - OPAL_NAME_PRINT(proc)); - - /* setup the caddy */ - opalcaddy = OBJ_NEW(ext2x_opalcaddy_t); - opalcaddy->mdxcbfunc = cbfunc; - opalcaddy->cbdata = cbdata; - - /* this function should only get called if we are in an async modex. - * If we are also collecting data, then the fence_nb will eventually - * complete and return all the required data down to the pmix - * server beneath us. Thus, we only need to track the dmodex_req - * and ensure that the release gets called once the data has - * arrived - this will trigger the pmix server to tell the - * client that the data is available */ - if (opal_pmix_base_async_modex && opal_pmix_collect_all_data) { - OPAL_PMIX_ACQUIRE_THREAD(&opal_pmix_base.lock); - dmdx = OBJ_NEW(opal_ext2x_dmx_trkr_t); - dmdx->cbfunc = cbfunc; - dmdx->cbdata = cbdata; - opal_list_append(&mca_pmix_ext2x_component.dmdx, &dmdx->super); - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - return PMIX_SUCCESS; - } - - /* convert the array of pmix_info_t to the list of info */ - for (n=0; n < ninfo; n++) { - iptr = OBJ_NEW(opal_value_t); - opal_list_append(&opalcaddy->info, &iptr->super); - iptr->key = strdup(info[n].key); - if (OPAL_SUCCESS != (rc = ext2x_value_unload(iptr, &info[n].value))) { - OBJ_RELEASE(opalcaddy); - return ext2x_convert_opalrc(rc); - } - } - - /* pass it up */ - rc = host_module->direct_modex(&proc, &opalcaddy->info, opmdx_response, opalcaddy); - if (OPAL_SUCCESS != rc && OPAL_ERR_IN_PROCESS != rc) { - OBJ_RELEASE(opalcaddy); - } - if (OPAL_ERR_IN_PROCESS == rc) { - rc = OPAL_SUCCESS; - } - return ext2x_convert_opalrc(rc); -} - -static pmix_status_t server_publish_fn(const pmix_proc_t *p, - const pmix_info_t info[], size_t ninfo, - pmix_op_cbfunc_t cbfunc, void *cbdata) -{ - int rc; - size_t n; - ext2x_opalcaddy_t *opalcaddy; - opal_process_name_t proc; - opal_value_t *oinfo; - - if (NULL == host_module || NULL == host_module->publish) { - return PMIX_ERR_NOT_SUPPORTED; - } - - /* convert the nspace/rank to an opal_process_name_t */ - if (OPAL_SUCCESS != (rc = opal_convert_string_to_jobid(&proc.jobid, p->nspace))) { - return ext2x_convert_opalrc(rc); - } - proc.vpid = ext2x_convert_rank(p->rank); - - opal_output_verbose(3, opal_pmix_base_framework.framework_output, - "%s CLIENT %s CALLED PUBLISH", - OPAL_NAME_PRINT(OPAL_PROC_MY_NAME), - OPAL_NAME_PRINT(proc)); - - /* setup the caddy */ - opalcaddy = OBJ_NEW(ext2x_opalcaddy_t); - opalcaddy->opcbfunc = cbfunc; - opalcaddy->cbdata = cbdata; - - /* convert the info array */ - for (n=0; n < ninfo; n++) { - oinfo = OBJ_NEW(opal_value_t); - opal_list_append(&opalcaddy->info, &oinfo->super); - oinfo->key = strdup(info[n].key); - if (OPAL_SUCCESS != (rc = ext2x_value_unload(oinfo, &info[n].value))) { - OBJ_RELEASE(opalcaddy); - return ext2x_convert_opalrc(rc); - } - } - - /* pass it up */ - rc = host_module->publish(&proc, &opalcaddy->info, opal_opcbfunc, opalcaddy); - if (OPAL_SUCCESS != rc) { - OBJ_RELEASE(opalcaddy); - } - - return ext2x_convert_opalrc(rc); -} - -static void opal_lkupcbfunc(int status, - opal_list_t *data, - void *cbdata) -{ - ext2x_opalcaddy_t *opalcaddy = (ext2x_opalcaddy_t*)cbdata; - pmix_status_t rc; - pmix_pdata_t *d=NULL; - size_t nd=0, n; - opal_pmix_pdata_t *p; - - if (NULL != opalcaddy->lkupcbfunc) { - rc = ext2x_convert_opalrc(status); - /* convert any returned data */ - if (NULL != data) { - nd = opal_list_get_size(data); - PMIX_PDATA_CREATE(d, nd); - n=0; - OPAL_LIST_FOREACH(p, data, opal_pmix_pdata_t) { - /* convert the jobid */ - (void)opal_snprintf_jobid(d[n].proc.nspace, PMIX_MAX_NSLEN, p->proc.jobid); - d[n].proc.rank = ext2x_convert_opalrank(p->proc.vpid); - (void)opal_string_copy(d[n].key, p->value.key, PMIX_MAX_KEYLEN); - ext2x_value_load(&d[n].value, &p->value); - } - } - opalcaddy->lkupcbfunc(rc, d, nd, opalcaddy->cbdata); - PMIX_PDATA_FREE(d, nd); - } - OBJ_RELEASE(opalcaddy); -} - -static pmix_status_t server_lookup_fn(const pmix_proc_t *p, char **keys, - const pmix_info_t info[], size_t ninfo, - pmix_lookup_cbfunc_t cbfunc, void *cbdata) -{ - int rc; - ext2x_opalcaddy_t *opalcaddy; - opal_process_name_t proc; - opal_value_t *iptr; - size_t n; - - if (NULL == host_module || NULL == host_module->lookup) { - return PMIX_ERR_NOT_SUPPORTED; - } - - /* convert the nspace/rank to an opal_process_name_t */ - if (OPAL_SUCCESS != (rc = opal_convert_string_to_jobid(&proc.jobid, p->nspace))) { - return ext2x_convert_opalrc(rc); - } - proc.vpid = ext2x_convert_rank(p->rank); - - opal_output_verbose(3, opal_pmix_base_framework.framework_output, - "%s CLIENT %s CALLED LOOKUP", - OPAL_NAME_PRINT(OPAL_PROC_MY_NAME), - OPAL_NAME_PRINT(proc)); - - /* setup the caddy */ - opalcaddy = OBJ_NEW(ext2x_opalcaddy_t); - opalcaddy->lkupcbfunc = cbfunc; - opalcaddy->cbdata = cbdata; - - /* convert the array of pmix_info_t to the list of info */ - for (n=0; n < ninfo; n++) { - iptr = OBJ_NEW(opal_value_t); - opal_list_append(&opalcaddy->info, &iptr->super); - iptr->key = strdup(info[n].key); - if (OPAL_SUCCESS != (rc = ext2x_value_unload(iptr, &info[n].value))) { - OBJ_RELEASE(opalcaddy); - return ext2x_convert_opalrc(rc); - } - } - - /* pass it up */ - rc = host_module->lookup(&proc, keys, &opalcaddy->info, opal_lkupcbfunc, opalcaddy); - if (OPAL_SUCCESS != rc) { - OBJ_RELEASE(opalcaddy); - } - - return ext2x_convert_opalrc(rc); -} - - -static pmix_status_t server_unpublish_fn(const pmix_proc_t *p, char **keys, - const pmix_info_t info[], size_t ninfo, - pmix_op_cbfunc_t cbfunc, void *cbdata) -{ - int rc; - ext2x_opalcaddy_t *opalcaddy; - opal_process_name_t proc; - opal_value_t *iptr; - size_t n; - - if (NULL == host_module || NULL == host_module->unpublish) { - return PMIX_SUCCESS; - } - - /* convert the nspace/rank to an opal_process_name_t */ - if (OPAL_SUCCESS != (rc = opal_convert_string_to_jobid(&proc.jobid, p->nspace))) { - return ext2x_convert_opalrc(rc); - } - proc.vpid = ext2x_convert_rank(p->rank); - - opal_output_verbose(3, opal_pmix_base_framework.framework_output, - "%s CLIENT %s CALLED UNPUBLISH", - OPAL_NAME_PRINT(OPAL_PROC_MY_NAME), - OPAL_NAME_PRINT(proc)); - - /* setup the caddy */ - opalcaddy = OBJ_NEW(ext2x_opalcaddy_t); - opalcaddy->opcbfunc = cbfunc; - opalcaddy->cbdata = cbdata; - - /* convert the array of pmix_info_t to the list of info */ - for (n=0; n < ninfo; n++) { - iptr = OBJ_NEW(opal_value_t); - opal_list_append(&opalcaddy->info, &iptr->super); - iptr->key = strdup(info[n].key); - if (OPAL_SUCCESS != (rc = ext2x_value_unload(iptr, &info[n].value))) { - OBJ_RELEASE(opalcaddy); - return ext2x_convert_opalrc(rc); - } - } - - /* pass it up */ - rc = host_module->unpublish(&proc, keys, &opalcaddy->info, opal_opcbfunc, opalcaddy); - if (OPAL_SUCCESS != rc) { - OBJ_RELEASE(opalcaddy); - } - - return ext2x_convert_opalrc(rc); -} - -static void opal_spncbfunc(int status, opal_jobid_t jobid, void *cbdata) -{ - ext2x_opalcaddy_t *opalcaddy = (ext2x_opalcaddy_t*)cbdata; - pmix_status_t rc; - char nspace[PMIX_MAX_NSLEN]; - - if (NULL != opalcaddy->spwncbfunc) { - rc = ext2x_convert_opalrc(status); - /* convert the jobid */ - (void)opal_snprintf_jobid(nspace, PMIX_MAX_NSLEN, jobid); - opalcaddy->spwncbfunc(rc, nspace, opalcaddy->cbdata); - } - OBJ_RELEASE(opalcaddy); -} - -static pmix_status_t server_spawn_fn(const pmix_proc_t *p, - const pmix_info_t job_info[], size_t ninfo, - const pmix_app_t apps[], size_t napps, - pmix_spawn_cbfunc_t cbfunc, void *cbdata) -{ - ext2x_opalcaddy_t *opalcaddy; - opal_process_name_t proc; - opal_pmix_app_t *app; - opal_value_t *oinfo; - size_t k, n; - int rc; - - if (NULL == host_module || NULL == host_module->spawn) { - return PMIX_ERR_NOT_SUPPORTED; - } - - /* convert the nspace/rank to an opal_process_name_t */ - if (OPAL_SUCCESS != (rc = opal_convert_string_to_jobid(&proc.jobid, p->nspace))) { - return ext2x_convert_opalrc(rc); - } - proc.vpid = ext2x_convert_rank(p->rank); - - /* setup the caddy */ - opalcaddy = OBJ_NEW(ext2x_opalcaddy_t); - opalcaddy->spwncbfunc = cbfunc; - opalcaddy->cbdata = cbdata; - - /* convert the job info */ - for (k=0; k < ninfo; k++) { - oinfo = OBJ_NEW(opal_value_t); - opal_list_append(&opalcaddy->info, &oinfo->super); - oinfo->key = strdup(job_info[k].key); - if (OPAL_SUCCESS != (rc = ext2x_value_unload(oinfo, &job_info[k].value))) { - OBJ_RELEASE(opalcaddy); - return ext2x_convert_opalrc(rc); - } - } - - /* convert the apps */ - for (n=0; n < napps; n++) { - app = OBJ_NEW(opal_pmix_app_t); - opal_list_append(&opalcaddy->apps, &app->super); - if (NULL != apps[n].cmd) { - app->cmd = strdup(apps[n].cmd); - } - if (NULL != apps[n].argv) { - app->argv = opal_argv_copy(apps[n].argv); - } - if (NULL != apps[n].env) { - app->env = opal_argv_copy(apps[n].env); - } - if (NULL != apps[n].cwd) { - app->cwd = strdup(apps[n].cwd); - } - app->maxprocs = apps[n].maxprocs; - for (k=0; k < apps[n].ninfo; k++) { - oinfo = OBJ_NEW(opal_value_t); - opal_list_append(&app->info, &oinfo->super); - oinfo->key = strdup(apps[n].info[k].key); - if (OPAL_SUCCESS != (rc = ext2x_value_unload(oinfo, &apps[n].info[k].value))) { - OBJ_RELEASE(opalcaddy); - return ext2x_convert_opalrc(rc); - } - } - } - - /* pass it up */ - rc = host_module->spawn(&proc, &opalcaddy->info, &opalcaddy->apps, opal_spncbfunc, opalcaddy); - if (OPAL_SUCCESS != rc) { - OPAL_ERROR_LOG(rc); - OBJ_RELEASE(opalcaddy); - } - - return ext2x_convert_opalrc(rc); -} - - -static pmix_status_t server_connect_fn(const pmix_proc_t procs[], size_t nprocs, - const pmix_info_t info[], size_t ninfo, - pmix_op_cbfunc_t cbfunc, void *cbdata) -{ - int rc; - ext2x_opalcaddy_t *opalcaddy; - opal_namelist_t *nm; - size_t n; - opal_value_t *oinfo; - - if (NULL == host_module || NULL == host_module->connect) { - return PMIX_ERR_NOT_SUPPORTED; - } - - /* setup the caddy */ - opalcaddy = OBJ_NEW(ext2x_opalcaddy_t); - opalcaddy->opcbfunc = cbfunc; - opalcaddy->cbdata = cbdata; - - /* convert the array of pmix_proc_t to the list of procs */ - for (n=0; n < nprocs; n++) { - nm = OBJ_NEW(opal_namelist_t); - opal_list_append(&opalcaddy->procs, &nm->super); - if (OPAL_SUCCESS != (rc = opal_convert_string_to_jobid(&nm->name.jobid, procs[n].nspace))) { - OBJ_RELEASE(opalcaddy); - return ext2x_convert_opalrc(rc); - } - nm->name.vpid = ext2x_convert_rank(procs[n].rank); - } - - /* convert the info */ - for (n=0; n < ninfo; n++) { - oinfo = OBJ_NEW(opal_value_t); - opal_list_append(&opalcaddy->info, &oinfo->super); - oinfo->key = strdup(info[n].key); - if (OPAL_SUCCESS != (rc = ext2x_value_unload(oinfo, &info[n].value))) { - OBJ_RELEASE(opalcaddy); - return ext2x_convert_opalrc(rc); - } - } - - /* pass it up */ - rc = host_module->connect(&opalcaddy->procs, &opalcaddy->info, opal_opcbfunc, opalcaddy); - if (OPAL_SUCCESS != rc) { - OBJ_RELEASE(opalcaddy); - } - - return ext2x_convert_opalrc(rc); -} - - -static pmix_status_t server_disconnect_fn(const pmix_proc_t procs[], size_t nprocs, - const pmix_info_t info[], size_t ninfo, - pmix_op_cbfunc_t cbfunc, void *cbdata) -{ - int rc; - ext2x_opalcaddy_t *opalcaddy; - opal_namelist_t *nm; - size_t n; - opal_value_t *oinfo; - - if (NULL == host_module || NULL == host_module->disconnect) { - return PMIX_ERR_NOT_SUPPORTED; - } - - /* setup the caddy */ - opalcaddy = OBJ_NEW(ext2x_opalcaddy_t); - opalcaddy->opcbfunc = cbfunc; - opalcaddy->cbdata = cbdata; - - /* convert the array of pmix_proc_t to the list of procs */ - for (n=0; n < nprocs; n++) { - nm = OBJ_NEW(opal_namelist_t); - opal_list_append(&opalcaddy->procs, &nm->super); - if (OPAL_SUCCESS != (rc = opal_convert_string_to_jobid(&nm->name.jobid, procs[n].nspace))) { - OBJ_RELEASE(opalcaddy); - return ext2x_convert_opalrc(rc); - } - nm->name.vpid = ext2x_convert_rank(procs[n].rank); - } - - /* convert the info */ - for (n=0; n < ninfo; n++) { - oinfo = OBJ_NEW(opal_value_t); - opal_list_append(&opalcaddy->info, &oinfo->super); - oinfo->key = strdup(info[n].key); - if (OPAL_SUCCESS != (rc = ext2x_value_unload(oinfo, &info[n].value))) { - OBJ_RELEASE(opalcaddy); - return ext2x_convert_opalrc(rc); - } - } - - /* pass it up */ - rc = host_module->disconnect(&opalcaddy->procs, &opalcaddy->info, opal_opcbfunc, opalcaddy); - if (OPAL_SUCCESS != rc) { - OBJ_RELEASE(opalcaddy); - } - - return ext2x_convert_opalrc(rc); -} - -static pmix_status_t server_register_events(pmix_status_t *codes, size_t ncodes, - const pmix_info_t info[], size_t ninfo, - pmix_op_cbfunc_t cbfunc, void *cbdata) -{ - ext2x_opalcaddy_t *opalcaddy; - size_t n; - opal_value_t *oinfo; - int rc; - - opal_output_verbose(3, opal_pmix_base_framework.framework_output, - "%s REGISTER EVENTS", - OPAL_NAME_PRINT(OPAL_PROC_MY_NAME)); - - /* setup the caddy */ - opalcaddy = OBJ_NEW(ext2x_opalcaddy_t); - opalcaddy->opcbfunc = cbfunc; - opalcaddy->cbdata = cbdata; - - /* convert the info */ - for (n=0; n < ninfo; n++) { - oinfo = OBJ_NEW(opal_value_t); - opal_list_append(&opalcaddy->info, &oinfo->super); - oinfo->key = strdup(info[n].key); - if (OPAL_SUCCESS != (rc = ext2x_value_unload(oinfo, &info[n].value))) { - OBJ_RELEASE(opalcaddy); - return ext2x_convert_opalrc(rc); - } - } - - /* pass it up */ - rc = host_module->register_events(&opalcaddy->info, opal_opcbfunc, opalcaddy); - if (OPAL_SUCCESS != rc) { - OBJ_RELEASE(opalcaddy); - } - - return ext2x_convert_opalrc(rc); -} - -static pmix_status_t server_deregister_events(pmix_status_t *codes, size_t ncodes, - pmix_op_cbfunc_t cbfunc, void *cbdata) -{ - opal_output_verbose(3, opal_pmix_base_framework.framework_output, - "%s DEREGISTER EVENTS", OPAL_NAME_PRINT(OPAL_PROC_MY_NAME)); - - return PMIX_ERR_NOT_SUPPORTED; -} - -static pmix_status_t server_notify_event(pmix_status_t code, - const pmix_proc_t *source, - pmix_data_range_t range, - pmix_info_t info[], size_t ninfo, - pmix_op_cbfunc_t cbfunc, void *cbdata) -{ - ext2x_opalcaddy_t *opalcaddy; - opal_process_name_t src; - size_t n; - opal_value_t *oinfo; - int rc, status; - - if (NULL == host_module || NULL == host_module->notify_event) { - return PMIX_ERR_NOT_SUPPORTED; - } - - /* setup the caddy */ - opalcaddy = OBJ_NEW(ext2x_opalcaddy_t); - opalcaddy->opcbfunc = cbfunc; - opalcaddy->cbdata = cbdata; - - /* convert the code */ - status = ext2x_convert_rc(code); - - /* convert the source */ - if (OPAL_SUCCESS != (rc = opal_convert_string_to_jobid(&src.jobid, source->nspace))) { - OBJ_RELEASE(opalcaddy); - return ext2x_convert_opalrc(rc); - } - src.vpid = ext2x_convert_rank(source->rank); - - opal_output_verbose(3, opal_pmix_base_framework.framework_output, - "%s CLIENT %s CALLED NOTIFY", - OPAL_NAME_PRINT(OPAL_PROC_MY_NAME), - OPAL_NAME_PRINT(src)); - - /* ignore the range for now */ - - /* convert the info */ - for (n=0; n < ninfo; n++) { - oinfo = OBJ_NEW(opal_value_t); - opal_list_append(&opalcaddy->info, &oinfo->super); - oinfo->key = strdup(info[n].key); - if (OPAL_SUCCESS != (rc = ext2x_value_unload(oinfo, &info[n].value))) { - OBJ_RELEASE(opalcaddy); - return ext2x_convert_opalrc(rc); - } - } - - /* send it upstairs */ - if (OPAL_SUCCESS != (rc = host_module->notify_event(status, &src, &opalcaddy->info, - opal_opcbfunc, opalcaddy))) { - OBJ_RELEASE(opalcaddy); - } - return ext2x_convert_opalrc(rc); -} - -static void _info_rel(void *cbdata) -{ - ext2x_opcaddy_t *pcaddy = (ext2x_opcaddy_t*)cbdata; - - OBJ_RELEASE(pcaddy); -} -static void info_cbfunc(int status, - opal_list_t *info, - void *cbdata, - opal_pmix_release_cbfunc_t release_fn, - void *release_cbdata) -{ - ext2x_opalcaddy_t *opalcaddy = (ext2x_opalcaddy_t*)cbdata; - ext2x_opcaddy_t *pcaddy; - opal_value_t *kv; - size_t n; - - pcaddy = OBJ_NEW(ext2x_opcaddy_t); - - /* convert the status */ - pcaddy->status = ext2x_convert_opalrc(status); - - /* convert the list to a pmix_info_t array */ - if (NULL != info && 0 < (pcaddy->ninfo = opal_list_get_size(info))) { - PMIX_INFO_CREATE(pcaddy->info, pcaddy->ninfo); - n = 0; - OPAL_LIST_FOREACH(kv, info, opal_value_t) { - (void)opal_string_copy(pcaddy->info[n].key, kv->key, PMIX_MAX_KEYLEN); - ext2x_value_load(&pcaddy->info[n].value, kv); - } - } - /* we are done with the incoming data */ - if (NULL != release_fn) { - release_fn(release_cbdata); - } - - /* provide the answer downward */ - if (NULL != opalcaddy->infocbfunc) { - opalcaddy->infocbfunc(pcaddy->status, pcaddy->info, pcaddy->ninfo, - opalcaddy->cbdata, _info_rel, pcaddy); - } - OBJ_RELEASE(opalcaddy); -} - -static pmix_status_t server_query(pmix_proc_t *proct, - pmix_query_t *queries, size_t nqueries, - pmix_info_cbfunc_t cbfunc, - void *cbdata) -{ - ext2x_opalcaddy_t *opalcaddy; - opal_process_name_t requestor; - int rc; - size_t n, m; - opal_pmix_query_t *q; - opal_value_t *oinfo; - - if (NULL == host_module || NULL == host_module->query) { - return PMIX_ERR_NOT_SUPPORTED; - } - - /* setup the caddy */ - opalcaddy = OBJ_NEW(ext2x_opalcaddy_t); - opalcaddy->infocbfunc = cbfunc; - opalcaddy->cbdata = cbdata; - - /* convert the requestor */ - if (OPAL_SUCCESS != (rc = opal_convert_string_to_jobid(&requestor.jobid, proct->nspace))) { - OBJ_RELEASE(opalcaddy); - return ext2x_convert_opalrc(rc); - } - requestor.vpid = ext2x_convert_rank(proct->rank); - - opal_output_verbose(3, opal_pmix_base_framework.framework_output, - "%s CLIENT %s CALLED QUERY", - OPAL_NAME_PRINT(OPAL_PROC_MY_NAME), - OPAL_NAME_PRINT(requestor)); - - /* convert the queries */ - for (n=0; n < nqueries; n++) { - q = OBJ_NEW(opal_pmix_query_t); - /* we "borrow" the info field of the caddy as we and the - * server function both agree on what will be there */ - opal_list_append(&opalcaddy->info, &q->super); - q->keys = opal_argv_copy(queries[n].keys); - for (m=0; m < queries[n].nqual; m++) { - oinfo = OBJ_NEW(opal_value_t); - opal_list_append(&q->qualifiers, &oinfo->super); - oinfo->key = strdup(queries[n].qualifiers[m].key); - if (OPAL_SUCCESS != (rc = ext2x_value_unload(oinfo, &queries[n].qualifiers[m].value))) { - OBJ_RELEASE(opalcaddy); - return ext2x_convert_opalrc(rc); - } - } - } - - /* pass the call upwards */ - if (OPAL_SUCCESS != (rc = host_module->query(&requestor, - &opalcaddy->info, - info_cbfunc, opalcaddy))) { - OBJ_RELEASE(opalcaddy); - } - - return ext2x_convert_opalrc(rc); -} - -static void toolcbfunc(int status, - opal_process_name_t proc, - void *cbdata) -{ - ext2x_opalcaddy_t *opalcaddy = (ext2x_opalcaddy_t*)cbdata; - pmix_status_t rc; - pmix_proc_t p; - opal_ext2x_jobid_trkr_t *job; - - /* convert the status */ - rc = ext2x_convert_opalrc(status); - - memset(&p, 0, sizeof(pmix_proc_t)); - if (OPAL_SUCCESS == status) { - /* convert the process name */ - (void)opal_snprintf_jobid(p.nspace, PMIX_MAX_NSLEN, proc.jobid); - p.rank = ext2x_convert_opalrank(proc.vpid); - /* store this job in our list of known nspaces */ - job = OBJ_NEW(opal_ext2x_jobid_trkr_t); - (void)opal_string_copy(job->nspace, p.nspace, PMIX_MAX_NSLEN); - job->jobid = proc.jobid; - OPAL_PMIX_ACQUIRE_THREAD(&opal_pmix_base.lock); - opal_list_append(&mca_pmix_ext2x_component.jobids, &job->super); - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - } - - /* pass it down */ - if (NULL != opalcaddy->toolcbfunc) { - opalcaddy->toolcbfunc(rc, &p, opalcaddy->cbdata); - } - OBJ_RELEASE(opalcaddy); -} - -static void server_tool_connection(pmix_info_t *info, size_t ninfo, - pmix_tool_connection_cbfunc_t cbfunc, - void *cbdata) -{ - ext2x_opalcaddy_t *opalcaddy; - size_t n; - opal_value_t *oinfo; - int rc; - pmix_status_t err; - - /* setup the caddy */ - opalcaddy = OBJ_NEW(ext2x_opalcaddy_t); - opalcaddy->toolcbfunc = cbfunc; - opalcaddy->cbdata = cbdata; - - /* convert the info */ - for (n=0; n < ninfo; n++) { - oinfo = OBJ_NEW(opal_value_t); - opal_list_append(&opalcaddy->info, &oinfo->super); - oinfo->key = strdup(info[n].key); - if (OPAL_SUCCESS != (rc = ext2x_value_unload(oinfo, &info[n].value))) { - OBJ_RELEASE(opalcaddy); - err = ext2x_convert_opalrc(rc); - if (NULL != cbfunc) { - cbfunc(err, NULL, cbdata); - } - } - } - - /* pass it up */ - host_module->tool_connected(&opalcaddy->info, toolcbfunc, opalcaddy); -} - -static void server_log(const pmix_proc_t *proct, - const pmix_info_t data[], size_t ndata, - const pmix_info_t directives[], size_t ndirs, - pmix_op_cbfunc_t cbfunc, void *cbdata) -{ - ext2x_opalcaddy_t *opalcaddy; - opal_process_name_t requestor; - int rc; - size_t n; - opal_value_t *oinfo; - pmix_status_t ret; - - if (NULL == host_module || NULL == host_module->log) { - if (NULL != cbfunc) { - cbfunc(PMIX_ERR_NOT_SUPPORTED, cbdata); - } - return; - } - - /* setup the caddy */ - opalcaddy = OBJ_NEW(ext2x_opalcaddy_t); - opalcaddy->opcbfunc = cbfunc; - opalcaddy->cbdata = cbdata; - - /* convert the requestor */ - if (OPAL_SUCCESS != (rc = opal_convert_string_to_jobid(&requestor.jobid, proct->nspace))) { - OBJ_RELEASE(opalcaddy); - ret = ext2x_convert_opalrc(rc); - if (NULL != cbfunc) { - cbfunc(ret, cbdata); - } - return; - } - requestor.vpid = ext2x_convert_rank(proct->rank); - - /* convert the data */ - for (n=0; n < ndata; n++) { - oinfo = OBJ_NEW(opal_value_t); - oinfo->key = strdup(data[n].key); - /* we "borrow" the info field of the caddy as we and the - * server function both agree on what will be there */ - opal_list_append(&opalcaddy->info, &oinfo->super); - if (OPAL_SUCCESS != (rc = ext2x_value_unload(oinfo, &data[n].value))) { - OBJ_RELEASE(opalcaddy); - ret = ext2x_convert_opalrc(rc); - if (NULL != cbfunc) { - cbfunc(ret, cbdata); - } - return; - } - } - - /* convert the directives */ - for (n=0; n < ndirs; n++) { - oinfo = OBJ_NEW(opal_value_t); - /* we "borrow" the apps field of the caddy as we and the - * server function both agree on what will be there */ - opal_list_append(&opalcaddy->apps, &oinfo->super); - if (OPAL_SUCCESS != (rc = ext2x_value_unload(oinfo, &directives[n].value))) { - OBJ_RELEASE(opalcaddy); - ret = ext2x_convert_opalrc(rc); - if (NULL != cbfunc) { - cbfunc(ret, cbdata); - } - return; - } - } - - /* pass the call upwards */ - host_module->log(&requestor, - &opalcaddy->info, - &opalcaddy->apps, - opal_opcbfunc, opalcaddy); -} - -static pmix_status_t server_allocate(const pmix_proc_t *proct, - pmix_alloc_directive_t directive, - const pmix_info_t data[], size_t ndata, - pmix_info_cbfunc_t cbfunc, void *cbdata) -{ - ext2x_opalcaddy_t *opalcaddy; - opal_process_name_t requestor; - int rc; - size_t n; - opal_value_t *oinfo; - opal_pmix_alloc_directive_t odir; - - if (NULL == host_module || NULL == host_module->allocate) { - return PMIX_ERR_NOT_SUPPORTED; - } - - /* setup the caddy */ - opalcaddy = OBJ_NEW(ext2x_opalcaddy_t); - opalcaddy->infocbfunc = cbfunc; - opalcaddy->cbdata = cbdata; - - /* convert the requestor */ - if (OPAL_SUCCESS != (rc = opal_convert_string_to_jobid(&requestor.jobid, proct->nspace))) { - OBJ_RELEASE(opalcaddy); - return ext2x_convert_opalrc(rc); - } - requestor.vpid = ext2x_convert_rank(proct->rank); - - /* convert the directive */ - odir = ext2x_convert_allocdir(directive); - - /* convert the data */ - for (n=0; n < ndata; n++) { - oinfo = OBJ_NEW(opal_value_t); - opal_list_append(&opalcaddy->info, &oinfo->super); - if (OPAL_SUCCESS != (rc = ext2x_value_unload(oinfo, &data[n].value))) { - OBJ_RELEASE(opalcaddy); - return ext2x_convert_opalrc(rc); - } - } - - /* pass the call upwards */ - if (OPAL_SUCCESS != (rc = host_module->allocate(&requestor, odir, - &opalcaddy->info, - info_cbfunc, opalcaddy))) { - OBJ_RELEASE(opalcaddy); - return ext2x_convert_opalrc(rc); - } - - return PMIX_SUCCESS; - -} - -static pmix_status_t server_job_control(const pmix_proc_t *proct, - const pmix_proc_t targets[], size_t ntargets, - const pmix_info_t directives[], size_t ndirs, - pmix_info_cbfunc_t cbfunc, void *cbdata) -{ - ext2x_opalcaddy_t *opalcaddy; - opal_process_name_t requestor; - int rc; - size_t n; - opal_value_t *oinfo; - opal_namelist_t *nm; - - if (NULL == host_module || NULL == host_module->job_control) { - return PMIX_ERR_NOT_SUPPORTED; - } - - /* setup the caddy */ - opalcaddy = OBJ_NEW(ext2x_opalcaddy_t); - opalcaddy->infocbfunc = cbfunc; - opalcaddy->cbdata = cbdata; - - /* convert the requestor */ - if (OPAL_SUCCESS != (rc = opal_convert_string_to_jobid(&requestor.jobid, proct->nspace))) { - OBJ_RELEASE(opalcaddy); - return ext2x_convert_opalrc(rc); - } - requestor.vpid = ext2x_convert_rank(proct->rank); - - /* convert the targets */ - for (n=0; n < ntargets; n++) { - nm = OBJ_NEW(opal_namelist_t); - opal_list_append(&opalcaddy->procs, &nm->super); - if (OPAL_SUCCESS != (rc = opal_convert_string_to_jobid(&nm->name.jobid, targets[n].nspace))) { - OBJ_RELEASE(opalcaddy); - return ext2x_convert_opalrc(rc); - } - nm->name.vpid = ext2x_convert_rank(targets[n].rank); - } - - /* convert the directives */ - for (n=0; n < ndirs; n++) { - oinfo = OBJ_NEW(opal_value_t); - opal_list_append(&opalcaddy->info, &oinfo->super); - oinfo->key = strdup(directives[n].key); - if (OPAL_SUCCESS != (rc = ext2x_value_unload(oinfo, &directives[n].value))) { - OBJ_RELEASE(opalcaddy); - return ext2x_convert_opalrc(rc); - } - } - - /* pass the call upwards */ - if (OPAL_SUCCESS != (rc = host_module->job_control(&requestor, - &opalcaddy->procs, - &opalcaddy->info, - info_cbfunc, opalcaddy))) { - OBJ_RELEASE(opalcaddy); - return ext2x_convert_opalrc(rc); - } - - return PMIX_SUCCESS; -} diff --git a/opal/mca/pmix/ext2x/ext2x_server_south.c b/opal/mca/pmix/ext2x/ext2x_server_south.c deleted file mode 100644 index 45228394ac7..00000000000 --- a/opal/mca/pmix/ext2x/ext2x_server_south.c +++ /dev/null @@ -1,572 +0,0 @@ -/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ -/* - * Copyright (c) 2014-2017 Intel, Inc. All rights reserved. - * Copyright (c) 2014-2017 Research Organization for Information Science - * and Technology (RIST). All rights reserved. - * Copyright (c) 2014-2016 Intel, Inc. All rights reserved. - * Copyright (c) 2014-2017 Mellanox Technologies, Inc. - * All rights reserved. - * Copyright (c) 2016 Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2017 Los Alamos National Security, LLC. All rights - * reserved. - * Copyright (c) 2018 The University of Tennessee and The University - * of Tennessee Research Foundation. All rights - * reserved. - * $COPYRIGHT$ - * - * Additional copyrights may follow - * - * $HEADER$ - */ - -#include "opal_config.h" -#include "opal/constants.h" -#include "opal/types.h" - -#ifdef HAVE_STRING_H -#include -#endif -#ifdef HAVE_UNISTD_H -#include -#endif - -#include "opal/dss/dss.h" -#include "opal/mca/event/event.h" -#include "opal/mca/hwloc/base/base.h" -#include "opal/runtime/opal.h" -#include "opal/runtime/opal_progress_threads.h" -#include "opal/threads/threads.h" -#include "opal/util/argv.h" -#include "opal/util/error.h" -#include "opal/util/output.h" -#include "opal/util/opal_environ.h" -#include "opal/util/proc.h" -#include "opal/util/show_help.h" -#include "opal/util/string_copy.h" -#include "opal/mca/pmix/base/base.h" -#include "ext2x.h" - -#include "pmix.h" -#include "pmix_server.h" - -/**** S.O.U.T.H.B.O.U.N.D I.N.T.E.R.F.A.C.E.S ****/ - -/* These are the interfaces used by the OMPI/ORTE/OPAL layer to call - * down into the embedded PMIx server. */ - -extern pmix_server_module_t mymodule; -extern opal_pmix_server_module_t *host_module; -static char *dbgvalue=NULL; - -static void errreg_cbfunc (pmix_status_t status, - size_t errhandler_ref, - void *cbdata) -{ - opal_ext2x_event_t *ev = (opal_ext2x_event_t*)cbdata; - - OPAL_ACQUIRE_OBJECT(ev); - ev->index = errhandler_ref; - opal_output_verbose(5, opal_pmix_base_framework.framework_output, - "PMIX server errreg_cbfunc - error handler registered status=%d, reference=%lu", - status, (unsigned long)errhandler_ref); - OPAL_POST_OBJECT(ev); - OPAL_PMIX_WAKEUP_THREAD(&ev->lock); -} - -static void opcbfunc(pmix_status_t status, void *cbdata) -{ - ext2x_opcaddy_t *op = (ext2x_opcaddy_t*)cbdata; - - OPAL_ACQUIRE_OBJECT(op); - - if (NULL != op->opcbfunc) { - op->opcbfunc(ext2x_convert_rc(status), op->cbdata); - } - OBJ_RELEASE(op); -} - -static void lkcbfunc(pmix_status_t status, void *cbdata) -{ - opal_pmix_lock_t *lk = (opal_pmix_lock_t*)cbdata; - - OPAL_POST_OBJECT(lk); - OPAL_PMIX_WAKEUP_THREAD(lk); -} - -int ext2x_server_init(opal_pmix_server_module_t *module, - opal_list_t *info) -{ - pmix_status_t rc; - int dbg; - opal_value_t *kv; - pmix_info_t *pinfo; - size_t sz, n; - opal_ext2x_event_t *event; - opal_ext2x_jobid_trkr_t *job; - opal_pmix_lock_t lk; - - OPAL_PMIX_ACQUIRE_THREAD(&opal_pmix_base.lock); - - if (0 == opal_pmix_base.initialized) { - if (0 < (dbg = opal_output_get_verbosity(opal_pmix_base_framework.framework_output))) { - asprintf(&dbgvalue, "PMIX_DEBUG=%d", dbg); - putenv(dbgvalue); - } - /* check the evars for a mismatch */ - if (OPAL_SUCCESS != (dbg = opal_pmix_ext2x_check_evars())) { - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - return dbg; - } - } - ++opal_pmix_base.initialized; - - /* convert the list to an array of pmix_info_t */ - sz = 2 + ((NULL==info)?0:opal_list_get_size(info)); - PMIX_INFO_CREATE(pinfo, sz); - n = 0; - if (NULL != info) { - OPAL_LIST_FOREACH(kv, info, opal_value_t) { - (void)opal_string_copy(pinfo[n].key, kv->key, PMIX_MAX_KEYLEN); - ext2x_value_load(&pinfo[n].value, kv); - ++n; - } - } - - /* insert ourselves into our list of jobids - it will be the - * first, and so we'll check it first */ - job = OBJ_NEW(opal_ext2x_jobid_trkr_t); - (void)opal_snprintf_jobid(job->nspace, PMIX_MAX_NSLEN, OPAL_PROC_MY_NAME.jobid); - job->jobid = OPAL_PROC_MY_NAME.jobid; - opal_list_append(&mca_pmix_ext2x_component.jobids, &job->super); - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - - /* add our nspace and rank to the array going down to the PMIx server */ - PMIX_INFO_LOAD(&pinfo[sz-2], PMIX_SERVER_NSPACE, job->nspace, PMIX_STRING); - PMIX_INFO_LOAD(&pinfo[sz-1], PMIX_SERVER_RANK, &OPAL_PROC_MY_NAME.vpid, PMIX_PROC_RANK); - if (PMIX_SUCCESS != (rc = PMIx_server_init(&mymodule, pinfo, sz))) { - PMIX_INFO_FREE(pinfo, sz); - return ext2x_convert_rc(rc); - } - PMIX_INFO_FREE(pinfo, sz); - - /* record the host module */ - host_module = module; - - /* register the default event handler */ - event = OBJ_NEW(opal_ext2x_event_t); - opal_list_append(&mca_pmix_ext2x_component.events, &event->super); - PMIX_INFO_CREATE(pinfo, 1); - PMIX_INFO_LOAD(&pinfo[0], PMIX_EVENT_HDLR_NAME, "OPAL-PMIX-2X-SERVER-DEFAULT", PMIX_STRING); - PMIx_Register_event_handler(NULL, 0, pinfo, 1, ext2x_event_hdlr, errreg_cbfunc, (void*)event); - OPAL_PMIX_WAIT_THREAD(&event->lock); - PMIX_INFO_FREE(pinfo, 1); - - /* as we might want to use some client-side functions, be sure - * to register our own nspace */ - OPAL_PMIX_CONSTRUCT_LOCK(&lk); - PMIX_INFO_CREATE(pinfo, 1); - PMIX_INFO_LOAD(&pinfo[0], PMIX_REGISTER_NODATA, NULL, PMIX_BOOL); - PMIx_server_register_nspace(job->nspace, 1, pinfo, 1, lkcbfunc, (void*)&lk); - OPAL_PMIX_WAIT_THREAD(&lk); - OPAL_PMIX_DESTRUCT_LOCK(&lk); - PMIX_INFO_FREE(pinfo, 1); - - return OPAL_SUCCESS; -} - -static void dereg_cbfunc(pmix_status_t st, void *cbdata) -{ - opal_ext2x_event_t *ev = (opal_ext2x_event_t*)cbdata; - OPAL_PMIX_WAKEUP_THREAD(&ev->lock); -} - -int ext2x_server_finalize(void) -{ - pmix_status_t rc; - opal_ext2x_event_t *event, *ev2; - opal_list_t evlist; - OBJ_CONSTRUCT(&evlist, opal_list_t); - - OPAL_PMIX_ACQUIRE_THREAD(&opal_pmix_base.lock); - --opal_pmix_base.initialized; - - if (0 < opal_pmix_base.initialized) { - /* deregister all event handlers */ - OPAL_LIST_FOREACH_SAFE(event, ev2, &mca_pmix_ext2x_component.events, opal_ext2x_event_t) { - OPAL_PMIX_DESTRUCT_LOCK(&event->lock); - OPAL_PMIX_CONSTRUCT_LOCK(&event->lock); - PMIx_Deregister_event_handler(event->index, dereg_cbfunc, (void*)event); - opal_list_remove_item(&mca_pmix_ext2x_component.events, &event->super); - /* wait and release outside the loop to avoid double mutex - * interlock */ - opal_list_append(&evlist, &event->super); - } - } - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - OPAL_LIST_FOREACH_SAFE(event, ev2, &evlist, opal_ext2x_event_t) { - OPAL_PMIX_WAIT_THREAD(&event->lock); - opal_list_remove_item(&evlist, &event->super); - OBJ_RELEASE(event); - } - OBJ_DESTRUCT(&evlist); - rc = PMIx_server_finalize(); - return ext2x_convert_rc(rc); -} - -int ext2x_server_gen_regex(const char *input, char **regex) -{ - pmix_status_t rc; - - OPAL_PMIX_ACQUIRE_THREAD(&opal_pmix_base.lock); - if (0 >= opal_pmix_base.initialized) { - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - return OPAL_ERR_NOT_INITIALIZED; - } - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - - rc = PMIx_generate_regex(input, regex); - return ext2x_convert_rc(rc); -} - - -int ext2x_server_gen_ppn(const char *input, char **ppn) -{ - pmix_status_t rc; - - OPAL_PMIX_ACQUIRE_THREAD(&opal_pmix_base.lock); - if (0 >= opal_pmix_base.initialized) { - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - return OPAL_ERR_NOT_INITIALIZED; - } - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - - rc = PMIx_generate_ppn(input, ppn); - return ext2x_convert_rc(rc); -} - -int ext2x_server_register_nspace(opal_jobid_t jobid, - int nlocalprocs, - opal_list_t *info, - opal_pmix_op_cbfunc_t cbfunc, - void *cbdata) -{ - opal_value_t *kv, *k2; - pmix_info_t *pinfo = NULL, *pmap; - size_t sz, szmap, m, n; - char nspace[PMIX_MAX_NSLEN]; - pmix_status_t rc; - opal_list_t *pmapinfo; - opal_ext2x_jobid_trkr_t *job; - opal_pmix_lock_t lock; - int ret; - - OPAL_PMIX_ACQUIRE_THREAD(&opal_pmix_base.lock); - if (0 >= opal_pmix_base.initialized) { - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - return OPAL_ERR_NOT_INITIALIZED; - } - - /* convert the jobid */ - (void)opal_snprintf_jobid(nspace, PMIX_MAX_NSLEN, jobid); - - /* store this job in our list of known nspaces */ - job = OBJ_NEW(opal_ext2x_jobid_trkr_t); - (void)opal_string_copy(job->nspace, nspace, PMIX_MAX_NSLEN); - job->jobid = jobid; - opal_list_append(&mca_pmix_ext2x_component.jobids, &job->super); - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - - /* convert the list to an array of pmix_info_t */ - if (NULL != info && 0 < (sz = opal_list_get_size(info))) { - PMIX_INFO_CREATE(pinfo, sz); - n = 0; - OPAL_LIST_FOREACH(kv, info, opal_value_t) { - (void)opal_string_copy(pinfo[n].key, kv->key, PMIX_MAX_KEYLEN); - if (0 == strcmp(kv->key, OPAL_PMIX_PROC_DATA)) { - pinfo[n].value.type = PMIX_DATA_ARRAY; - /* the value contains a list of values - convert - * that list to another array */ - pmapinfo = (opal_list_t*)kv->data.ptr; - szmap = opal_list_get_size(pmapinfo); - if (0 < szmap) { - PMIX_INFO_CREATE(pmap, szmap); - pinfo[n].value.data.darray = (pmix_data_array_t*)calloc(1, sizeof(pmix_data_array_t)); - pinfo[n].value.data.darray->type = PMIX_INFO; - pinfo[n].value.data.darray->array = (struct pmix_info_t*)pmap; - pinfo[n].value.data.darray->size = szmap; - m = 0; - OPAL_LIST_FOREACH(k2, pmapinfo, opal_value_t) { - (void)opal_string_copy(pmap[m].key, k2->key, PMIX_MAX_KEYLEN); - ext2x_value_load(&pmap[m].value, k2); - ++m; - } - } - OPAL_LIST_RELEASE(pmapinfo); - } else { - ext2x_value_load(&pinfo[n].value, kv); - } - ++n; - } - } else { - sz = 0; - pinfo = NULL; - } - - OPAL_PMIX_CONSTRUCT_LOCK(&lock); - rc = PMIx_server_register_nspace(nspace, nlocalprocs, pinfo, sz, - lkcbfunc, (void*)&lock); - if (PMIX_SUCCESS == rc) { - OPAL_PMIX_WAIT_THREAD(&lock); - } - OPAL_PMIX_DESTRUCT_LOCK(&lock); - - if (NULL != pinfo) { - PMIX_INFO_FREE(pinfo, sz); - } - - ret = ext2x_convert_rc(rc); - - /* release the caller */ - if (NULL != cbfunc) { - cbfunc(ret, cbdata); - } - return ret; -} - -void ext2x_server_deregister_nspace(opal_jobid_t jobid, - opal_pmix_op_cbfunc_t cbfunc, - void *cbdata) -{ - opal_ext2x_jobid_trkr_t *jptr; - opal_pmix_lock_t lock; - - OPAL_PMIX_ACQUIRE_THREAD(&opal_pmix_base.lock); - if (0 >= opal_pmix_base.initialized) { - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - /* release the caller */ - if (NULL != cbfunc) { - cbfunc(OPAL_ERR_NOT_INITIALIZED, cbdata); - } - return; - } - - /* if we don't already have it, we can ignore this */ - OPAL_LIST_FOREACH(jptr, &mca_pmix_ext2x_component.jobids, opal_ext2x_jobid_trkr_t) { - if (jptr->jobid == jobid) { - /* found it - tell the server to deregister */ - OPAL_PMIX_CONSTRUCT_LOCK(&lock); - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - PMIx_server_deregister_nspace(jptr->nspace, lkcbfunc, (void*)&lock); - OPAL_PMIX_WAIT_THREAD(&lock); - OPAL_PMIX_DESTRUCT_LOCK(&lock); - /* now get rid of it from our list */ - OPAL_PMIX_ACQUIRE_THREAD(&opal_pmix_base.lock); - opal_list_remove_item(&mca_pmix_ext2x_component.jobids, &jptr->super); - OBJ_RELEASE(jptr); - break; - } - } - - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - /* release the caller */ - if (NULL != cbfunc) { - cbfunc(OPAL_SUCCESS, cbdata); - } -} - -int ext2x_server_register_client(const opal_process_name_t *proc, - uid_t uid, gid_t gid, - void *server_object, - opal_pmix_op_cbfunc_t cbfunc, - void *cbdata) -{ - pmix_status_t rc; - pmix_proc_t p; - opal_pmix_lock_t lock; - - OPAL_PMIX_ACQUIRE_THREAD(&opal_pmix_base.lock); - if (0 >= opal_pmix_base.initialized) { - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - return OPAL_ERR_NOT_INITIALIZED; - } - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - - /* convert the jobid */ - (void)opal_snprintf_jobid(p.nspace, PMIX_MAX_NSLEN, proc->jobid); - p.rank = ext2x_convert_opalrank(proc->vpid); - - OPAL_PMIX_CONSTRUCT_LOCK(&lock); - rc = PMIx_server_register_client(&p, uid, gid, server_object, - lkcbfunc, (void*)&lock); - if (PMIX_SUCCESS == rc) { - OPAL_PMIX_WAIT_THREAD(&lock); - } - OPAL_PMIX_DESTRUCT_LOCK(&lock); - return ext2x_convert_rc(rc); -} - -/* tell the local PMIx server to cleanup this client as it is - * done executing */ -void ext2x_server_deregister_client(const opal_process_name_t *proc, - opal_pmix_op_cbfunc_t cbfunc, - void *cbdata) -{ - opal_ext2x_jobid_trkr_t *jptr; - pmix_proc_t p; - opal_pmix_lock_t lock; - - OPAL_PMIX_ACQUIRE_THREAD(&opal_pmix_base.lock); - if (0 >= opal_pmix_base.initialized) { - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - if (NULL != cbfunc) { - cbfunc(OPAL_ERR_NOT_INITIALIZED, cbdata); - } - return; - } - - /* if we don't already have it, we can ignore this */ - OPAL_LIST_FOREACH(jptr, &mca_pmix_ext2x_component.jobids, opal_ext2x_jobid_trkr_t) { - if (jptr->jobid == proc->jobid) { - /* found it - tell the server to deregister */ - (void)opal_string_copy(p.nspace, jptr->nspace, PMIX_MAX_NSLEN); - p.rank = ext2x_convert_opalrank(proc->vpid); - OPAL_PMIX_CONSTRUCT_LOCK(&lock); - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - PMIx_server_deregister_client(&p, lkcbfunc, (void*)&lock); - OPAL_PMIX_WAIT_THREAD(&lock); - OPAL_PMIX_DESTRUCT_LOCK(&lock); - OPAL_PMIX_ACQUIRE_THREAD(&opal_pmix_base.lock); - break; - } - } - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - if (NULL != cbfunc) { - cbfunc(OPAL_SUCCESS, cbdata); - } -} - -/* have the local PMIx server setup the environment for this client */ -int ext2x_server_setup_fork(const opal_process_name_t *proc, char ***env) -{ - pmix_status_t rc; - pmix_proc_t p; - - OPAL_PMIX_ACQUIRE_THREAD(&opal_pmix_base.lock); - if (0 >= opal_pmix_base.initialized) { - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - return OPAL_ERR_NOT_INITIALIZED; - } - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - - /* convert the jobid */ - (void)opal_snprintf_jobid(p.nspace, PMIX_MAX_NSLEN, proc->jobid); - p.rank = ext2x_convert_opalrank(proc->vpid); - - rc = PMIx_server_setup_fork(&p, env); - return ext2x_convert_rc(rc); -} - -/* this is the call back up from the embedded PMIx server that - * will contain the returned data. Note that the embedded server - * "owns" the data and will free it upon return from this function */ -static void dmdx_response(pmix_status_t status, char *data, size_t sz, void *cbdata) -{ - int rc; - ext2x_opcaddy_t *op = (ext2x_opcaddy_t*)cbdata; - - rc = ext2x_convert_rc(status); - if (NULL != op->mdxcbfunc) { - op->mdxcbfunc(rc, data, sz, op->cbdata, NULL, NULL); - } - OBJ_RELEASE(op); -} - -/* request modex data for a local proc from the PMIx server */ -int ext2x_server_dmodex(const opal_process_name_t *proc, - opal_pmix_modex_cbfunc_t cbfunc, void *cbdata) -{ - ext2x_opcaddy_t *op; - pmix_status_t rc; - - OPAL_PMIX_ACQUIRE_THREAD(&opal_pmix_base.lock); - if (0 >= opal_pmix_base.initialized) { - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - return OPAL_ERR_NOT_INITIALIZED; - } - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - - /* setup the caddy */ - op = OBJ_NEW(ext2x_opcaddy_t); - op->mdxcbfunc = cbfunc; - op->cbdata = cbdata; - - /* convert the jobid */ - (void)opal_snprintf_jobid(op->p.nspace, PMIX_MAX_NSLEN, proc->jobid); - op->p.rank = ext2x_convert_opalrank(proc->vpid); - - /* find the internally-cached data for this proc */ - rc = PMIx_server_dmodex_request(&op->p, dmdx_response, op); - if (PMIX_SUCCESS != rc) { - OBJ_RELEASE(op); - } - return ext2x_convert_rc(rc); -} - -/* tell the PMIx server to notify its local clients of an event */ -int ext2x_server_notify_event(int status, - const opal_process_name_t *source, - opal_list_t *info, - opal_pmix_op_cbfunc_t cbfunc, void *cbdata) -{ - opal_value_t *kv; - pmix_info_t *pinfo; - size_t sz, n; - pmix_status_t rc; - ext2x_opcaddy_t *op; - - OPAL_PMIX_ACQUIRE_THREAD(&opal_pmix_base.lock); - if (0 >= opal_pmix_base.initialized) { - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - return OPAL_ERR_NOT_INITIALIZED; - } - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - - /* convert the list to an array of pmix_info_t */ - if (NULL != info && 0 < (sz = opal_list_get_size(info))) { - PMIX_INFO_CREATE(pinfo, sz); - n = 0; - OPAL_LIST_FOREACH(kv, info, opal_value_t) { - (void)opal_string_copy(pinfo[n].key, kv->key, PMIX_MAX_KEYLEN); - ext2x_value_load(&pinfo[n].value, kv); - ++n; - } - } else { - sz = 0; - pinfo = NULL; - } - /* setup the caddy */ - op = OBJ_NEW(ext2x_opcaddy_t); - op->info = pinfo; - op->sz = sz; - op->opcbfunc = cbfunc; - op->cbdata = cbdata; - /* convert the jobid */ - if (NULL == source) { - (void)opal_snprintf_jobid(op->p.nspace, PMIX_MAX_NSLEN, OPAL_JOBID_INVALID); - op->p.rank = ext2x_convert_opalrank(OPAL_VPID_INVALID); - } else { - (void)opal_snprintf_jobid(op->p.nspace, PMIX_MAX_NSLEN, source->jobid); - op->p.rank = ext2x_convert_opalrank(source->vpid); - } - - - rc = ext2x_convert_opalrc(status); - /* the range must be nonlocal so the server will pass - * the event down to its local clients */ - rc = PMIx_Notify_event(rc, &op->p, PMIX_RANGE_SESSION, - pinfo, sz, opcbfunc, op); - if (PMIX_SUCCESS != rc) { - OBJ_RELEASE(op); - } - return ext2x_convert_rc(rc); -} diff --git a/opal/mca/pmix/ext2x/help-pmix-ext2x.txt b/opal/mca/pmix/ext2x/help-pmix-ext2x.txt deleted file mode 100644 index 07327e11636..00000000000 --- a/opal/mca/pmix/ext2x/help-pmix-ext2x.txt +++ /dev/null @@ -1,32 +0,0 @@ -# -*- text -*- -# -# 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) 2017 Intel, Inc. All rights reserved. -# $COPYRIGHT$ -# -# Additional copyrights may follow -# -# $HEADER$ -# -# This is the US/English help file for Open MPI MCA error messages. -# -[evars] -We found conflicting directives regarding the location of OPAL vs PMIx -installation directories: - -%s - -This usually indicates that OMPI was configured to use its internal copy -of PMIx, but another installation of PMIx is also in use on this system -and could potentially cause confusion between the two sets of plugins. -Please either unset the indicated environment variables, or configure -OMPI to use the external PMIx installation. diff --git a/opal/mca/pmix/ext3x/Makefile.am b/opal/mca/pmix/ext3x/Makefile.am deleted file mode 100644 index 6dc65417216..00000000000 --- a/opal/mca/pmix/ext3x/Makefile.am +++ /dev/null @@ -1,51 +0,0 @@ -# -# Copyright (c) 2014-2018 Intel, Inc. All rights reserved. -# Copyright (c) 2015 Cisco Systems, Inc. All rights reserved. -# Copyright (c) 2015-2018 Research Organization for Information Science -# and Technology (RIST). All rights reserved. -# Copyright (c) 2017 IBM Corporation. All rights reserved. -# $COPYRIGHT$ -# -# Additional copyrights may follow -# -# $HEADER$ -# - -dist_opaldata_DATA = help-pmix-ext3x.txt - -sources = \ - ext3x.h \ - ext3x.c \ - ext3x_local.c \ - ext3x_client.c \ - ext3x_component.c \ - ext3x_server_north.c \ - ext3x_server_south.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_opal_pmix_ext3x_DSO -component_noinst = -component_install = mca_pmix_ext3x.la -else -component_noinst = libmca_pmix_ext3x.la -component_install = -endif - -mcacomponentdir = $(opallibdir) -mcacomponent_LTLIBRARIES = $(component_install) -mca_pmix_ext3x_la_SOURCES = $(sources) -mca_pmix_ext3x_la_CFLAGS = $(opal_pmix_ext3x_CFLAGS) -mca_pmix_ext3x_la_CPPFLAGS =$(opal_pmix_ext3x_CPPFLAGS) -mca_pmix_ext3x_la_LDFLAGS = -module -avoid-version $(opal_pmix_ext3x_LDFLAGS) -mca_pmix_ext3x_la_LIBADD = $(top_builddir)/opal/lib@OPAL_LIB_PREFIX@open-pal.la \ - $(opal_pmix_ext3x_LIBS) - -noinst_LTLIBRARIES = $(component_noinst) -libmca_pmix_ext3x_la_SOURCES =$(sources) -libmca_pmix_ext3x_la_CFLAGS = $(opal_pmix_ext3x_CFLAGS) -libmca_pmix_ext3x_la_CPPFLAGS = $(opal_pmix_ext3x_CPPFLAGS) -libmca_pmix_ext3x_la_LDFLAGS = -module -avoid-version $(opal_pmix_ext3x_LDFLAGS) -libmca_pmix_ext3x_la_LIBADD = $(opal_pmix_ext3x_LIBS) diff --git a/opal/mca/pmix/ext3x/common_sym_whitelist.txt b/opal/mca/pmix/ext3x/common_sym_whitelist.txt deleted file mode 100644 index 7a60b367d69..00000000000 --- a/opal/mca/pmix/ext3x/common_sym_whitelist.txt +++ /dev/null @@ -1,6 +0,0 @@ -# Ignore symbols in this component that are auto-generated and we -# can't do anything about them (e.g., flex/bison symbols). -pmix_util_keyval_yyleng -pmix_util_keyval_yytext -pmix_show_help_yyleng -pmix_show_help_yytext diff --git a/opal/mca/pmix/ext3x/configure.m4 b/opal/mca/pmix/ext3x/configure.m4 deleted file mode 100644 index acfda711121..00000000000 --- a/opal/mca/pmix/ext3x/configure.m4 +++ /dev/null @@ -1,63 +0,0 @@ -# -*- shell-script -*- -# -# 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) 2011-2013 Los Alamos National Security, LLC. -# All rights reserved. -# Copyright (c) 2010-2015 Cisco Systems, Inc. All rights reserved. -# Copyright (c) 2013-2017 Intel, Inc. All rights reserved. -# Copyright (c) 2015-2017 Research Organization for Information Science -# and Technology (RIST). All rights reserved. -# Copyright (c) 2014-2015 Mellanox Technologies, Inc. -# All rights reserved. -# $COPYRIGHT$ -# -# Additional copyrights may follow -# -# $HEADER$ -# - -# MCA_pmix_ext3x_CONFIG([action-if-found], [action-if-not-found]) -# ----------------------------------------------------------- -AC_DEFUN([MCA_opal_pmix_ext3x_CONFIG],[ - AC_CONFIG_FILES([opal/mca/pmix/ext3x/Makefile]) - - AS_IF([test "$opal_external_pmix_happy" = "yes"], - [ # check for the 3.x version - AC_MSG_CHECKING([if external component is version 3.x]) - AS_IF([test "$opal_external_pmix_version" = "3x"], - [AC_MSG_RESULT([yes]) - AS_IF([test "$opal_event_external_support" != "yes"], - [AC_MSG_WARN([EXTERNAL PMIX SUPPORT REQUIRES USE OF EXTERNAL LIBEVENT]) - AC_MSG_WARN([LIBRARY. THIS LIBRARY MUST POINT TO THE SAME ONE USED]) - AC_MSG_WARN([TO BUILD PMIX OR ELSE UNPREDICTABLE BEHAVIOR MAY RESULT]) - AC_MSG_ERROR([PLEASE CORRECT THE CONFIGURE COMMAND LINE AND REBUILD])]) - opal_pmix_external_3x_happy=yes], - [AC_MSG_RESULT([no]) - opal_pmix_external_3x_happy=no]) - - AS_IF([test "$opal_pmix_external_3x_happy" = "yes"], - [$1 - # need to set the wrapper flags for static builds - pmix_ext3x_WRAPPER_EXTRA_LDFLAGS=$opal_external_pmix_LDFLAGS - pmix_ext3x_WRAPPER_EXTRA_LIBS=$opal_external_pmix_LIBS], - [$2])], - [$2]) - - opal_pmix_ext3x_CPPFLAGS=$opal_external_pmix_CPPFLAGS - opal_pmix_ext3x_LDFLAGS=$opal_external_pmix_LDFLAGS - opal_pmix_ext3x_LIBS=$opal_external_pmix_LIBS - - AC_SUBST([opal_pmix_ext3x_CPPFLAGS]) - AC_SUBST([opal_pmix_ext3x_LDFLAGS]) - AC_SUBST([opal_pmix_ext3x_LIBS]) - -])dnl diff --git a/opal/mca/pmix/ext3x/ext3x.c b/opal/mca/pmix/ext3x/ext3x.c deleted file mode 100644 index d59b393f4a3..00000000000 --- a/opal/mca/pmix/ext3x/ext3x.c +++ /dev/null @@ -1,1874 +0,0 @@ -/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ -/* - * Copyright (c) 2014-2018 Intel, Inc. All rights reserved. - * Copyright (c) 2014-2019 Research Organization for Information Science - * and Technology (RIST). All rights reserved. - * Copyright (c) 2014-2015 Mellanox Technologies, Inc. - * All rights reserved. - * Copyright (c) 2016 Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2017 Los Alamos National Security, LLC. All rights - * reserved. - * $COPYRIGHT$ - * - * Additional copyrights may follow - * - * $HEADER$ - */ - -#include "opal_config.h" -#include "opal/constants.h" -#include "opal/types.h" - -#ifdef HAVE_STRING_H -#include -#endif -#ifdef HAVE_UNISTD_H -#include -#endif -#ifdef HAVE_SYS_STAT_H -#include -#endif - -#include "opal/dss/dss.h" -#include "opal/mca/event/event.h" -#include "opal/mca/hwloc/base/base.h" -#include "opal/runtime/opal.h" -#include "opal/runtime/opal_progress_threads.h" -#include "opal/threads/threads.h" -#include "opal/util/argv.h" -#include "opal/util/error.h" -#include "opal/util/opal_environ.h" -#include "opal/util/output.h" -#include "opal/util/proc.h" -#include "opal/util/show_help.h" -#include "opal/util/string_copy.h" - -#include "ext3x.h" -#include "opal/mca/pmix/base/base.h" -#include "opal/mca/pmix/pmix_types.h" - -#include -#include - -/**** C.O.M.M.O.N I.N.T.E.R.F.A.C.E.S ****/ - -/* These are functions used by both client and server to - * access common functions in the embedded PMIx library */ -static bool legacy_get(void); -static const char *ext3x_get_nspace(opal_jobid_t jobid); -static void ext3x_register_jobid(opal_jobid_t jobid, const char *nspace); -static void register_handler(opal_list_t *event_codes, - opal_list_t *info, - opal_pmix_notification_fn_t evhandler, - opal_pmix_evhandler_reg_cbfunc_t cbfunc, - void *cbdata); -static void deregister_handler(size_t evhandler, - opal_pmix_op_cbfunc_t cbfunc, - void *cbdata); -static int notify_event(int status, - const opal_process_name_t *source, - opal_pmix_data_range_t range, - opal_list_t *info, - opal_pmix_op_cbfunc_t cbfunc, void *cbdata); -static void ext3x_query(opal_list_t *queries, - opal_pmix_info_cbfunc_t cbfunc, void *cbdata); -static void ext3x_log(opal_list_t *info, - opal_pmix_op_cbfunc_t cbfunc, void *cbdata); - -static int ext3x_register_cleanup(char *path, bool directory, bool ignore, bool jobscope); - -const opal_pmix_base_module_t opal_pmix_ext3x_module = { - .legacy_get = legacy_get, - /* client APIs */ - .init = ext3x_client_init, - .finalize = ext3x_client_finalize, - .initialized = ext3x_initialized, - .abort = ext3x_abort, - .commit = ext3x_commit, - .fence = ext3x_fence, - .fence_nb = ext3x_fencenb, - .put = ext3x_put, - .get = ext3x_get, - .get_nb = ext3x_getnb, - .publish = ext3x_publish, - .publish_nb = ext3x_publishnb, - .lookup = ext3x_lookup, - .lookup_nb = ext3x_lookupnb, - .unpublish = ext3x_unpublish, - .unpublish_nb = ext3x_unpublishnb, - .spawn = ext3x_spawn, - .spawn_nb = ext3x_spawnnb, - .connect = ext3x_connect, - .connect_nb = ext3x_connectnb, - .disconnect = ext3x_disconnect, - .disconnect_nb = ext3x_disconnectnb, - .resolve_peers = ext3x_resolve_peers, - .resolve_nodes = ext3x_resolve_nodes, - .query = ext3x_query, - .log = ext3x_log, - .allocate = ext3x_allocate, - .job_control = ext3x_job_control, - .register_cleanup = ext3x_register_cleanup, - /* server APIs */ - .server_init = ext3x_server_init, - .server_finalize = ext3x_server_finalize, - .generate_regex = ext3x_server_gen_regex, - .generate_ppn = ext3x_server_gen_ppn, - .server_register_nspace = ext3x_server_register_nspace, - .server_deregister_nspace = ext3x_server_deregister_nspace, - .server_register_client = ext3x_server_register_client, - .server_deregister_client = ext3x_server_deregister_client, - .server_setup_fork = ext3x_server_setup_fork, - .server_dmodex_request = ext3x_server_dmodex, - .server_notify_event = ext3x_server_notify_event, - .server_iof_push = ext3x_server_iof_push, - .server_setup_application = ext3x_server_setup_application, - .server_setup_local_support = ext3x_server_setup_local_support, - /* tool APIs */ - .tool_init = ext3x_tool_init, - .tool_finalize = ext3x_tool_fini, - /* utility APIs */ - .get_version = PMIx_Get_version, - .register_evhandler = register_handler, - .deregister_evhandler = deregister_handler, - .notify_event = notify_event, - .store_local = ext3x_store_local, - .get_nspace = ext3x_get_nspace, - .register_jobid = ext3x_register_jobid -}; - -static bool legacy_get(void) -{ - return false; -} - -static void opcbfunc(pmix_status_t status, void *cbdata) -{ - ext3x_opcaddy_t *op = (ext3x_opcaddy_t*)cbdata; - - OPAL_ACQUIRE_OBJECT(op); - - if (NULL != op->opcbfunc) { - op->opcbfunc(ext3x_convert_rc(status), op->cbdata); - } - OBJ_RELEASE(op); -} - - -static const char *ext3x_get_nspace(opal_jobid_t jobid) -{ - opal_ext3x_jobid_trkr_t *jptr; - - OPAL_PMIX_ACQUIRE_THREAD(&opal_pmix_base.lock); - - OPAL_LIST_FOREACH(jptr, &mca_pmix_ext3x_component.jobids, opal_ext3x_jobid_trkr_t) { - if (jptr->jobid == jobid) { - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - return jptr->nspace; - } - } - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - return NULL; -} - -static void ext3x_register_jobid(opal_jobid_t jobid, const char *nspace) -{ - opal_ext3x_jobid_trkr_t *jptr; - - OPAL_PMIX_ACQUIRE_THREAD(&opal_pmix_base.lock); - - /* if we don't already have it, add this to our jobid tracker */ - OPAL_LIST_FOREACH(jptr, &mca_pmix_ext3x_component.jobids, opal_ext3x_jobid_trkr_t) { - if (jptr->jobid == jobid) { - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - return; - } - } - jptr = OBJ_NEW(opal_ext3x_jobid_trkr_t); - (void)opal_string_copy(jptr->nspace, nspace, PMIX_MAX_NSLEN); - jptr->jobid = jobid; - opal_list_append(&mca_pmix_ext3x_component.jobids, &jptr->super); - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); -} - -static void event_hdlr_complete(pmix_status_t status, void *cbdata) -{ - ext3x_opcaddy_t *op = (ext3x_opcaddy_t*)cbdata; - - OBJ_RELEASE(op); -} - -static void return_local_event_hdlr(int status, opal_list_t *results, - opal_pmix_op_cbfunc_t cbfunc, void *thiscbdata, - void *notification_cbdata) -{ - ext3x_threadshift_t *cd = (ext3x_threadshift_t*)notification_cbdata; - ext3x_opcaddy_t *op; - opal_value_t *kv; - pmix_status_t pstatus; - size_t n; - - OPAL_ACQUIRE_OBJECT(cd); - if (NULL != cd->pmixcbfunc) { - op = OBJ_NEW(ext3x_opcaddy_t); - - if (NULL != results && 0 < (op->ninfo = opal_list_get_size(results))) { - /* convert the list of results to an array of info */ - PMIX_INFO_CREATE(op->info, op->ninfo); - n=0; - OPAL_LIST_FOREACH(kv, cd->info, opal_value_t) { - (void)opal_string_copy(op->info[n].key, kv->key, PMIX_MAX_KEYLEN); - ext3x_value_load(&op->info[n].value, kv); - ++n; - } - } - /* convert the status */ - pstatus = ext3x_convert_opalrc(status); - /* call the library's callback function */ - cd->pmixcbfunc(pstatus, op->info, op->ninfo, event_hdlr_complete, op, cd->cbdata); - } - - /* release the threadshift object */ - if (NULL != cd->info) { - OPAL_LIST_RELEASE(cd->info); - } - OBJ_RELEASE(cd); - - /* release the caller */ - if (NULL != cbfunc) { - cbfunc(OPAL_SUCCESS, thiscbdata); - } -} - -/* process the notification */ -static void process_event(int sd, short args, void *cbdata) -{ - ext3x_threadshift_t *cd = (ext3x_threadshift_t*)cbdata; - opal_ext3x_event_t *event; - - OPAL_PMIX_ACQUIRE_THREAD(&opal_pmix_base.lock); - - /* cycle thru the registrations */ - OPAL_LIST_FOREACH(event, &mca_pmix_ext3x_component.events, opal_ext3x_event_t) { - if (cd->id == event->index) { - /* found it - invoke the handler, pointing its - * callback function to our callback function */ - opal_output_verbose(2, opal_pmix_base_framework.framework_output, - "%s _EVENT_HDLR CALLING EVHDLR", - OPAL_NAME_PRINT(OPAL_PROC_MY_NAME)); - if (NULL != event->handler) { - OBJ_RETAIN(event); - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - event->handler(cd->status, &cd->pname, - cd->info, &cd->results, - return_local_event_hdlr, cd); - OBJ_RELEASE(event); - return; - } - } - } - - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - - /* if we didn't find a match, we still have to call their final callback */ - if (NULL != cd->pmixcbfunc) { - cd->pmixcbfunc(PMIX_SUCCESS, NULL, 0, NULL, NULL, cd->cbdata); - } - OPAL_LIST_RELEASE(cd->info); - OBJ_RELEASE(cd); - return; - -} -/* this function will be called by the PMIx client library - * whenever it receives notification of an event. The - * notification can come from an ORTE daemon (when launched - * by mpirun), directly from a RM (when direct launched), or - * from another process (via the local daemon). - * The call will occur in the PMIx event base */ -void ext3x_event_hdlr(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) -{ - ext3x_threadshift_t *cd; - int rc; - opal_value_t *iptr; - size_t n; - - opal_output_verbose(2, opal_pmix_base_framework.framework_output, - "%s RECEIVED NOTIFICATION OF STATUS %d ON HDLR %lu", - OPAL_NAME_PRINT(OPAL_PROC_MY_NAME), status, - (unsigned long)evhdlr_registration_id); - - OPAL_PMIX_ACQUIRE_THREAD(&opal_pmix_base.lock); - - cd = OBJ_NEW(ext3x_threadshift_t); - cd->id = evhdlr_registration_id; - cd->pmixcbfunc = cbfunc; - cd->cbdata = cbdata; - - /* convert the incoming status */ - cd->status = ext3x_convert_rc(status); - opal_output_verbose(2, opal_pmix_base_framework.framework_output, - "%s CONVERTED STATUS %d TO STATUS %d", - OPAL_NAME_PRINT(OPAL_PROC_MY_NAME), status, cd->status); - - /* convert the nspace/rank to an opal_process_name_t */ - if (NULL == source) { - cd->pname.jobid = OPAL_NAME_INVALID->jobid; - cd->pname.vpid = OPAL_NAME_INVALID->vpid; - } else { - if (OPAL_SUCCESS != (rc = opal_convert_string_to_jobid(&cd->pname.jobid, source->nspace))) { - OPAL_ERROR_LOG(rc); - cd->pname.jobid = OPAL_NAME_INVALID->jobid; - } - cd->pname.vpid = ext3x_convert_rank(source->rank); - } - - /* convert the array of info */ - if (NULL != info) { - cd->info = OBJ_NEW(opal_list_t); - for (n=0; n < ninfo; n++) { - iptr = OBJ_NEW(opal_value_t); - iptr->key = strdup(info[n].key); - if (OPAL_SUCCESS != (rc = ext3x_value_unload(iptr, &info[n].value))) { - OPAL_ERROR_LOG(rc); - OBJ_RELEASE(iptr); - continue; - } - opal_list_append(cd->info, &iptr->super); - } - } - - /* convert the array of prior results */ - if (NULL != results) { - for (n=0; n < nresults; n++) { - iptr = OBJ_NEW(opal_value_t); - iptr->key = strdup(results[n].key); - if (OPAL_SUCCESS != (rc = ext3x_value_unload(iptr, &results[n].value))) { - OPAL_ERROR_LOG(rc); - OBJ_RELEASE(iptr); - continue; - } - opal_list_append(&cd->results, &iptr->super); - } - } - - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - - /* do NOT directly call the event handler as this - * may lead to a deadlock condition should the - * handler invoke a PMIx function */ - OPAL_PMIX2X_THREADSHIFT(cd, process_event); - return; -} - -static int ext3x_register_cleanup(char *path, bool directory, bool ignore, bool jobscope) -{ - pmix_info_t pinfo[3]; - size_t n, ninfo=0; - pmix_status_t rc; - int ret; - - if (ignore) { - /* they want this path ignored */ - PMIX_INFO_LOAD(&pinfo[ninfo], PMIX_CLEANUP_IGNORE, path, PMIX_STRING); - ++ninfo; - } else { - if (directory) { - PMIX_INFO_LOAD(&pinfo[ninfo], PMIX_REGISTER_CLEANUP_DIR, path, PMIX_STRING); - ++ninfo; - /* recursively cleanup directories */ - PMIX_INFO_LOAD(&pinfo[ninfo], PMIX_CLEANUP_RECURSIVE, NULL, PMIX_BOOL); - ++ninfo; - } else { - /* order cleanup of the provided path */ - PMIX_INFO_LOAD(&pinfo[ninfo], PMIX_REGISTER_CLEANUP, path, PMIX_STRING); - ++ninfo; - } - } - - /* if they want this applied to the job, then indicate so */ - if (jobscope) { - rc = PMIx_Job_control_nb(NULL, 0, pinfo, ninfo, NULL, NULL); - } else { - /* only applies to us */ - rc = PMIx_Job_control_nb(&mca_pmix_ext3x_component.myproc, 1, pinfo, ninfo, NULL, NULL); - } - ret = ext3x_convert_rc(rc); - for (n=0; n < ninfo; n++) { - PMIX_INFO_DESTRUCT(&pinfo[n]); - } - return ret; -} - -opal_vpid_t ext3x_convert_rank(pmix_rank_t rank) -{ - switch(rank) { - case PMIX_RANK_UNDEF: - return OPAL_VPID_INVALID; - case PMIX_RANK_WILDCARD: - return OPAL_VPID_WILDCARD; - default: - return (opal_vpid_t)rank; - } -} - -pmix_rank_t ext3x_convert_opalrank(opal_vpid_t vpid) -{ - switch(vpid) { - case OPAL_VPID_WILDCARD: - return PMIX_RANK_WILDCARD; - case OPAL_VPID_INVALID: - return PMIX_RANK_UNDEF; - default: - return (pmix_rank_t)vpid; - } -} - -pmix_status_t ext3x_convert_opalrc(int rc) -{ - switch (rc) { - case OPAL_ERR_DEBUGGER_RELEASE: - return PMIX_ERR_DEBUGGER_RELEASE; - - case OPAL_ERR_HANDLERS_COMPLETE: - return PMIX_EVENT_ACTION_COMPLETE; - - case OPAL_ERR_PROC_ABORTED: - return PMIX_ERR_PROC_ABORTED; - - case OPAL_ERR_PROC_REQUESTED_ABORT: - return PMIX_ERR_PROC_REQUESTED_ABORT; - - case OPAL_ERR_PROC_ABORTING: - return PMIX_ERR_PROC_ABORTING; - - case OPAL_ERR_NODE_DOWN: - return PMIX_ERR_NODE_DOWN; - - case OPAL_ERR_NODE_OFFLINE: - return PMIX_ERR_NODE_OFFLINE; - - case OPAL_ERR_JOB_TERMINATED: - return PMIX_ERR_JOB_TERMINATED; - - case OPAL_ERR_PROC_RESTART: - return PMIX_ERR_PROC_RESTART; - - case OPAL_ERR_PROC_CHECKPOINT: - return PMIX_ERR_PROC_CHECKPOINT; - - case OPAL_ERR_PROC_MIGRATE: - return PMIX_ERR_PROC_MIGRATE; - - case OPAL_ERR_EVENT_REGISTRATION: - return PMIX_ERR_EVENT_REGISTRATION; - - case OPAL_ERR_NOT_IMPLEMENTED: - case OPAL_ERR_NOT_SUPPORTED: - return PMIX_ERR_NOT_SUPPORTED; - - case OPAL_ERR_NOT_FOUND: - return PMIX_ERR_NOT_FOUND; - - case OPAL_ERR_PERM: - case OPAL_ERR_UNREACH: - case OPAL_ERR_SERVER_NOT_AVAIL: - return PMIX_ERR_UNREACH; - - case OPAL_ERR_BAD_PARAM: - return PMIX_ERR_BAD_PARAM; - - case OPAL_ERR_OUT_OF_RESOURCE: - return PMIX_ERR_OUT_OF_RESOURCE; - - case OPAL_ERR_DATA_VALUE_NOT_FOUND: - return PMIX_ERR_DATA_VALUE_NOT_FOUND; - - case OPAL_ERR_TIMEOUT: - return PMIX_ERR_TIMEOUT; - - case OPAL_ERR_WOULD_BLOCK: - return PMIX_ERR_WOULD_BLOCK; - - case OPAL_EXISTS: - return PMIX_EXISTS; - - case OPAL_ERR_PARTIAL_SUCCESS: - return PMIX_QUERY_PARTIAL_SUCCESS; - - case OPAL_ERR_MODEL_DECLARED: - return PMIX_MODEL_DECLARED; - - case OPAL_ERROR: - return PMIX_ERROR; - case OPAL_SUCCESS: - return PMIX_SUCCESS; - - case OPAL_OPERATION_SUCCEEDED: - return PMIX_OPERATION_SUCCEEDED; - - default: - return rc; - } -} - -int ext3x_convert_rc(pmix_status_t rc) -{ - switch (rc) { - case PMIX_ERR_DEBUGGER_RELEASE: - return OPAL_ERR_DEBUGGER_RELEASE; - - case PMIX_EVENT_ACTION_COMPLETE: - return OPAL_ERR_HANDLERS_COMPLETE; - - case PMIX_ERR_PROC_ABORTED: - return OPAL_ERR_PROC_ABORTED; - - case PMIX_ERR_PROC_REQUESTED_ABORT: - return OPAL_ERR_PROC_REQUESTED_ABORT; - - case PMIX_ERR_PROC_ABORTING: - return OPAL_ERR_PROC_ABORTING; - - case PMIX_ERR_NODE_DOWN: - return OPAL_ERR_NODE_DOWN; - - case PMIX_ERR_NODE_OFFLINE: - return OPAL_ERR_NODE_OFFLINE; - - case PMIX_ERR_JOB_TERMINATED: - return OPAL_ERR_JOB_TERMINATED; - - case PMIX_ERR_PROC_RESTART: - return OPAL_ERR_PROC_RESTART; - - case PMIX_ERR_PROC_CHECKPOINT: - return OPAL_ERR_PROC_CHECKPOINT; - - case PMIX_ERR_PROC_MIGRATE: - return OPAL_ERR_PROC_MIGRATE; - - case PMIX_ERR_EVENT_REGISTRATION: - return OPAL_ERR_EVENT_REGISTRATION; - - case PMIX_ERR_NOT_SUPPORTED: - return OPAL_ERR_NOT_SUPPORTED; - - case PMIX_ERR_NOT_FOUND: - return OPAL_ERR_NOT_FOUND; - - case PMIX_ERR_OUT_OF_RESOURCE: - return OPAL_ERR_OUT_OF_RESOURCE; - - case PMIX_ERR_INIT: - return OPAL_ERROR; - - case PMIX_ERR_BAD_PARAM: - return OPAL_ERR_BAD_PARAM; - - case PMIX_ERR_UNREACH: - case PMIX_ERR_NO_PERMISSIONS: - return OPAL_ERR_UNREACH; - - case PMIX_ERR_TIMEOUT: - return OPAL_ERR_TIMEOUT; - - case PMIX_ERR_WOULD_BLOCK: - return OPAL_ERR_WOULD_BLOCK; - - case PMIX_ERR_LOST_CONNECTION_TO_SERVER: - case PMIX_ERR_LOST_PEER_CONNECTION: - case PMIX_ERR_LOST_CONNECTION_TO_CLIENT: - return OPAL_ERR_COMM_FAILURE; - - case PMIX_EXISTS: - return OPAL_EXISTS; - - case PMIX_QUERY_PARTIAL_SUCCESS: - return OPAL_ERR_PARTIAL_SUCCESS; - - case PMIX_MONITOR_HEARTBEAT_ALERT: - return OPAL_ERR_HEARTBEAT_ALERT; - - case PMIX_MONITOR_FILE_ALERT: - return OPAL_ERR_FILE_ALERT; - - case PMIX_MODEL_DECLARED: - return OPAL_ERR_MODEL_DECLARED; - - case PMIX_ERROR: - return OPAL_ERROR; - case PMIX_SUCCESS: - return OPAL_SUCCESS; - - case PMIX_OPERATION_SUCCEEDED: - return OPAL_OPERATION_SUCCEEDED; - - default: - return rc; - } -} - -opal_pmix_scope_t ext3x_convert_scope(pmix_scope_t scope) -{ - switch(scope) { - case PMIX_SCOPE_UNDEF: - return OPAL_PMIX_SCOPE_UNDEF; - case PMIX_LOCAL: - return OPAL_PMIX_LOCAL; - case PMIX_REMOTE: - return OPAL_PMIX_REMOTE; - case PMIX_GLOBAL: - return OPAL_PMIX_GLOBAL; - default: - return OPAL_PMIX_SCOPE_UNDEF; - } -} - -pmix_scope_t ext3x_convert_opalscope(opal_pmix_scope_t scope) { - switch(scope) { - case OPAL_PMIX_LOCAL: - return PMIX_LOCAL; - case OPAL_PMIX_REMOTE: - return PMIX_REMOTE; - case OPAL_PMIX_GLOBAL: - return PMIX_GLOBAL; - default: - return PMIX_SCOPE_UNDEF; - } -} - -pmix_data_range_t ext3x_convert_opalrange(opal_pmix_data_range_t range) { - switch(range) { - case OPAL_PMIX_RANGE_UNDEF: - return PMIX_RANGE_UNDEF; - case OPAL_PMIX_RANGE_LOCAL: - return PMIX_RANGE_LOCAL; - case OPAL_PMIX_RANGE_NAMESPACE: - return PMIX_RANGE_NAMESPACE; - case OPAL_PMIX_RANGE_SESSION: - return PMIX_RANGE_SESSION; - case OPAL_PMIX_RANGE_GLOBAL: - return PMIX_RANGE_GLOBAL; - case OPAL_PMIX_RANGE_CUSTOM: - return PMIX_RANGE_CUSTOM; - case OPAL_PMIX_RANGE_PROC_LOCAL: - return PMIX_RANGE_PROC_LOCAL; - default: - return PMIX_SCOPE_UNDEF; - } -} - -opal_pmix_data_range_t ext3x_convert_range(pmix_data_range_t range) { - switch(range) { - case PMIX_RANGE_UNDEF: - return OPAL_PMIX_RANGE_UNDEF; - case PMIX_RANGE_LOCAL: - return OPAL_PMIX_RANGE_LOCAL; - case PMIX_RANGE_NAMESPACE: - return OPAL_PMIX_RANGE_NAMESPACE; - case PMIX_RANGE_SESSION: - return OPAL_PMIX_RANGE_SESSION; - case PMIX_RANGE_GLOBAL: - return OPAL_PMIX_RANGE_GLOBAL; - case PMIX_RANGE_CUSTOM: - return OPAL_PMIX_RANGE_CUSTOM; - default: - return OPAL_PMIX_RANGE_UNDEF; - } -} - -opal_pmix_persistence_t ext3x_convert_persist(pmix_persistence_t persist) -{ - switch(persist) { - case PMIX_PERSIST_INDEF: - return OPAL_PMIX_PERSIST_INDEF; - case PMIX_PERSIST_FIRST_READ: - return OPAL_PMIX_PERSIST_FIRST_READ; - case PMIX_PERSIST_PROC: - return OPAL_PMIX_PERSIST_PROC; - case PMIX_PERSIST_APP: - return OPAL_PMIX_PERSIST_APP; - case PMIX_PERSIST_SESSION: - return OPAL_PMIX_PERSIST_SESSION; - default: - return OPAL_PMIX_PERSIST_INDEF; - } -} - -pmix_persistence_t ext3x_convert_opalpersist(opal_pmix_persistence_t persist) -{ - switch(persist) { - case OPAL_PMIX_PERSIST_INDEF: - return PMIX_PERSIST_INDEF; - case OPAL_PMIX_PERSIST_FIRST_READ: - return PMIX_PERSIST_FIRST_READ; - case OPAL_PMIX_PERSIST_PROC: - return PMIX_PERSIST_PROC; - case OPAL_PMIX_PERSIST_APP: - return PMIX_PERSIST_APP; - case OPAL_PMIX_PERSIST_SESSION: - return PMIX_PERSIST_SESSION; - default: - return PMIX_PERSIST_INDEF; - } -} - -char* ext3x_convert_jobid(opal_jobid_t jobid) -{ - opal_ext3x_jobid_trkr_t *jptr; - - /* look thru our list of jobids and find the - * corresponding nspace */ - OPAL_LIST_FOREACH(jptr, &mca_pmix_ext3x_component.jobids, opal_ext3x_jobid_trkr_t) { - if (jptr->jobid == jobid) { - return jptr->nspace; - } - } - return NULL; -} - -/**** RHC: NEED TO ADD SUPPORT FOR NEW PMIX DATA TYPES, INCLUDING - **** CONVERSION OF PROC STATES ****/ - -void ext3x_value_load(pmix_value_t *v, - opal_value_t *kv) -{ - opal_ext3x_jobid_trkr_t *job; - bool found; - opal_list_t *list; - opal_value_t *val; - pmix_info_t *info; - size_t n; - - switch(kv->type) { - case OPAL_UNDEF: - v->type = PMIX_UNDEF; - break; - case OPAL_BOOL: - v->type = PMIX_BOOL; - memcpy(&(v->data.flag), &kv->data.flag, 1); - break; - case OPAL_BYTE: - v->type = PMIX_BYTE; - memcpy(&(v->data.byte), &kv->data.byte, 1); - break; - case OPAL_STRING: - v->type = PMIX_STRING; - if (NULL != kv->data.string) { - v->data.string = strdup(kv->data.string); - } else { - v->data.string = NULL; - } - break; - case OPAL_SIZE: - v->type = PMIX_SIZE; - memcpy(&(v->data.size), &kv->data.size, sizeof(size_t)); - break; - case OPAL_PID: - v->type = PMIX_PID; - memcpy(&(v->data.pid), &kv->data.pid, sizeof(pid_t)); - break; - case OPAL_INT: - v->type = PMIX_INT; - memcpy(&(v->data.integer), &kv->data.integer, sizeof(int)); - break; - case OPAL_INT8: - v->type = PMIX_INT8; - memcpy(&(v->data.int8), &kv->data.int8, 1); - break; - case OPAL_INT16: - v->type = PMIX_INT16; - memcpy(&(v->data.int16), &kv->data.int16, 2); - break; - case OPAL_INT32: - v->type = PMIX_INT32; - memcpy(&(v->data.int32), &kv->data.int32, 4); - break; - case OPAL_INT64: - v->type = PMIX_INT64; - memcpy(&(v->data.int64), &kv->data.int64, 8); - break; - case OPAL_UINT: - v->type = PMIX_UINT; - memcpy(&(v->data.uint), &kv->data.uint, sizeof(int)); - break; - case OPAL_UINT8: - v->type = PMIX_UINT8; - memcpy(&(v->data.uint8), &kv->data.uint8, 1); - break; - case OPAL_UINT16: - v->type = PMIX_UINT16; - memcpy(&(v->data.uint16), &kv->data.uint16, 2); - break; - case OPAL_UINT32: - v->type = PMIX_UINT32; - memcpy(&(v->data.uint32), &kv->data.uint32, 4); - break; - case OPAL_UINT64: - v->type = PMIX_UINT64; - memcpy(&(v->data.uint64), &kv->data.uint64, 8); - break; - case OPAL_FLOAT: - v->type = PMIX_FLOAT; - memcpy(&(v->data.fval), &kv->data.fval, sizeof(float)); - break; - case OPAL_DOUBLE: - v->type = PMIX_DOUBLE; - memcpy(&(v->data.dval), &kv->data.dval, sizeof(double)); - break; - case OPAL_TIMEVAL: - v->type = PMIX_TIMEVAL; - memcpy(&(v->data.tv), &kv->data.tv, sizeof(struct timeval)); - break; - case OPAL_TIME: - v->type = PMIX_TIME; - memcpy(&(v->data.time), &kv->data.time, sizeof(time_t)); - break; - case OPAL_STATUS: - v->type = PMIX_STATUS; - v->data.status = ext3x_convert_opalrc(kv->data.status); - break; - case OPAL_VPID: - v->type = PMIX_PROC_RANK; - v->data.rank = ext3x_convert_opalrank(kv->data.name.vpid); - break; - case OPAL_NAME: - v->type = PMIX_PROC; - /* have to stringify the jobid */ - PMIX_PROC_CREATE(v->data.proc, 1); - /* see if this job is in our list of known nspaces */ - found = false; - OPAL_LIST_FOREACH(job, &mca_pmix_ext3x_component.jobids, opal_ext3x_jobid_trkr_t) { - if (job->jobid == kv->data.name.jobid) { - (void)opal_string_copy(v->data.proc->nspace, job->nspace, PMIX_MAX_NSLEN); - found = true; - break; - } - } - if (!found) { - (void)opal_snprintf_jobid(v->data.proc->nspace, PMIX_MAX_NSLEN, kv->data.name.jobid); - } - v->data.proc->rank = ext3x_convert_opalrank(kv->data.name.vpid); - break; - case OPAL_BYTE_OBJECT: - v->type = PMIX_BYTE_OBJECT; - if (NULL != kv->data.bo.bytes) { - v->data.bo.bytes = (char*)malloc(kv->data.bo.size); - memcpy(v->data.bo.bytes, kv->data.bo.bytes, kv->data.bo.size); - v->data.bo.size = (size_t)kv->data.bo.size; - } else { - v->data.bo.bytes = NULL; - v->data.bo.size = 0; - } - break; - case OPAL_PERSIST: - v->type = PMIX_PERSIST; - v->data.persist = ext3x_convert_opalpersist((opal_pmix_persistence_t)kv->data.uint8); - break; - case OPAL_SCOPE: - v->type = PMIX_SCOPE; - v->data.scope = ext3x_convert_opalscope((opal_pmix_scope_t)kv->data.uint8); - break; - case OPAL_DATA_RANGE: - v->type = PMIX_DATA_RANGE; - v->data.range = ext3x_convert_opalrange((opal_pmix_data_range_t)kv->data.uint8); - break; - case OPAL_PROC_STATE: - v->type = PMIX_PROC_STATE; - /* the OPAL layer doesn't have any concept of proc state, - * so the ORTE layer is responsible for converting it */ - memcpy(&v->data.state, &kv->data.uint8, sizeof(uint8_t)); - break; - case OPAL_PTR: - /* if the opal_value_t is passing a true pointer, then - * respect that request and pass it along */ - if (0 == strcmp(kv->key, OPAL_PMIX_EVENT_RETURN_OBJECT)) { - v->type = PMIX_POINTER; - v->data.ptr = kv->data.ptr; - break; - } - /* otherwise, it must be to a list of - * opal_value_t's that we need to convert to a pmix_data_array - * of pmix_info_t structures */ - list = (opal_list_t*)kv->data.ptr; - v->type = PMIX_DATA_ARRAY; - v->data.darray = (pmix_data_array_t*)malloc(sizeof(pmix_data_array_t)); - v->data.darray->type = PMIX_INFO; - v->data.darray->size = opal_list_get_size(list); - if (0 < v->data.darray->size) { - PMIX_INFO_CREATE(info, v->data.darray->size); - v->data.darray->array = info; - n=0; - OPAL_LIST_FOREACH(val, list, opal_value_t) { - if (NULL != val->key) { - (void)opal_string_copy(info[n].key, val->key, PMIX_MAX_KEYLEN); - } - ext3x_value_load(&info[n].value, val); - ++n; - } - } else { - v->data.darray->array = NULL; - } - break; - case OPAL_PROC_INFO: - v->type = PMIX_PROC_INFO; - PMIX_PROC_INFO_CREATE(v->data.pinfo, 1); - /* see if this job is in our list of known nspaces */ - found = false; - OPAL_LIST_FOREACH(job, &mca_pmix_ext3x_component.jobids, opal_ext3x_jobid_trkr_t) { - if (job->jobid == kv->data.pinfo.name.jobid) { - (void)opal_string_copy(v->data.pinfo->proc.nspace, job->nspace, PMIX_MAX_NSLEN); - found = true; - break; - } - } - if (!found) { - (void)opal_snprintf_jobid(v->data.pinfo->proc.nspace, PMIX_MAX_NSLEN, kv->data.pinfo.name.jobid); - } - v->data.pinfo->proc.rank = ext3x_convert_opalrank(kv->data.pinfo.name.vpid); - if (NULL != kv->data.pinfo.hostname) { - v->data.pinfo->hostname = strdup(kv->data.pinfo.hostname); - } - if (NULL != kv->data.pinfo.executable_name) { - v->data.pinfo->executable_name = strdup(kv->data.pinfo.executable_name); - } - v->data.pinfo->pid = kv->data.pinfo.pid; - v->data.pinfo->exit_code = kv->data.pinfo.exit_code; - v->data.pinfo->state = ext3x_convert_opalstate(kv->data.pinfo.state); - break; - case OPAL_ENVAR: - v->type = PMIX_ENVAR; - PMIX_ENVAR_CONSTRUCT(&v->data.envar); - if (NULL != kv->data.envar.envar) { - v->data.envar.envar = strdup(kv->data.envar.envar); - } - if (NULL != kv->data.envar.value) { - v->data.envar.value = strdup(kv->data.envar.value); - } - v->data.envar.separator = kv->data.envar.separator; - break; - default: - /* silence warnings */ - break; - } -} - -int ext3x_value_unload(opal_value_t *kv, - const pmix_value_t *v) -{ - int rc=OPAL_SUCCESS; - bool found; - opal_ext3x_jobid_trkr_t *job; - opal_list_t *lt; - opal_value_t *ival; - size_t n; - - switch(v->type) { - case PMIX_UNDEF: - kv->type = OPAL_UNDEF; - break; - case PMIX_BOOL: - kv->type = OPAL_BOOL; - memcpy(&kv->data.flag, &(v->data.flag), 1); - break; - case PMIX_BYTE: - kv->type = OPAL_BYTE; - memcpy(&kv->data.byte, &(v->data.byte), 1); - break; - case PMIX_STRING: - kv->type = OPAL_STRING; - if (NULL != v->data.string) { - kv->data.string = strdup(v->data.string); - } - break; - case PMIX_SIZE: - kv->type = OPAL_SIZE; - memcpy(&kv->data.size, &(v->data.size), sizeof(size_t)); - break; - case PMIX_PID: - kv->type = OPAL_PID; - memcpy(&kv->data.pid, &(v->data.pid), sizeof(pid_t)); - break; - case PMIX_INT: - kv->type = OPAL_INT; - memcpy(&kv->data.integer, &(v->data.integer), sizeof(int)); - break; - case PMIX_INT8: - kv->type = OPAL_INT8; - memcpy(&kv->data.int8, &(v->data.int8), 1); - break; - case PMIX_INT16: - kv->type = OPAL_INT16; - memcpy(&kv->data.int16, &(v->data.int16), 2); - break; - case PMIX_INT32: - kv->type = OPAL_INT32; - memcpy(&kv->data.int32, &(v->data.int32), 4); - break; - case PMIX_INT64: - kv->type = OPAL_INT64; - memcpy(&kv->data.int64, &(v->data.int64), 8); - break; - case PMIX_UINT: - kv->type = OPAL_UINT; - memcpy(&kv->data.uint, &(v->data.uint), sizeof(int)); - break; - case PMIX_UINT8: - kv->type = OPAL_UINT8; - memcpy(&kv->data.uint8, &(v->data.uint8), 1); - break; - case PMIX_UINT16: - kv->type = OPAL_UINT16; - memcpy(&kv->data.uint16, &(v->data.uint16), 2); - break; - case PMIX_UINT32: - kv->type = OPAL_UINT32; - memcpy(&kv->data.uint32, &(v->data.uint32), 4); - break; - case PMIX_UINT64: - kv->type = OPAL_UINT64; - memcpy(&kv->data.uint64, &(v->data.uint64), 8); - break; - case PMIX_FLOAT: - kv->type = OPAL_FLOAT; - memcpy(&kv->data.fval, &(v->data.fval), sizeof(float)); - break; - case PMIX_DOUBLE: - kv->type = OPAL_DOUBLE; - memcpy(&kv->data.dval, &(v->data.dval), sizeof(double)); - break; - case PMIX_TIMEVAL: - kv->type = OPAL_TIMEVAL; - memcpy(&kv->data.tv, &(v->data.tv), sizeof(struct timeval)); - break; - case PMIX_TIME: - kv->type = OPAL_TIME; - memcpy(&kv->data.time, &(v->data.time), sizeof(time_t)); - break; - case PMIX_STATUS: - kv->type = OPAL_STATUS; - kv->data.status = ext3x_convert_rc(v->data.status); - break; - case PMIX_VALUE: - OPAL_ERROR_LOG(OPAL_ERR_NOT_SUPPORTED); - rc = OPAL_ERR_NOT_SUPPORTED; - break; - case PMIX_PROC: - kv->type = OPAL_NAME; - /* see if this job is in our list of known nspaces */ - found = false; - OPAL_LIST_FOREACH(job, &mca_pmix_ext3x_component.jobids, opal_ext3x_jobid_trkr_t) { - if (0 == strncmp(job->nspace, v->data.proc->nspace, PMIX_MAX_NSLEN)) { - kv->data.name.jobid = job->jobid; - found = true; - break; - } - } - if (!found) { - if (OPAL_SUCCESS != (rc = opal_convert_string_to_jobid(&kv->data.name.jobid, v->data.proc->nspace))) { - return ext3x_convert_opalrc(rc); - } - } - kv->data.name.vpid = ext3x_convert_rank(v->data.proc->rank); - break; - case PMIX_APP: - OPAL_ERROR_LOG(OPAL_ERR_NOT_SUPPORTED); - rc = OPAL_ERR_NOT_SUPPORTED; - break; - case PMIX_INFO: - OPAL_ERROR_LOG(OPAL_ERR_NOT_SUPPORTED); - rc = OPAL_ERR_NOT_SUPPORTED; - break; - case PMIX_PDATA: - OPAL_ERROR_LOG(OPAL_ERR_NOT_SUPPORTED); - rc = OPAL_ERR_NOT_SUPPORTED; - break; - case PMIX_BUFFER: - OPAL_ERROR_LOG(OPAL_ERR_NOT_SUPPORTED); - rc = OPAL_ERR_NOT_SUPPORTED; - break; - case PMIX_BYTE_OBJECT: - kv->type = OPAL_BYTE_OBJECT; - if (NULL != v->data.bo.bytes && 0 < v->data.bo.size) { - kv->data.bo.bytes = (uint8_t*)malloc(v->data.bo.size); - memcpy(kv->data.bo.bytes, v->data.bo.bytes, v->data.bo.size); - kv->data.bo.size = (int)v->data.bo.size; - } else { - kv->data.bo.bytes = NULL; - kv->data.bo.size = 0; - } - break; - case PMIX_KVAL: - OPAL_ERROR_LOG(OPAL_ERR_NOT_SUPPORTED); - rc = OPAL_ERR_NOT_SUPPORTED; - break; -#ifdef PMIX_MODEX - case PMIX_MODEX: - OPAL_ERROR_LOG(OPAL_ERR_NOT_SUPPORTED); - rc = OPAL_ERR_NOT_SUPPORTED; - break; -#endif /* PMIX_MODEX */ - case PMIX_PERSIST: - kv->type = OPAL_PERSIST; - kv->data.uint8 = ext3x_convert_persist(v->data.persist); - break; - case PMIX_POINTER: - kv->type = OPAL_PTR; - kv->data.ptr = v->data.ptr; - break; - case PMIX_SCOPE: - kv->type = OPAL_SCOPE; - kv->data.uint8 = ext3x_convert_scope(v->data.scope); - break; - case PMIX_DATA_RANGE: - kv->type = OPAL_DATA_RANGE; - kv->data.uint8 = ext3x_convert_range(v->data.range); - break; - case PMIX_COMMAND: - OPAL_ERROR_LOG(OPAL_ERR_NOT_SUPPORTED); - rc = OPAL_ERR_NOT_SUPPORTED; - break; - case PMIX_INFO_DIRECTIVES: - OPAL_ERROR_LOG(OPAL_ERR_NOT_SUPPORTED); - rc = OPAL_ERR_NOT_SUPPORTED; - break; - case PMIX_DATA_TYPE: - OPAL_ERROR_LOG(OPAL_ERR_NOT_SUPPORTED); - rc = OPAL_ERR_NOT_SUPPORTED; - break; - case PMIX_PROC_STATE: - kv->type = OPAL_PROC_STATE; - /* the OPAL layer doesn't have any concept of proc state, - * so the ORTE layer is responsible for converting it */ - memcpy(&kv->data.uint8, &v->data.state, sizeof(uint8_t)); - break; - case PMIX_PROC_INFO: - kv->type = OPAL_PROC_INFO; - if (NULL == v->data.pinfo) { - rc = OPAL_ERR_BAD_PARAM; - break; - } - /* see if this job is in our list of known nspaces */ - found = false; - OPAL_LIST_FOREACH(job, &mca_pmix_ext3x_component.jobids, opal_ext3x_jobid_trkr_t) { - if (0 == strncmp(job->nspace, v->data.pinfo->proc.nspace, PMIX_MAX_NSLEN)) { - kv->data.pinfo.name.jobid = job->jobid; - found = true; - break; - } - } - if (!found) { - if (OPAL_SUCCESS != (rc = opal_convert_string_to_jobid(&kv->data.pinfo.name.jobid, v->data.pinfo->proc.nspace))) { - return ext3x_convert_opalrc(rc); - } - } - kv->data.pinfo.name.vpid = ext3x_convert_rank(v->data.pinfo->proc.rank); - if (NULL != v->data.pinfo->hostname) { - kv->data.pinfo.hostname = strdup(v->data.pinfo->hostname); - } - if (NULL != v->data.pinfo->executable_name) { - kv->data.pinfo.executable_name = strdup(v->data.pinfo->executable_name); - } - kv->data.pinfo.pid = v->data.pinfo->pid; - kv->data.pinfo.exit_code = v->data.pinfo->exit_code; - kv->data.pinfo.state = ext3x_convert_state(v->data.pinfo->state); - break; - case PMIX_DATA_ARRAY: - if (NULL == v->data.darray || NULL == v->data.darray->array) { - kv->data.ptr = NULL; - break; - } - lt = OBJ_NEW(opal_list_t); - kv->type = OPAL_PTR; - kv->data.ptr = (void*)lt; - for (n=0; n < v->data.darray->size; n++) { - ival = OBJ_NEW(opal_value_t); - opal_list_append(lt, &ival->super); - /* handle the various types */ - if (PMIX_INFO == v->data.darray->type) { - pmix_info_t *iptr = (pmix_info_t*)v->data.darray->array; - if (NULL == iptr) { - rc = OPAL_ERR_BAD_PARAM; - break; - } - ival->key = strdup(iptr[n].key); - rc = ext3x_value_unload(ival, &iptr[n].value); - if (OPAL_SUCCESS != rc) { - OPAL_LIST_RELEASE(lt); - kv->type = OPAL_UNDEF; - kv->data.ptr = NULL; - break; - } - } - } - break; - case PMIX_PROC_RANK: - kv->type = OPAL_VPID; - kv->data.name.vpid = ext3x_convert_rank(v->data.rank); - break; - case PMIX_QUERY: - OPAL_ERROR_LOG(OPAL_ERR_NOT_SUPPORTED); - rc = OPAL_ERR_NOT_SUPPORTED; - break; - case PMIX_COMPRESSED_STRING: - OPAL_ERROR_LOG(OPAL_ERR_NOT_SUPPORTED); - rc = OPAL_ERR_NOT_SUPPORTED; - break; - case PMIX_ALLOC_DIRECTIVE: - OPAL_ERROR_LOG(OPAL_ERR_NOT_SUPPORTED); - rc = OPAL_ERR_NOT_SUPPORTED; - break; -#ifdef PMIX_INFO_ARRAY - case PMIX_INFO_ARRAY: - OPAL_ERROR_LOG(OPAL_ERR_NOT_SUPPORTED); - rc = OPAL_ERR_NOT_SUPPORTED; - break; -#endif /* PMIX_INFO_ARRAY */ - case PMIX_IOF_CHANNEL: - OPAL_ERROR_LOG(OPAL_ERR_NOT_SUPPORTED); - rc = OPAL_ERR_NOT_SUPPORTED; - break; - case PMIX_ENVAR: - kv->type = OPAL_ENVAR; - OBJ_CONSTRUCT(&kv->data.envar, opal_envar_t); - if (NULL != v->data.envar.envar) { - kv->data.envar.envar = strdup(v->data.envar.envar); - } - if (NULL != v->data.envar.value) { - kv->data.envar.value = strdup(v->data.envar.value); - } - kv->data.envar.separator = v->data.envar.separator; - break; - default: - /* silence warnings */ - rc = OPAL_ERROR; - break; - } - return rc; -} - -static void errreg_cbfunc (pmix_status_t status, - size_t errhandler_ref, - void *cbdata) -{ - ext3x_opcaddy_t *op = (ext3x_opcaddy_t*)cbdata; - - OPAL_ACQUIRE_OBJECT(op); - op->event->index = errhandler_ref; - opal_output_verbose(5, opal_pmix_base_framework.framework_output, - "PMIX3x errreg_cbfunc - error handler registered status=%d, reference=%lu", - status, (unsigned long)errhandler_ref); - if (NULL != op->evregcbfunc) { - op->evregcbfunc(ext3x_convert_rc(status), errhandler_ref, op->cbdata); - } - OBJ_RELEASE(op); -} - -static void register_handler(opal_list_t *event_codes, - opal_list_t *info, - opal_pmix_notification_fn_t evhandler, - opal_pmix_evhandler_reg_cbfunc_t cbfunc, - void *cbdata) -{ - ext3x_opcaddy_t *op = (ext3x_opcaddy_t*)cbdata; - size_t n; - opal_value_t *kv; - - OPAL_PMIX_ACQUIRE_THREAD(&opal_pmix_base.lock); - if (0 >= opal_pmix_base.initialized) { - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - if (NULL != cbfunc) { - cbfunc(OPAL_ERR_NOT_INITIALIZED, 0, cbdata); - } - return; - } - - op = OBJ_NEW(ext3x_opcaddy_t); - op->evregcbfunc = cbfunc; - op->cbdata = cbdata; - - /* convert the event codes */ - if (NULL != event_codes) { - op->ncodes = opal_list_get_size(event_codes); - op->pcodes = (pmix_status_t*)malloc(op->ncodes * sizeof(pmix_status_t)); - n=0; - OPAL_LIST_FOREACH(kv, event_codes, opal_value_t) { - op->pcodes[n] = ext3x_convert_opalrc(kv->data.integer); - ++n; - } - } - - /* convert the list of info to an array of pmix_info_t */ - if (NULL != info && 0 < (op->ninfo = opal_list_get_size(info))) { - PMIX_INFO_CREATE(op->info, op->ninfo); - n=0; - OPAL_LIST_FOREACH(kv, info, opal_value_t) { - (void)opal_string_copy(op->info[n].key, kv->key, PMIX_MAX_KEYLEN); - ext3x_value_load(&op->info[n].value, kv); - ++n; - } - } - - /* register the event */ - op->event = OBJ_NEW(opal_ext3x_event_t); - op->event->handler = evhandler; - opal_list_append(&mca_pmix_ext3x_component.events, &op->event->super); - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - - PMIx_Register_event_handler(op->pcodes, op->ncodes, - op->info, op->ninfo, - ext3x_event_hdlr, errreg_cbfunc, op); - return; -} - -static void deregister_handler(size_t evhandler, - opal_pmix_op_cbfunc_t cbfunc, - void *cbdata) -{ - ext3x_opcaddy_t *op; - opal_ext3x_event_t *event; - - OPAL_PMIX_ACQUIRE_THREAD(&opal_pmix_base.lock); - if (0 >= opal_pmix_base.initialized) { - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - if (NULL != cbfunc) { - cbfunc(OPAL_ERR_NOT_INITIALIZED, cbdata); - } - return; - } - - /* look for this event */ - OPAL_LIST_FOREACH(event, &mca_pmix_ext3x_component.events, opal_ext3x_event_t) { - if (evhandler == event->index) { - opal_list_remove_item(&mca_pmix_ext3x_component.events, &event->super); - OBJ_RELEASE(event); - break; - } - } - - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - - op = OBJ_NEW(ext3x_opcaddy_t); - op->opcbfunc = cbfunc; - op->cbdata = cbdata; - - /* tell the library to deregister this handler */ - PMIx_Deregister_event_handler(evhandler, opcbfunc, op); - return; -} - -static void notify_complete(pmix_status_t status, void *cbdata) -{ - ext3x_opcaddy_t *op = (ext3x_opcaddy_t*)cbdata; - if (NULL != op->opcbfunc) { - op->opcbfunc(ext3x_convert_rc(status), op->cbdata); - } - OBJ_RELEASE(op); -} - -static int notify_event(int status, - const opal_process_name_t *source, - opal_pmix_data_range_t range, - opal_list_t *info, - opal_pmix_op_cbfunc_t cbfunc, void *cbdata) -{ - ext3x_opcaddy_t *op; - opal_value_t *kv; - pmix_proc_t p, *pptr; - pmix_status_t pstatus; - size_t n; - pmix_data_range_t prange; - char *nsptr; - - OPAL_PMIX_ACQUIRE_THREAD(&opal_pmix_base.lock); - if (0 >= opal_pmix_base.initialized) { - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - return OPAL_ERR_NOT_INITIALIZED; - } - - op = OBJ_NEW(ext3x_opcaddy_t); - op->opcbfunc = cbfunc; - op->cbdata = cbdata; - - /* convert the status */ - pstatus = ext3x_convert_opalrc(status); - - /* convert the source */ - if (NULL == source) { - pptr = NULL; - } else { - if (NULL == (nsptr = ext3x_convert_jobid(source->jobid))) { - OBJ_RELEASE(op); - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - return OPAL_ERR_NOT_FOUND; - } - (void)opal_string_copy(p.nspace, nsptr, PMIX_MAX_NSLEN); - p.rank = ext3x_convert_opalrank(source->vpid); - pptr = &p; - } - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - - /* convert the range */ - prange = ext3x_convert_opalrange(range); - - /* convert the list of info */ - if (NULL != info && 0 < (op->ninfo = opal_list_get_size(info))) { - PMIX_INFO_CREATE(op->info, op->ninfo); - n=0; - OPAL_LIST_FOREACH(kv, info, opal_value_t) { - (void)opal_string_copy(op->info[n].key, kv->key, PMIX_MAX_KEYLEN); - /* little dicey here as we need to convert a status, if - * provided, and it will be an int coming down to us */ - if (0 == strcmp(kv->key, OPAL_PMIX_JOB_TERM_STATUS)) { - op->info[n].value.type = PMIX_STATUS; - op->info[n].value.data.status = ext3x_convert_opalrc(kv->data.integer); - } else { - ext3x_value_load(&op->info[n].value, kv); - } - ++n; - } - } - - /* ask the library to notify our clients */ - pstatus = PMIx_Notify_event(pstatus, pptr, prange, op->info, op->ninfo, notify_complete, op); - - return ext3x_convert_rc(pstatus); -} - -static void relcbfunc(void *cbdata) -{ - opal_list_t *results = (opal_list_t*)cbdata; - if (NULL != results) { - OPAL_LIST_RELEASE(results); - } -} - -static void infocbfunc(pmix_status_t status, - pmix_info_t *info, size_t ninfo, - void *cbdata, - pmix_release_cbfunc_t release_fn, - void *release_cbdata) -{ - ext3x_opcaddy_t *cd = (ext3x_opcaddy_t*)cbdata; - int rc = OPAL_SUCCESS; - opal_list_t *results = NULL; - opal_value_t *iptr; - size_t n; - - OPAL_ACQUIRE_OBJECT(cd); - - /* convert the array of pmix_info_t to the list of info */ - if (NULL != info) { - results = OBJ_NEW(opal_list_t); - for (n=0; n < ninfo; n++) { - iptr = OBJ_NEW(opal_value_t); - opal_list_append(results, &iptr->super); - iptr->key = strdup(info[n].key); - if (OPAL_SUCCESS != (rc = ext3x_value_unload(iptr, &info[n].value))) { - OPAL_ERROR_LOG(rc); - OPAL_LIST_RELEASE(results); - results = NULL; - break; - } - } - } - - if (NULL != release_fn) { - release_fn(release_cbdata); - } - - /* return the values to the original requestor */ - if (NULL != cd->qcbfunc) { - cd->qcbfunc(rc, results, cd->cbdata, relcbfunc, results); - } - OBJ_RELEASE(cd); -} - -static void ext3x_query(opal_list_t *queries, - opal_pmix_info_cbfunc_t cbfunc, void *cbdata) -{ - int rc; - opal_value_t *ival; - size_t n, nqueries, nq; - ext3x_opcaddy_t *cd; - pmix_status_t prc; - opal_pmix_query_t *q; - - OPAL_PMIX_ACQUIRE_THREAD(&opal_pmix_base.lock); - if (0 >= opal_pmix_base.initialized) { - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - if (NULL != cbfunc) { - cbfunc(OPAL_ERR_NOT_INITIALIZED, NULL, cbdata, NULL, NULL); - } - return; - } - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - - /* create the caddy */ - cd = OBJ_NEW(ext3x_opcaddy_t); - - /* bozo check */ - if (NULL == queries || 0 == (nqueries = opal_list_get_size(queries))) { - rc = OPAL_ERR_BAD_PARAM; - goto CLEANUP; - } - - /* setup the operation */ - cd->qcbfunc = cbfunc; - cd->cbdata = cbdata; - cd->nqueries = nqueries; - - /* convert the list to an array of query objects */ - PMIX_QUERY_CREATE(cd->queries, cd->nqueries); - n=0; - OPAL_LIST_FOREACH(q, queries, opal_pmix_query_t) { - cd->queries[n].keys = opal_argv_copy(q->keys); - cd->queries[n].nqual = opal_list_get_size(&q->qualifiers); - if (0 < cd->queries[n].nqual) { - PMIX_INFO_CREATE(cd->queries[n].qualifiers, cd->queries[n].nqual); - nq = 0; - OPAL_LIST_FOREACH(ival, &q->qualifiers, opal_value_t) { - (void)opal_string_copy(cd->queries[n].qualifiers[nq].key, ival->key, PMIX_MAX_KEYLEN); - ext3x_value_load(&cd->queries[n].qualifiers[nq].value, ival); - ++nq; - } - } - ++n; - } - - /* pass it down */ - if (PMIX_SUCCESS != (prc = PMIx_Query_info_nb(cd->queries, cd->nqueries, - infocbfunc, cd))) { - /* do not hang! */ - rc = ext3x_convert_rc(prc); - goto CLEANUP; - } - - return; - - CLEANUP: - if (NULL != cbfunc) { - cbfunc(rc, NULL, cbdata, NULL, NULL); - } - OBJ_RELEASE(cd); - return; -} - -static void ext3x_log(opal_list_t *info, - opal_pmix_op_cbfunc_t cbfunc, void *cbdata) -{ - int rc; - opal_value_t *ival; - size_t n, ninfo; - ext3x_opcaddy_t *cd; - pmix_status_t prc; - - OPAL_PMIX_ACQUIRE_THREAD(&opal_pmix_base.lock); - if (0 >= opal_pmix_base.initialized) { - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - if (NULL != cbfunc) { - cbfunc(OPAL_ERR_NOT_INITIALIZED, cbdata); - } - return; - } - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - - /* create the caddy */ - cd = OBJ_NEW(ext3x_opcaddy_t); - - /* bozo check */ - if (NULL == info || 0 == (ninfo = opal_list_get_size(info))) { - rc = OPAL_ERR_BAD_PARAM; - goto CLEANUP; - } - - /* setup the operation */ - cd->opcbfunc = cbfunc; - cd->cbdata = cbdata; - cd->ninfo = ninfo; - - /* convert the list to an array of info objects */ - PMIX_INFO_CREATE(cd->info, cd->ninfo); - n=0; - OPAL_LIST_FOREACH(ival, info, opal_value_t) { - (void)opal_string_copy(cd->info[n].key, ival->key, PMIX_MAX_KEYLEN); - ext3x_value_load(&cd->info[n].value, ival); - ++n; - } - - /* pass it down */ - if (PMIX_SUCCESS != (prc = PMIx_Log_nb(cd->info, cd->ninfo, NULL, 0, - opcbfunc, cd))) { - /* do not hang! */ - rc = ext3x_convert_rc(prc); - goto CLEANUP; - } - - return; - - CLEANUP: - if (NULL != cbfunc) { - cbfunc(rc, cbdata); - } - OBJ_RELEASE(cd); -} - -opal_pmix_alloc_directive_t ext3x_convert_allocdir(pmix_alloc_directive_t dir) -{ - switch (dir) { - case PMIX_ALLOC_NEW: - return OPAL_PMIX_ALLOC_NEW; - case PMIX_ALLOC_EXTEND: - return OPAL_PMIX_ALLOC_EXTEND; - case PMIX_ALLOC_RELEASE: - return OPAL_PMIX_ALLOC_RELEASE; - case PMIX_ALLOC_REAQUIRE: - return OPAL_PMIX_ALLOC_REAQCUIRE; - default: - return OPAL_PMIX_ALLOC_UNDEF; - } -} - -int ext3x_convert_state(pmix_proc_state_t state) -{ - switch(state) { - case PMIX_PROC_STATE_UNDEF: - return 0; - case PMIX_PROC_STATE_PREPPED: - case PMIX_PROC_STATE_LAUNCH_UNDERWAY: - return 1; - case PMIX_PROC_STATE_RESTART: - return 2; - case PMIX_PROC_STATE_TERMINATE: - return 3; - case PMIX_PROC_STATE_RUNNING: - return 4; - case PMIX_PROC_STATE_CONNECTED: - return 5; - case PMIX_PROC_STATE_UNTERMINATED: - return 15; - case PMIX_PROC_STATE_TERMINATED: - return 20; - case PMIX_PROC_STATE_KILLED_BY_CMD: - return 51; - case PMIX_PROC_STATE_ABORTED: - return 52; - case PMIX_PROC_STATE_FAILED_TO_START: - return 53; - case PMIX_PROC_STATE_ABORTED_BY_SIG: - return 54; - case PMIX_PROC_STATE_TERM_WO_SYNC: - return 55; - case PMIX_PROC_STATE_COMM_FAILED: - return 56; - case PMIX_PROC_STATE_CALLED_ABORT: - return 58; - case PMIX_PROC_STATE_MIGRATING: - return 60; - case PMIX_PROC_STATE_CANNOT_RESTART: - return 61; - case PMIX_PROC_STATE_TERM_NON_ZERO: - return 62; - case PMIX_PROC_STATE_FAILED_TO_LAUNCH: - return 63; - default: - return 0; // undef - } -} - -pmix_proc_state_t ext3x_convert_opalstate(int state) -{ - switch(state) { - case 0: - return PMIX_PROC_STATE_UNDEF; - case 1: - return PMIX_PROC_STATE_LAUNCH_UNDERWAY; - case 2: - return PMIX_PROC_STATE_RESTART; - case 3: - return PMIX_PROC_STATE_TERMINATE; - case 4: - return PMIX_PROC_STATE_RUNNING; - case 5: - return PMIX_PROC_STATE_CONNECTED; - case 51: - return PMIX_PROC_STATE_KILLED_BY_CMD; - case 52: - return PMIX_PROC_STATE_ABORTED; - case 53: - return PMIX_PROC_STATE_FAILED_TO_START; - case 54: - return PMIX_PROC_STATE_ABORTED_BY_SIG; - case 55: - return PMIX_PROC_STATE_TERM_WO_SYNC; - case 56: - return PMIX_PROC_STATE_COMM_FAILED; - case 58: - return PMIX_PROC_STATE_CALLED_ABORT; - case 59: - return PMIX_PROC_STATE_MIGRATING; - case 61: - return PMIX_PROC_STATE_CANNOT_RESTART; - case 62: - return PMIX_PROC_STATE_TERM_NON_ZERO; - case 63: - return PMIX_PROC_STATE_FAILED_TO_LAUNCH; - default: - return PMIX_PROC_STATE_UNDEF; - } -} - -/**** INSTANTIATE INTERNAL CLASSES ****/ -OBJ_CLASS_INSTANCE(opal_ext3x_jobid_trkr_t, - opal_list_item_t, - NULL, NULL); - -static void evcon(opal_ext3x_event_t *p) -{ - OPAL_PMIX_CONSTRUCT_LOCK(&p->lock); - p->handler = NULL; - p->cbdata = NULL; -} -static void evdes(opal_ext3x_event_t *p) -{ - OPAL_PMIX_DESTRUCT_LOCK(&p->lock); -} -OBJ_CLASS_INSTANCE(opal_ext3x_event_t, - opal_list_item_t, - evcon, evdes); - -static void opcon(ext3x_opcaddy_t *p) -{ - memset(&p->p, 0, sizeof(pmix_proc_t)); - p->nspace = NULL; - p->procs = NULL; - p->nprocs = 0; - p->pdata = NULL; - p->npdata = 0; - p->error_procs = NULL; - p->nerror_procs = 0; - p->info = NULL; - p->ninfo = 0; - p->apps = NULL; - p->sz = 0; - OPAL_PMIX_CONSTRUCT_LOCK(&p->lock); - p->codes = NULL; - p->pcodes = NULL; - p->ncodes = 0; - p->queries = NULL; - p->nqueries = 0; - p->event = NULL; - p->opcbfunc = NULL; - p->mdxcbfunc = NULL; - p->valcbfunc = NULL; - p->lkcbfunc = NULL; - p->spcbfunc = NULL; - p->evregcbfunc = NULL; - p->qcbfunc = NULL; - p->cbdata = NULL; -} -static void opdes(ext3x_opcaddy_t *p) -{ - OPAL_PMIX_DESTRUCT_LOCK(&p->lock); - if (NULL != p->nspace) { - free(p->nspace); - } - if (NULL != p->procs) { - PMIX_PROC_FREE(p->procs, p->nprocs); - } - if (NULL != p->pdata) { - PMIX_PDATA_FREE(p->pdata, p->npdata); - } - if (NULL != p->error_procs) { - PMIX_PROC_FREE(p->error_procs, p->nerror_procs); - } - if (NULL != p->info) { - PMIX_INFO_FREE(p->info, p->ninfo); - } - if (NULL != p->apps) { - PMIX_APP_FREE(p->apps, p->sz); - } - if (NULL != p->pcodes) { - free(p->pcodes); - } - if (NULL != p->queries) { - PMIX_QUERY_FREE(p->queries, p->nqueries); - } -} -OBJ_CLASS_INSTANCE(ext3x_opcaddy_t, - opal_object_t, - opcon, opdes); - -static void ocadcon(ext3x_opalcaddy_t *p) -{ - OBJ_CONSTRUCT(&p->procs, opal_list_t); - OBJ_CONSTRUCT(&p->info, opal_list_t); - OBJ_CONSTRUCT(&p->apps, opal_list_t); - p->opcbfunc = NULL; - p->dmdxfunc = NULL; - p->mdxcbfunc = NULL; - p->lkupcbfunc = NULL; - p->spwncbfunc = NULL; - p->cbdata = NULL; - p->odmdxfunc = NULL; - p->infocbfunc = NULL; - p->toolcbfunc = NULL; - p->ocbdata = NULL; -} -static void ocaddes(ext3x_opalcaddy_t *p) -{ - OPAL_LIST_DESTRUCT(&p->procs); - OPAL_LIST_DESTRUCT(&p->info); - OPAL_LIST_DESTRUCT(&p->apps); -} -OBJ_CLASS_INSTANCE(ext3x_opalcaddy_t, - opal_object_t, - ocadcon, ocaddes); - -static void tscon(ext3x_threadshift_t *p) -{ - OPAL_PMIX_CONSTRUCT_LOCK(&p->lock); - p->msg = NULL; - p->strings = NULL; - p->source = NULL; - p->event_codes = NULL; - p->info = NULL; - OBJ_CONSTRUCT(&p->results, opal_list_t); - p->evhandler = NULL; - p->nondefault = false; - p->cbfunc = NULL; - p->opcbfunc = NULL; - p->cbdata = NULL; -} -static void tsdes(ext3x_threadshift_t *p) -{ - OPAL_PMIX_DESTRUCT_LOCK(&p->lock); - if (NULL != p->strings) { - free(p->strings); - } - OPAL_LIST_DESTRUCT(&p->results); -} -OBJ_CLASS_INSTANCE(ext3x_threadshift_t, - opal_object_t, - tscon, tsdes); - -static void dmcon(opal_ext3x_dmx_trkr_t *p) -{ - p->nspace = NULL; - p->cbfunc = NULL; - p->cbdata = NULL; -} -static void dmdes(opal_ext3x_dmx_trkr_t *p) -{ - if (NULL != p->nspace) { - free(p->nspace); - } -} -OBJ_CLASS_INSTANCE(opal_ext3x_dmx_trkr_t, - opal_list_item_t, - dmcon, dmdes); diff --git a/opal/mca/pmix/ext3x/ext3x.h b/opal/mca/pmix/ext3x/ext3x.h deleted file mode 100644 index a2f5fc57008..00000000000 --- a/opal/mca/pmix/ext3x/ext3x.h +++ /dev/null @@ -1,351 +0,0 @@ -/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ -/* - * Copyright (c) 2014-2018 Intel, Inc. All rights reserved. - * Copyright (c) 2014-2015 Mellanox Technologies, Inc. - * All rights reserved. - * Copyright (c) 2016-2018 Research Organization for Information Science - * and Technology (RIST). All rights reserved. - * Copyright (c) 2017 Los Alamos National Security, LLC. All rights - * reserved. - * $COPYRIGHT$ - * - * Additional copyrights may follow - * - * $HEADER$ - */ - -#ifndef MCA_PMIX_PMIX3X_H -#define MCA_PMIX_PMIX3X_H - -#include "opal_config.h" - -#ifdef HAVE_SYS_SOCKET_H -#include -#endif -#ifdef HAVE_SYS_UN_H -#include -#endif - -#include "opal/class/opal_list.h" -#include "opal/mca/mca.h" -#include "opal/mca/event/event.h" -#include "opal/util/proc.h" - -#include "opal/mca/pmix/base/base.h" -#include "pmix_server.h" -#include "pmix_common.h" - -BEGIN_C_DECLS - -typedef struct { - opal_pmix_base_component_t super; - pmix_proc_t myproc; - opal_list_t jobids; - bool native_launch; - size_t evindex; - opal_list_t events; - int cache_size; - opal_list_t cache; - opal_list_t dmdx; - bool silence_warning; -} mca_pmix_ext3x_component_t; - -OPAL_DECLSPEC extern mca_pmix_ext3x_component_t mca_pmix_ext3x_component; - -OPAL_DECLSPEC extern const opal_pmix_base_module_t opal_pmix_ext3x_module; - -/**** INTERNAL OBJECTS ****/ -typedef struct { - opal_list_item_t super; - opal_jobid_t jobid; - char nspace[PMIX_MAX_NSLEN + 1]; -} opal_ext3x_jobid_trkr_t; -OBJ_CLASS_DECLARATION(opal_ext3x_jobid_trkr_t); - -typedef struct { - opal_list_item_t super; - opal_pmix_lock_t lock; - size_t index; - opal_pmix_notification_fn_t handler; - void *cbdata; -} opal_ext3x_event_t; -OBJ_CLASS_DECLARATION(opal_ext3x_event_t); - -typedef struct { - opal_list_item_t super; - char *nspace; - pmix_modex_cbfunc_t cbfunc; - void *cbdata; -} opal_ext3x_dmx_trkr_t; -OBJ_CLASS_DECLARATION(opal_ext3x_dmx_trkr_t); - -typedef struct { - opal_object_t super; - opal_event_t ev; - pmix_status_t status; - char *nspace; - pmix_proc_t p; - pmix_proc_t *procs; - size_t nprocs; - pmix_pdata_t *pdata; - size_t npdata; - pmix_proc_t *error_procs; - size_t nerror_procs; - pmix_info_t *info; - size_t ninfo; - pmix_app_t *apps; - size_t sz; - opal_pmix_lock_t lock; - opal_list_t *codes; - pmix_status_t *pcodes; - size_t ncodes; - pmix_query_t *queries; - size_t nqueries; - opal_ext3x_event_t *event; - opal_pmix_op_cbfunc_t opcbfunc; - opal_pmix_modex_cbfunc_t mdxcbfunc; - opal_pmix_value_cbfunc_t valcbfunc; - opal_pmix_lookup_cbfunc_t lkcbfunc; - opal_pmix_spawn_cbfunc_t spcbfunc; - opal_pmix_evhandler_reg_cbfunc_t evregcbfunc; - opal_pmix_info_cbfunc_t qcbfunc; - opal_pmix_setup_application_cbfunc_t setupcbfunc; - void *cbdata; -} ext3x_opcaddy_t; -OBJ_CLASS_DECLARATION(ext3x_opcaddy_t); - -typedef struct { - opal_object_t super; - opal_list_t procs; - opal_list_t info; - opal_list_t apps; - pmix_op_cbfunc_t opcbfunc; - pmix_dmodex_response_fn_t dmdxfunc; - pmix_modex_cbfunc_t mdxcbfunc; - pmix_lookup_cbfunc_t lkupcbfunc; - pmix_spawn_cbfunc_t spwncbfunc; - pmix_info_cbfunc_t infocbfunc; - pmix_tool_connection_cbfunc_t toolcbfunc; - void *cbdata; - opal_pmix_release_cbfunc_t odmdxfunc; - void *ocbdata; -} ext3x_opalcaddy_t; -OBJ_CLASS_DECLARATION(ext3x_opalcaddy_t); - -typedef struct { - opal_object_t super; - opal_event_t ev; - opal_pmix_lock_t lock; - const char *msg; - char *strings; - size_t id; - int status; - opal_process_name_t pname; - opal_jobid_t jobid; - const opal_process_name_t *source; - opal_pmix_data_range_t range; - bool nondefault; - size_t handler; - opal_value_t *val; - opal_list_t *event_codes; - opal_list_t *info; - opal_list_t results; - opal_pmix_notification_fn_t evhandler; - opal_pmix_evhandler_reg_cbfunc_t cbfunc; - opal_pmix_op_cbfunc_t opcbfunc; - pmix_event_notification_cbfunc_fn_t pmixcbfunc; - opal_pmix_value_cbfunc_t valcbfunc; - opal_pmix_lookup_cbfunc_t lkcbfunc; - void *cbdata; -} ext3x_threadshift_t; -OBJ_CLASS_DECLARATION(ext3x_threadshift_t); - -#define OPAL_PMIX_OP_THREADSHIFT(e, fn, cb, cd) \ - do { \ - ext3x_threadshift_t *_cd; \ - _cd = OBJ_NEW(ext3x_threadshift_t); \ - _cd->handler = (e); \ - _cd->opcbfunc = (cb); \ - _cd->cbdata = (cd); \ - opal_event_assign(&((_cd)->ev), opal_pmix_base.evbase, \ - -1, EV_WRITE, (fn), (_cd)); \ - OPAL_POST_OBJECT(_cd); \ - opal_event_active(&((_cd)->ev), EV_WRITE, 1); \ - } while(0) - -#define OPAL_PMIX_THREADSHIFT(e, i, eh, fn, cb, cd) \ - do { \ - ext3x_threadshift_t *_cd; \ - _cd = OBJ_NEW(ext3x_threadshift_t); \ - _cd->event_codes = (e); \ - _cd->info = (i); \ - _cd->evhandler = (eh); \ - _cd->cbfunc = (cb); \ - _cd->cbdata = (cd); \ - opal_event_assign(&((_cd)->ev), opal_pmix_base.evbase, \ - -1, EV_WRITE, (fn), (_cd)); \ - OPAL_POST_OBJECT(_cd); \ - opal_event_active(&((_cd)->ev), EV_WRITE, 1); \ - } while(0) - -#define OPAL_PMIX_NOTIFY_THREADSHIFT(s, sr, r, i, fn, cb, cd) \ - do { \ - ext3x_threadshift_t *_cd; \ - _cd = OBJ_NEW(ext3x_threadshift_t); \ - _cd->status = (s); \ - _cd->source = (sr); \ - _cd->range = (r); \ - _cd->info = (i); \ - _cd->opcbfunc = (cb); \ - _cd->cbdata = (cd); \ - opal_event_assign(&((_cd)->ev), opal_pmix_base.evbase, \ - -1, EV_WRITE, (fn), (_cd)); \ - OPAL_POST_OBJECT(_cd); \ - opal_event_active(&((_cd)->ev), EV_WRITE, 1); \ - } while(0) - -#define OPAL_PMIX2X_THREADSHIFT(p, cb) \ - do { \ - opal_event_assign(&((p)->ev), opal_pmix_base.evbase, \ - -1, EV_WRITE, (cb), (p)); \ - OPAL_POST_OBJECT(p); \ - opal_event_active(&((p)->ev), EV_WRITE, 1); \ - } while(0) - -/**** CLIENT FUNCTIONS ****/ -OPAL_MODULE_DECLSPEC int ext3x_client_init(opal_list_t *ilist); -OPAL_MODULE_DECLSPEC int ext3x_client_finalize(void); -OPAL_MODULE_DECLSPEC int ext3x_initialized(void); -OPAL_MODULE_DECLSPEC int ext3x_abort(int flag, const char *msg, - opal_list_t *procs); -OPAL_MODULE_DECLSPEC int ext3x_commit(void); -OPAL_MODULE_DECLSPEC int ext3x_fence(opal_list_t *procs, int collect_data); -OPAL_MODULE_DECLSPEC int ext3x_fencenb(opal_list_t *procs, int collect_data, - opal_pmix_op_cbfunc_t cbfunc, void *cbdata); -OPAL_MODULE_DECLSPEC int ext3x_put(opal_pmix_scope_t scope, - opal_value_t *val); -OPAL_MODULE_DECLSPEC int ext3x_get(const opal_process_name_t *proc, const char *key, - opal_list_t *info, opal_value_t **val); -OPAL_MODULE_DECLSPEC int ext3x_getnb(const opal_process_name_t *proc, const char *key, - opal_list_t *info, - opal_pmix_value_cbfunc_t cbfunc, void *cbdata); -OPAL_MODULE_DECLSPEC int ext3x_publish(opal_list_t *info); -OPAL_MODULE_DECLSPEC int ext3x_publishnb(opal_list_t *info, - opal_pmix_op_cbfunc_t cbfunc, void *cbdata); -OPAL_MODULE_DECLSPEC int ext3x_lookup(opal_list_t *data, opal_list_t *info); -OPAL_MODULE_DECLSPEC int ext3x_lookupnb(char **keys, opal_list_t *info, - opal_pmix_lookup_cbfunc_t cbfunc, void *cbdata); -OPAL_MODULE_DECLSPEC int ext3x_unpublish(char **keys, opal_list_t *info); -OPAL_MODULE_DECLSPEC int ext3x_unpublishnb(char **keys, opal_list_t *info, - opal_pmix_op_cbfunc_t cbfunc, void *cbdata); -OPAL_MODULE_DECLSPEC int ext3x_spawn(opal_list_t *job_info, opal_list_t *apps, opal_jobid_t *jobid); -OPAL_MODULE_DECLSPEC int ext3x_spawnnb(opal_list_t *job_info, opal_list_t *apps, - opal_pmix_spawn_cbfunc_t cbfunc, void *cbdata); -OPAL_MODULE_DECLSPEC int ext3x_connect(opal_list_t *procs); -OPAL_MODULE_DECLSPEC int ext3x_connectnb(opal_list_t *procs, - opal_pmix_op_cbfunc_t cbfunc, - void *cbdata); -OPAL_MODULE_DECLSPEC int ext3x_disconnect(opal_list_t *procs); -OPAL_MODULE_DECLSPEC int ext3x_disconnectnb(opal_list_t *procs, - opal_pmix_op_cbfunc_t cbfunc, - void *cbdata); -OPAL_MODULE_DECLSPEC int ext3x_resolve_peers(const char *nodename, opal_jobid_t jobid, - opal_list_t *procs); -OPAL_MODULE_DECLSPEC int ext3x_resolve_nodes(opal_jobid_t jobid, char **nodelist); -OPAL_MODULE_DECLSPEC int ext3x_allocate(opal_pmix_alloc_directive_t directive, - opal_list_t *info, - opal_pmix_info_cbfunc_t cbfunc, void *cbdata); -OPAL_MODULE_DECLSPEC int ext3x_job_control(opal_list_t *targets, - opal_list_t *directives, - opal_pmix_info_cbfunc_t cbfunc, void *cbdata); - -/**** TOOL FUNCTIONS ****/ -OPAL_MODULE_DECLSPEC int ext3x_tool_init(opal_list_t *info); -OPAL_MODULE_DECLSPEC int ext3x_tool_fini(void); - -/**** COMMON FUNCTIONS ****/ -OPAL_MODULE_DECLSPEC int ext3x_store_local(const opal_process_name_t *proc, - opal_value_t *val); - -/**** SERVER SOUTHBOUND FUNCTIONS ****/ -OPAL_MODULE_DECLSPEC int ext3x_server_init(opal_pmix_server_module_t *module, - opal_list_t *info); -OPAL_MODULE_DECLSPEC int ext3x_server_finalize(void); -OPAL_MODULE_DECLSPEC int ext3x_server_gen_regex(const char *input, char **regex); -OPAL_MODULE_DECLSPEC int ext3x_server_gen_ppn(const char *input, char **ppn); -OPAL_MODULE_DECLSPEC int ext3x_server_register_nspace(opal_jobid_t jobid, - int nlocalprocs, - opal_list_t *info, - opal_pmix_op_cbfunc_t cbfunc, - void *cbdata); -OPAL_MODULE_DECLSPEC void ext3x_server_deregister_nspace(opal_jobid_t jobid, - opal_pmix_op_cbfunc_t cbfunc, - void *cbdata); -OPAL_MODULE_DECLSPEC int ext3x_server_register_client(const opal_process_name_t *proc, - uid_t uid, gid_t gid, - void *server_object, - opal_pmix_op_cbfunc_t cbfunc, - void *cbdata); -OPAL_MODULE_DECLSPEC void ext3x_server_deregister_client(const opal_process_name_t *proc, - opal_pmix_op_cbfunc_t cbfunc, - void *cbdata); -OPAL_MODULE_DECLSPEC int ext3x_server_setup_fork(const opal_process_name_t *proc, char ***env); -OPAL_MODULE_DECLSPEC int ext3x_server_dmodex(const opal_process_name_t *proc, - opal_pmix_modex_cbfunc_t cbfunc, void *cbdata); -OPAL_MODULE_DECLSPEC int ext3x_server_notify_event(int status, - const opal_process_name_t *source, - opal_list_t *info, - opal_pmix_op_cbfunc_t cbfunc, void *cbdata); - -OPAL_MODULE_DECLSPEC int ext3x_server_iof_push(const opal_process_name_t *source, - opal_pmix_iof_channel_t channel, - unsigned char *data, size_t nbytes); - -OPAL_MODULE_DECLSPEC int ext3x_server_setup_application(opal_jobid_t jobid, - opal_list_t *info, - opal_pmix_setup_application_cbfunc_t cbfunc, void *cbdata); -OPAL_MODULE_DECLSPEC int ext3x_server_setup_local_support(opal_jobid_t jobid, - opal_list_t *info, - opal_pmix_op_cbfunc_t cbfunc, void *cbdata); - -/**** COMPONENT UTILITY FUNCTIONS ****/ -OPAL_MODULE_DECLSPEC int opal_pmix_ext3x_check_evars(void); - -OPAL_MODULE_DECLSPEC void ext3x_event_hdlr(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); -OPAL_MODULE_DECLSPEC pmix_status_t ext3x_convert_opalrc(int rc); -OPAL_MODULE_DECLSPEC int ext3x_convert_rc(pmix_status_t rc); - -OPAL_MODULE_DECLSPEC opal_vpid_t ext3x_convert_rank(pmix_rank_t rank); -OPAL_MODULE_DECLSPEC pmix_rank_t ext3x_convert_opalrank(opal_vpid_t vpid); - -OPAL_MODULE_DECLSPEC opal_pmix_scope_t ext3x_convert_scope(pmix_scope_t scope); -OPAL_MODULE_DECLSPEC pmix_scope_t ext3x_convert_opalscope(opal_pmix_scope_t scope); - -OPAL_MODULE_DECLSPEC pmix_data_range_t ext3x_convert_opalrange(opal_pmix_data_range_t range); -OPAL_MODULE_DECLSPEC opal_pmix_data_range_t ext3x_convert_range(pmix_data_range_t range); - -OPAL_MODULE_DECLSPEC opal_pmix_persistence_t ext3x_convert_persist(pmix_persistence_t scope); -OPAL_MODULE_DECLSPEC pmix_persistence_t ext3x_convert_opalpersist(opal_pmix_persistence_t scope); - -OPAL_MODULE_DECLSPEC void ext3x_value_load(pmix_value_t *v, - opal_value_t *kv); -OPAL_MODULE_DECLSPEC int ext3x_value_unload(opal_value_t *kv, - const pmix_value_t *v); - -OPAL_MODULE_DECLSPEC opal_pmix_alloc_directive_t ext3x_convert_allocdir(pmix_alloc_directive_t dir); - -OPAL_MODULE_DECLSPEC char* ext3x_convert_jobid(opal_jobid_t jobid); - -OPAL_MODULE_DECLSPEC int ext3x_convert_state(pmix_proc_state_t state); - -OPAL_MODULE_DECLSPEC pmix_proc_state_t ext3x_convert_opalstate(int state); - - -END_C_DECLS - -#endif /* MCA_PMIX_PMIX3X_H */ diff --git a/opal/mca/pmix/ext3x/ext3x_client.c b/opal/mca/pmix/ext3x/ext3x_client.c deleted file mode 100644 index 617f20936b7..00000000000 --- a/opal/mca/pmix/ext3x/ext3x_client.c +++ /dev/null @@ -1,1673 +0,0 @@ -/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ -/* - * Copyright (c) 2014-2018 Intel, Inc. All rights reserved. - * Copyright (c) 2014-2017 Research Organization for Information Science - * and Technology (RIST). All rights reserved. - * Copyright (c) 2014-2017 Mellanox Technologies, Inc. - * All rights reserved. - * Copyright (c) 2016 Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2016 Los Alamos National Security, LLC. All rights - * reserved. - * Copyright (c) 2018 The University of Tennessee and The University - * of Tennessee Research Foundation. All rights - * reserved. - * Copyright (c) 2019 IBM Corporation. All rights reserved. - * $COPYRIGHT$ - * - * Additional copyrights may follow - * - * $HEADER$ - */ - -#include "opal_config.h" -#include "opal/constants.h" -#include "opal/types.h" - -#ifdef HAVE_STRING_H -#include -#endif -#ifdef HAVE_UNISTD_H -#include -#endif - -#include "opal/hash_string.h" -#include "opal/threads/threads.h" -#include "opal/util/argv.h" -#include "opal/util/opal_environ.h" -#include "opal/util/proc.h" -#include "opal/util/show_help.h" -#include "opal/util/string_copy.h" - -#include "opal/mca/pmix/base/base.h" -#include "ext3x.h" -#include "pmix.h" -#include "pmix_tool.h" - -static char *dbgvalue=NULL; - -static void errreg_cbfunc (pmix_status_t status, - size_t errhandler_ref, - void *cbdata) -{ - opal_ext3x_event_t *event = (opal_ext3x_event_t*)cbdata; - - OPAL_ACQUIRE_OBJECT(event); - - event->index = errhandler_ref; - opal_output_verbose(5, opal_pmix_base_framework.framework_output, - "PMIX client errreg_cbfunc - error handler registered status=%d, reference=%lu", - status, (unsigned long)errhandler_ref); - OPAL_POST_OBJECT(event); - OPAL_PMIX_WAKEUP_THREAD(&event->lock); -} - -int ext3x_client_init(opal_list_t *ilist) -{ - opal_process_name_t pname; - pmix_status_t rc; - int dbg; - opal_ext3x_jobid_trkr_t *job; - opal_ext3x_event_t *event; - pmix_info_t *pinfo; - size_t ninfo, n; - opal_value_t *ival; - - opal_output_verbose(1, opal_pmix_base_framework.framework_output, - "PMIx_client init"); - - OPAL_PMIX_ACQUIRE_THREAD(&opal_pmix_base.lock); - - if (0 == opal_pmix_base.initialized) { - if (0 < (dbg = opal_output_get_verbosity(opal_pmix_base_framework.framework_output))) { - asprintf(&dbgvalue, "PMIX_DEBUG=%d", dbg); - putenv(dbgvalue); - } - /* check the evars for a mismatch */ - if (OPAL_SUCCESS != (dbg = opal_pmix_ext3x_check_evars())) { - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - return dbg; - } - } - - /* convert the incoming list to info structs */ - if (NULL != ilist && 0 < (ninfo = opal_list_get_size(ilist))) { - PMIX_INFO_CREATE(pinfo, ninfo); - n=0; - OPAL_LIST_FOREACH(ival, ilist, opal_value_t) { - (void)opal_string_copy(pinfo[n].key, ival->key, PMIX_MAX_KEYLEN); - ext3x_value_load(&pinfo[n].value, ival); - ++n; - } - } else { - pinfo = NULL; - ninfo = 0; - } - - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - rc = PMIx_Init(&mca_pmix_ext3x_component.myproc, pinfo, ninfo); - if (NULL != pinfo) { - PMIX_INFO_FREE(pinfo, ninfo); - } - if (PMIX_SUCCESS != rc) { - dbg = ext3x_convert_rc(rc); - OPAL_ERROR_LOG(dbg); - return dbg; - } - OPAL_PMIX_ACQUIRE_THREAD(&opal_pmix_base.lock); - - ++opal_pmix_base.initialized; - if (1 < opal_pmix_base.initialized) { - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - return OPAL_SUCCESS; - } - - /* store our jobid and rank */ - if (NULL != getenv(OPAL_MCA_PREFIX"orte_launch")) { - /* if we were launched by the OMPI RTE, then - * the jobid is in a special format - so get it */ - mca_pmix_ext3x_component.native_launch = true; - opal_convert_string_to_jobid(&pname.jobid, mca_pmix_ext3x_component.myproc.nspace); - } else { - /* we were launched by someone else, so make the - * jobid just be the hash of the nspace */ - OPAL_HASH_JOBID(mca_pmix_ext3x_component.myproc.nspace, pname.jobid); - } - /* insert this into our list of jobids - it will be the - * first, and so we'll check it first */ - job = OBJ_NEW(opal_ext3x_jobid_trkr_t); - (void)opal_string_copy(job->nspace, mca_pmix_ext3x_component.myproc.nspace, PMIX_MAX_NSLEN); - job->jobid = pname.jobid; - opal_list_append(&mca_pmix_ext3x_component.jobids, &job->super); - - pname.vpid = ext3x_convert_rank(mca_pmix_ext3x_component.myproc.rank); - opal_proc_set_name(&pname); - - /* release the thread in case the event handler fires when - * registered */ - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - - /* register the default event handler */ - event = OBJ_NEW(opal_ext3x_event_t); - opal_list_append(&mca_pmix_ext3x_component.events, &event->super); - PMIX_INFO_CREATE(pinfo, 1); - PMIX_INFO_LOAD(&pinfo[0], PMIX_EVENT_HDLR_NAME, "OPAL-PMIX-2X-DEFAULT", PMIX_STRING); - PMIx_Register_event_handler(NULL, 0, NULL, 0, ext3x_event_hdlr, errreg_cbfunc, event); - OPAL_PMIX_WAIT_THREAD(&event->lock); - PMIX_INFO_FREE(pinfo, 1); - - return OPAL_SUCCESS; - -} - -static void dereg_cbfunc(pmix_status_t st, void *cbdata) -{ - opal_ext3x_event_t *ev = (opal_ext3x_event_t*)cbdata; - OPAL_PMIX_WAKEUP_THREAD(&ev->lock); -} - -int ext3x_client_finalize(void) -{ - pmix_status_t rc; - opal_ext3x_event_t *event, *ev2; - opal_list_t evlist; - OBJ_CONSTRUCT(&evlist, opal_list_t); - - opal_output_verbose(1, opal_pmix_base_framework.framework_output, - "PMIx_client finalize"); - - OPAL_PMIX_ACQUIRE_THREAD(&opal_pmix_base.lock); - --opal_pmix_base.initialized; - - if (0 == opal_pmix_base.initialized) { - /* deregister all event handlers */ - OPAL_LIST_FOREACH_SAFE(event, ev2, &mca_pmix_ext3x_component.events, opal_ext3x_event_t) { - OPAL_PMIX_DESTRUCT_LOCK(&event->lock); - OPAL_PMIX_CONSTRUCT_LOCK(&event->lock); - PMIx_Deregister_event_handler(event->index, dereg_cbfunc, (void*)event); - opal_list_remove_item(&mca_pmix_ext3x_component.events, &event->super); - /* wait and release outside the loop to avoid double mutex - * interlock */ - opal_list_append(&evlist, &event->super); - } - } - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - OPAL_LIST_FOREACH_SAFE(event, ev2, &evlist, opal_ext3x_event_t) { - OPAL_PMIX_WAIT_THREAD(&event->lock); - opal_list_remove_item(&evlist, &event->super); - OBJ_RELEASE(event); - } - OBJ_DESTRUCT(&evlist); - rc = PMIx_Finalize(NULL, 0); - - return ext3x_convert_rc(rc); -} - -int ext3x_tool_init(opal_list_t *info) -{ - pmix_info_t *pinfo; - size_t ninfo, n; - opal_ext3x_jobid_trkr_t *job; - opal_value_t *val; - pmix_status_t rc; - int ret; - opal_process_name_t pname = {OPAL_JOBID_INVALID, OPAL_VPID_INVALID}; - opal_ext3x_event_t *event; - - opal_output_verbose(1, opal_pmix_base_framework.framework_output, - "PMIx_tool init"); - - OPAL_PMIX_ACQUIRE_THREAD(&opal_pmix_base.lock); - - /* convert the incoming list to info structs */ - if (NULL != info && 0 < (ninfo = opal_list_get_size(info))) { - PMIX_INFO_CREATE(pinfo, ninfo); - n=0; - OPAL_LIST_FOREACH(val, info, opal_value_t) { - (void)opal_string_copy(pinfo[n].key, val->key, PMIX_MAX_KEYLEN); - ext3x_value_load(&pinfo[n].value, val); - ++n; - /* check to see if our name is being given from above */ - if (0 == strcmp(val->key, OPAL_PMIX_TOOL_NSPACE)) { - opal_convert_string_to_jobid(&pname.jobid, val->data.string); - (void)opal_string_copy(mca_pmix_ext3x_component.myproc.nspace, val->data.string, PMIX_MAX_NSLEN); - } else if (0 == strcmp(val->key, OPAL_PMIX_TOOL_RANK)) { - pname.vpid = val->data.name.vpid; - mca_pmix_ext3x_component.myproc.rank = pname.vpid; - } - } - } else { - pinfo = NULL; - ninfo = 0; - } - /* we are going to get our name from the server, or we were given it by the tool, - * so mark as native launch so we don't convert back/forth */ - mca_pmix_ext3x_component.native_launch = true; - - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - rc = PMIx_tool_init(&mca_pmix_ext3x_component.myproc, pinfo, ninfo); - if (NULL != pinfo) { - PMIX_INFO_FREE(pinfo, ninfo); - } - if (PMIX_SUCCESS != rc) { - ret = ext3x_convert_rc(rc); - OPAL_ERROR_LOG(ret); - return ret; - } - OPAL_PMIX_ACQUIRE_THREAD(&opal_pmix_base.lock); - - ++opal_pmix_base.initialized; - if (1 < opal_pmix_base.initialized) { - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - return OPAL_SUCCESS; - } - - /* store our jobid and rank */ - opal_convert_string_to_jobid(&pname.jobid, mca_pmix_ext3x_component.myproc.nspace); - pname.vpid = ext3x_convert_rank(mca_pmix_ext3x_component.myproc.rank); - - /* insert this into our list of jobids - it will be the - * first, and so we'll check it first */ - job = OBJ_NEW(opal_ext3x_jobid_trkr_t); - (void)opal_string_copy(job->nspace, mca_pmix_ext3x_component.myproc.nspace, PMIX_MAX_NSLEN); - job->jobid = pname.jobid; - opal_list_append(&mca_pmix_ext3x_component.jobids, &job->super); - - opal_proc_set_name(&pname); - - /* release the thread in case the event handler fires when - * registered */ - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - - /* register the default event handler */ - event = OBJ_NEW(opal_ext3x_event_t); - opal_list_append(&mca_pmix_ext3x_component.events, &event->super); - PMIX_INFO_CREATE(pinfo, 1); - PMIX_INFO_LOAD(&pinfo[0], PMIX_EVENT_HDLR_NAME, "OPAL-PMIX-2X-DEFAULT", PMIX_STRING); - PMIx_Register_event_handler(NULL, 0, NULL, 0, ext3x_event_hdlr, errreg_cbfunc, event); - OPAL_PMIX_WAIT_THREAD(&event->lock); - PMIX_INFO_FREE(pinfo, 1); - - return OPAL_SUCCESS; -} - -int ext3x_tool_fini(void) -{ - pmix_status_t rc; - opal_ext3x_event_t *event, *ev2; - - opal_output_verbose(1, opal_pmix_base_framework.framework_output, - "PMIx_tool finalize"); - - OPAL_PMIX_ACQUIRE_THREAD(&opal_pmix_base.lock); - --opal_pmix_base.initialized; - - if (0 == opal_pmix_base.initialized) { - /* deregister all event handlers */ - OPAL_LIST_FOREACH_SAFE(event, ev2, &mca_pmix_ext3x_component.events, opal_ext3x_event_t) { - OPAL_PMIX_DESTRUCT_LOCK(&event->lock); - OPAL_PMIX_CONSTRUCT_LOCK(&event->lock); - PMIx_Deregister_event_handler(event->index, dereg_cbfunc, (void*)event); - OPAL_PMIX_WAIT_THREAD(&event->lock); - opal_list_remove_item(&mca_pmix_ext3x_component.events, &event->super); - OBJ_RELEASE(event); - } - } - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - rc = PMIx_tool_finalize(); - - return ext3x_convert_rc(rc); -} - - -int ext3x_initialized(void) -{ - int init; - - opal_output_verbose(1, opal_pmix_base_framework.framework_output, - "PMIx_client initialized"); - - OPAL_PMIX_ACQUIRE_THREAD(&opal_pmix_base.lock); - init = opal_pmix_base.initialized; - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - - return init; -} - -int ext3x_abort(int flag, const char *msg, - opal_list_t *procs) -{ - pmix_status_t rc; - pmix_proc_t *parray=NULL; - size_t n, cnt=0; - opal_namelist_t *ptr; - char *nsptr; - - opal_output_verbose(1, opal_pmix_base_framework.framework_output, - "PMIx_client abort"); - - OPAL_PMIX_ACQUIRE_THREAD(&opal_pmix_base.lock); - if (0 >= opal_pmix_base.initialized) { - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - return OPAL_ERR_NOT_INITIALIZED; - } - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - - /* convert the list of procs to an array - * of pmix_proc_t */ - if (NULL != procs && 0 < (cnt = opal_list_get_size(procs))) { - PMIX_PROC_CREATE(parray, cnt); - n=0; - OPAL_LIST_FOREACH(ptr, procs, opal_namelist_t) { - if (NULL == (nsptr = ext3x_convert_jobid(ptr->name.jobid))) { - PMIX_PROC_FREE(parray, cnt); - return OPAL_ERR_NOT_FOUND; - } - (void)opal_string_copy(parray[n].nspace, nsptr, PMIX_MAX_NSLEN); - parray[n].rank = ext3x_convert_opalrank(ptr->name.vpid); - ++n; - } - } - - /* call the library abort - this is a blocking call */ - rc = PMIx_Abort(flag, msg, parray, cnt); - - /* release the array */ - PMIX_PROC_FREE(parray, cnt); - - return ext3x_convert_rc(rc); -} - -int ext3x_store_local(const opal_process_name_t *proc, opal_value_t *val) -{ - pmix_value_t kv; - pmix_status_t rc; - pmix_proc_t p; - char *nsptr; - opal_ext3x_jobid_trkr_t *job; - - OPAL_PMIX_ACQUIRE_THREAD(&opal_pmix_base.lock); - - if (0 >= opal_pmix_base.initialized) { - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - return OPAL_ERR_NOT_INITIALIZED; - } - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - - if (NULL != proc) { - if (NULL == (nsptr = ext3x_convert_jobid(proc->jobid))) { - job = OBJ_NEW(opal_ext3x_jobid_trkr_t); - (void)opal_snprintf_jobid(job->nspace, PMIX_MAX_NSLEN, proc->jobid); - job->jobid = proc->jobid; - OPAL_PMIX_ACQUIRE_THREAD(&opal_pmix_base.lock); - opal_list_append(&mca_pmix_ext3x_component.jobids, &job->super); - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - nsptr = job->nspace; - } - (void)opal_string_copy(p.nspace, nsptr, PMIX_MAX_NSLEN); - p.rank = ext3x_convert_opalrank(proc->vpid); - } else { - /* use our name */ - (void)opal_string_copy(p.nspace, mca_pmix_ext3x_component.myproc.nspace, PMIX_MAX_NSLEN); - p.rank = ext3x_convert_opalrank(OPAL_PROC_MY_NAME.vpid); - } - - PMIX_VALUE_CONSTRUCT(&kv); - ext3x_value_load(&kv, val); - - /* call the library - this is a blocking call */ - rc = PMIx_Store_internal(&p, val->key, &kv); - PMIX_VALUE_DESTRUCT(&kv); - - return ext3x_convert_rc(rc); -} - -int ext3x_commit(void) -{ - pmix_status_t rc; - - OPAL_PMIX_ACQUIRE_THREAD(&opal_pmix_base.lock); - if (0 >= opal_pmix_base.initialized) { - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - return OPAL_ERR_NOT_INITIALIZED; - } - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - - rc = PMIx_Commit(); - return ext3x_convert_rc(rc); -} - -static void opcbfunc(pmix_status_t status, void *cbdata) -{ - ext3x_opcaddy_t *op = (ext3x_opcaddy_t*)cbdata; - - OPAL_ACQUIRE_OBJECT(op); - if (NULL != op->opcbfunc) { - op->opcbfunc(ext3x_convert_rc(status), op->cbdata); - } - OBJ_RELEASE(op); -} - -int ext3x_fence(opal_list_t *procs, int collect_data) -{ - pmix_status_t rc; - opal_namelist_t *ptr; - char *nsptr; - size_t cnt = 0, n; - pmix_proc_t *parray = NULL; - pmix_info_t info, *iptr; - - opal_output_verbose(1, opal_pmix_base_framework.framework_output, - "PMIx_client fence"); - - OPAL_PMIX_ACQUIRE_THREAD(&opal_pmix_base.lock); - if (0 >= opal_pmix_base.initialized) { - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - return OPAL_ERR_NOT_INITIALIZED; - } - - /* convert the list of procs to an array - * of pmix_proc_t */ - if (NULL != procs && 0 < (cnt = opal_list_get_size(procs))) { - PMIX_PROC_CREATE(parray, cnt); - n=0; - OPAL_LIST_FOREACH(ptr, procs, opal_namelist_t) { - if (NULL == (nsptr = ext3x_convert_jobid(ptr->name.jobid))) { - PMIX_PROC_FREE(parray, cnt); - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - return OPAL_ERR_NOT_FOUND; - } - (void)opal_string_copy(parray[n].nspace, nsptr, PMIX_MAX_NSLEN); - parray[n].rank = ext3x_convert_opalrank(ptr->name.vpid); - ++n; - } - } - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - - if (collect_data) { - PMIX_INFO_CONSTRUCT(&info); - (void)opal_string_copy(info.key, PMIX_COLLECT_DATA, PMIX_MAX_KEYLEN); - info.value.type = PMIX_BOOL; - info.value.data.flag = true; - iptr = &info; - n = 1; - } else { - iptr = NULL; - n = 0; - } - - rc = PMIx_Fence(parray, cnt, iptr, n); - if (collect_data) { - PMIX_INFO_DESTRUCT(&info); - } - if (NULL != parray) { - PMIX_PROC_FREE(parray, cnt); - } - - return ext3x_convert_rc(rc); -} - -int ext3x_fencenb(opal_list_t *procs, int collect_data, - opal_pmix_op_cbfunc_t cbfunc, void *cbdata) -{ - pmix_status_t rc; - pmix_proc_t *parray=NULL; - size_t n, cnt=0; - opal_namelist_t *ptr; - ext3x_opcaddy_t *op; - char *nsptr; - - opal_output_verbose(1, opal_pmix_base_framework.framework_output, - "PMIx_client fencenb"); - - OPAL_PMIX_ACQUIRE_THREAD(&opal_pmix_base.lock); - if (0 >= opal_pmix_base.initialized) { - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - return OPAL_ERR_NOT_INITIALIZED; - } - - /* convert the list of procs to an array - * of pmix_proc_t */ - if (NULL != procs && 0 < (cnt = opal_list_get_size(procs))) { - PMIX_PROC_CREATE(parray, cnt); - n=0; - OPAL_LIST_FOREACH(ptr, procs, opal_namelist_t) { - if (NULL == (nsptr = ext3x_convert_jobid(ptr->name.jobid))) { - PMIX_PROC_FREE(parray, cnt); - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - return OPAL_ERR_NOT_FOUND; - } - (void)opal_string_copy(parray[n].nspace, nsptr, PMIX_MAX_NSLEN); - parray[n].rank = ext3x_convert_opalrank(ptr->name.vpid); - ++n; - } - } - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - - /* create the caddy */ - op = OBJ_NEW(ext3x_opcaddy_t); - op->opcbfunc = cbfunc; - op->cbdata = cbdata; - op->procs = parray; - op->nprocs = cnt; - - if (collect_data) { - op->ninfo = 1; - PMIX_INFO_CREATE(op->info, op->ninfo); - PMIX_INFO_LOAD(&op->info[0], PMIX_COLLECT_DATA, NULL, PMIX_BOOL); - } - - /* call the library function */ - rc = PMIx_Fence_nb(op->procs, op->nprocs, op->info, op->ninfo, opcbfunc, op); - return ext3x_convert_rc(rc); -} - -int ext3x_put(opal_pmix_scope_t opal_scope, - opal_value_t *val) -{ - pmix_value_t kv; - pmix_scope_t pmix_scope = ext3x_convert_opalscope(opal_scope); - pmix_status_t rc; - - opal_output_verbose(1, opal_pmix_base_framework.framework_output, - "PMIx_client put"); - - OPAL_PMIX_ACQUIRE_THREAD(&opal_pmix_base.lock); - if (0 >= opal_pmix_base.initialized) { - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - return OPAL_ERR_NOT_INITIALIZED; - } - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - - PMIX_VALUE_CONSTRUCT(&kv); - ext3x_value_load(&kv, val); - - rc = PMIx_Put(pmix_scope, val->key, &kv); - PMIX_VALUE_DESTRUCT(&kv); - return ext3x_convert_rc(rc); -} - -int ext3x_get(const opal_process_name_t *proc, const char *key, - opal_list_t *info, opal_value_t **val) -{ - pmix_status_t rc; - pmix_proc_t p; - char *nsptr; - pmix_info_t *pinfo = NULL; - size_t sz = 0, n; - opal_value_t *ival; - pmix_value_t *pval = NULL; - int ret; - - opal_output_verbose(1, opal_pmix_base_framework.framework_output, - "%s ext3x:client get on proc %s key %s", - OPAL_NAME_PRINT(OPAL_PROC_MY_NAME), - (NULL == proc) ? "NULL" : OPAL_NAME_PRINT(*proc), key); - - OPAL_PMIX_ACQUIRE_THREAD(&opal_pmix_base.lock); - if (0 >= opal_pmix_base.initialized) { - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - return OPAL_ERR_NOT_INITIALIZED; - } - - if (NULL == proc) { - /* if they are asking for our jobid, then return it */ - if (0 == strcmp(key, OPAL_PMIX_JOBID)) { - (*val) = OBJ_NEW(opal_value_t); - (*val)->key = strdup(key); - (*val)->type = OPAL_UINT32; - (*val)->data.uint32 = OPAL_PROC_MY_NAME.jobid; - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - return OPAL_SUCCESS; - } - /* if they are asking for our rank, return it */ - if (0 == strcmp(key, OPAL_PMIX_RANK)) { - (*val) = OBJ_NEW(opal_value_t); - (*val)->key = strdup(key); - (*val)->type = OPAL_INT; - (*val)->data.integer = ext3x_convert_rank(mca_pmix_ext3x_component.myproc.rank); - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - return OPAL_SUCCESS; - } - } - *val = NULL; - - if (NULL == proc) { - (void)opal_string_copy(p.nspace, mca_pmix_ext3x_component.myproc.nspace, PMIX_MAX_NSLEN); - p.rank = ext3x_convert_rank(PMIX_RANK_WILDCARD); - } else { - if (NULL == (nsptr = ext3x_convert_jobid(proc->jobid))) { - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - return OPAL_ERR_NOT_FOUND; - } - (void)opal_string_copy(p.nspace, nsptr, PMIX_MAX_NSLEN); - p.rank = ext3x_convert_opalrank(proc->vpid); - } - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - - if (NULL != info && 0 < (sz = opal_list_get_size(info))) { - PMIX_INFO_CREATE(pinfo, sz); - n=0; - OPAL_LIST_FOREACH(ival, info, opal_value_t) { - (void)opal_string_copy(pinfo[n].key, ival->key, PMIX_MAX_KEYLEN); - ext3x_value_load(&pinfo[n].value, ival); - ++n; - } - } - - rc = PMIx_Get(&p, key, pinfo, sz, &pval); - if (PMIX_SUCCESS == rc) { - ival = OBJ_NEW(opal_value_t); - if (NULL != key) { - ival->key = strdup(key); - } - if (OPAL_SUCCESS != (ret = ext3x_value_unload(ival, pval))) { - rc = ext3x_convert_opalrc(ret); - } else { - *val = ival; - } - PMIX_VALUE_FREE(pval, 1); - } - PMIX_INFO_FREE(pinfo, sz); - - return ext3x_convert_rc(rc); -} - -static void val_cbfunc(pmix_status_t status, - pmix_value_t *kv, void *cbdata) -{ - ext3x_opcaddy_t *op = (ext3x_opcaddy_t*)cbdata; - int rc; - opal_value_t val, *v=NULL; - - OPAL_ACQUIRE_OBJECT(op); - OBJ_CONSTRUCT(&val, opal_value_t); - if (NULL != op->nspace) { - val.key = strdup(op->nspace); - } - rc = ext3x_convert_opalrc(status); - if (PMIX_SUCCESS == status && NULL != kv) { - rc = ext3x_value_unload(&val, kv); - v = &val; - } - - if (NULL != op->valcbfunc) { - op->valcbfunc(rc, v, op->cbdata); - } - OBJ_DESTRUCT(&val); - OBJ_RELEASE(op); -} - -int ext3x_getnb(const opal_process_name_t *proc, const char *key, - opal_list_t *info, - opal_pmix_value_cbfunc_t cbfunc, void *cbdata) -{ - ext3x_opcaddy_t *op; - opal_value_t *val; - pmix_status_t rc; - char *nsptr; - size_t n; - - opal_output_verbose(1, opal_pmix_base_framework.framework_output, - "%s PMIx_client get_nb on proc %s key %s", - OPAL_NAME_PRINT(OPAL_PROC_MY_NAME), - (NULL == proc) ? "NULL" : OPAL_NAME_PRINT(*proc), key); - - OPAL_PMIX_ACQUIRE_THREAD(&opal_pmix_base.lock); - if (0 >= opal_pmix_base.initialized) { - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - return OPAL_ERR_NOT_INITIALIZED; - } - - if (NULL == proc) { - /* if they are asking for our jobid, then return it */ - if (0 == strcmp(key, OPAL_PMIX_JOBID)) { - if (NULL != cbfunc) { - val = OBJ_NEW(opal_value_t); - val->key = strdup(key); - val->type = OPAL_UINT32; - val->data.uint32 = OPAL_PROC_MY_NAME.jobid; - cbfunc(OPAL_SUCCESS, val, cbdata); - } - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - return OPAL_SUCCESS; - } - /* if they are asking for our rank, return it */ - if (0 == strcmp(key, OPAL_PMIX_RANK)) { - if (NULL != cbfunc) { - val = OBJ_NEW(opal_value_t); - val->key = strdup(key); - val->type = OPAL_INT; - val->data.integer = ext3x_convert_rank(mca_pmix_ext3x_component.myproc.rank); - cbfunc(OPAL_SUCCESS, val, cbdata); - } - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - return OPAL_SUCCESS; - } - } - - /* create the caddy */ - op = OBJ_NEW(ext3x_opcaddy_t); - op->valcbfunc = cbfunc; - op->cbdata = cbdata; - if (NULL != key) { - op->nspace = strdup(key); - } - if (NULL == proc) { - (void)opal_string_copy(op->p.nspace, mca_pmix_ext3x_component.myproc.nspace, PMIX_MAX_NSLEN); - op->p.rank = ext3x_convert_rank(PMIX_RANK_WILDCARD); - } else { - if (NULL == (nsptr = ext3x_convert_jobid(proc->jobid))) { - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - return OPAL_ERR_NOT_FOUND; - } - (void)opal_string_copy(op->p.nspace, nsptr, PMIX_MAX_NSLEN); - op->p.rank = ext3x_convert_opalrank(proc->vpid); - } - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - - if (NULL != info && 0 < (op->sz = opal_list_get_size(info))) { - PMIX_INFO_CREATE(op->info, op->sz); - n=0; - OPAL_LIST_FOREACH(val, info, opal_value_t) { - (void)opal_string_copy(op->info[n].key, val->key, PMIX_MAX_KEYLEN); - ext3x_value_load(&op->info[n].value, val); - ++n; - } - } - - /* call the library function */ - rc = PMIx_Get_nb(&op->p, key, op->info, op->sz, val_cbfunc, op); - if (PMIX_SUCCESS != rc) { - OBJ_RELEASE(op); - } - - return ext3x_convert_rc(rc); -} - -int ext3x_publish(opal_list_t *info) -{ - pmix_info_t *pinfo; - pmix_status_t ret; - opal_value_t *iptr; - size_t sz, n; - - opal_output_verbose(1, opal_pmix_base_framework.framework_output, - "PMIx_client publish"); - - OPAL_PMIX_ACQUIRE_THREAD(&opal_pmix_base.lock); - if (0 >= opal_pmix_base.initialized) { - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - return OPAL_ERR_NOT_INITIALIZED; - } - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - - if (NULL == info) { - return OPAL_ERR_BAD_PARAM; - } - - sz = opal_list_get_size(info); - if (0 < sz) { - PMIX_INFO_CREATE(pinfo, sz); - n=0; - OPAL_LIST_FOREACH(iptr, info, opal_value_t) { - (void)opal_string_copy(pinfo[n].key, iptr->key, PMIX_MAX_KEYLEN); - ext3x_value_load(&pinfo[n].value, iptr); - ++n; - } - } else { - pinfo = NULL; - } - - ret = PMIx_Publish(pinfo, sz); - if (0 < sz) { - PMIX_INFO_FREE(pinfo, sz); - } - - return ext3x_convert_rc(ret); -} - -int ext3x_publishnb(opal_list_t *info, - opal_pmix_op_cbfunc_t cbfunc, void *cbdata) -{ - pmix_status_t ret; - opal_value_t *iptr; - size_t n; - ext3x_opcaddy_t *op; - - opal_output_verbose(1, opal_pmix_base_framework.framework_output, - "PMIx_client publish_nb"); - - OPAL_PMIX_ACQUIRE_THREAD(&opal_pmix_base.lock); - if (0 >= opal_pmix_base.initialized) { - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - return OPAL_ERR_NOT_INITIALIZED; - } - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - - if (NULL == info) { - return OPAL_ERR_BAD_PARAM; - } - - /* create the caddy */ - op = OBJ_NEW(ext3x_opcaddy_t); - op->opcbfunc = cbfunc; - op->cbdata = cbdata; - - op->sz = opal_list_get_size(info); - if (0 < op->sz) { - PMIX_INFO_CREATE(op->info, op->sz); - n=0; - OPAL_LIST_FOREACH(iptr, info, opal_value_t) { - (void)opal_string_copy(op->info[n].key, iptr->key, PMIX_MAX_KEYLEN); - ext3x_value_load(&op->info[n].value, iptr); - ++n; - } - } - - ret = PMIx_Publish_nb(op->info, op->sz, opcbfunc, op); - - return ext3x_convert_rc(ret); -} - -int ext3x_lookup(opal_list_t *data, opal_list_t *info) -{ - opal_pmix_pdata_t *d; - pmix_pdata_t *pdata; - pmix_info_t *pinfo = NULL; - pmix_status_t rc; - size_t cnt, n, sz = 0; - opal_value_t *iptr; - opal_ext3x_jobid_trkr_t *jptr, *job; - int ret; - - opal_output_verbose(1, opal_pmix_base_framework.framework_output, - "ext3x:client lookup"); - - OPAL_PMIX_ACQUIRE_THREAD(&opal_pmix_base.lock); - if (0 >= opal_pmix_base.initialized) { - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - return OPAL_ERR_NOT_INITIALIZED; - } - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - - if (NULL == data || 0 == (cnt = opal_list_get_size(data))) { - return OPAL_ERR_BAD_PARAM; - } - PMIX_PDATA_CREATE(pdata, cnt); - n = 0; - OPAL_LIST_FOREACH(d, data, opal_pmix_pdata_t) { - (void)opal_string_copy(pdata[n].key, d->value.key, PMIX_MAX_KEYLEN); - ++n; - } - - if (NULL != info && 0 < (sz = opal_list_get_size(info))) { - PMIX_INFO_CREATE(pinfo, sz); - n=0; - OPAL_LIST_FOREACH(iptr, info, opal_value_t) { - (void)opal_string_copy(pinfo[n].key, iptr->key, PMIX_MAX_KEYLEN); - ext3x_value_load(&pinfo[n].value, iptr); - ++n; - } - } - - rc = PMIx_Lookup(pdata, cnt, pinfo, sz); - if (PMIX_SUCCESS == rc) { - /* load the answers back into the list */ - n=0; - OPAL_PMIX_ACQUIRE_THREAD(&opal_pmix_base.lock); - OPAL_LIST_FOREACH(d, data, opal_pmix_pdata_t) { - if (mca_pmix_ext3x_component.native_launch) { - /* if we were launched by the OMPI RTE, then - * the jobid is in a special format - so get it */ - opal_convert_string_to_jobid(&d->proc.jobid, pdata[n].proc.nspace); - } else { - /* we were launched by someone else, so make the - * jobid just be the hash of the nspace */ - OPAL_HASH_JOBID(pdata[n].proc.nspace, d->proc.jobid); - } - /* if we don't already have it, add this to our jobid tracker */ - job = NULL; - OPAL_LIST_FOREACH(jptr, &mca_pmix_ext3x_component.jobids, opal_ext3x_jobid_trkr_t) { - if (jptr->jobid == d->proc.jobid) { - job = jptr; - break; - } - } - if (NULL == job) { - job = OBJ_NEW(opal_ext3x_jobid_trkr_t); - (void)opal_string_copy(job->nspace, pdata[n].proc.nspace, PMIX_MAX_NSLEN); - job->jobid = d->proc.jobid; - opal_list_append(&mca_pmix_ext3x_component.jobids, &job->super); - } - d->proc.vpid = ext3x_convert_rank(pdata[n].proc.rank); - if (OPAL_SUCCESS != (ret = ext3x_value_unload(&d->value, &pdata[n].value))) { - OPAL_ERROR_LOG(ret); - } - } - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - } - PMIX_PDATA_FREE(pdata, cnt); - if (NULL != pinfo) { - PMIX_INFO_FREE(pinfo, sz); - } - return ext3x_convert_rc(rc); -} - -static void lk_cbfunc(pmix_status_t status, - pmix_pdata_t data[], size_t ndata, - void *cbdata) -{ - ext3x_opcaddy_t *op = (ext3x_opcaddy_t*)cbdata; - opal_pmix_pdata_t *d; - opal_list_t results, *r = NULL; - int rc; - size_t n; - opal_ext3x_jobid_trkr_t *job, *jptr; - - OPAL_ACQUIRE_OBJECT(op); - - if (NULL == op->lkcbfunc) { - OBJ_RELEASE(op); - return; - } - - rc = ext3x_convert_rc(op->status); - if (OPAL_SUCCESS == rc) { - OPAL_PMIX_ACQUIRE_THREAD(&opal_pmix_base.lock); - OBJ_CONSTRUCT(&results, opal_list_t); - for (n=0; n < ndata; n++) { - d = OBJ_NEW(opal_pmix_pdata_t); - opal_list_append(&results, &d->super); - if (mca_pmix_ext3x_component.native_launch) { - /* if we were launched by the OMPI RTE, then - * the jobid is in a special format - so get it */ - opal_convert_string_to_jobid(&d->proc.jobid, data[n].proc.nspace); - } else { - /* we were launched by someone else, so make the - * jobid just be the hash of the nspace */ - OPAL_HASH_JOBID(data[n].proc.nspace, d->proc.jobid); - } - /* if we don't already have it, add this to our jobid tracker */ - job = NULL; - OPAL_LIST_FOREACH(jptr, &mca_pmix_ext3x_component.jobids, opal_ext3x_jobid_trkr_t) { - if (jptr->jobid == d->proc.jobid) { - job = jptr; - break; - } - } - if (NULL == job) { - job = OBJ_NEW(opal_ext3x_jobid_trkr_t); - (void)opal_string_copy(job->nspace, data[n].proc.nspace, PMIX_MAX_NSLEN); - job->jobid = d->proc.jobid; - opal_list_append(&mca_pmix_ext3x_component.jobids, &job->super); - } - d->proc.vpid = ext3x_convert_rank(data[n].proc.rank); - d->value.key = strdup(data[n].key); - rc = ext3x_value_unload(&d->value, &data[n].value); - if (OPAL_SUCCESS != rc) { - rc = OPAL_ERR_BAD_PARAM; - OPAL_ERROR_LOG(rc); - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - goto release; - } - } - r = &results; - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - } - - release: - /* execute the callback */ - op->lkcbfunc(rc, r, op->cbdata); - - if (NULL != r) { - OPAL_LIST_DESTRUCT(&results); - } - OBJ_RELEASE(op); -} - -int ext3x_lookupnb(char **keys, opal_list_t *info, - opal_pmix_lookup_cbfunc_t cbfunc, void *cbdata) -{ - pmix_status_t ret; - ext3x_opcaddy_t *op; - opal_value_t *iptr; - size_t n; - - - opal_output_verbose(1, opal_pmix_base_framework.framework_output, - "ext3x:client lookup_nb"); - - OPAL_PMIX_ACQUIRE_THREAD(&opal_pmix_base.lock); - if (0 >= opal_pmix_base.initialized) { - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - return OPAL_ERR_NOT_INITIALIZED; - } - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - - /* create the caddy */ - op = OBJ_NEW(ext3x_opcaddy_t); - op->lkcbfunc = cbfunc; - op->cbdata = cbdata; - - if (NULL != info && 0 < (op->sz = opal_list_get_size(info))) { - PMIX_INFO_CREATE(op->info, op->sz); - n=0; - OPAL_LIST_FOREACH(iptr, info, opal_value_t) { - (void)opal_string_copy(op->info[n].key, iptr->key, PMIX_MAX_KEYLEN); - ext3x_value_load(&op->info[n].value, iptr); - ++n; - } - } - ret = PMIx_Lookup_nb(keys, op->info, op->sz, lk_cbfunc, op); - - return ext3x_convert_rc(ret); -} - -int ext3x_unpublish(char **keys, opal_list_t *info) -{ - pmix_status_t ret; - size_t ninfo, n; - pmix_info_t *pinfo; - opal_value_t *iptr; - - OPAL_PMIX_ACQUIRE_THREAD(&opal_pmix_base.lock); - if (0 >= opal_pmix_base.initialized) { - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - return OPAL_ERR_NOT_INITIALIZED; - } - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - - if (NULL != info && 0 < (ninfo = opal_list_get_size(info))) { - PMIX_INFO_CREATE(pinfo, ninfo); - n=0; - OPAL_LIST_FOREACH(iptr, info, opal_value_t) { - (void)opal_string_copy(pinfo[n].key, iptr->key, PMIX_MAX_KEYLEN); - ext3x_value_load(&pinfo[n].value, iptr); - ++n; - } - } else { - pinfo = NULL; - ninfo = 0; - } - - ret = PMIx_Unpublish(keys, pinfo, ninfo); - PMIX_INFO_FREE(pinfo, ninfo); - - return ext3x_convert_rc(ret); -} - -int ext3x_unpublishnb(char **keys, opal_list_t *info, - opal_pmix_op_cbfunc_t cbfunc, void *cbdata) -{ - pmix_status_t ret; - ext3x_opcaddy_t *op; - opal_value_t *iptr; - size_t n; - - OPAL_PMIX_ACQUIRE_THREAD(&opal_pmix_base.lock); - if (0 >= opal_pmix_base.initialized) { - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - return OPAL_ERR_NOT_INITIALIZED; - } - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - - /* create the caddy */ - op = OBJ_NEW(ext3x_opcaddy_t); - op->opcbfunc = cbfunc; - op->cbdata = cbdata; - - if (NULL != info && 0 < (op->sz = opal_list_get_size(info))) { - PMIX_INFO_CREATE(op->info, op->sz); - n=0; - OPAL_LIST_FOREACH(iptr, info, opal_value_t) { - (void)opal_string_copy(op->info[n].key, iptr->key, PMIX_MAX_KEYLEN); - ext3x_value_load(&op->info[n].value, iptr); - ++n; - } - } - - ret = PMIx_Unpublish_nb(keys, op->info, op->sz, opcbfunc, op); - - return ext3x_convert_rc(ret); -} - -int ext3x_spawn(opal_list_t *job_info, opal_list_t *apps, opal_jobid_t *jobid) -{ - pmix_status_t rc; - pmix_info_t *info = NULL; - pmix_app_t *papps; - size_t ninfo = 0, napps, n, m; - opal_value_t *ival; - opal_pmix_app_t *app; - char nspace[PMIX_MAX_NSLEN+1]; - opal_ext3x_jobid_trkr_t *job; - - OPAL_PMIX_ACQUIRE_THREAD(&opal_pmix_base.lock); - if (0 >= opal_pmix_base.initialized) { - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - return OPAL_ERR_NOT_INITIALIZED; - } - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - - *jobid = OPAL_JOBID_INVALID; - - if (NULL != job_info && 0 < (ninfo = opal_list_get_size(job_info))) { - PMIX_INFO_CREATE(info, ninfo); - n=0; - OPAL_LIST_FOREACH(ival, job_info, opal_value_t) { - (void)opal_string_copy(info[n].key, ival->key, PMIX_MAX_KEYLEN); - ext3x_value_load(&info[n].value, ival); - ++n; - } - } - - napps = opal_list_get_size(apps); - PMIX_APP_CREATE(papps, napps); - n=0; - OPAL_LIST_FOREACH(app, apps, opal_pmix_app_t) { - papps[n].cmd = strdup(app->cmd); - if (NULL != app->argv) { - papps[n].argv = opal_argv_copy(app->argv); - } - if (NULL != app->env) { - papps[n].env = opal_argv_copy(app->env); - } - if (NULL != app->cwd) { - papps[n].cwd = strdup(app->cwd); - } - papps[n].maxprocs = app->maxprocs; - if (0 < (papps[n].ninfo = opal_list_get_size(&app->info))) { - PMIX_INFO_CREATE(papps[n].info, papps[n].ninfo); - m=0; - OPAL_LIST_FOREACH(ival, &app->info, opal_value_t) { - (void)opal_string_copy(papps[n].info[m].key, ival->key, PMIX_MAX_KEYLEN); - ext3x_value_load(&papps[n].info[m].value, ival); - ++m; - } - } - ++n; - } - - rc = PMIx_Spawn(info, ninfo, papps, napps, nspace); - if (PMIX_SUCCESS == rc) { - OPAL_PMIX_ACQUIRE_THREAD(&opal_pmix_base.lock); - if (mca_pmix_ext3x_component.native_launch) { - /* if we were launched by the OMPI RTE, then - * the jobid is in a special format - so get it */ - opal_convert_string_to_jobid(jobid, nspace); - } else { - /* we were launched by someone else, so make the - * jobid just be the hash of the nspace */ - OPAL_HASH_JOBID(nspace, *jobid); - } - /* add this to our jobid tracker */ - job = OBJ_NEW(opal_ext3x_jobid_trkr_t); - (void)opal_string_copy(job->nspace, nspace, PMIX_MAX_NSLEN); - job->jobid = *jobid; - opal_list_append(&mca_pmix_ext3x_component.jobids, &job->super); - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - } - return rc; -} - -static void spcbfunc(pmix_status_t status, - char *nspace, void *cbdata) -{ - ext3x_opcaddy_t *op = (ext3x_opcaddy_t*)cbdata; - opal_ext3x_jobid_trkr_t *job; - opal_jobid_t jobid = OPAL_JOBID_INVALID; - int rc; - - OPAL_ACQUIRE_OBJECT(op); - - rc = ext3x_convert_rc(status); - if (PMIX_SUCCESS == status) { - /* this is in the PMIx local thread - need to protect - * the framework-level data */ - OPAL_PMIX_ACQUIRE_THREAD(&opal_pmix_base.lock); - if (mca_pmix_ext3x_component.native_launch) { - /* if we were launched by the OMPI RTE, then - * the jobid is in a special format - so get it */ - opal_convert_string_to_jobid(&jobid, nspace); - } else { - /* we were launched by someone else, so make the - * jobid just be the hash of the nspace */ - OPAL_HASH_JOBID(nspace, jobid); - } - /* add this to our jobid tracker */ - job = OBJ_NEW(opal_ext3x_jobid_trkr_t); - (void)opal_string_copy(job->nspace, nspace, PMIX_MAX_NSLEN); - job->jobid = jobid; - opal_list_append(&mca_pmix_ext3x_component.jobids, &job->super); - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - } - - op->spcbfunc(rc, jobid, op->cbdata); - OBJ_RELEASE(op); -} - -int ext3x_spawnnb(opal_list_t *job_info, opal_list_t *apps, - opal_pmix_spawn_cbfunc_t cbfunc, void *cbdata) -{ - pmix_status_t ret; - ext3x_opcaddy_t *op; - size_t n, m; - opal_value_t *info; - opal_pmix_app_t *app; - - OPAL_PMIX_ACQUIRE_THREAD(&opal_pmix_base.lock); - if (0 >= opal_pmix_base.initialized) { - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - return OPAL_ERR_NOT_INITIALIZED; - } - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - - /* create the caddy */ - op = OBJ_NEW(ext3x_opcaddy_t); - op->spcbfunc = cbfunc; - op->cbdata = cbdata; - - if (NULL != job_info && 0 < (op->ninfo = opal_list_get_size(job_info))) { - PMIX_INFO_CREATE(op->info, op->ninfo); - n=0; - OPAL_LIST_FOREACH(info, job_info, opal_value_t) { - (void)opal_string_copy(op->info[n].key, info->key, PMIX_MAX_KEYLEN); - ext3x_value_load(&op->info[n].value, info); - ++n; - } - } - - op->sz = opal_list_get_size(apps); - PMIX_APP_CREATE(op->apps, op->sz); - n=0; - OPAL_LIST_FOREACH(app, apps, opal_pmix_app_t) { - op->apps[n].cmd = strdup(app->cmd); - if (NULL != app->argv) { - op->apps[n].argv = opal_argv_copy(app->argv); - } - if (NULL != app->env) { - op->apps[n].env = opal_argv_copy(app->env); - } - op->apps[n].maxprocs = app->maxprocs; - if (0 < (op->apps[n].ninfo = opal_list_get_size(&app->info))) { - PMIX_INFO_CREATE(op->apps[n].info, op->apps[n].ninfo); - m=0; - OPAL_LIST_FOREACH(info, &app->info, opal_value_t) { - (void)opal_string_copy(op->apps[n].info[m].key, info->key, PMIX_MAX_KEYLEN); - ext3x_value_load(&op->apps[n].info[m].value, info); - ++m; - } - } - ++n; - } - - ret = PMIx_Spawn_nb(op->info, op->ninfo, op->apps, op->sz, spcbfunc, op); - - return ext3x_convert_rc(ret); -} - -int ext3x_connect(opal_list_t *procs) -{ - pmix_proc_t *p; - size_t nprocs; - opal_namelist_t *ptr; - pmix_status_t ret; - char *nsptr; - size_t n; - - opal_output_verbose(1, opal_pmix_base_framework.framework_output, - "ext3x:client connect"); - - /* protect against bozo error */ - if (NULL == procs || 0 == (nprocs = opal_list_get_size(procs))) { - return OPAL_ERR_BAD_PARAM; - } - - OPAL_PMIX_ACQUIRE_THREAD(&opal_pmix_base.lock); - if (0 >= opal_pmix_base.initialized) { - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - return OPAL_ERR_NOT_INITIALIZED; - } - - /* convert the list of procs to an array - * of pmix_proc_t */ - PMIX_PROC_CREATE(p, nprocs); - n=0; - OPAL_LIST_FOREACH(ptr, procs, opal_namelist_t) { - if (NULL == (nsptr = ext3x_convert_jobid(ptr->name.jobid))) { - PMIX_PROC_FREE(p, nprocs); - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - return OPAL_ERR_NOT_FOUND; - } - (void)opal_string_copy(p[n].nspace, nsptr, PMIX_MAX_NSLEN); - p[n].rank = ext3x_convert_opalrank(ptr->name.vpid); - ++n; - } - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - - ret = PMIx_Connect(p, nprocs, NULL, 0); - PMIX_PROC_FREE(p, nprocs); - - return ext3x_convert_rc(ret); -} - -int ext3x_connectnb(opal_list_t *procs, - opal_pmix_op_cbfunc_t cbfunc, - void *cbdata) -{ - ext3x_opcaddy_t *op; - opal_namelist_t *ptr; - pmix_status_t ret; - char *nsptr; - size_t n; - - opal_output_verbose(1, opal_pmix_base_framework.framework_output, - "ext3x:client connect NB"); - - /* protect against bozo error */ - if (NULL == procs || 0 == opal_list_get_size(procs)) { - return OPAL_ERR_BAD_PARAM; - } - - OPAL_PMIX_ACQUIRE_THREAD(&opal_pmix_base.lock); - if (0 >= opal_pmix_base.initialized) { - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - return OPAL_ERR_NOT_INITIALIZED; - } - - /* create the caddy */ - op = OBJ_NEW(ext3x_opcaddy_t); - op->opcbfunc = cbfunc; - op->cbdata = cbdata; - op->nprocs = opal_list_get_size(procs); - - /* convert the list of procs to an array - * of pmix_proc_t */ - PMIX_PROC_CREATE(op->procs, op->nprocs); - n=0; - OPAL_LIST_FOREACH(ptr, procs, opal_namelist_t) { - if (NULL == (nsptr = ext3x_convert_jobid(ptr->name.jobid))) { - OBJ_RELEASE(op); - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - return OPAL_ERR_NOT_FOUND; - } - (void)opal_string_copy(op->procs[n].nspace, nsptr, PMIX_MAX_NSLEN); - op->procs[n].rank = ext3x_convert_opalrank(ptr->name.vpid); - ++n; - } - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - - ret = PMIx_Connect_nb(op->procs, op->nprocs, NULL, 0, opcbfunc, op); - if (PMIX_SUCCESS != ret) { - OBJ_RELEASE(op); - } - return ext3x_convert_rc(ret); -} - -int ext3x_disconnect(opal_list_t *procs) -{ - size_t nprocs, n; - opal_namelist_t *ptr; - pmix_status_t ret=PMIX_SUCCESS; - pmix_proc_t *p; - char *nsptr; - - opal_output_verbose(1, opal_pmix_base_framework.framework_output, - "ext3x:client disconnect"); - - /* protect against bozo error */ - if (NULL == procs || 0 == (nprocs = opal_list_get_size(procs))) { - return OPAL_ERR_BAD_PARAM; - } - - OPAL_PMIX_ACQUIRE_THREAD(&opal_pmix_base.lock); - if (0 >= opal_pmix_base.initialized) { - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - return OPAL_ERR_NOT_INITIALIZED; - } - - /* convert the list of procs to an array - * of pmix_proc_t */ - PMIX_PROC_CREATE(p, nprocs); - n=0; - OPAL_LIST_FOREACH(ptr, procs, opal_namelist_t) { - if (NULL == (nsptr = ext3x_convert_jobid(ptr->name.jobid))) { - PMIX_PROC_FREE(p, nprocs); - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - return OPAL_ERR_NOT_FOUND; - } - (void)opal_string_copy(p[n].nspace, nsptr, PMIX_MAX_NSLEN); - p[n].rank = ext3x_convert_opalrank(ptr->name.vpid); - ++n; - } - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - - ret = PMIx_Disconnect(p, nprocs, NULL, 0); - PMIX_PROC_FREE(p, nprocs); - - return ext3x_convert_rc(ret); -} - -int ext3x_disconnectnb(opal_list_t *procs, - opal_pmix_op_cbfunc_t cbfunc, - void *cbdata) -{ - ext3x_opcaddy_t *op; - opal_namelist_t *ptr; - pmix_status_t ret; - char *nsptr; - size_t n; - - opal_output_verbose(1, opal_pmix_base_framework.framework_output, - "ext3x:client disconnect NB"); - - /* protect against bozo error */ - if (NULL == procs || 0 == opal_list_get_size(procs)) { - return OPAL_ERR_BAD_PARAM; - } - - OPAL_PMIX_ACQUIRE_THREAD(&opal_pmix_base.lock); - if (0 >= opal_pmix_base.initialized) { - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - return OPAL_ERR_NOT_INITIALIZED; - } - - /* create the caddy */ - op = OBJ_NEW(ext3x_opcaddy_t); - op->opcbfunc = cbfunc; - op->cbdata = cbdata; - op->nprocs = opal_list_get_size(procs); - - /* convert the list of procs to an array - * of pmix_proc_t */ - PMIX_PROC_CREATE(op->procs, op->nprocs); - n=0; - OPAL_LIST_FOREACH(ptr, procs, opal_namelist_t) { - if (NULL == (nsptr = ext3x_convert_jobid(ptr->name.jobid))) { - OBJ_RELEASE(op); - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - return OPAL_ERR_NOT_FOUND; - } - (void)opal_string_copy(op->procs[n].nspace, nsptr, PMIX_MAX_NSLEN); - op->procs[n].rank = ext3x_convert_opalrank(ptr->name.vpid); - ++n; - } - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - - ret = PMIx_Disconnect_nb(op->procs, op->nprocs, NULL, 0, opcbfunc, op); - if (PMIX_SUCCESS != ret) { - OBJ_RELEASE(op); - } - return ext3x_convert_rc(ret); -} - -int ext3x_resolve_peers(const char *nodename, - opal_jobid_t jobid, - opal_list_t *procs) -{ - pmix_status_t ret; - char *nspace; - pmix_proc_t *array=NULL; - size_t nprocs, n; - opal_namelist_t *nm; - opal_ext3x_jobid_trkr_t *job; - - OPAL_PMIX_ACQUIRE_THREAD(&opal_pmix_base.lock); - if (0 >= opal_pmix_base.initialized) { - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - return OPAL_ERR_NOT_INITIALIZED; - } - - if (OPAL_JOBID_WILDCARD != jobid) { - if (NULL == (nspace = ext3x_convert_jobid(jobid))) { - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - return OPAL_ERR_NOT_FOUND; - } - } else { - nspace = NULL; - } - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - - ret = PMIx_Resolve_peers(nodename, nspace, &array, &nprocs); - - if (NULL != array && 0 < nprocs) { - OPAL_PMIX_ACQUIRE_THREAD(&opal_pmix_base.lock); - for (n=0; n < nprocs; n++) { - nm = OBJ_NEW(opal_namelist_t); - opal_list_append(procs, &nm->super); - if (mca_pmix_ext3x_component.native_launch) { - /* if we were launched by the OMPI RTE, then - * the jobid is in a special format - so get it */ - opal_convert_string_to_jobid(&nm->name.jobid, array[n].nspace); - } else { - /* we were launched by someone else, so make the - * jobid just be the hash of the nspace */ - OPAL_HASH_JOBID(array[n].nspace, nm->name.jobid); - } - /* if we don't already have it, add this to our jobid tracker */ - if (NULL == ext3x_convert_jobid(nm->name.jobid)) { - job = OBJ_NEW(opal_ext3x_jobid_trkr_t); - (void)opal_string_copy(job->nspace, array[n].nspace, PMIX_MAX_NSLEN); - job->jobid = nm->name.jobid; - opal_list_append(&mca_pmix_ext3x_component.jobids, &job->super); - } - nm->name.vpid = ext3x_convert_rank(array[n].rank); - } - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - } - PMIX_PROC_FREE(array, nprocs); - return ext3x_convert_rc(ret); -} - -int ext3x_resolve_nodes(opal_jobid_t jobid, char **nodelist) -{ - pmix_status_t ret; - char *nsptr; - - OPAL_PMIX_ACQUIRE_THREAD(&opal_pmix_base.lock); - if (0 >= opal_pmix_base.initialized) { - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - return OPAL_ERR_NOT_INITIALIZED; - } - - if (NULL == (nsptr = ext3x_convert_jobid(jobid))) { - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - return OPAL_ERR_NOT_FOUND; - } - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - - ret = PMIx_Resolve_nodes(nsptr, nodelist); - - return ext3x_convert_rc(ret); -} - -static void relcbfunc(void *cbdata) -{ - ext3x_opcaddy_t *op = (ext3x_opcaddy_t*)cbdata; - OBJ_RELEASE(op); -} - -static void infocbfunc(pmix_status_t status, - pmix_info_t *info, size_t ninfo, - void *cbdata, - pmix_release_cbfunc_t release_fn, - void *release_cbdata) -{ - ext3x_opcaddy_t *op = (ext3x_opcaddy_t*)cbdata; - int rc; - - if (NULL != release_fn) { - release_fn(release_cbdata); - } - rc = ext3x_convert_rc(status); - if (NULL != op->qcbfunc) { - op->qcbfunc(rc, NULL, op->cbdata, relcbfunc, op); - } else { - OBJ_RELEASE(op); - } -} - -int ext3x_allocate(opal_pmix_alloc_directive_t directive, - opal_list_t *info, - opal_pmix_info_cbfunc_t cbfunc, void *cbdata) -{ - return OPAL_ERR_NOT_SUPPORTED; -} - -int ext3x_job_control(opal_list_t *targets, - opal_list_t *directives, - opal_pmix_info_cbfunc_t cbfunc, void *cbdata) -{ - ext3x_opcaddy_t *op; - size_t n; - opal_namelist_t *ptr; - opal_value_t *iptr; - pmix_status_t rc; - char *nsptr; - - OPAL_PMIX_ACQUIRE_THREAD(&opal_pmix_base.lock); - if (0 >= opal_pmix_base.initialized) { - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - return OPAL_ERR_NOT_INITIALIZED; - } - - /* create the caddy */ - op = OBJ_NEW(ext3x_opcaddy_t); - op->qcbfunc = cbfunc; - op->cbdata = cbdata; - if (NULL != targets) { - op->nprocs = opal_list_get_size(targets); - - /* convert the list of procs to an array - * of pmix_proc_t */ - PMIX_PROC_CREATE(op->procs, op->nprocs); - n=0; - OPAL_LIST_FOREACH(ptr, targets, opal_namelist_t) { - if (NULL == (nsptr = ext3x_convert_jobid(ptr->name.jobid))) { - OBJ_RELEASE(op); - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - return OPAL_ERR_NOT_FOUND; - } - (void)opal_string_copy(op->procs[n].nspace, nsptr, PMIX_MAX_NSLEN); - op->procs[n].rank = ext3x_convert_opalrank(ptr->name.vpid); - ++n; - } - } - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - - if (NULL != directives && 0 < (op->ninfo = opal_list_get_size(directives))) { - PMIX_INFO_CREATE(op->info, op->ninfo); - n=0; - OPAL_LIST_FOREACH(iptr, directives, opal_value_t) { - (void)opal_string_copy(op->info[n].key, iptr->key, PMIX_MAX_KEYLEN); - ext3x_value_load(&op->info[n].value, iptr); - ++n; - } - } - - rc = PMIx_Job_control_nb(op->procs,op->nprocs, op->info, op->ninfo, infocbfunc, op); - if (PMIX_SUCCESS != rc) { - OBJ_RELEASE(op); - } - return ext3x_convert_rc(rc); -} diff --git a/opal/mca/pmix/ext3x/ext3x_component.c b/opal/mca/pmix/ext3x/ext3x_component.c deleted file mode 100644 index 1bc2e9a11f7..00000000000 --- a/opal/mca/pmix/ext3x/ext3x_component.c +++ /dev/null @@ -1,157 +0,0 @@ -/* - * Copyright (c) 2014-2018 Intel, Inc. All rights reserved. - * Copyright (c) 2014-2018 Research Organization for Information Science - * and Technology (RIST). All rights reserved. - * Copyright (c) 2016-2018 Cisco Systems, 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 "opal_config.h" - -#include "opal/constants.h" -#include "opal/class/opal_list.h" -#include "opal/util/proc.h" -#include "opal/util/show_help.h" -#include "opal/mca/pmix/pmix.h" -#include "ext3x.h" - -/* - * Public string showing the pmix external component version number - */ -const char *opal_pmix_ext3x_component_version_string = - "OPAL ext3x MCA component version " OPAL_VERSION; - -/* - * Local function - */ -static int external_register(void); -static int external_open(void); -static int external_close(void); -static int external_component_query(mca_base_module_t **module, int *priority); - -/* - * Local variable - */ -static char *pmix_library_version = NULL; - - -/* - * Instantiate the public struct with all of our public information - * and pointers to our public functions in it - */ - -mca_pmix_ext3x_component_t mca_pmix_ext3x_component = { - { - /* First, the mca_component_t struct containing meta information - about the component itself */ - - .base_version = { - /* Indicate that we are a pmix v1.1.0 component (which also - implies a specific MCA version) */ - - OPAL_PMIX_BASE_VERSION_2_0_0, - - /* Component name and version */ - - .mca_component_name = "ext3x", - MCA_BASE_MAKE_VERSION(component, OPAL_MAJOR_VERSION, OPAL_MINOR_VERSION, - OPAL_RELEASE_VERSION), - - /* Component open and close functions */ - - .mca_open_component = external_open, - .mca_close_component = external_close, - .mca_query_component = external_component_query, - .mca_register_component_params = external_register - }, - /* Next the MCA v1.0.0 component meta data */ - .base_data = { - /* The component is checkpoint ready */ - MCA_BASE_METADATA_PARAM_CHECKPOINT - } - }, - .native_launch = false -}; - -static int external_register(void) -{ - mca_base_component_t *component = &mca_pmix_ext3x_component.super.base_version; - char *tmp = NULL; - - mca_pmix_ext3x_component.silence_warning = false; - (void) mca_base_component_var_register (component, "silence_warning", - "Silence warning about PMIX_INSTALL_PREFIX", - MCA_BASE_VAR_TYPE_BOOL, NULL, 0, 0, - OPAL_INFO_LVL_4, - MCA_BASE_VAR_SCOPE_READONLY, - &mca_pmix_ext3x_component.silence_warning); - - asprintf(&pmix_library_version, - "PMIx library version %s (embedded in Open MPI)", PMIx_Get_version()); - tmp = pmix_library_version; - (void) mca_base_component_var_register(component, "library_version", - "Version of the underlying PMIx library", - MCA_BASE_VAR_TYPE_STRING, - NULL, 0, 0, - OPAL_INFO_LVL_4, - MCA_BASE_VAR_SCOPE_CONSTANT, - &pmix_library_version); - free(tmp); - - return OPAL_SUCCESS; -} - -static int external_open(void) -{ - const char *version; - - mca_pmix_ext3x_component.evindex = 0; - OBJ_CONSTRUCT(&mca_pmix_ext3x_component.jobids, opal_list_t); - OBJ_CONSTRUCT(&mca_pmix_ext3x_component.events, opal_list_t); - OBJ_CONSTRUCT(&mca_pmix_ext3x_component.dmdx, opal_list_t); - - version = PMIx_Get_version(); - if ('3' > version[0]) { - opal_show_help("help-pmix-base.txt", - "incorrect-pmix", true, version, "v3.x"); - return OPAL_ERROR; - } - return OPAL_SUCCESS; -} - -static int external_close(void) -{ - OPAL_LIST_DESTRUCT(&mca_pmix_ext3x_component.jobids); - OPAL_LIST_DESTRUCT(&mca_pmix_ext3x_component.events); - OPAL_LIST_DESTRUCT(&mca_pmix_ext3x_component.dmdx); - - return OPAL_SUCCESS; -} - - -static int external_component_query(mca_base_module_t **module, int *priority) -{ - char *t, *id; - - /* see if a PMIx server is present */ - if (NULL != (t = getenv("PMIX_SERVER_URI")) || - NULL != (id = getenv("PMIX_ID"))) { - /* if PMIx is present, then we are a client and need to use it */ - *priority = 100; - } else { - /* we could be a server, so we still need to be considered */ - *priority = 5; - } - *module = (mca_base_module_t *)&opal_pmix_ext3x_module; - return OPAL_SUCCESS; -} diff --git a/opal/mca/pmix/ext3x/ext3x_local.c b/opal/mca/pmix/ext3x/ext3x_local.c deleted file mode 100644 index dda58e2f485..00000000000 --- a/opal/mca/pmix/ext3x/ext3x_local.c +++ /dev/null @@ -1,27 +0,0 @@ -/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ -/* - * Copyright (c) 2014-2017 Intel, Inc. All rights reserved. - * Copyright (c) 2014-2017 Research Organization for Information Science - * and Technology (RIST). All rights reserved. - * Copyright (c) 2014-2015 Mellanox Technologies, Inc. - * All rights reserved. - * Copyright (c) 2016 Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2017 Los Alamos National Security, LLC. All rights - * reserved. - * $COPYRIGHT$ - * - * Additional copyrights may follow - * - * $HEADER$ - */ - -#include "opal_config.h" -#include "opal/constants.h" - -#include "ext3x.h" - -int opal_pmix_ext3x_check_evars(void) -{ - /* a dummy function */ - return OPAL_SUCCESS; -} diff --git a/opal/mca/pmix/ext3x/ext3x_server_north.c b/opal/mca/pmix/ext3x/ext3x_server_north.c deleted file mode 100644 index c22e8862a46..00000000000 --- a/opal/mca/pmix/ext3x/ext3x_server_north.c +++ /dev/null @@ -1,1339 +0,0 @@ -/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ -/* - * Copyright (c) 2014-2018 Intel, Inc. All rights reserved. - * Copyright (c) 2014-2017 Research Organization for Information Science - * and Technology (RIST). All rights reserved. - * Copyright (c) 2014-2015 Mellanox Technologies, Inc. - * All rights reserved. - * Copyright (c) 2016 Cisco Systems, Inc. All rights reserved. - * $COPYRIGHT$ - * - * Additional copyrights may follow - * - * $HEADER$ - */ - -#include "opal_config.h" -#include "opal/constants.h" -#include "opal/types.h" - -#ifdef HAVE_STRING_H -#include -#endif -#ifdef HAVE_UNISTD_H -#include -#endif - -#include "opal/dss/dss.h" -#include "opal/mca/event/event.h" -#include "opal/mca/hwloc/base/base.h" -#include "opal/runtime/opal.h" -#include "opal/runtime/opal_progress_threads.h" -#include "opal/threads/threads.h" -#include "opal/util/argv.h" -#include "opal/util/error.h" -#include "opal/util/output.h" -#include "opal/util/proc.h" -#include "opal/util/show_help.h" -#include "opal/util/string_copy.h" -#include "opal/mca/pmix/base/base.h" -#include "ext3x.h" - -#include "pmix.h" -#include "pmix_server.h" - -/**** N.O.R.T.H.B.O.U.N.D I.N.T.E.R.F.A.C.E.S ****/ - -/* These are the interfaces used by the embedded PMIx server - * to call up into ORTE for service requests */ - -static pmix_status_t server_client_connected_fn(const pmix_proc_t *proc, void* server_object, - pmix_op_cbfunc_t cbfunc, void *cbdata); -static pmix_status_t server_client_finalized_fn(const pmix_proc_t *proc, void* server_object, - pmix_op_cbfunc_t cbfunc, void *cbdata); -static pmix_status_t server_abort_fn(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); -static pmix_status_t server_fencenb_fn(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); -static pmix_status_t server_dmodex_req_fn(const pmix_proc_t *proc, - const pmix_info_t info[], size_t ninfo, - pmix_modex_cbfunc_t cbfunc, void *cbdata); -static pmix_status_t server_publish_fn(const pmix_proc_t *proc, - const pmix_info_t info[], size_t ninfo, - pmix_op_cbfunc_t cbfunc, void *cbdata); -static pmix_status_t server_lookup_fn(const pmix_proc_t *proc, char **keys, - const pmix_info_t info[], size_t ninfo, - pmix_lookup_cbfunc_t cbfunc, void *cbdata); -static pmix_status_t server_unpublish_fn(const pmix_proc_t *proc, char **keys, - const pmix_info_t info[], size_t ninfo, - pmix_op_cbfunc_t cbfunc, void *cbdata); -static pmix_status_t server_spawn_fn(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); -static pmix_status_t server_connect_fn(const pmix_proc_t procs[], size_t nprocs, - const pmix_info_t info[], size_t ninfo, - pmix_op_cbfunc_t cbfunc, void *cbdata); -static pmix_status_t server_disconnect_fn(const pmix_proc_t procs[], size_t nprocs, - const pmix_info_t info[], size_t ninfo, - pmix_op_cbfunc_t cbfunc, void *cbdata); -static pmix_status_t server_register_events(pmix_status_t *codes, size_t ncodes, - const pmix_info_t info[], size_t ninfo, - pmix_op_cbfunc_t cbfunc, void *cbdata); -static pmix_status_t server_deregister_events(pmix_status_t *codes, size_t ncodes, - pmix_op_cbfunc_t cbfunc, void *cbdata); -static pmix_status_t server_notify_event(pmix_status_t code, - const pmix_proc_t *source, - pmix_data_range_t range, - pmix_info_t info[], size_t ninfo, - pmix_op_cbfunc_t cbfunc, void *cbdata); -static pmix_status_t server_query(pmix_proc_t *proct, - pmix_query_t *queryies, size_t nqueries, - pmix_info_cbfunc_t cbfunc, - void *cbdata); -static void server_tool_connection(pmix_info_t *info, size_t ninfo, - pmix_tool_connection_cbfunc_t cbfunc, - void *cbdata); -static void server_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); - -static pmix_status_t server_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); - -static pmix_status_t server_job_control(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); -static pmix_status_t server_iof_pull(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); -static pmix_status_t server_stdin(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); - -pmix_server_module_t mymodule = { - .client_connected = server_client_connected_fn, - .client_finalized = server_client_finalized_fn, - .abort = server_abort_fn, - .fence_nb = server_fencenb_fn, - .direct_modex = server_dmodex_req_fn, - .publish = server_publish_fn, - .lookup = server_lookup_fn, - .unpublish = server_unpublish_fn, - .spawn = server_spawn_fn, - .connect = server_connect_fn, - .disconnect = server_disconnect_fn, - .register_events = server_register_events, - .deregister_events = server_deregister_events, - .notify_event = server_notify_event, - .query = server_query, - .tool_connected = server_tool_connection, - .log = server_log, - .allocate = server_allocate, - .job_control = server_job_control, - /* we do not support monitoring, but use the - * PMIx internal monitoring capability */ - .iof_pull = server_iof_pull, - .push_stdin = server_stdin -}; - -opal_pmix_server_module_t *host_module = NULL; - - -static void opal_opcbfunc(int status, void *cbdata) -{ - ext3x_opalcaddy_t *opalcaddy = (ext3x_opalcaddy_t*)cbdata; - - OPAL_ACQUIRE_OBJECT(opalcaddy); - if (NULL != opalcaddy->opcbfunc) { - opalcaddy->opcbfunc(ext3x_convert_opalrc(status), opalcaddy->cbdata); - } - OBJ_RELEASE(opalcaddy); -} - -static pmix_status_t server_client_connected_fn(const pmix_proc_t *p, void *server_object, - pmix_op_cbfunc_t cbfunc, void *cbdata) -{ - int rc; - opal_process_name_t proc; - ext3x_opalcaddy_t *opalcaddy; - - if (NULL == host_module || NULL == host_module->client_connected) { - return PMIX_SUCCESS; - } - - opalcaddy = OBJ_NEW(ext3x_opalcaddy_t); - opalcaddy->opcbfunc = cbfunc; - opalcaddy->cbdata = cbdata; - - /* convert the nspace/rank to an opal_process_name_t */ - if (OPAL_SUCCESS != (rc = opal_convert_string_to_jobid(&proc.jobid, p->nspace))) { - return ext3x_convert_opalrc(rc); - } - proc.vpid = ext3x_convert_rank(p->rank); - - /* pass it up */ - rc = host_module->client_connected(&proc, server_object, - opal_opcbfunc, opalcaddy); - return ext3x_convert_opalrc(rc); -} - -static pmix_status_t server_client_finalized_fn(const pmix_proc_t *p, void* server_object, - pmix_op_cbfunc_t cbfunc, void *cbdata) -{ - int rc; - ext3x_opalcaddy_t *opalcaddy; - opal_process_name_t proc; - - if (NULL == host_module || NULL == host_module->client_finalized) { - return PMIX_SUCCESS; - } - - /* convert the nspace/rank to an opal_process_name_t */ - if (OPAL_SUCCESS != (rc = opal_convert_string_to_jobid(&proc.jobid, p->nspace))) { - return ext3x_convert_opalrc(rc); - } - proc.vpid = ext3x_convert_rank(p->rank); - - /* setup the caddy */ - opalcaddy = OBJ_NEW(ext3x_opalcaddy_t); - opalcaddy->opcbfunc = cbfunc; - opalcaddy->cbdata = cbdata; - - /* pass it up */ - opal_output_verbose(3, opal_pmix_base_framework.framework_output, - "%s CLIENT %s FINALIZED", - OPAL_NAME_PRINT(OPAL_PROC_MY_NAME), - OPAL_NAME_PRINT(proc)); - rc = host_module->client_finalized(&proc, server_object, opal_opcbfunc, opalcaddy); - if (OPAL_SUCCESS != rc) { - OBJ_RELEASE(opalcaddy); - } - return ext3x_convert_opalrc(rc); -} - -static pmix_status_t server_abort_fn(const pmix_proc_t *p, void *server_object, - int status, const char msg[], - pmix_proc_t procs[], size_t nprocs, - pmix_op_cbfunc_t cbfunc, void *cbdata) -{ - size_t n; - opal_namelist_t *nm; - opal_process_name_t proc; - int rc; - ext3x_opalcaddy_t *opalcaddy; - - if (NULL == host_module || NULL == host_module->abort) { - return PMIX_ERR_NOT_SUPPORTED; - } - - /* convert the nspace/rank to an opal_process_name_t */ - if (OPAL_SUCCESS != (rc = opal_convert_string_to_jobid(&proc.jobid, p->nspace))) { - return ext3x_convert_opalrc(rc); - } - proc.vpid = ext3x_convert_rank(p->rank); - - opal_output_verbose(3, opal_pmix_base_framework.framework_output, - "%s CLIENT %s CALLED ABORT", - OPAL_NAME_PRINT(OPAL_PROC_MY_NAME), - OPAL_NAME_PRINT(proc)); - - /* setup the caddy */ - opalcaddy = OBJ_NEW(ext3x_opalcaddy_t); - opalcaddy->opcbfunc = cbfunc; - opalcaddy->cbdata = cbdata; - - /* convert the array of pmix_proc_t to the list of procs */ - for (n=0; n < nprocs; n++) { - nm = OBJ_NEW(opal_namelist_t); - opal_list_append(&opalcaddy->procs, &nm->super); - if (OPAL_SUCCESS != (rc = opal_convert_string_to_jobid(&nm->name.jobid, procs[n].nspace))) { - OBJ_RELEASE(opalcaddy); - return ext3x_convert_opalrc(rc); - } - nm->name.vpid = ext3x_convert_rank(procs[n].rank); - } - - /* pass it up */ - rc = host_module->abort(&proc, server_object, status, msg, - &opalcaddy->procs, opal_opcbfunc, opalcaddy); - if (OPAL_SUCCESS != rc) { - OBJ_RELEASE(opalcaddy); - } - return ext3x_convert_opalrc(rc); -} - -static void _data_release(void *cbdata) -{ - ext3x_opalcaddy_t *opalcaddy = (ext3x_opalcaddy_t*)cbdata; - - if (NULL != opalcaddy->odmdxfunc) { - opalcaddy->odmdxfunc(opalcaddy->ocbdata); - } - OBJ_RELEASE(opalcaddy); -} - -static void opmdx_response(int status, const char *data, size_t sz, void *cbdata, - opal_pmix_release_cbfunc_t relcbfunc, void *relcbdata) -{ - pmix_status_t rc; - ext3x_opalcaddy_t *opalcaddy = (ext3x_opalcaddy_t*)cbdata; - opal_ext3x_dmx_trkr_t *dmdx; - - rc = ext3x_convert_rc(status); - if (NULL != opalcaddy->mdxcbfunc) { - opalcaddy->odmdxfunc = relcbfunc; - opalcaddy->ocbdata = relcbdata; - opalcaddy->mdxcbfunc(rc, data, sz, opalcaddy->cbdata, - _data_release, opalcaddy); - } else { - OBJ_RELEASE(opalcaddy); - } - if (opal_pmix_collect_all_data) { - /* if we were collecting all data, then check for any pending - * dmodx requests that we cached and notify them that the - * data has arrived */ - OPAL_PMIX_ACQUIRE_THREAD(&opal_pmix_base.lock); - while (NULL != (dmdx = (opal_ext3x_dmx_trkr_t*)opal_list_remove_first(&mca_pmix_ext3x_component.dmdx))) { - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - dmdx->cbfunc(PMIX_SUCCESS, NULL, 0, dmdx->cbdata, NULL, NULL); - OPAL_PMIX_ACQUIRE_THREAD(&opal_pmix_base.lock); - OBJ_RELEASE(dmdx); - } - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - } -} - -static pmix_status_t server_fencenb_fn(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) -{ - ext3x_opalcaddy_t *opalcaddy; - size_t n; - opal_namelist_t *nm; - opal_value_t *iptr; - int rc; - - opal_output_verbose(3, opal_pmix_base_framework.framework_output, - "%s FENCE CALLED", OPAL_NAME_PRINT(OPAL_PROC_MY_NAME)); - - if (NULL == host_module || NULL == host_module->fence_nb) { - return PMIX_ERR_NOT_SUPPORTED; - } - /* setup the caddy */ - opalcaddy = OBJ_NEW(ext3x_opalcaddy_t); - opalcaddy->mdxcbfunc = cbfunc; - opalcaddy->cbdata = cbdata; - - /* convert the array of pmix_proc_t to the list of procs */ - for (n=0; n < nprocs; n++) { - nm = OBJ_NEW(opal_namelist_t); - opal_list_append(&opalcaddy->procs, &nm->super); - if (OPAL_SUCCESS != (rc = opal_convert_string_to_jobid(&nm->name.jobid, procs[n].nspace))) { - OBJ_RELEASE(opalcaddy); - return ext3x_convert_opalrc(rc); - } - nm->name.vpid = ext3x_convert_rank(procs[n].rank); - } - - /* convert the array of pmix_info_t to the list of info */ - for (n=0; n < ninfo; n++) { - iptr = OBJ_NEW(opal_value_t); - opal_list_append(&opalcaddy->info, &iptr->super); - iptr->key = strdup(info[n].key); - if (OPAL_SUCCESS != (rc = ext3x_value_unload(iptr, &info[n].value))) { - OBJ_RELEASE(opalcaddy); - return ext3x_convert_opalrc(rc); - } - } - - /* pass it up */ - rc = host_module->fence_nb(&opalcaddy->procs, &opalcaddy->info, - data, ndata, opmdx_response, opalcaddy); - if (OPAL_SUCCESS != rc) { - OBJ_RELEASE(opalcaddy); - } - return ext3x_convert_opalrc(rc); -} - -static pmix_status_t server_dmodex_req_fn(const pmix_proc_t *p, - const pmix_info_t info[], size_t ninfo, - pmix_modex_cbfunc_t cbfunc, void *cbdata) -{ - int rc; - ext3x_opalcaddy_t *opalcaddy; - opal_process_name_t proc; - opal_value_t *iptr; - size_t n; - opal_ext3x_dmx_trkr_t *dmdx; - - if (NULL == host_module || NULL == host_module->direct_modex) { - return PMIX_ERR_NOT_SUPPORTED; - } - - /* convert the nspace/rank to an opal_process_name_t */ - if (OPAL_SUCCESS != (rc = opal_convert_string_to_jobid(&proc.jobid, p->nspace))) { - return ext3x_convert_opalrc(rc); - } - proc.vpid = ext3x_convert_rank(p->rank); - - opal_output_verbose(3, opal_pmix_base_framework.framework_output, - "%s CLIENT %s CALLED DMODX", - OPAL_NAME_PRINT(OPAL_PROC_MY_NAME), - OPAL_NAME_PRINT(proc)); - - /* setup the caddy */ - opalcaddy = OBJ_NEW(ext3x_opalcaddy_t); - opalcaddy->mdxcbfunc = cbfunc; - opalcaddy->cbdata = cbdata; - - /* this function should only get called if we are in an async modex. - * If we are also collecting data, then the fence_nb will eventually - * complete and return all the required data down to the pmix - * server beneath us. Thus, we only need to track the dmodex_req - * and ensure that the release gets called once the data has - * arrived - this will trigger the pmix server to tell the - * client that the data is available */ - if (opal_pmix_base_async_modex && opal_pmix_collect_all_data) { - OPAL_PMIX_ACQUIRE_THREAD(&opal_pmix_base.lock); - dmdx = OBJ_NEW(opal_ext3x_dmx_trkr_t); - dmdx->cbfunc = cbfunc; - dmdx->cbdata = cbdata; - opal_list_append(&mca_pmix_ext3x_component.dmdx, &dmdx->super); - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - return PMIX_SUCCESS; - } - - /* convert the array of pmix_info_t to the list of info */ - for (n=0; n < ninfo; n++) { - iptr = OBJ_NEW(opal_value_t); - opal_list_append(&opalcaddy->info, &iptr->super); - iptr->key = strdup(info[n].key); - if (OPAL_SUCCESS != (rc = ext3x_value_unload(iptr, &info[n].value))) { - OBJ_RELEASE(opalcaddy); - return ext3x_convert_opalrc(rc); - } - } - - /* pass it up */ - rc = host_module->direct_modex(&proc, &opalcaddy->info, opmdx_response, opalcaddy); - if (OPAL_SUCCESS != rc && OPAL_ERR_IN_PROCESS != rc) { - OBJ_RELEASE(opalcaddy); - } - if (OPAL_ERR_IN_PROCESS == rc) { - rc = OPAL_SUCCESS; - } - return ext3x_convert_opalrc(rc); -} - -static pmix_status_t server_publish_fn(const pmix_proc_t *p, - const pmix_info_t info[], size_t ninfo, - pmix_op_cbfunc_t cbfunc, void *cbdata) -{ - int rc; - size_t n; - ext3x_opalcaddy_t *opalcaddy; - opal_process_name_t proc; - opal_value_t *oinfo; - - if (NULL == host_module || NULL == host_module->publish) { - return PMIX_ERR_NOT_SUPPORTED; - } - - /* convert the nspace/rank to an opal_process_name_t */ - if (OPAL_SUCCESS != (rc = opal_convert_string_to_jobid(&proc.jobid, p->nspace))) { - return ext3x_convert_opalrc(rc); - } - proc.vpid = ext3x_convert_rank(p->rank); - - opal_output_verbose(3, opal_pmix_base_framework.framework_output, - "%s CLIENT %s CALLED PUBLISH", - OPAL_NAME_PRINT(OPAL_PROC_MY_NAME), - OPAL_NAME_PRINT(proc)); - - /* setup the caddy */ - opalcaddy = OBJ_NEW(ext3x_opalcaddy_t); - opalcaddy->opcbfunc = cbfunc; - opalcaddy->cbdata = cbdata; - - /* convert the info array */ - for (n=0; n < ninfo; n++) { - oinfo = OBJ_NEW(opal_value_t); - opal_list_append(&opalcaddy->info, &oinfo->super); - oinfo->key = strdup(info[n].key); - if (OPAL_SUCCESS != (rc = ext3x_value_unload(oinfo, &info[n].value))) { - OBJ_RELEASE(opalcaddy); - return ext3x_convert_opalrc(rc); - } - } - - /* pass it up */ - rc = host_module->publish(&proc, &opalcaddy->info, opal_opcbfunc, opalcaddy); - if (OPAL_SUCCESS != rc) { - OBJ_RELEASE(opalcaddy); - } - - return ext3x_convert_opalrc(rc); -} - -static void opal_lkupcbfunc(int status, - opal_list_t *data, - void *cbdata) -{ - ext3x_opalcaddy_t *opalcaddy = (ext3x_opalcaddy_t*)cbdata; - pmix_status_t rc; - pmix_pdata_t *d=NULL; - size_t nd=0, n; - opal_pmix_pdata_t *p; - - if (NULL != opalcaddy->lkupcbfunc) { - rc = ext3x_convert_opalrc(status); - /* convert any returned data */ - if (NULL != data) { - nd = opal_list_get_size(data); - PMIX_PDATA_CREATE(d, nd); - n=0; - OPAL_LIST_FOREACH(p, data, opal_pmix_pdata_t) { - /* convert the jobid */ - (void)opal_snprintf_jobid(d[n].proc.nspace, PMIX_MAX_NSLEN, p->proc.jobid); - d[n].proc.rank = ext3x_convert_opalrank(p->proc.vpid); - (void)opal_string_copy(d[n].key, p->value.key, PMIX_MAX_KEYLEN); - ext3x_value_load(&d[n].value, &p->value); - } - } - opalcaddy->lkupcbfunc(rc, d, nd, opalcaddy->cbdata); - PMIX_PDATA_FREE(d, nd); - } - OBJ_RELEASE(opalcaddy); -} - -static pmix_status_t server_lookup_fn(const pmix_proc_t *p, char **keys, - const pmix_info_t info[], size_t ninfo, - pmix_lookup_cbfunc_t cbfunc, void *cbdata) -{ - int rc; - ext3x_opalcaddy_t *opalcaddy; - opal_process_name_t proc; - opal_value_t *iptr; - size_t n; - - if (NULL == host_module || NULL == host_module->lookup) { - return PMIX_ERR_NOT_SUPPORTED; - } - - /* convert the nspace/rank to an opal_process_name_t */ - if (OPAL_SUCCESS != (rc = opal_convert_string_to_jobid(&proc.jobid, p->nspace))) { - return ext3x_convert_opalrc(rc); - } - proc.vpid = ext3x_convert_rank(p->rank); - - opal_output_verbose(3, opal_pmix_base_framework.framework_output, - "%s CLIENT %s CALLED LOOKUP", - OPAL_NAME_PRINT(OPAL_PROC_MY_NAME), - OPAL_NAME_PRINT(proc)); - - /* setup the caddy */ - opalcaddy = OBJ_NEW(ext3x_opalcaddy_t); - opalcaddy->lkupcbfunc = cbfunc; - opalcaddy->cbdata = cbdata; - - /* convert the array of pmix_info_t to the list of info */ - for (n=0; n < ninfo; n++) { - iptr = OBJ_NEW(opal_value_t); - opal_list_append(&opalcaddy->info, &iptr->super); - iptr->key = strdup(info[n].key); - if (OPAL_SUCCESS != (rc = ext3x_value_unload(iptr, &info[n].value))) { - OBJ_RELEASE(opalcaddy); - return ext3x_convert_opalrc(rc); - } - } - - /* pass it up */ - rc = host_module->lookup(&proc, keys, &opalcaddy->info, opal_lkupcbfunc, opalcaddy); - if (OPAL_SUCCESS != rc) { - OBJ_RELEASE(opalcaddy); - } - - return ext3x_convert_opalrc(rc); -} - - -static pmix_status_t server_unpublish_fn(const pmix_proc_t *p, char **keys, - const pmix_info_t info[], size_t ninfo, - pmix_op_cbfunc_t cbfunc, void *cbdata) -{ - int rc; - ext3x_opalcaddy_t *opalcaddy; - opal_process_name_t proc; - opal_value_t *iptr; - size_t n; - - if (NULL == host_module || NULL == host_module->unpublish) { - return PMIX_SUCCESS; - } - - /* convert the nspace/rank to an opal_process_name_t */ - if (OPAL_SUCCESS != (rc = opal_convert_string_to_jobid(&proc.jobid, p->nspace))) { - return ext3x_convert_opalrc(rc); - } - proc.vpid = ext3x_convert_rank(p->rank); - - opal_output_verbose(3, opal_pmix_base_framework.framework_output, - "%s CLIENT %s CALLED UNPUBLISH", - OPAL_NAME_PRINT(OPAL_PROC_MY_NAME), - OPAL_NAME_PRINT(proc)); - - /* setup the caddy */ - opalcaddy = OBJ_NEW(ext3x_opalcaddy_t); - opalcaddy->opcbfunc = cbfunc; - opalcaddy->cbdata = cbdata; - - /* convert the array of pmix_info_t to the list of info */ - for (n=0; n < ninfo; n++) { - iptr = OBJ_NEW(opal_value_t); - opal_list_append(&opalcaddy->info, &iptr->super); - iptr->key = strdup(info[n].key); - if (OPAL_SUCCESS != (rc = ext3x_value_unload(iptr, &info[n].value))) { - OBJ_RELEASE(opalcaddy); - return ext3x_convert_opalrc(rc); - } - } - - /* pass it up */ - rc = host_module->unpublish(&proc, keys, &opalcaddy->info, opal_opcbfunc, opalcaddy); - if (OPAL_SUCCESS != rc) { - OBJ_RELEASE(opalcaddy); - } - - return ext3x_convert_opalrc(rc); -} - -static void opal_spncbfunc(int status, opal_jobid_t jobid, void *cbdata) -{ - ext3x_opalcaddy_t *opalcaddy = (ext3x_opalcaddy_t*)cbdata; - pmix_status_t rc; - char nspace[PMIX_MAX_NSLEN]; - - if (NULL != opalcaddy->spwncbfunc) { - rc = ext3x_convert_opalrc(status); - /* convert the jobid */ - (void)opal_snprintf_jobid(nspace, PMIX_MAX_NSLEN, jobid); - opalcaddy->spwncbfunc(rc, nspace, opalcaddy->cbdata); - } - OBJ_RELEASE(opalcaddy); -} - -static pmix_status_t server_spawn_fn(const pmix_proc_t *p, - const pmix_info_t job_info[], size_t ninfo, - const pmix_app_t apps[], size_t napps, - pmix_spawn_cbfunc_t cbfunc, void *cbdata) -{ - ext3x_opalcaddy_t *opalcaddy; - opal_process_name_t proc; - opal_pmix_app_t *app; - opal_value_t *oinfo; - size_t k, n; - int rc; - - if (NULL == host_module || NULL == host_module->spawn) { - return PMIX_ERR_NOT_SUPPORTED; - } - - /* convert the nspace/rank to an opal_process_name_t */ - if (OPAL_SUCCESS != (rc = opal_convert_string_to_jobid(&proc.jobid, p->nspace))) { - return ext3x_convert_opalrc(rc); - } - proc.vpid = ext3x_convert_rank(p->rank); - - /* setup the caddy */ - opalcaddy = OBJ_NEW(ext3x_opalcaddy_t); - opalcaddy->spwncbfunc = cbfunc; - opalcaddy->cbdata = cbdata; - - /* convert the job info */ - for (k=0; k < ninfo; k++) { - oinfo = OBJ_NEW(opal_value_t); - opal_list_append(&opalcaddy->info, &oinfo->super); - oinfo->key = strdup(job_info[k].key); - if (OPAL_SUCCESS != (rc = ext3x_value_unload(oinfo, &job_info[k].value))) { - OBJ_RELEASE(opalcaddy); - return ext3x_convert_opalrc(rc); - } - } - - /* convert the apps */ - for (n=0; n < napps; n++) { - app = OBJ_NEW(opal_pmix_app_t); - opal_list_append(&opalcaddy->apps, &app->super); - if (NULL != apps[n].cmd) { - app->cmd = strdup(apps[n].cmd); - } - if (NULL != apps[n].argv) { - app->argv = opal_argv_copy(apps[n].argv); - } - if (NULL != apps[n].env) { - app->env = opal_argv_copy(apps[n].env); - } - if (NULL != apps[n].cwd) { - app->cwd = strdup(apps[n].cwd); - } - app->maxprocs = apps[n].maxprocs; - for (k=0; k < apps[n].ninfo; k++) { - oinfo = OBJ_NEW(opal_value_t); - opal_list_append(&app->info, &oinfo->super); - oinfo->key = strdup(apps[n].info[k].key); - if (OPAL_SUCCESS != (rc = ext3x_value_unload(oinfo, &apps[n].info[k].value))) { - OBJ_RELEASE(opalcaddy); - return ext3x_convert_opalrc(rc); - } - } - } - - /* pass it up */ - rc = host_module->spawn(&proc, &opalcaddy->info, &opalcaddy->apps, opal_spncbfunc, opalcaddy); - if (OPAL_SUCCESS != rc) { - OPAL_ERROR_LOG(rc); - OBJ_RELEASE(opalcaddy); - } - - return ext3x_convert_opalrc(rc); -} - - -static pmix_status_t server_connect_fn(const pmix_proc_t procs[], size_t nprocs, - const pmix_info_t info[], size_t ninfo, - pmix_op_cbfunc_t cbfunc, void *cbdata) -{ - int rc; - ext3x_opalcaddy_t *opalcaddy; - opal_namelist_t *nm; - size_t n; - opal_value_t *oinfo; - - if (NULL == host_module || NULL == host_module->connect) { - return PMIX_ERR_NOT_SUPPORTED; - } - - /* setup the caddy */ - opalcaddy = OBJ_NEW(ext3x_opalcaddy_t); - opalcaddy->opcbfunc = cbfunc; - opalcaddy->cbdata = cbdata; - - /* convert the array of pmix_proc_t to the list of procs */ - for (n=0; n < nprocs; n++) { - nm = OBJ_NEW(opal_namelist_t); - opal_list_append(&opalcaddy->procs, &nm->super); - if (OPAL_SUCCESS != (rc = opal_convert_string_to_jobid(&nm->name.jobid, procs[n].nspace))) { - OBJ_RELEASE(opalcaddy); - return ext3x_convert_opalrc(rc); - } - nm->name.vpid = ext3x_convert_rank(procs[n].rank); - } - - /* convert the info */ - for (n=0; n < ninfo; n++) { - oinfo = OBJ_NEW(opal_value_t); - opal_list_append(&opalcaddy->info, &oinfo->super); - oinfo->key = strdup(info[n].key); - if (OPAL_SUCCESS != (rc = ext3x_value_unload(oinfo, &info[n].value))) { - OBJ_RELEASE(opalcaddy); - return ext3x_convert_opalrc(rc); - } - } - - /* pass it up */ - rc = host_module->connect(&opalcaddy->procs, &opalcaddy->info, opal_opcbfunc, opalcaddy); - if (OPAL_SUCCESS != rc) { - OBJ_RELEASE(opalcaddy); - } - - return ext3x_convert_opalrc(rc); -} - - -static pmix_status_t server_disconnect_fn(const pmix_proc_t procs[], size_t nprocs, - const pmix_info_t info[], size_t ninfo, - pmix_op_cbfunc_t cbfunc, void *cbdata) -{ - int rc; - ext3x_opalcaddy_t *opalcaddy; - opal_namelist_t *nm; - size_t n; - opal_value_t *oinfo; - - if (NULL == host_module || NULL == host_module->disconnect) { - return PMIX_ERR_NOT_SUPPORTED; - } - - /* setup the caddy */ - opalcaddy = OBJ_NEW(ext3x_opalcaddy_t); - opalcaddy->opcbfunc = cbfunc; - opalcaddy->cbdata = cbdata; - - /* convert the array of pmix_proc_t to the list of procs */ - for (n=0; n < nprocs; n++) { - nm = OBJ_NEW(opal_namelist_t); - opal_list_append(&opalcaddy->procs, &nm->super); - if (OPAL_SUCCESS != (rc = opal_convert_string_to_jobid(&nm->name.jobid, procs[n].nspace))) { - OBJ_RELEASE(opalcaddy); - return ext3x_convert_opalrc(rc); - } - nm->name.vpid = ext3x_convert_rank(procs[n].rank); - } - - /* convert the info */ - for (n=0; n < ninfo; n++) { - oinfo = OBJ_NEW(opal_value_t); - opal_list_append(&opalcaddy->info, &oinfo->super); - oinfo->key = strdup(info[n].key); - if (OPAL_SUCCESS != (rc = ext3x_value_unload(oinfo, &info[n].value))) { - OBJ_RELEASE(opalcaddy); - return ext3x_convert_opalrc(rc); - } - } - - /* pass it up */ - rc = host_module->disconnect(&opalcaddy->procs, &opalcaddy->info, opal_opcbfunc, opalcaddy); - if (OPAL_SUCCESS != rc) { - OBJ_RELEASE(opalcaddy); - } - - return ext3x_convert_opalrc(rc); -} - -static pmix_status_t server_register_events(pmix_status_t *codes, size_t ncodes, - const pmix_info_t info[], size_t ninfo, - pmix_op_cbfunc_t cbfunc, void *cbdata) -{ - ext3x_opalcaddy_t *opalcaddy; - size_t n; - opal_value_t *oinfo; - int rc; - - opal_output_verbose(3, opal_pmix_base_framework.framework_output, - "%s REGISTER EVENTS", - OPAL_NAME_PRINT(OPAL_PROC_MY_NAME)); - - /* setup the caddy */ - opalcaddy = OBJ_NEW(ext3x_opalcaddy_t); - opalcaddy->opcbfunc = cbfunc; - opalcaddy->cbdata = cbdata; - - /* convert the info */ - for (n=0; n < ninfo; n++) { - oinfo = OBJ_NEW(opal_value_t); - opal_list_append(&opalcaddy->info, &oinfo->super); - oinfo->key = strdup(info[n].key); - if (OPAL_SUCCESS != (rc = ext3x_value_unload(oinfo, &info[n].value))) { - OBJ_RELEASE(opalcaddy); - return ext3x_convert_opalrc(rc); - } - } - - /* pass it up */ - rc = host_module->register_events(&opalcaddy->info, opal_opcbfunc, opalcaddy); - if (OPAL_SUCCESS != rc) { - OBJ_RELEASE(opalcaddy); - } - - return ext3x_convert_opalrc(rc); -} - -static pmix_status_t server_deregister_events(pmix_status_t *codes, size_t ncodes, - pmix_op_cbfunc_t cbfunc, void *cbdata) -{ - opal_output_verbose(3, opal_pmix_base_framework.framework_output, - "%s DEREGISTER EVENTS", OPAL_NAME_PRINT(OPAL_PROC_MY_NAME)); - - return PMIX_ERR_NOT_SUPPORTED; -} - -static pmix_status_t server_notify_event(pmix_status_t code, - const pmix_proc_t *source, - pmix_data_range_t range, - pmix_info_t info[], size_t ninfo, - pmix_op_cbfunc_t cbfunc, void *cbdata) -{ - ext3x_opalcaddy_t *opalcaddy; - opal_process_name_t src; - size_t n; - opal_value_t *oinfo; - int rc, status; - - if (NULL == host_module || NULL == host_module->notify_event) { - return PMIX_ERR_NOT_SUPPORTED; - } - - /* setup the caddy */ - opalcaddy = OBJ_NEW(ext3x_opalcaddy_t); - opalcaddy->opcbfunc = cbfunc; - opalcaddy->cbdata = cbdata; - - /* convert the code */ - status = ext3x_convert_rc(code); - - /* convert the source */ - if (OPAL_SUCCESS != (rc = opal_convert_string_to_jobid(&src.jobid, source->nspace))) { - OBJ_RELEASE(opalcaddy); - return ext3x_convert_opalrc(rc); - } - src.vpid = ext3x_convert_rank(source->rank); - - opal_output_verbose(3, opal_pmix_base_framework.framework_output, - "%s CLIENT %s CALLED NOTIFY", - OPAL_NAME_PRINT(OPAL_PROC_MY_NAME), - OPAL_NAME_PRINT(src)); - - /* ignore the range for now */ - - /* convert the info */ - for (n=0; n < ninfo; n++) { - oinfo = OBJ_NEW(opal_value_t); - opal_list_append(&opalcaddy->info, &oinfo->super); - oinfo->key = strdup(info[n].key); - if (OPAL_SUCCESS != (rc = ext3x_value_unload(oinfo, &info[n].value))) { - OBJ_RELEASE(opalcaddy); - return ext3x_convert_opalrc(rc); - } - } - - /* send it upstairs */ - if (OPAL_SUCCESS != (rc = host_module->notify_event(status, &src, &opalcaddy->info, - opal_opcbfunc, opalcaddy))) { - OBJ_RELEASE(opalcaddy); - } - return ext3x_convert_opalrc(rc); -} - -static void _info_rel(void *cbdata) -{ - ext3x_opcaddy_t *pcaddy = (ext3x_opcaddy_t*)cbdata; - - OBJ_RELEASE(pcaddy); -} -static void info_cbfunc(int status, - opal_list_t *info, - void *cbdata, - opal_pmix_release_cbfunc_t release_fn, - void *release_cbdata) -{ - ext3x_opalcaddy_t *opalcaddy = (ext3x_opalcaddy_t*)cbdata; - ext3x_opcaddy_t *pcaddy; - opal_value_t *kv; - size_t n; - - pcaddy = OBJ_NEW(ext3x_opcaddy_t); - - /* convert the status */ - pcaddy->status = ext3x_convert_opalrc(status); - - /* convert the list to a pmix_info_t array */ - if (NULL != info && 0 < (pcaddy->ninfo = opal_list_get_size(info))) { - PMIX_INFO_CREATE(pcaddy->info, pcaddy->ninfo); - n = 0; - OPAL_LIST_FOREACH(kv, info, opal_value_t) { - (void)opal_string_copy(pcaddy->info[n].key, kv->key, PMIX_MAX_KEYLEN); - ext3x_value_load(&pcaddy->info[n].value, kv); - ++n; - } - } - /* we are done with the incoming data */ - if (NULL != release_fn) { - release_fn(release_cbdata); - } - - /* provide the answer downward */ - if (NULL != opalcaddy->infocbfunc) { - opalcaddy->infocbfunc(pcaddy->status, pcaddy->info, pcaddy->ninfo, - opalcaddy->cbdata, _info_rel, pcaddy); - } - OBJ_RELEASE(opalcaddy); -} - -static pmix_status_t server_query(pmix_proc_t *proct, - pmix_query_t *queries, size_t nqueries, - pmix_info_cbfunc_t cbfunc, - void *cbdata) -{ - ext3x_opalcaddy_t *opalcaddy; - opal_process_name_t requestor; - int rc; - size_t n, m; - opal_pmix_query_t *q; - opal_value_t *oinfo; - - if (NULL == host_module || NULL == host_module->query) { - return PMIX_ERR_NOT_SUPPORTED; - } - - /* setup the caddy */ - opalcaddy = OBJ_NEW(ext3x_opalcaddy_t); - opalcaddy->infocbfunc = cbfunc; - opalcaddy->cbdata = cbdata; - - /* convert the requestor */ - if (OPAL_SUCCESS != (rc = opal_convert_string_to_jobid(&requestor.jobid, proct->nspace))) { - OBJ_RELEASE(opalcaddy); - return ext3x_convert_opalrc(rc); - } - requestor.vpid = ext3x_convert_rank(proct->rank); - - opal_output_verbose(3, opal_pmix_base_framework.framework_output, - "%s CLIENT %s CALLED QUERY", - OPAL_NAME_PRINT(OPAL_PROC_MY_NAME), - OPAL_NAME_PRINT(requestor)); - - /* convert the queries */ - for (n=0; n < nqueries; n++) { - q = OBJ_NEW(opal_pmix_query_t); - /* we "borrow" the info field of the caddy as we and the - * server function both agree on what will be there */ - opal_list_append(&opalcaddy->info, &q->super); - q->keys = opal_argv_copy(queries[n].keys); - for (m=0; m < queries[n].nqual; m++) { - oinfo = OBJ_NEW(opal_value_t); - opal_list_append(&q->qualifiers, &oinfo->super); - - if (0 == strcmp(queries[n].qualifiers[m].key, PMIX_NSPACE)) { - /* must convert this to jobid */ - oinfo->key = strdup(OPAL_PMIX_PROCID); - if (OPAL_SUCCESS != (rc = opal_convert_string_to_jobid(&oinfo->data.name.jobid, queries[n].qualifiers[m].value.data.string))) { - OBJ_RELEASE(opalcaddy); - return ext3x_convert_opalrc(rc); - } - } else { - oinfo->key = strdup(queries[n].qualifiers[m].key); - if (OPAL_SUCCESS != (rc = ext3x_value_unload(oinfo, &queries[n].qualifiers[m].value))) { - OBJ_RELEASE(opalcaddy); - return ext3x_convert_opalrc(rc); - } - } - } - } - - /* pass the call upwards */ - if (OPAL_SUCCESS != (rc = host_module->query(&requestor, - &opalcaddy->info, - info_cbfunc, opalcaddy))) { - OBJ_RELEASE(opalcaddy); - } - - return ext3x_convert_opalrc(rc); -} - -static void toolcbfunc(int status, - opal_process_name_t proc, - void *cbdata) -{ - ext3x_opalcaddy_t *opalcaddy = (ext3x_opalcaddy_t*)cbdata; - pmix_status_t rc; - pmix_proc_t p; - opal_ext3x_jobid_trkr_t *job; - - /* convert the status */ - rc = ext3x_convert_opalrc(status); - - memset(&p, 0, sizeof(pmix_proc_t)); - if (OPAL_SUCCESS == status) { - /* convert the process name */ - (void)opal_snprintf_jobid(p.nspace, PMIX_MAX_NSLEN, proc.jobid); - p.rank = ext3x_convert_opalrank(proc.vpid); - /* store this job in our list of known nspaces */ - job = OBJ_NEW(opal_ext3x_jobid_trkr_t); - (void)opal_string_copy(job->nspace, p.nspace, PMIX_MAX_NSLEN); - job->jobid = proc.jobid; - OPAL_PMIX_ACQUIRE_THREAD(&opal_pmix_base.lock); - opal_list_append(&mca_pmix_ext3x_component.jobids, &job->super); - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - } - - /* pass it down */ - if (NULL != opalcaddy->toolcbfunc) { - opalcaddy->toolcbfunc(rc, &p, opalcaddy->cbdata); - } - OBJ_RELEASE(opalcaddy); -} - -static void server_tool_connection(pmix_info_t *info, size_t ninfo, - pmix_tool_connection_cbfunc_t cbfunc, - void *cbdata) -{ - ext3x_opalcaddy_t *opalcaddy; - size_t n; - opal_value_t *oinfo; - int rc; - pmix_status_t err; - opal_ext3x_jobid_trkr_t *job; - bool found; - - /* setup the caddy */ - opalcaddy = OBJ_NEW(ext3x_opalcaddy_t); - opalcaddy->toolcbfunc = cbfunc; - opalcaddy->cbdata = cbdata; - - /* convert the info */ - for (n=0; n < ninfo; n++) { - oinfo = OBJ_NEW(opal_value_t); - opal_list_append(&opalcaddy->info, &oinfo->super); - oinfo->key = strdup(info[n].key); - if (0 == strncmp(oinfo->key, PMIX_NSPACE, PMIX_MAX_KEYLEN)) { - /* will pass it up as a jobid */ - oinfo->type = OPAL_JOBID; - /* see if this job is in our list of known nspaces */ - found = false; - OPAL_LIST_FOREACH(job, &mca_pmix_ext3x_component.jobids, opal_ext3x_jobid_trkr_t) { - if (0 == strncmp(job->nspace, info[n].value.data.proc->nspace, PMIX_MAX_NSLEN)) { - oinfo->data.name.jobid = job->jobid; - found = true; - break; - } - } - if (!found) { - if (OPAL_SUCCESS != (rc = opal_convert_string_to_jobid(&oinfo->data.name.jobid, info[n].value.data.proc->nspace))) { - OPAL_ERROR_LOG(rc); - OBJ_RELEASE(opalcaddy); - err = ext3x_convert_opalrc(rc); - if (NULL != cbfunc) { - cbfunc(err, NULL, cbdata); - } - return; - } - } - } else if (OPAL_SUCCESS != (rc = ext3x_value_unload(oinfo, &info[n].value))) { - OBJ_RELEASE(opalcaddy); - err = ext3x_convert_opalrc(rc); - if (NULL != cbfunc) { - cbfunc(err, NULL, cbdata); - } - return; - } - } - - /* pass it up */ - host_module->tool_connected(&opalcaddy->info, toolcbfunc, opalcaddy); -} - -static void server_log(const pmix_proc_t *proct, - const pmix_info_t data[], size_t ndata, - const pmix_info_t directives[], size_t ndirs, - pmix_op_cbfunc_t cbfunc, void *cbdata) -{ - ext3x_opalcaddy_t *opalcaddy; - opal_process_name_t requestor; - int rc; - size_t n; - opal_value_t *oinfo; - pmix_status_t ret; - - if (NULL == host_module || NULL == host_module->log) { - if (NULL != cbfunc) { - cbfunc(PMIX_ERR_NOT_SUPPORTED, cbdata); - } - return; - } - - /* setup the caddy */ - opalcaddy = OBJ_NEW(ext3x_opalcaddy_t); - opalcaddy->opcbfunc = cbfunc; - opalcaddy->cbdata = cbdata; - - /* convert the requestor */ - if (OPAL_SUCCESS != (rc = opal_convert_string_to_jobid(&requestor.jobid, proct->nspace))) { - OBJ_RELEASE(opalcaddy); - ret = ext3x_convert_opalrc(rc); - if (NULL != cbfunc) { - cbfunc(ret, cbdata); - } - return; - } - requestor.vpid = ext3x_convert_rank(proct->rank); - - /* convert the data */ - for (n=0; n < ndata; n++) { - oinfo = OBJ_NEW(opal_value_t); - oinfo->key = strdup(data[n].key); - /* we "borrow" the info field of the caddy as we and the - * server function both agree on what will be there */ - opal_list_append(&opalcaddy->info, &oinfo->super); - if (OPAL_SUCCESS != (rc = ext3x_value_unload(oinfo, &data[n].value))) { - OBJ_RELEASE(opalcaddy); - ret = ext3x_convert_opalrc(rc); - if (NULL != cbfunc) { - cbfunc(ret, cbdata); - } - return; - } - } - - /* convert the directives */ - for (n=0; n < ndirs; n++) { - oinfo = OBJ_NEW(opal_value_t); - /* we "borrow" the apps field of the caddy as we and the - * server function both agree on what will be there */ - opal_list_append(&opalcaddy->apps, &oinfo->super); - if (OPAL_SUCCESS != (rc = ext3x_value_unload(oinfo, &directives[n].value))) { - OBJ_RELEASE(opalcaddy); - ret = ext3x_convert_opalrc(rc); - if (NULL != cbfunc) { - cbfunc(ret, cbdata); - } - return; - } - } - - /* pass the call upwards */ - host_module->log(&requestor, - &opalcaddy->info, - &opalcaddy->apps, - opal_opcbfunc, opalcaddy); -} - -static pmix_status_t server_allocate(const pmix_proc_t *proct, - pmix_alloc_directive_t directive, - const pmix_info_t data[], size_t ndata, - pmix_info_cbfunc_t cbfunc, void *cbdata) -{ - ext3x_opalcaddy_t *opalcaddy; - opal_process_name_t requestor; - int rc; - size_t n; - opal_value_t *oinfo; - opal_pmix_alloc_directive_t odir; - - if (NULL == host_module || NULL == host_module->allocate) { - return PMIX_ERR_NOT_SUPPORTED; - } - - /* setup the caddy */ - opalcaddy = OBJ_NEW(ext3x_opalcaddy_t); - opalcaddy->infocbfunc = cbfunc; - opalcaddy->cbdata = cbdata; - - /* convert the requestor */ - if (OPAL_SUCCESS != (rc = opal_convert_string_to_jobid(&requestor.jobid, proct->nspace))) { - OBJ_RELEASE(opalcaddy); - return ext3x_convert_opalrc(rc); - } - requestor.vpid = ext3x_convert_rank(proct->rank); - - /* convert the directive */ - odir = ext3x_convert_allocdir(directive); - - /* convert the data */ - for (n=0; n < ndata; n++) { - oinfo = OBJ_NEW(opal_value_t); - opal_list_append(&opalcaddy->info, &oinfo->super); - if (OPAL_SUCCESS != (rc = ext3x_value_unload(oinfo, &data[n].value))) { - OBJ_RELEASE(opalcaddy); - return ext3x_convert_opalrc(rc); - } - } - - /* pass the call upwards */ - if (OPAL_SUCCESS != (rc = host_module->allocate(&requestor, odir, - &opalcaddy->info, - info_cbfunc, opalcaddy))) { - OBJ_RELEASE(opalcaddy); - return ext3x_convert_opalrc(rc); - } - - return PMIX_SUCCESS; - -} - -static pmix_status_t server_job_control(const pmix_proc_t *proct, - const pmix_proc_t targets[], size_t ntargets, - const pmix_info_t directives[], size_t ndirs, - pmix_info_cbfunc_t cbfunc, void *cbdata) -{ - ext3x_opalcaddy_t *opalcaddy; - opal_process_name_t requestor; - int rc; - size_t n; - opal_value_t *oinfo; - opal_namelist_t *nm; - - if (NULL == host_module || NULL == host_module->job_control) { - return PMIX_ERR_NOT_SUPPORTED; - } - - /* setup the caddy */ - opalcaddy = OBJ_NEW(ext3x_opalcaddy_t); - opalcaddy->infocbfunc = cbfunc; - opalcaddy->cbdata = cbdata; - - /* convert the requestor */ - if (OPAL_SUCCESS != (rc = opal_convert_string_to_jobid(&requestor.jobid, proct->nspace))) { - OBJ_RELEASE(opalcaddy); - return ext3x_convert_opalrc(rc); - } - requestor.vpid = ext3x_convert_rank(proct->rank); - - /* convert the targets */ - for (n=0; n < ntargets; n++) { - nm = OBJ_NEW(opal_namelist_t); - opal_list_append(&opalcaddy->procs, &nm->super); - if (OPAL_SUCCESS != (rc = opal_convert_string_to_jobid(&nm->name.jobid, targets[n].nspace))) { - OBJ_RELEASE(opalcaddy); - return ext3x_convert_opalrc(rc); - } - nm->name.vpid = ext3x_convert_rank(targets[n].rank); - } - - /* convert the directives */ - for (n=0; n < ndirs; n++) { - oinfo = OBJ_NEW(opal_value_t); - opal_list_append(&opalcaddy->info, &oinfo->super); - oinfo->key = strdup(directives[n].key); - if (OPAL_SUCCESS != (rc = ext3x_value_unload(oinfo, &directives[n].value))) { - OBJ_RELEASE(opalcaddy); - return ext3x_convert_opalrc(rc); - } - } - - /* pass the call upwards */ - if (OPAL_SUCCESS != (rc = host_module->job_control(&requestor, - &opalcaddy->procs, - &opalcaddy->info, - info_cbfunc, opalcaddy))) { - OBJ_RELEASE(opalcaddy); - return ext3x_convert_opalrc(rc); - } - - return PMIX_SUCCESS; -} - -static pmix_status_t server_iof_pull(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) -{ - if (NULL == host_module || NULL == host_module->iof_pull) { - return PMIX_ERR_NOT_SUPPORTED; - } - return PMIX_ERR_NOT_SUPPORTED; -} - -static pmix_status_t server_stdin(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) -{ - if (NULL == host_module || NULL == host_module->iof_push) { - return PMIX_ERR_NOT_SUPPORTED; - } - return PMIX_ERR_NOT_SUPPORTED; -} diff --git a/opal/mca/pmix/ext3x/ext3x_server_south.c b/opal/mca/pmix/ext3x/ext3x_server_south.c deleted file mode 100644 index 2991aca6c2d..00000000000 --- a/opal/mca/pmix/ext3x/ext3x_server_south.c +++ /dev/null @@ -1,799 +0,0 @@ -/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ -/* - * Copyright (c) 2014-2018 Intel, Inc. All rights reserved. - * Copyright (c) 2014-2017 Research Organization for Information Science - * and Technology (RIST). All rights reserved. - * Copyright (c) 2014-2016 Intel, Inc. All rights reserved. - * Copyright (c) 2014-2017 Mellanox Technologies, Inc. - * All rights reserved. - * Copyright (c) 2016 Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2017 Los Alamos National Security, LLC. All rights - * reserved. - * Copyright (c) 2018 The University of Tennessee and The University - * of Tennessee Research Foundation. All rights - * reserved. - * Copyright (c) 2019 IBM Corporation. All rights reserved. - * $COPYRIGHT$ - * - * Additional copyrights may follow - * - * $HEADER$ - */ - -#include "opal_config.h" -#include "opal/constants.h" -#include "opal/types.h" - -#ifdef HAVE_STRING_H -#include -#endif -#ifdef HAVE_UNISTD_H -#include -#endif - -#include "opal/dss/dss.h" -#include "opal/mca/event/event.h" -#include "opal/mca/hwloc/base/base.h" -#include "opal/runtime/opal.h" -#include "opal/runtime/opal_progress_threads.h" -#include "opal/threads/threads.h" -#include "opal/util/argv.h" -#include "opal/util/error.h" -#include "opal/util/output.h" -#include "opal/util/opal_environ.h" -#include "opal/util/proc.h" -#include "opal/util/show_help.h" -#include "opal/util/string_copy.h" -#include "opal/mca/pmix/base/base.h" -#include "ext3x.h" - -#include "pmix.h" -#include "pmix_server.h" - -/**** S.O.U.T.H.B.O.U.N.D I.N.T.E.R.F.A.C.E.S ****/ - -/* These are the interfaces used by the OMPI/ORTE/OPAL layer to call - * down into the embedded PMIx server. */ - -extern pmix_server_module_t mymodule; -extern opal_pmix_server_module_t *host_module; -static char *dbgvalue=NULL; - -static void errreg_cbfunc (pmix_status_t status, - size_t errhandler_ref, - void *cbdata) -{ - opal_ext3x_event_t *ev = (opal_ext3x_event_t*)cbdata; - - OPAL_ACQUIRE_OBJECT(ev); - ev->index = errhandler_ref; - opal_output_verbose(5, opal_pmix_base_framework.framework_output, - "PMIX server errreg_cbfunc - error handler registered status=%d, reference=%lu", - status, (unsigned long)errhandler_ref); - OPAL_POST_OBJECT(ev); - OPAL_PMIX_WAKEUP_THREAD(&ev->lock); -} - -static void opcbfunc(pmix_status_t status, void *cbdata) -{ - ext3x_opcaddy_t *op = (ext3x_opcaddy_t*)cbdata; - - OPAL_ACQUIRE_OBJECT(op); - - if (NULL != op->opcbfunc) { - op->opcbfunc(ext3x_convert_rc(status), op->cbdata); - } - OBJ_RELEASE(op); -} - -static void lkcbfunc(pmix_status_t status, void *cbdata) -{ - opal_pmix_lock_t *lk = (opal_pmix_lock_t*)cbdata; - - OPAL_POST_OBJECT(lk); - lk->status = ext3x_convert_rc(status); - OPAL_PMIX_WAKEUP_THREAD(lk); -} - -int ext3x_server_init(opal_pmix_server_module_t *module, - opal_list_t *info) -{ - pmix_status_t rc; - int dbg; - opal_value_t *kv; - pmix_info_t *pinfo; - size_t sz, n; - opal_ext3x_event_t *event; - opal_ext3x_jobid_trkr_t *job; - opal_pmix_lock_t lk; - - OPAL_PMIX_ACQUIRE_THREAD(&opal_pmix_base.lock); - - if (0 == opal_pmix_base.initialized) { - if (0 < (dbg = opal_output_get_verbosity(opal_pmix_base_framework.framework_output))) { - asprintf(&dbgvalue, "PMIX_DEBUG=%d", dbg); - putenv(dbgvalue); - } - /* check the evars for a mismatch */ - if (OPAL_SUCCESS != (dbg = opal_pmix_ext3x_check_evars())) { - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - return dbg; - } - } - ++opal_pmix_base.initialized; - - /* convert the list to an array of pmix_info_t */ - sz = 2 + ((NULL==info)?0:opal_list_get_size(info)); - PMIX_INFO_CREATE(pinfo, sz); - n = 0; - if (NULL != info) { - OPAL_LIST_FOREACH(kv, info, opal_value_t) { - (void)opal_string_copy(pinfo[n].key, kv->key, PMIX_MAX_KEYLEN); - ext3x_value_load(&pinfo[n].value, kv); - ++n; - } - } - - /* insert ourselves into our list of jobids - it will be the - * first, and so we'll check it first */ - job = OBJ_NEW(opal_ext3x_jobid_trkr_t); - (void)opal_snprintf_jobid(job->nspace, PMIX_MAX_NSLEN, OPAL_PROC_MY_NAME.jobid); - job->jobid = OPAL_PROC_MY_NAME.jobid; - opal_list_append(&mca_pmix_ext3x_component.jobids, &job->super); - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - - /* add our nspace and rank to the array going down to the PMIx server */ - PMIX_INFO_LOAD(&pinfo[sz-2], PMIX_SERVER_NSPACE, job->nspace, PMIX_STRING); - PMIX_INFO_LOAD(&pinfo[sz-1], PMIX_SERVER_RANK, &OPAL_PROC_MY_NAME.vpid, PMIX_PROC_RANK); - if (PMIX_SUCCESS != (rc = PMIx_server_init(&mymodule, pinfo, sz))) { - PMIX_INFO_FREE(pinfo, sz); - return ext3x_convert_rc(rc); - } - PMIX_INFO_FREE(pinfo, sz); - - /* record the host module */ - host_module = module; - - /* register the default event handler */ - event = OBJ_NEW(opal_ext3x_event_t); - opal_list_append(&mca_pmix_ext3x_component.events, &event->super); - PMIX_INFO_CREATE(pinfo, 1); - PMIX_INFO_LOAD(&pinfo[0], PMIX_EVENT_HDLR_NAME, "OPAL-PMIX-2X-SERVER-DEFAULT", PMIX_STRING); - PMIx_Register_event_handler(NULL, 0, pinfo, 1, ext3x_event_hdlr, errreg_cbfunc, (void*)event); - OPAL_PMIX_WAIT_THREAD(&event->lock); - PMIX_INFO_FREE(pinfo, 1); - - /* as we might want to use some client-side functions, be sure - * to register our own nspace */ - OPAL_PMIX_CONSTRUCT_LOCK(&lk); - PMIX_INFO_CREATE(pinfo, 1); - PMIX_INFO_LOAD(&pinfo[0], PMIX_REGISTER_NODATA, NULL, PMIX_BOOL); - PMIx_server_register_nspace(job->nspace, 1, pinfo, 1, lkcbfunc, (void*)&lk); - OPAL_PMIX_WAIT_THREAD(&lk); - OPAL_PMIX_DESTRUCT_LOCK(&lk); - PMIX_INFO_FREE(pinfo, 1); - - return OPAL_SUCCESS; -} - -static void dereg_cbfunc(pmix_status_t st, void *cbdata) -{ - opal_ext3x_event_t *ev = (opal_ext3x_event_t*)cbdata; - OPAL_PMIX_WAKEUP_THREAD(&ev->lock); -} - -int ext3x_server_finalize(void) -{ - pmix_status_t rc; - opal_ext3x_event_t *event, *ev2; - opal_list_t evlist; - OBJ_CONSTRUCT(&evlist, opal_list_t); - - OPAL_PMIX_ACQUIRE_THREAD(&opal_pmix_base.lock); - --opal_pmix_base.initialized; - - if (0 < opal_pmix_base.initialized) { - /* deregister all event handlers */ - OPAL_LIST_FOREACH_SAFE(event, ev2, &mca_pmix_ext3x_component.events, opal_ext3x_event_t) { - OPAL_PMIX_DESTRUCT_LOCK(&event->lock); - OPAL_PMIX_CONSTRUCT_LOCK(&event->lock); - PMIx_Deregister_event_handler(event->index, dereg_cbfunc, (void*)event); - opal_list_remove_item(&mca_pmix_ext3x_component.events, &event->super); - /* wait and release outside the loop to avoid double mutex - * interlock */ - opal_list_append(&evlist, &event->super); - } - } - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - OPAL_LIST_FOREACH_SAFE(event, ev2, &evlist, opal_ext3x_event_t) { - OPAL_PMIX_WAIT_THREAD(&event->lock); - opal_list_remove_item(&evlist, &event->super); - OBJ_RELEASE(event); - } - OBJ_DESTRUCT(&evlist); - rc = PMIx_server_finalize(); - return ext3x_convert_rc(rc); -} - -int ext3x_server_gen_regex(const char *input, char **regex) -{ - pmix_status_t rc; - - OPAL_PMIX_ACQUIRE_THREAD(&opal_pmix_base.lock); - if (0 >= opal_pmix_base.initialized) { - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - return OPAL_ERR_NOT_INITIALIZED; - } - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - - rc = PMIx_generate_regex(input, regex); - return ext3x_convert_rc(rc); -} - - -int ext3x_server_gen_ppn(const char *input, char **ppn) -{ - pmix_status_t rc; - - OPAL_PMIX_ACQUIRE_THREAD(&opal_pmix_base.lock); - if (0 >= opal_pmix_base.initialized) { - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - return OPAL_ERR_NOT_INITIALIZED; - } - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - - rc = PMIx_generate_ppn(input, ppn); - return ext3x_convert_rc(rc); -} - -int ext3x_server_register_nspace(opal_jobid_t jobid, - int nlocalprocs, - opal_list_t *info, - opal_pmix_op_cbfunc_t cbfunc, - void *cbdata) -{ - opal_value_t *kv, *k2; - pmix_info_t *pinfo = NULL, *pmap; - size_t sz, szmap, m, n; - char nspace[PMIX_MAX_NSLEN]; - pmix_status_t rc; - opal_list_t *pmapinfo; - opal_ext3x_jobid_trkr_t *job; - opal_pmix_lock_t lock; - int ret; - - OPAL_PMIX_ACQUIRE_THREAD(&opal_pmix_base.lock); - if (0 >= opal_pmix_base.initialized) { - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - return OPAL_ERR_NOT_INITIALIZED; - } - - /* convert the jobid */ - (void)opal_snprintf_jobid(nspace, PMIX_MAX_NSLEN, jobid); - - /* store this job in our list of known nspaces */ - job = OBJ_NEW(opal_ext3x_jobid_trkr_t); - (void)opal_string_copy(job->nspace, nspace, PMIX_MAX_NSLEN); - job->jobid = jobid; - opal_list_append(&mca_pmix_ext3x_component.jobids, &job->super); - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - - /* convert the list to an array of pmix_info_t */ - if (NULL != info && 0 < (sz = opal_list_get_size(info))) { - PMIX_INFO_CREATE(pinfo, sz); - n = 0; - OPAL_LIST_FOREACH(kv, info, opal_value_t) { - (void)opal_string_copy(pinfo[n].key, kv->key, PMIX_MAX_KEYLEN); - if (0 == strcmp(kv->key, OPAL_PMIX_PROC_DATA)) { - pinfo[n].value.type = PMIX_DATA_ARRAY; - /* the value contains a list of values - convert - * that list to another array */ - pmapinfo = (opal_list_t*)kv->data.ptr; - szmap = opal_list_get_size(pmapinfo); - if (0 < szmap) { - PMIX_INFO_CREATE(pmap, szmap); - pinfo[n].value.data.darray = (pmix_data_array_t*)calloc(1, sizeof(pmix_data_array_t)); - pinfo[n].value.data.darray->type = PMIX_INFO; - pinfo[n].value.data.darray->array = (struct pmix_info_t*)pmap; - pinfo[n].value.data.darray->size = szmap; - m = 0; - OPAL_LIST_FOREACH(k2, pmapinfo, opal_value_t) { - (void)opal_string_copy(pmap[m].key, k2->key, PMIX_MAX_KEYLEN); - ext3x_value_load(&pmap[m].value, k2); - ++m; - } - } - OPAL_LIST_RELEASE(pmapinfo); - } else { - ext3x_value_load(&pinfo[n].value, kv); - } - ++n; - } - } else { - sz = 0; - pinfo = NULL; - } - - OPAL_PMIX_CONSTRUCT_LOCK(&lock); - rc = PMIx_server_register_nspace(nspace, nlocalprocs, pinfo, sz, - lkcbfunc, (void*)&lock); - if (PMIX_SUCCESS == rc) { - OPAL_PMIX_WAIT_THREAD(&lock); - } - OPAL_PMIX_DESTRUCT_LOCK(&lock); - - if (NULL != pinfo) { - PMIX_INFO_FREE(pinfo, sz); - } - - ret = ext3x_convert_rc(rc); - - /* release the caller */ - if (NULL != cbfunc) { - cbfunc(ret, cbdata); - } - return ret; -} - -void ext3x_server_deregister_nspace(opal_jobid_t jobid, - opal_pmix_op_cbfunc_t cbfunc, - void *cbdata) -{ - opal_ext3x_jobid_trkr_t *jptr; - opal_pmix_lock_t lock; - - OPAL_PMIX_ACQUIRE_THREAD(&opal_pmix_base.lock); - if (0 >= opal_pmix_base.initialized) { - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - /* release the caller */ - if (NULL != cbfunc) { - cbfunc(OPAL_ERR_NOT_INITIALIZED, cbdata); - } - return; - } - - /* if we don't already have it, we can ignore this */ - OPAL_LIST_FOREACH(jptr, &mca_pmix_ext3x_component.jobids, opal_ext3x_jobid_trkr_t) { - if (jptr->jobid == jobid) { - /* found it - tell the server to deregister */ - OPAL_PMIX_CONSTRUCT_LOCK(&lock); - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - PMIx_server_deregister_nspace(jptr->nspace, lkcbfunc, (void*)&lock); - OPAL_PMIX_WAIT_THREAD(&lock); - OPAL_PMIX_DESTRUCT_LOCK(&lock); - /* now get rid of it from our list */ - OPAL_PMIX_ACQUIRE_THREAD(&opal_pmix_base.lock); - opal_list_remove_item(&mca_pmix_ext3x_component.jobids, &jptr->super); - OBJ_RELEASE(jptr); - break; - } - } - - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - /* release the caller */ - if (NULL != cbfunc) { - cbfunc(OPAL_SUCCESS, cbdata); - } -} - -int ext3x_server_register_client(const opal_process_name_t *proc, - uid_t uid, gid_t gid, - void *server_object, - opal_pmix_op_cbfunc_t cbfunc, - void *cbdata) -{ - pmix_status_t rc; - pmix_proc_t p; - opal_pmix_lock_t lock; - - OPAL_PMIX_ACQUIRE_THREAD(&opal_pmix_base.lock); - if (0 >= opal_pmix_base.initialized) { - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - return OPAL_ERR_NOT_INITIALIZED; - } - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - - /* convert the jobid */ - (void)opal_snprintf_jobid(p.nspace, PMIX_MAX_NSLEN, proc->jobid); - p.rank = ext3x_convert_opalrank(proc->vpid); - - OPAL_PMIX_CONSTRUCT_LOCK(&lock); - rc = PMIx_server_register_client(&p, uid, gid, server_object, - lkcbfunc, (void*)&lock); - if (PMIX_SUCCESS == rc) { - OPAL_PMIX_WAIT_THREAD(&lock); - } - OPAL_PMIX_DESTRUCT_LOCK(&lock); - return ext3x_convert_rc(rc); -} - -/* tell the local PMIx server to cleanup this client as it is - * done executing */ -void ext3x_server_deregister_client(const opal_process_name_t *proc, - opal_pmix_op_cbfunc_t cbfunc, - void *cbdata) -{ - opal_ext3x_jobid_trkr_t *jptr; - pmix_proc_t p; - opal_pmix_lock_t lock; - - OPAL_PMIX_ACQUIRE_THREAD(&opal_pmix_base.lock); - if (0 >= opal_pmix_base.initialized) { - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - if (NULL != cbfunc) { - cbfunc(OPAL_ERR_NOT_INITIALIZED, cbdata); - } - return; - } - - /* if we don't already have it, we can ignore this */ - OPAL_LIST_FOREACH(jptr, &mca_pmix_ext3x_component.jobids, opal_ext3x_jobid_trkr_t) { - if (jptr->jobid == proc->jobid) { - /* found it - tell the server to deregister */ - (void)opal_string_copy(p.nspace, jptr->nspace, PMIX_MAX_NSLEN); - p.rank = ext3x_convert_opalrank(proc->vpid); - OPAL_PMIX_CONSTRUCT_LOCK(&lock); - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - PMIx_server_deregister_client(&p, lkcbfunc, (void*)&lock); - OPAL_PMIX_WAIT_THREAD(&lock); - OPAL_PMIX_DESTRUCT_LOCK(&lock); - OPAL_PMIX_ACQUIRE_THREAD(&opal_pmix_base.lock); - break; - } - } - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - if (NULL != cbfunc) { - cbfunc(OPAL_SUCCESS, cbdata); - } -} - -/* have the local PMIx server setup the environment for this client */ -int ext3x_server_setup_fork(const opal_process_name_t *proc, char ***env) -{ - pmix_status_t rc; - pmix_proc_t p; - - OPAL_PMIX_ACQUIRE_THREAD(&opal_pmix_base.lock); - if (0 >= opal_pmix_base.initialized) { - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - return OPAL_ERR_NOT_INITIALIZED; - } - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - - /* convert the jobid */ - (void)opal_snprintf_jobid(p.nspace, PMIX_MAX_NSLEN, proc->jobid); - p.rank = ext3x_convert_opalrank(proc->vpid); - - rc = PMIx_server_setup_fork(&p, env); - return ext3x_convert_rc(rc); -} - -/* this is the call back up from the embedded PMIx server that - * will contain the returned data. Note that the embedded server - * "owns" the data and will free it upon return from this function */ -static void dmdx_response(pmix_status_t status, char *data, size_t sz, void *cbdata) -{ - int rc; - ext3x_opcaddy_t *op = (ext3x_opcaddy_t*)cbdata; - - rc = ext3x_convert_rc(status); - if (NULL != op->mdxcbfunc) { - op->mdxcbfunc(rc, data, sz, op->cbdata, NULL, NULL); - } - OBJ_RELEASE(op); -} - -/* request modex data for a local proc from the PMIx server */ -int ext3x_server_dmodex(const opal_process_name_t *proc, - opal_pmix_modex_cbfunc_t cbfunc, void *cbdata) -{ - ext3x_opcaddy_t *op; - pmix_status_t rc; - - OPAL_PMIX_ACQUIRE_THREAD(&opal_pmix_base.lock); - if (0 >= opal_pmix_base.initialized) { - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - return OPAL_ERR_NOT_INITIALIZED; - } - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - - /* setup the caddy */ - op = OBJ_NEW(ext3x_opcaddy_t); - op->mdxcbfunc = cbfunc; - op->cbdata = cbdata; - - /* convert the jobid */ - (void)opal_snprintf_jobid(op->p.nspace, PMIX_MAX_NSLEN, proc->jobid); - op->p.rank = ext3x_convert_opalrank(proc->vpid); - - /* find the internally-cached data for this proc */ - rc = PMIx_server_dmodex_request(&op->p, dmdx_response, op); - if (PMIX_SUCCESS != rc) { - OBJ_RELEASE(op); - } - return ext3x_convert_rc(rc); -} - -/* tell the PMIx server to notify its local clients of an event */ -int ext3x_server_notify_event(int status, - const opal_process_name_t *source, - opal_list_t *info, - opal_pmix_op_cbfunc_t cbfunc, void *cbdata) -{ - opal_value_t *kv; - pmix_info_t *pinfo; - size_t sz, n; - pmix_status_t rc; - ext3x_opcaddy_t *op; - - OPAL_PMIX_ACQUIRE_THREAD(&opal_pmix_base.lock); - if (0 >= opal_pmix_base.initialized) { - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - return OPAL_ERR_NOT_INITIALIZED; - } - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - - /* convert the list to an array of pmix_info_t */ - if (NULL != info && 0 < (sz = opal_list_get_size(info))) { - PMIX_INFO_CREATE(pinfo, sz); - n = 0; - OPAL_LIST_FOREACH(kv, info, opal_value_t) { - (void)opal_string_copy(pinfo[n].key, kv->key, PMIX_MAX_KEYLEN); - if (0 == strcmp(kv->key, OPAL_PMIX_JOB_TERM_STATUS)) { - pinfo[n].value.type = PMIX_STATUS; - pinfo[n].value.data.status = ext3x_convert_opalrc(kv->data.integer); - } else { - ext3x_value_load(&pinfo[n].value, kv); - } - ++n; - } - } else { - sz = 0; - pinfo = NULL; - } - /* setup the caddy */ - op = OBJ_NEW(ext3x_opcaddy_t); - op->info = pinfo; - op->sz = sz; - op->opcbfunc = cbfunc; - op->cbdata = cbdata; - /* convert the jobid */ - if (NULL == source) { - (void)opal_snprintf_jobid(op->p.nspace, PMIX_MAX_NSLEN, OPAL_JOBID_INVALID); - op->p.rank = ext3x_convert_opalrank(OPAL_VPID_INVALID); - } else { - (void)opal_snprintf_jobid(op->p.nspace, PMIX_MAX_NSLEN, source->jobid); - op->p.rank = ext3x_convert_opalrank(source->vpid); - } - - - rc = ext3x_convert_opalrc(status); - /* the range must be nonlocal so the server will pass - * the event down to its local clients */ - rc = PMIx_Notify_event(rc, &op->p, PMIX_RANGE_SESSION, - pinfo, sz, opcbfunc, op); - if (PMIX_SUCCESS != rc) { - OBJ_RELEASE(op); - } - return ext3x_convert_rc(rc); -} - -int ext3x_server_iof_push(const opal_process_name_t *source, - opal_pmix_iof_channel_t channel, - unsigned char *data, size_t nbytes) -{ - ext3x_opcaddy_t *op; - pmix_byte_object_t bo; - pmix_iof_channel_t pchan; - opal_pmix_lock_t lock; - pmix_status_t rc; - int ret; - - opal_output_verbose(2, opal_pmix_base_framework.framework_output, - "%s IOF push from %s with %d bytes", - OPAL_NAME_PRINT(OPAL_PROC_MY_NAME), - OPAL_NAME_PRINT(*source), (int)nbytes); - - OPAL_PMIX_ACQUIRE_THREAD(&opal_pmix_base.lock); - if (0 >= opal_pmix_base.initialized) { - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - return OPAL_ERR_NOT_INITIALIZED; - } - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - - /* setup the caddy */ - op = OBJ_NEW(ext3x_opcaddy_t); - /* convert the source */ - (void)opal_snprintf_jobid(op->p.nspace, PMIX_MAX_NSLEN, source->jobid); - op->p.rank = ext3x_convert_opalrank(source->vpid); - /* convert the channel */ - pchan = 0; - if (OPAL_PMIX_FWD_STDIN_CHANNEL & channel) { - pchan |= PMIX_FWD_STDIN_CHANNEL; - } - if (OPAL_PMIX_FWD_STDOUT_CHANNEL & channel) { - pchan |= PMIX_FWD_STDOUT_CHANNEL; - } - if (OPAL_PMIX_FWD_STDERR_CHANNEL & channel) { - pchan |= PMIX_FWD_STDERR_CHANNEL; - } - if (OPAL_PMIX_FWD_STDDIAG_CHANNEL & channel) { - pchan |= PMIX_FWD_STDDIAG_CHANNEL; - } - - /* setup the byte object */ - PMIX_BYTE_OBJECT_CONSTRUCT(&bo); - if (0 < nbytes) { - bo.bytes = (char*)data; - } - bo.size = nbytes; - - /* push the IO */ - OPAL_PMIX_CONSTRUCT_LOCK(&lock); - rc = PMIx_server_IOF_deliver(&op->p, pchan, &bo, NULL, 0, lkcbfunc, (void*)&lock); - if (PMIX_SUCCESS != rc) { - ret = ext3x_convert_rc(rc); - } else { - /* wait for completion */ - OPAL_PMIX_WAIT_THREAD(&lock); - ret = lock.status; - OPAL_PMIX_DESTRUCT_LOCK(&lock); - } - /* cleanup */ - OBJ_RELEASE(op); - - return ret; -} - -static void final_cleanup(int status, void *cbdata) -{ - ext3x_opalcaddy_t *opalcaddy = (ext3x_opalcaddy_t*)cbdata; - OBJ_RELEASE(opalcaddy); -} - -static void setup_cbfunc(pmix_status_t status, - pmix_info_t info[], size_t ninfo, - void *provided_cbdata, - pmix_op_cbfunc_t cbfunc, void *cbdata) -{ - ext3x_opcaddy_t *op = (ext3x_opcaddy_t*)provided_cbdata; - ext3x_opalcaddy_t *opalcaddy; - size_t n; - opal_value_t *iptr; - int rc; - pmix_status_t ret = PMIX_SUCCESS; - - /* setup the caddy */ - opalcaddy = OBJ_NEW(ext3x_opalcaddy_t); - - rc = ext3x_convert_rc(status); - if (OPAL_SUCCESS == rc && NULL != info) { - /* need to convert the info array to a list */ - for (n=0; n < ninfo; n++) { - iptr = OBJ_NEW(opal_value_t); - opal_list_append(&opalcaddy->info, &iptr->super); - iptr->key = strdup(info[n].key); - if (OPAL_SUCCESS != (rc = ext3x_value_unload(iptr, &info[n].value))) { - OBJ_RELEASE(opalcaddy); - ret = ext3x_convert_opalrc(rc); - goto done; - } - } - } - - done: - /* release our caller */ - if (NULL != cbfunc) { - cbfunc(ret, cbdata); - } - /* pass what we have upstairs */ - if (NULL != op->setupcbfunc) { - op->setupcbfunc(rc, &opalcaddy->info, op->cbdata, - final_cleanup, opalcaddy); - } - OBJ_RELEASE(op); -} - -int ext3x_server_setup_application(opal_jobid_t jobid, - opal_list_t *info, - opal_pmix_setup_application_cbfunc_t cbfunc, void *cbdata) -{ - opal_value_t *kv; - pmix_info_t *pinfo; - size_t sz, n; - pmix_status_t rc; - ext3x_opcaddy_t *op; - - opal_output_verbose(2, opal_pmix_base_framework.framework_output, - "%s setup application for job %s", - OPAL_NAME_PRINT(OPAL_PROC_MY_NAME), - OPAL_JOBID_PRINT(jobid)); - - OPAL_PMIX_ACQUIRE_THREAD(&opal_pmix_base.lock); - if (0 >= opal_pmix_base.initialized) { - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - return OPAL_ERR_NOT_INITIALIZED; - } - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - - /* convert the list to an array of pmix_info_t */ - if (NULL != info && 0 < (sz = opal_list_get_size(info))) { - PMIX_INFO_CREATE(pinfo, sz); - n = 0; - OPAL_LIST_FOREACH(kv, info, opal_value_t) { - (void)opal_string_copy(pinfo[n].key, kv->key, PMIX_MAX_KEYLEN); - ext3x_value_load(&pinfo[n].value, kv); - ++n; - } - } else { - sz = 0; - pinfo = NULL; - } - /* setup the caddy */ - op = OBJ_NEW(ext3x_opcaddy_t); - op->info = pinfo; - op->sz = sz; - op->setupcbfunc = cbfunc; - op->cbdata = cbdata; - /* convert the jobid */ - (void)opal_snprintf_jobid(op->p.nspace, PMIX_MAX_NSLEN, jobid); - - rc = PMIx_server_setup_application(op->p.nspace, op->info, op->sz, - setup_cbfunc, op); - if (PMIX_SUCCESS != rc) { - OBJ_RELEASE(op); - } - return ext3x_convert_rc(rc); -} - -int ext3x_server_setup_local_support(opal_jobid_t jobid, - opal_list_t *info, - opal_pmix_op_cbfunc_t cbfunc, void *cbdata) -{ - opal_value_t *kv; - pmix_info_t *pinfo; - size_t sz, n; - pmix_status_t rc; - ext3x_opcaddy_t *op; - - opal_output_verbose(2, opal_pmix_base_framework.framework_output, - "%s setup local support for job %s", - OPAL_NAME_PRINT(OPAL_PROC_MY_NAME), - OPAL_JOBID_PRINT(jobid)); - - OPAL_PMIX_ACQUIRE_THREAD(&opal_pmix_base.lock); - if (0 >= opal_pmix_base.initialized) { - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - return OPAL_ERR_NOT_INITIALIZED; - } - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - - /* convert the list to an array of pmix_info_t */ - if (NULL != info && 0 < (sz = opal_list_get_size(info))) { - PMIX_INFO_CREATE(pinfo, sz); - n = 0; - OPAL_LIST_FOREACH(kv, info, opal_value_t) { - (void)opal_string_copy(pinfo[n].key, kv->key, PMIX_MAX_KEYLEN); - ext3x_value_load(&pinfo[n].value, kv); - ++n; - } - } else { - sz = 0; - pinfo = NULL; - } - /* setup the caddy */ - op = OBJ_NEW(ext3x_opcaddy_t); - op->info = pinfo; - op->sz = sz; - op->opcbfunc = cbfunc; - op->cbdata = cbdata; - /* convert the jobid */ - (void)opal_snprintf_jobid(op->p.nspace, PMIX_MAX_NSLEN, jobid); - - rc = PMIx_server_setup_local_support(op->p.nspace, op->info, op->sz, - opcbfunc, op); - if (PMIX_SUCCESS != rc) { - OBJ_RELEASE(op); - } - return ext3x_convert_rc(rc); -} diff --git a/opal/mca/pmix/ext3x/help-pmix-ext3x.txt b/opal/mca/pmix/ext3x/help-pmix-ext3x.txt deleted file mode 100644 index 07327e11636..00000000000 --- a/opal/mca/pmix/ext3x/help-pmix-ext3x.txt +++ /dev/null @@ -1,32 +0,0 @@ -# -*- text -*- -# -# 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) 2017 Intel, Inc. All rights reserved. -# $COPYRIGHT$ -# -# Additional copyrights may follow -# -# $HEADER$ -# -# This is the US/English help file for Open MPI MCA error messages. -# -[evars] -We found conflicting directives regarding the location of OPAL vs PMIx -installation directories: - -%s - -This usually indicates that OMPI was configured to use its internal copy -of PMIx, but another installation of PMIx is also in use on this system -and could potentially cause confusion between the two sets of plugins. -Please either unset the indicated environment variables, or configure -OMPI to use the external PMIx installation. diff --git a/opal/mca/pmix/ext4x/Makefile.am b/opal/mca/pmix/ext4x/Makefile.am deleted file mode 100644 index 7b0cc4cbc44..00000000000 --- a/opal/mca/pmix/ext4x/Makefile.am +++ /dev/null @@ -1,73 +0,0 @@ -# -# Copyright (c) 2014-2018 Intel, Inc. All rights reserved. -# Copyright (c) 2015 Cisco Systems, Inc. All rights reserved. -# Copyright (c) 2015-2018 Research Organization for Information Science -# and Technology (RIST). All rights reserved. -# Copyright (c) 2017 IBM Corporation. All rights reserved. -# $COPYRIGHT$ -# -# Additional copyrights may follow -# -# $HEADER$ -# - -dist_opaldata_DATA = help-pmix-ext4x.txt - -sources = \ - ext4x_local.c - -nodist_headers = \ - ext4x.h - -nodist_sources = \ - ext4x.c \ - ext4x_client.c \ - ext4x_component.c \ - ext4x_server_north.c \ - ext4x_server_south.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_opal_pmix_ext4x_DSO -component_noinst = -component_install = mca_pmix_ext4x.la -else -component_noinst = libmca_pmix_ext4x.la -component_install = -endif - -# -# Generate ext4x sources from the pmix4x component -# -$(nodist_headers): - pmix4xname=`echo $@ | sed -e s/ext4x/pmix4x/g` ; \ - $(SED) 's/pmix4x/ext4x/g' $(top_srcdir)/opal/mca/pmix/pmix4x/$$pmix4xname > $@ - -$(sources): $(nodist_headers) - -$(nodist_sources): $(nodist_headers) - pmix4xname=`echo $@ | sed -e s/ext4x/pmix4x/g` ; \ - $(SED) 's/pmix4x/ext4x/g' $(top_srcdir)/opal/mca/pmix/pmix4x/$$pmix4xname > $@ - -mcacomponentdir = $(opallibdir) -mcacomponent_LTLIBRARIES = $(component_install) -mca_pmix_ext4x_la_SOURCES = $(sources) -nodist_mca_pmix_ext4x_la_SOURCES = $(nodist_sources) -mca_pmix_ext4x_la_CFLAGS = $(opal_pmix_ext4x_CFLAGS) -mca_pmix_ext4x_la_CPPFLAGS =$(opal_pmix_ext4x_CPPFLAGS) -mca_pmix_ext4x_la_LDFLAGS = -module -avoid-version $(opal_pmix_ext4x_LDFLAGS) -mca_pmix_ext4x_la_LIBADD = $(top_builddir)/opal/lib@OPAL_LIB_PREFIX@open-pal.la \ - $(opal_pmix_ext4x_LIBS) - -noinst_LTLIBRARIES = $(component_noinst) -libmca_pmix_ext4x_la_SOURCES =$(sources) -nodist_libmca_pmix_ext4x_la_SOURCES = $(nodist_sources) -libmca_pmix_ext4x_la_CFLAGS = $(opal_pmix_ext4x_CFLAGS) -libmca_pmix_ext4x_la_CPPFLAGS = $(opal_pmix_ext4x_CPPFLAGS) -libmca_pmix_ext4x_la_LDFLAGS = -module -avoid-version $(opal_pmix_ext4x_LDFLAGS) -libmca_pmix_ext4x_la_LIBADD = $(opal_pmix_ext4x_LIBS) - -clean-local: - $(RM) -f $(nodist_sources) $(nodist_headers) diff --git a/opal/mca/pmix/ext4x/common_sym_whitelist.txt b/opal/mca/pmix/ext4x/common_sym_whitelist.txt deleted file mode 100644 index 7a60b367d69..00000000000 --- a/opal/mca/pmix/ext4x/common_sym_whitelist.txt +++ /dev/null @@ -1,6 +0,0 @@ -# Ignore symbols in this component that are auto-generated and we -# can't do anything about them (e.g., flex/bison symbols). -pmix_util_keyval_yyleng -pmix_util_keyval_yytext -pmix_show_help_yyleng -pmix_show_help_yytext diff --git a/opal/mca/pmix/ext4x/configure.m4 b/opal/mca/pmix/ext4x/configure.m4 deleted file mode 100644 index f43cc48a48f..00000000000 --- a/opal/mca/pmix/ext4x/configure.m4 +++ /dev/null @@ -1,63 +0,0 @@ -# -*- shell-script -*- -# -# 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) 2011-2013 Los Alamos National Security, LLC. -# All rights reserved. -# Copyright (c) 2010-2015 Cisco Systems, Inc. All rights reserved. -# Copyright (c) 2013-2018 Intel, Inc. All rights reserved. -# Copyright (c) 2015-2017 Research Organization for Information Science -# and Technology (RIST). All rights reserved. -# Copyright (c) 2014-2015 Mellanox Technologies, Inc. -# All rights reserved. -# $COPYRIGHT$ -# -# Additional copyrights may follow -# -# $HEADER$ -# - -# MCA_pmix_ext4x_CONFIG([action-if-found], [action-if-not-found]) -# ----------------------------------------------------------- -AC_DEFUN([MCA_opal_pmix_ext4x_CONFIG],[ - AC_CONFIG_FILES([opal/mca/pmix/ext4x/Makefile]) - - AS_IF([test "$opal_external_pmix_happy" = "yes"], - [ # check for the 4.x version - AC_MSG_CHECKING([if external component is version 4.x]) - AS_IF([test "$opal_external_pmix_version" = "4x"], - [AC_MSG_RESULT([yes]) - AS_IF([test "$opal_event_external_support" != "yes"], - [AC_MSG_WARN([EXTERNAL PMIX SUPPORT REQUIRES USE OF EXTERNAL LIBEVENT]) - AC_MSG_WARN([LIBRARY. THIS LIBRARY MUST POINT TO THE SAME ONE USED]) - AC_MSG_WARN([TO BUILD PMIX OR ELSE UNPREDICTABLE BEHAVIOR MAY RESULT]) - AC_MSG_ERROR([PLEASE CORRECT THE CONFIGURE COMMAND LINE AND REBUILD])]) - opal_pmix_external_4x_happy=yes], - [AC_MSG_RESULT([no]) - opal_pmix_external_4x_happy=no]) - - AS_IF([test "$opal_pmix_external_4x_happy" = "yes"], - [$1 - # need to set the wrapper flags for static builds - pmix_ext4x_WRAPPER_EXTRA_LDFLAGS=$opal_external_pmix_LDFLAGS - pmix_ext4x_WRAPPER_EXTRA_LIBS=$opal_external_pmix_LIBS], - [$2])], - [$2]) - - opal_pmix_ext4x_CPPFLAGS=$opal_external_pmix_CPPFLAGS - opal_pmix_ext4x_LDFLAGS=$opal_external_pmix_LDFLAGS - opal_pmix_ext4x_LIBS=$opal_external_pmix_LIBS - - AC_SUBST([opal_pmix_ext4x_CPPFLAGS]) - AC_SUBST([opal_pmix_ext4x_LDFLAGS]) - AC_SUBST([opal_pmix_ext4x_LIBS]) - -])dnl diff --git a/opal/mca/pmix/ext4x/ext4x_local.c b/opal/mca/pmix/ext4x/ext4x_local.c deleted file mode 100644 index ef7b75cef67..00000000000 --- a/opal/mca/pmix/ext4x/ext4x_local.c +++ /dev/null @@ -1,27 +0,0 @@ -/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ -/* - * Copyright (c) 2014-2018 Intel, Inc. All rights reserved. - * Copyright (c) 2014-2017 Research Organization for Information Science - * and Technology (RIST). All rights reserved. - * Copyright (c) 2014-2015 Mellanox Technologies, Inc. - * All rights reserved. - * Copyright (c) 2016 Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2017 Los Alamos National Security, LLC. All rights - * reserved. - * $COPYRIGHT$ - * - * Additional copyrights may follow - * - * $HEADER$ - */ - -#include "opal_config.h" -#include "opal/constants.h" - -#include "ext4x.h" - -int opal_pmix_ext4x_check_evars(void) -{ - /* a dummy function */ - return OPAL_SUCCESS; -} diff --git a/opal/mca/pmix/ext4x/help-pmix-ext4x.txt b/opal/mca/pmix/ext4x/help-pmix-ext4x.txt deleted file mode 100644 index b11b4c45498..00000000000 --- a/opal/mca/pmix/ext4x/help-pmix-ext4x.txt +++ /dev/null @@ -1,32 +0,0 @@ -# -*- text -*- -# -# 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) 2017-2018 Intel, Inc. All rights reserved. -# $COPYRIGHT$ -# -# Additional copyrights may follow -# -# $HEADER$ -# -# This is the US/English help file for Open MPI MCA error messages. -# -[evars] -We found conflicting directives regarding the location of OPAL vs PMIx -installation directories: - -%s - -This usually indicates that OMPI was configured to use its internal copy -of PMIx, but another installation of PMIx is also in use on this system -and could potentially cause confusion between the two sets of plugins. -Please either unset the indicated environment variables, or configure -OMPI to use the external PMIx installation. diff --git a/opal/mca/pmix/external/Makefile.am b/opal/mca/pmix/external/Makefile.am new file mode 100644 index 00000000000..c92bb2a210a --- /dev/null +++ b/opal/mca/pmix/external/Makefile.am @@ -0,0 +1,29 @@ +# +# Copyright (c) 2011-2012 Cisco Systems, Inc. All rights reserved. +# Copyright (c) 2016-2019 Intel, Inc. All rights reserved. +# $COPYRIGHT$ +# +# Additional copyrights may follow +# +# $HEADER$ +# + +# This is a special component -- its main purpose in life is to have +# its configure.m4 add some things to CPPFLAGS, LDFLAGS, and +# LIBS. Hence, there's nothing to build here. :-) + +# We only ever build this component statically + +noinst_LTLIBRARIES = libmca_pmix_external.la + +libmca_pmix_external_la_SOURCES = \ + external.h \ + pmix_external_component.c +libmca_pmix_external_la_LDFLAGS = \ + -module -avoid-version + +# Conditionally install the header files +if WANT_INSTALL_HEADERS +opaldir = $(opalincludedir)/$(subdir) +nobase_opal_HEADERS = external.h +endif diff --git a/opal/mca/pmix/external/configure.m4 b/opal/mca/pmix/external/configure.m4 new file mode 100644 index 00000000000..214990b3477 --- /dev/null +++ b/opal/mca/pmix/external/configure.m4 @@ -0,0 +1,57 @@ +# -*- shell-script -*- +# +# Copyright (c) 2009-2017 Cisco Systems, Inc. All rights reserved +# Copyright (c) 2014-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$ +# + +# +# Priority +# +AC_DEFUN([MCA_opal_pmix_external_PRIORITY], [90]) + +# +# Force this component to compile in static-only mode +# +AC_DEFUN([MCA_opal_pmix_external_COMPILE_MODE], [ + AC_MSG_CHECKING([for MCA component $2:$3 compile mode]) + $4="static" + AC_MSG_RESULT([$$4]) +]) + + +# MCA_pmix_external_POST_CONFIG() +# --------------------------------- +AC_DEFUN([MCA_opal_pmix_external_POST_CONFIG],[ + OPAL_VAR_SCOPE_PUSH([opal_pmix_external_basedir]) + + # If we won, then do all the rest of the setup + AS_IF([test "$1" = "1"], + [ # Set this variable so that the framework m4 knows what + # file to include in opal/mca/pmix/pmix-internal.h + # The CPPFLAGS, LDFLAGS, and LIBS were already set + # by the configury + opal_pmix_external_basedir=opal/mca/pmix/external + opal_pmix_base_include="$opal_pmix_external_basedir/external.h" + ]) + OPAL_VAR_SCOPE_POP +])dnl + + +# MCA_pmix_external_CONFIG([action-if-found], [action-if-not-found]) +# -------------------------------------------------------------------- +AC_DEFUN([MCA_opal_pmix_external_CONFIG],[ + AC_CONFIG_FILES([opal/mca/pmix/external/Makefile]) + + AS_IF([test "$opal_external_pmix_happy" = "yes"], + [$1], [$2]) + + OPAL_VAR_SCOPE_POP +])dnl diff --git a/opal/mca/pmix/external/external.h b/opal/mca/pmix/external/external.h new file mode 100644 index 00000000000..27d5c4aa4be --- /dev/null +++ b/opal/mca/pmix/external/external.h @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2011-2019 Cisco Systems, Inc. All rights reserved + * Copyright (c) 2016-2019 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * + * Copyright (c) 2016-2019 Intel, Inc. All rights reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + * + * When this component is used, this file is included in the rest of + * the OPAL/OMPI code base via opal/mca/pmix/pmix-internal.h. As such, + * this header represents the public interface to this static component. + */ + +#ifndef MCA_OPAL_PMIX_EXTERNAL_H +#define MCA_OPAL_PMIX_EXTERNAL_H + +BEGIN_C_DECLS + +#include + +/* Top-level configure will always configure the embedded pmix + * component, even if we already know that we'll be using an external + * pmix (because of complicated reasons). A side-effect of this is + * that the embedded pmix will AC_DEFINE PMIX_VERSION (and friends) + * in opal_config.h. If the external pmix defines a different value + * of PMIX_VERSION (etc.), we'll get zillions of warnings about the + * two PMIX_VERSION values not matching. Hence, we undefined all of + * them here (so that the external can define them to + * whatever it wants). */ + +#undef PMIX_VERSION +#undef PMIX_VERSION_MAJOR +#undef PMIX_VERSION_MINOR +#undef PMIX_VERSION_RELEASE +#undef PMIX_VERSION_GREEK + +#include "pmix_common.h" +#include "pmix.h" + +END_C_DECLS + +#endif /* MCA_OPAL_PMIX_EXTERNAL_H */ diff --git a/orte/mca/ess/alps/owner.txt b/opal/mca/pmix/external/owner.txt similarity index 92% rename from orte/mca/ess/alps/owner.txt rename to opal/mca/pmix/external/owner.txt index 52961b5d12f..e3c6bfb1ea4 100644 --- a/orte/mca/ess/alps/owner.txt +++ b/opal/mca/pmix/external/owner.txt @@ -3,5 +3,5 @@ # owner: institution that is responsible for this package # status: e.g. active, maintenance, unmaintained # -owner: LANL +owner:Intel status: maintenance diff --git a/opal/mca/pmix/external/pmix_external_component.c b/opal/mca/pmix/external/pmix_external_component.c new file mode 100644 index 00000000000..79630e5fe3c --- /dev/null +++ b/opal/mca/pmix/external/pmix_external_component.c @@ -0,0 +1,65 @@ +/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ +/* + * Copyright (c) 2011-2017 Cisco Systems, Inc. All rights reserved + * Copyright (c) 2015 Los Alamos National Security, LLC. All rights + * reserved. + * + * Copyright (c) 2019 Intel, Inc. All rights reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +#include "opal_config.h" +#include "opal/constants.h" + +#include "opal/mca/pmix/pmix-internal.h" + +/* + * Public string showing the sysinfo ompi_linux component version number + */ +const char *opal_pmix_external_component_version_string = + "OPAL pmix_external pmix MCA component version " OPAL_VERSION; + + +/* + * Local function + */ +static int pmix_external_open(void); + + +/* + * Instantiate the public struct with all of our public information + * and pointers to our public functions in it + */ + +const opal_pmix_component_t mca_pmix_external_component = { + + /* First, the mca_component_t struct containing meta information + about the component itself */ + + .base_version = { + OPAL_PMIX_BASE_VERSION_2_0_0, + + /* Component name and version */ + .mca_component_name = "external", + MCA_BASE_MAKE_VERSION(component, OPAL_MAJOR_VERSION, OPAL_MINOR_VERSION, + OPAL_RELEASE_VERSION), + + /* Component open and close functions */ + .mca_open_component = pmix_external_open, + }, + .base_data = { + /* The component is checkpoint ready */ + MCA_BASE_METADATA_PARAM_CHECKPOINT + }, +}; + +static int pmix_external_open(void) +{ + /* Must have some code in this file, or the OS X linker may + eliminate the whole file */ + return OPAL_SUCCESS; +} diff --git a/opal/mca/pmix/flux/Makefile.am b/opal/mca/pmix/flux/Makefile.am deleted file mode 100644 index bc7c46f87c7..00000000000 --- a/opal/mca/pmix/flux/Makefile.am +++ /dev/null @@ -1,40 +0,0 @@ -# -# Copyright (c) 2014-2016 Intel, Inc. All rights reserved. -# Copyright (c) 2017 IBM Corporation. All rights reserved. -# $COPYRIGHT$ -# -# Additional copyrights may follow -# -# $HEADER$ -# - -sources = \ - pmix_flux.h \ - pmix_flux_component.c \ - pmix_flux.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_opal_pmix_flux_DSO -component_noinst = -component_install = mca_pmix_flux.la -else -component_noinst = libmca_pmix_flux.la -component_install = -endif - -mcacomponentdir = $(opallibdir) -mcacomponent_LTLIBRARIES = $(component_install) -mca_pmix_flux_la_SOURCES = $(sources) -mca_pmix_flux_la_CPPFLAGS = $(FLUX_PMI_CFLAGS) -mca_pmix_flux_la_LDFLAGS = -module -avoid-version -mca_pmix_flux_la_LIBADD = $(top_builddir)/opal/lib@OPAL_LIB_PREFIX@open-pal.la \ - $(FLUX_PMI_LIBS) - -noinst_LTLIBRARIES = $(component_noinst) -libmca_pmix_flux_la_SOURCES =$(sources) -libmca_pmix_flux_la_CPPFLAGS = $(FLUX_PMI_CFLAGS) -libmca_pmix_flux_la_LDFLAGS = -module -avoid-version -libmca_pmix_flux_la_LIBADD = $(FLUX_PMI_LIBS) diff --git a/opal/mca/pmix/flux/configure.m4 b/opal/mca/pmix/flux/configure.m4 deleted file mode 100644 index 0b4c5ca2ce0..00000000000 --- a/opal/mca/pmix/flux/configure.m4 +++ /dev/null @@ -1,63 +0,0 @@ -# -*- shell-script -*- -# -# Copyright (c) 2014-2016 Intel, Inc. All rights reserved. -# $COPYRIGHT$ -# -# Additional copyrights may follow -# -# $HEADER$ -# - -# MCA_pmix_flux_CONFIG([action-if-found], [action-if-not-found]) -# ----------------------------------------------------------- -AC_DEFUN([MCA_opal_pmix_flux_CONFIG], [ - - AC_CONFIG_FILES([opal/mca/pmix/flux/Makefile]) - - AC_ARG_WITH([flux-pmi], - [AC_HELP_STRING([--with-flux-pmi], - [Build Flux PMI support (default: yes)])]) - - AC_ARG_WITH([flux-pmi-library], - [AC_HELP_STRING([--with-flux-pmi-library], - [Link Flux PMI support with PMI library at build time. Otherwise the library is opened at runtime at location specified by FLUX_PMI_LIBRARY_PATH environment variable. Use this option to enable Flux support when building statically or without dlopen support (default: no)])]) - - - # pkg-config check aborts configure on failure - AC_MSG_CHECKING([if user wants Flux support to link against PMI library]) - AS_IF([test "x$with_flux_pmi_library" != "xyes"], - [AC_MSG_RESULT([no]) - $3], - [AC_MSG_RESULT([yes]) - PKG_CHECK_MODULES([FLUX_PMI], [flux-pmi], [], []) - have_flux_pmi_library=yes - AC_DEFINE([HAVE_FLUX_PMI_LIBRARY], [1], - [Flux support builds against external PMI library]) - ]) - - AC_MSG_CHECKING([if Flux support allowed to use dlopen]) - AS_IF([test $OPAL_ENABLE_DLOPEN_SUPPORT -eq 1 && test "x$compile_mode" = "xdso"], - [AC_MSG_RESULT([yes]) - flux_can_dlopen=yes - ], - [AC_MSG_RESULT([no]) - ]) - - AC_MSG_CHECKING([Checking if Flux PMI support can be built]) - AS_IF([test "x$with_flux_pmi" != "xno" && ( test "x$have_flux_pmi_library" = "xyes" || test "x$flux_can_dlopen" = "xyes" ) ], - [AC_MSG_RESULT([yes]) - opal_enable_flux=yes - ], - [AC_MSG_RESULT([no]) - AS_IF([test "x$with_flux_pmi" = "xyes"], - [AC_MSG_ERROR([Aborting since Flux PMI support was requested]) - ]) - ]) - - # Evaluate succeed / fail - AS_IF([test "x$opal_enable_flux" = "xyes"], - [$1 - # need to set the wrapper flags for static builds - pmix_flux_WRAPPER_EXTRA_LIBS="$FLUX_PMI_LIBS"], - [$2]) -]) diff --git a/opal/mca/pmix/flux/owner.txt b/opal/mca/pmix/flux/owner.txt deleted file mode 100644 index 85b4416d206..00000000000 --- a/opal/mca/pmix/flux/owner.txt +++ /dev/null @@ -1,7 +0,0 @@ -# -# owner/status file -# owner: institution that is responsible for this package -# status: e.g. active, maintenance, unmaintained -# -owner: INTEL -status: active diff --git a/opal/mca/pmix/flux/pmix_flux.c b/opal/mca/pmix/flux/pmix_flux.c deleted file mode 100644 index 3233524e0fe..00000000000 --- a/opal/mca/pmix/flux/pmix_flux.c +++ /dev/null @@ -1,788 +0,0 @@ -/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ -/* - * Copyright (c) 2014-2019 Intel, Inc. All rights reserved. - * Copyright (c) 2014-2016 Research Organization for Information Science - * and Technology (RIST). All rights reserved. - * Copyright (c) 2016 Cisco Systems, Inc. All rights reserved. - * $COPYRIGHT$ - * - * Additional copyrights may follow - * - * $HEADER$ - */ - -#include "opal_config.h" -#include "opal/constants.h" -#include "opal/types.h" - -#include "opal_stdint.h" -#include "opal/mca/hwloc/base/base.h" -#include "opal/util/argv.h" -#include "opal/util/opal_environ.h" -#include "opal/util/output.h" -#include "opal/util/proc.h" -#include "opal/util/show_help.h" - -#include -#if defined (HAVE_FLUX_PMI_LIBRARY) -#include -#else -#include -#endif - -#include "opal/mca/pmix/base/base.h" -#include "opal/mca/pmix/base/pmix_base_fns.h" -#include "opal/mca/pmix/base/pmix_base_hash.h" -#include "pmix_flux.h" - -static int flux_init(opal_list_t *ilist); -static int flux_fini(void); -static int flux_initialized(void); -static int flux_abort(int flag, const char msg[], - opal_list_t *procs); -static int flux_commit(void); -static int flux_fence(opal_list_t *procs, int collect_data); -static int flux_put(opal_pmix_scope_t scope, - opal_value_t *kv); -static int flux_get(const opal_process_name_t *id, - const char *key, opal_list_t *info, - opal_value_t **kv); -static int flux_publish(opal_list_t *info); -static int flux_lookup(opal_list_t *data, opal_list_t *info); -static int flux_unpublish(char **keys, opal_list_t *info); -static int flux_spawn(opal_list_t *jobinfo, opal_list_t *apps, opal_jobid_t *jobid); -static int flux_job_connect(opal_list_t *procs); -static int flux_job_disconnect(opal_list_t *procs); -static int flux_store_local(const opal_process_name_t *proc, - opal_value_t *val); -static const char *flux_get_nspace(opal_jobid_t jobid); -static void flux_register_jobid(opal_jobid_t jobid, const char *nspace); - -const opal_pmix_base_module_t opal_pmix_flux_module = { - .init = flux_init, - .finalize = flux_fini, - .initialized = flux_initialized, - .abort = flux_abort, - .commit = flux_commit, - .fence = flux_fence, - .put = flux_put, - .get = flux_get, - .publish = flux_publish, - .lookup = flux_lookup, - .unpublish = flux_unpublish, - .spawn = flux_spawn, - .connect = flux_job_connect, - .disconnect = flux_job_disconnect, - .register_evhandler = opal_pmix_base_register_handler, - .deregister_evhandler = opal_pmix_base_deregister_handler, - .store_local = flux_store_local, - .get_nspace = flux_get_nspace, - .register_jobid = flux_register_jobid -}; - -// usage accounting -static int pmix_init_count = 0; - -// PMI constant values: -static int pmix_kvslen_max = 0; -static int pmix_keylen_max = 0; -static int pmix_vallen_max = 0; -static int pmix_vallen_threshold = INT_MAX; - -// Job environment description -static char *pmix_kvs_name = NULL; -static bool flux_committed = false; -static char* pmix_packed_data = NULL; -static int pmix_packed_data_offset = 0; -static char* pmix_packed_encoded_data = NULL; -static int pmix_packed_encoded_data_offset = 0; -static int pmix_pack_key = 0; -static opal_process_name_t flux_pname; -static int *lranks = NULL, nlranks; - -static char* pmix_error(int pmix_err); -#define OPAL_PMI_ERROR(pmi_err, pmi_func) \ - do { \ - opal_output(0, "%s [%s:%d:%s]: %s\n", \ - pmi_func, __FILE__, __LINE__, __func__, \ - pmix_error(pmi_err)); \ - } while(0); - - -#if !defined (HAVE_FLUX_PMI_LIBRARY) -// -// Wrapper functions for dlopened() PMI library. -// -#define PMI_SUCCESS 0 -#define PMI_FAIL -1 -#define PMI_ERR_INIT 1 -#define PMI_ERR_NOMEM 2 -#define PMI_ERR_INVALID_ARG 3 -#define PMI_ERR_INVALID_KEY 4 -#define PMI_ERR_INVALID_KEY_LENGTH 5 -#define PMI_ERR_INVALID_VAL 6 -#define PMI_ERR_INVALID_VAL_LENGTH 7 -#define PMI_ERR_INVALID_LENGTH 8 -#define PMI_ERR_INVALID_NUM_ARGS 9 -#define PMI_ERR_INVALID_ARGS 10 -#define PMI_ERR_INVALID_NUM_PARSED 11 -#define PMI_ERR_INVALID_KEYVALP 12 -#define PMI_ERR_INVALID_SIZE 13 - -static void *dso = NULL; - -static int PMI_Init (int *spawned) -{ - int (*f)(int *); - if (!dso) { - const char *path; - if ((path = getenv ("FLUX_PMI_LIBRARY_PATH"))) - dso = dlopen (path, RTLD_NOW | RTLD_GLOBAL); - if (!dso) - return PMI_FAIL; - } - *(void **)(&f) = dlsym (dso, "PMI_Init"); - return f ? f (spawned) : PMI_FAIL; -} - -static int PMI_Initialized (int *initialized) -{ - int (*f)(int *); - if (!dso) { - if (initialized) - *initialized = 0; - return PMI_SUCCESS; - } - *(void **)(&f) = dlsym (dso, "PMI_Initialized"); - return f ? f (initialized) : PMI_FAIL; -} - -static int PMI_Finalize (void) -{ - int (*f)(void); - int rc; - if (!dso) - return PMI_SUCCESS; - *(void **)(&f) = dlsym (dso, "PMI_Finalize"); - rc = f ? f () : PMI_FAIL; - dlclose (dso); - return rc; -} - -static int PMI_Get_size (int *size) -{ - int (*f)(int *); - *(void **)(&f) = dso ? dlsym (dso, "PMI_Get_size") : NULL; - return f ? f (size) : PMI_FAIL; -} - -static int PMI_Get_rank (int *rank) -{ - int (*f)(int *); - *(void **)(&f) = dso ? dlsym (dso, "PMI_Get_rank") : NULL; - return f ? f (rank) : PMI_FAIL; -} - -static int PMI_Get_universe_size (int *size) -{ - int (*f)(int *); - *(void **)(&f) = dso ? dlsym (dso, "PMI_Get_universe_size") : NULL; - return f ? f (size) : PMI_FAIL; -} - -static int PMI_Get_appnum (int *appnum) -{ - int (*f)(int *); - *(void **)(&f) = dso ? dlsym (dso, "PMI_Get_appnum") : NULL; - return f ? f (appnum) : PMI_FAIL; -} - -static int PMI_Barrier (void) -{ - int (*f)(void); - *(void **)(&f) = dso ? dlsym (dso, "PMI_Barrier") : NULL; - return f ? f () : PMI_FAIL; -} - -static int PMI_Abort (int exit_code, const char *error_msg) -{ - int (*f)(int, const char *); - *(void **)(&f) = dso ? dlsym (dso, "PMI_Abort") : NULL; - return f ? f (exit_code, error_msg) : PMI_FAIL; -} - -static int PMI_KVS_Get_my_name (char *kvsname, int length) -{ - int (*f)(char *, int); - *(void **)(&f) = dso ? dlsym (dso, "PMI_KVS_Get_my_name") : NULL; - return f ? f (kvsname, length) : PMI_FAIL; -} - -static int PMI_KVS_Get_name_length_max (int *length) -{ - int (*f)(int *); - *(void **)(&f) = dso ? dlsym (dso, "PMI_KVS_Get_name_length_max") : NULL; - return f ? f (length) : PMI_FAIL; -} - -static int PMI_KVS_Get_key_length_max (int *length) -{ - int (*f)(int *); - *(void **)(&f) = dso ? dlsym (dso, "PMI_KVS_Get_key_length_max") : NULL; - return f ? f (length) : PMI_FAIL; -} - -static int PMI_KVS_Get_value_length_max (int *length) -{ - int (*f)(int *); - *(void **)(&f) = dso ? dlsym (dso, "PMI_KVS_Get_value_length_max") : NULL; - return f ? f (length) : PMI_FAIL; -} - -static int PMI_KVS_Put (const char *kvsname, const char *key, const char *value) -{ - int (*f)(const char *, const char *, const char *); - *(void **)(&f) = dso ? dlsym (dso, "PMI_KVS_Put") : NULL; - return f ? f (kvsname, key, value) : PMI_FAIL; -} - -static int PMI_KVS_Commit (const char *kvsname) -{ - int (*f)(const char *); - *(void **)(&f) = dso ? dlsym (dso, "PMI_KVS_Commit") : NULL; - return f ? f (kvsname) : PMI_FAIL; -} - -static int PMI_KVS_Get (const char *kvsname, const char *key, - char *value, int len) -{ - int (*f)(const char *, const char *, char *, int); - *(void **)(&f) = dso ? dlsym (dso, "PMI_KVS_Get") : NULL; - return f ? f (kvsname, key, value, len) : PMI_FAIL; -} - -static int PMI_Get_clique_size (int *size) -{ - int (*f)(int *); - *(void **)(&f) = dso ? dlsym (dso, "PMI_Get_clique_size") : NULL; - return f ? f (size) : PMI_FAIL; -} - -static int PMI_Get_clique_ranks (int *ranks, int length) -{ - int (*f)(int *, int); - *(void **)(&f) = dso ? dlsym (dso, "PMI_Get_clique_ranks") : NULL; - return f ? f (ranks, length) : PMI_FAIL; -} - -#endif /* !HAVE_FLUX_PMI_LIBRARY */ - -static int kvs_get(const char key[], char value [], int maxvalue) -{ - int rc; - rc = PMI_KVS_Get(pmix_kvs_name, key, value, maxvalue); - if( PMI_SUCCESS != rc ){ - /* silently return an error - might be okay */ - return OPAL_ERROR; - } - return OPAL_SUCCESS; -} - -static int kvs_put(const char key[], const char value[]) -{ - int rc; - rc = PMI_KVS_Put(pmix_kvs_name, key, value); - if( PMI_SUCCESS != rc ){ - OPAL_PMI_ERROR(rc, "PMI_KVS_Put"); - return OPAL_ERROR; - } - return rc; -} - -static int cache_put_uint(opal_process_name_t *id, int type, - const char key[], uint64_t val) -{ - char *cpy; - opal_value_t kv; - int ret; - - if (!(cpy = strdup (key))) { - ret = OPAL_ERR_OUT_OF_RESOURCE; - goto done; - } - OBJ_CONSTRUCT(&kv, opal_value_t); - kv.key = cpy; - kv.type = type; - switch (type) { - case OPAL_UINT16: - kv.data.uint16 = val; - break; - case OPAL_UINT32: - kv.data.uint32 = val; - break; - case OPAL_UINT64: - kv.data.uint64 = val; - break; - default: - ret = OPAL_ERROR; - goto done_free; - } - ret = opal_pmix_base_store(id, &kv); -done_free: - OBJ_DESTRUCT(&kv); -done: - if (OPAL_SUCCESS != ret) - OPAL_ERROR_LOG(ret); - return ret; -} - -static int cache_put_string (opal_process_name_t *id, - const char key[], char *val) -{ - char *cpy; - opal_value_t kv; - int ret; - - if (!(cpy = strdup (key))) { - ret = OPAL_ERR_OUT_OF_RESOURCE; - goto done; - } - OBJ_CONSTRUCT(&kv, opal_value_t); - kv.key = cpy; - kv.type = OPAL_STRING; - kv.data.string = val; - ret = opal_pmix_base_store(id, &kv); - OBJ_DESTRUCT(&kv); -done: - if (OPAL_SUCCESS != ret) - OPAL_ERROR_LOG(ret); - return ret; -} - -static int flux_init(opal_list_t *ilist) -{ - int initialized; - int spawned; - int rc, ret = OPAL_ERROR; - int i, rank, lrank, nrank; - char tmp[64]; - const char *jobid; - opal_process_name_t ldr; - char **localranks=NULL; - opal_process_name_t wildcard_rank; - char *str; - - if (0 < pmix_init_count) { - pmix_init_count++; - return OPAL_SUCCESS; - } - - if (PMI_SUCCESS != (rc = PMI_Initialized(&initialized))) { - OPAL_PMI_ERROR(rc, "PMI_Initialized"); - return OPAL_ERROR; - } - - if (!initialized && PMI_SUCCESS != (rc = PMI_Init(&spawned))) { - OPAL_PMI_ERROR(rc, "PMI_Init"); - return OPAL_ERROR; - } - - // setup hash table - opal_pmix_base_hash_init(); - - // Initialize space demands - rc = PMI_KVS_Get_value_length_max(&pmix_vallen_max); - if (PMI_SUCCESS != rc) { - OPAL_PMI_ERROR(rc, "PMI_KVS_Get_value_length_max"); - goto err_exit; - } - pmix_vallen_threshold = pmix_vallen_max * 3; - pmix_vallen_threshold >>= 2; - - rc = PMI_KVS_Get_name_length_max(&pmix_kvslen_max); - if (PMI_SUCCESS != rc) { - OPAL_PMI_ERROR(rc, "PMI_KVS_Get_name_length_max"); - goto err_exit; - } - - rc = PMI_KVS_Get_key_length_max(&pmix_keylen_max); - if (PMI_SUCCESS != rc) { - OPAL_PMI_ERROR(rc, "PMI_KVS_Get_key_length_max"); - goto err_exit; - } - - /* get our rank */ - rc = PMI_Get_rank(&rank); - if (PMI_SUCCESS != rc) { - OPAL_PMI_ERROR(rc, "PMI_Get_rank"); - goto err_exit; - } - - /* get integer job id */ - if (!(jobid = getenv ("FLUX_JOB_ID"))) { - opal_output(0, "getenv FLUX_JOB_ID [%s:%d:%s]: failed\n", - __FILE__, __LINE__, __func__); - goto err_exit; - } - flux_pname.jobid = strtoul(jobid, NULL, 10); - ldr.jobid = flux_pname.jobid; - flux_pname.vpid = rank; - /* store our name in the opal_proc_t so that - * debug messages will make sense - an upper - * layer will eventually overwrite it, but that - * won't do any harm */ - opal_proc_set_name(&flux_pname); - opal_output_verbose(2, opal_pmix_base_framework.framework_output, - "%s pmix:flux: assigned tmp name", - OPAL_NAME_PRINT(flux_pname)); - - /* setup wildcard rank*/ - wildcard_rank = OPAL_PROC_MY_NAME; - wildcard_rank.vpid = OPAL_VPID_WILDCARD; - - if (OPAL_SUCCESS != (ret = cache_put_uint (&wildcard_rank, - OPAL_UINT32, - OPAL_PMIX_JOBID, - flux_pname.jobid))) - goto err_exit; - if (OPAL_SUCCESS != (ret = cache_put_uint (&OPAL_PROC_MY_NAME, - OPAL_UINT32, - OPAL_PMIX_RANK, - rank))) - goto err_exit; - - pmix_kvs_name = (char*)malloc(pmix_kvslen_max); - if (pmix_kvs_name == NULL) { - ret = OPAL_ERR_OUT_OF_RESOURCE; - goto err_exit; - } - - rc = PMI_KVS_Get_my_name(pmix_kvs_name, pmix_kvslen_max); - if (PMI_SUCCESS != rc) { - OPAL_PMI_ERROR(rc, "PMI_KVS_Get_my_name"); - goto err_exit; - } - - /* get our local proc info to find our local rank */ - if (PMI_SUCCESS != (rc = PMI_Get_clique_size(&nlranks))) { - OPAL_PMI_ERROR(rc, "PMI_Get_clique_size"); - goto err_exit; - } - /* save the local size */ - if (OPAL_SUCCESS != (ret = cache_put_uint (&wildcard_rank, - OPAL_UINT32, - OPAL_PMIX_LOCAL_SIZE, - nlranks))) - goto err_exit; - lrank = 0; - nrank = 0; - ldr.vpid = rank; - if (0 < nlranks) { - /* now get the specific ranks */ - lranks = (int*)calloc(nlranks, sizeof(int)); - if (NULL == lranks) { - ret = OPAL_ERR_OUT_OF_RESOURCE; - OPAL_ERROR_LOG(rc); - goto err_exit; - } - if (PMI_SUCCESS != (rc = PMI_Get_clique_ranks(lranks, nlranks))) { - OPAL_PMI_ERROR(rc, "PMI_Get_clique_ranks"); - free(lranks); - goto err_exit; - } - /* note the local ldr */ - ldr.vpid = lranks[0]; - /* save this */ - memset(tmp, 0, 64); - for (i=0; i < nlranks; i++) { - (void)snprintf(tmp, 64, "%d", lranks[i]); - opal_argv_append_nosize(&localranks, tmp); - if (rank == lranks[i]) { - lrank = i; - nrank = i; - } - } - str = opal_argv_join(localranks, ','); - opal_argv_free(localranks); - if (OPAL_SUCCESS != (ret = cache_put_string (&wildcard_rank, - OPAL_PMIX_LOCAL_PEERS, - str))) - goto err_exit; - } - - /* save the local leader */ - if (OPAL_SUCCESS != (ret = cache_put_uint (&OPAL_PROC_MY_NAME, - OPAL_UINT64, - OPAL_PMIX_LOCALLDR, - *(uint64_t*)&ldr))) - goto err_exit; - /* save our local rank */ - if (OPAL_SUCCESS != (ret = cache_put_uint (&OPAL_PROC_MY_NAME, - OPAL_UINT16, - OPAL_PMIX_LOCAL_RANK, - lrank))) - goto err_exit; - /* and our node rank */ - if (OPAL_SUCCESS != (ret = cache_put_uint (&OPAL_PROC_MY_NAME, - OPAL_UINT16, - OPAL_PMIX_NODE_RANK, - nrank))) - goto err_exit; - /* get universe size */ - rc = PMI_Get_universe_size(&i); - if (PMI_SUCCESS != rc) { - OPAL_PMI_ERROR(rc, "PMI_Get_universe_size"); - goto err_exit; - } - /* push this into the dstore for subsequent fetches */ - if (OPAL_SUCCESS != (ret = cache_put_uint (&wildcard_rank, - OPAL_UINT32, - OPAL_PMIX_UNIV_SIZE, - i))) - goto err_exit; - if (OPAL_SUCCESS != (ret = cache_put_uint (&wildcard_rank, - OPAL_UINT32, - OPAL_PMIX_MAX_PROCS, - i))) - goto err_exit; - /* get job size */ - rc = PMI_Get_size(&i); - if (PMI_SUCCESS != rc) { - OPAL_PMI_ERROR(rc, "PMI_Get_size"); - goto err_exit; - } - if (OPAL_SUCCESS != (ret = cache_put_uint (&wildcard_rank, - OPAL_UINT32, - OPAL_PMIX_JOB_SIZE, - i))) - goto err_exit; - - /* get appnum */ - rc = PMI_Get_appnum(&i); - if (PMI_SUCCESS != rc) { - OPAL_PMI_ERROR(rc, "PMI_Get_appnum"); - goto err_exit; - } - if (OPAL_SUCCESS != (ret = cache_put_uint (&OPAL_PROC_MY_NAME, - OPAL_UINT32, - OPAL_PMIX_APPNUM, - i))) - goto err_exit; - - /* increment the init count */ - ++pmix_init_count; - - return OPAL_SUCCESS; - -err_exit: - PMI_Finalize(); - return (ret == OPAL_SUCCESS ? OPAL_ERROR : ret); -} - -static int flux_fini(void) { - if (0 == pmix_init_count) { - return OPAL_SUCCESS; - } - - if (0 == --pmix_init_count) { - PMI_Finalize (); - // teardown hash table - opal_pmix_base_hash_finalize(); - } - - return OPAL_SUCCESS; -} - -static int flux_initialized(void) -{ - if (0 < pmix_init_count) { - return 1; - } - return 0; -} - -static int flux_abort(int flag, const char msg[], - opal_list_t *procs) -{ - PMI_Abort(flag, msg); - return OPAL_SUCCESS; -} - -static int flux_spawn(opal_list_t *jobinfo, opal_list_t *apps, opal_jobid_t *jobid) -{ - /* - int rc; - size_t preput_vector_size; - const int info_keyval_sizes[1]; - info_keyval_sizes[0] = (int)opal_list_get_size(info_keyval_vector); - //FIXME what's the size of array of lists? - preput_vector_size = opal_list_get_size(preput_keyval_vector); - rc = PMI_Spawn_multiple(count, cmds, argcs, argvs, maxprocs, info_keyval_sizes, info_keyval_vector, (int)preput_vector_size, preput_keyval_vector); - if( PMI_SUCCESS != rc ) { - OPAL_PMI_ERROR(rc, "PMI_Spawn_multiple"); - return OPAL_ERROR; - }*/ - return OPAL_ERR_NOT_IMPLEMENTED; -} - -static int flux_put(opal_pmix_scope_t scope, - opal_value_t *kv) -{ - int rc; - - opal_output_verbose(2, opal_pmix_base_framework.framework_output, - "%s pmix:flux put for key %s", - OPAL_NAME_PRINT(OPAL_PROC_MY_NAME), kv->key); - - if (OPAL_SUCCESS != (rc = opal_pmix_base_store_encoded (kv->key, (void*)&kv->data, kv->type, &pmix_packed_data, &pmix_packed_data_offset))) { - OPAL_ERROR_LOG(rc); - return rc; - } - - if (pmix_packed_data_offset == 0) { - /* nothing to write */ - return OPAL_SUCCESS; - } - - if (((pmix_packed_data_offset/3)*4) + pmix_packed_encoded_data_offset < pmix_vallen_max) { - /* this meta-key is still being filled, - * nothing to put yet - */ - return OPAL_SUCCESS; - } - - rc = opal_pmix_base_partial_commit_packed (&pmix_packed_data, &pmix_packed_data_offset, - &pmix_packed_encoded_data, &pmix_packed_encoded_data_offset, - pmix_vallen_max, &pmix_pack_key, kvs_put); - - flux_committed = false; - return rc; -} - -static int flux_commit(void) -{ - int rc; - - /* check if there is partially filled meta key and put them */ - opal_pmix_base_commit_packed (&pmix_packed_data, &pmix_packed_data_offset, - &pmix_packed_encoded_data, &pmix_packed_encoded_data_offset, - pmix_vallen_max, &pmix_pack_key, kvs_put); - - if (PMI_SUCCESS != (rc = PMI_KVS_Commit(pmix_kvs_name))) { - OPAL_PMI_ERROR(rc, "PMI_KVS_Commit"); - return OPAL_ERROR; - } - return OPAL_SUCCESS; -} - -static int flux_fence(opal_list_t *procs, int collect_data) -{ - int rc; - if (PMI_SUCCESS != (rc = PMI_Barrier())) { - OPAL_PMI_ERROR(rc, "PMI_Barrier"); - return OPAL_ERROR; - } - return OPAL_SUCCESS; -} - -static int flux_get(const opal_process_name_t *id, - const char *key, opal_list_t *info, - opal_value_t **kv) -{ - int rc; - opal_output_verbose(2, opal_pmix_base_framework.framework_output, - "%s pmix:flux called get for key %s", - OPAL_NAME_PRINT(OPAL_PROC_MY_NAME), key); - - /* Keys presumed stored directly to cache by flux_init() under the - * wildcard rank must not trigger PMI_KVS_Get() if not found. */ - if (id->vpid == OPAL_VPID_WILDCARD) { - opal_list_t values; - OBJ_CONSTRUCT(&values, opal_list_t); - rc = opal_pmix_base_fetch (id, key, &values); - OPAL_LIST_DESTRUCT(&values); - if (OPAL_SUCCESS != rc) { - return rc; - } - } - - rc = opal_pmix_base_cache_keys_locally(id, key, kv, pmix_kvs_name, pmix_vallen_max, kvs_get); - opal_output_verbose(2, opal_pmix_base_framework.framework_output, - "%s pmix:flux got key %s", - OPAL_NAME_PRINT(OPAL_PROC_MY_NAME), key); - - return rc; -} - -static int flux_publish(opal_list_t *info) -{ - return OPAL_ERR_NOT_SUPPORTED; -} - -static int flux_lookup(opal_list_t *data, opal_list_t *info) -{ - // Allocate mem for port here? Otherwise we won't get success! - - return OPAL_ERR_NOT_SUPPORTED; -} - -static int flux_unpublish(char **keys, opal_list_t *info) -{ - return OPAL_ERR_NOT_SUPPORTED; -} - -static int flux_job_connect(opal_list_t *procs) -{ - return OPAL_ERR_NOT_SUPPORTED; -} - -static int flux_job_disconnect(opal_list_t *procs) -{ - return OPAL_ERR_NOT_SUPPORTED; -} - -static int flux_store_local(const opal_process_name_t *proc, - opal_value_t *val) -{ - opal_pmix_base_store(proc, val); - - return OPAL_SUCCESS; -} - -static const char *flux_get_nspace(opal_jobid_t jobid) -{ - return "N/A"; -} -static void flux_register_jobid(opal_jobid_t jobid, const char *nspace) -{ - return; -} - -static char* pmix_error(int pmix_err) -{ - char * err_msg; - - switch(pmix_err) { - case PMI_FAIL: err_msg = "Operation failed"; break; - case PMI_ERR_INIT: err_msg = "PMI is not initialized"; break; - case PMI_ERR_NOMEM: err_msg = "Input buffer not large enough"; break; - case PMI_ERR_INVALID_ARG: err_msg = "Invalid argument"; break; - case PMI_ERR_INVALID_KEY: err_msg = "Invalid key argument"; break; - case PMI_ERR_INVALID_KEY_LENGTH: err_msg = "Invalid key length argument"; break; - case PMI_ERR_INVALID_VAL: err_msg = "Invalid value argument"; break; - case PMI_ERR_INVALID_VAL_LENGTH: err_msg = "Invalid value length argument"; break; - case PMI_ERR_INVALID_LENGTH: err_msg = "Invalid length argument"; break; - case PMI_ERR_INVALID_NUM_ARGS: err_msg = "Invalid number of arguments"; break; - case PMI_ERR_INVALID_ARGS: err_msg = "Invalid args argument"; break; - case PMI_ERR_INVALID_NUM_PARSED: err_msg = "Invalid num_parsed length argument"; break; - case PMI_ERR_INVALID_KEYVALP: err_msg = "Invalid keyvalp argument"; break; - case PMI_ERR_INVALID_SIZE: err_msg = "Invalid size argument"; break; -#if defined(PMI_ERR_INVALID_KVS) - /* pmix.h calls this a valid return code but mpich doesn't define it */ - case PMI_ERR_INVALID_KVS: err_msg = "Invalid kvs argument"; break; -#endif - case PMI_SUCCESS: err_msg = "Success"; break; - default: err_msg = "Unkown error"; - } - return err_msg; -} diff --git a/opal/mca/pmix/flux/pmix_flux.h b/opal/mca/pmix/flux/pmix_flux.h deleted file mode 100644 index 934c3ecf191..00000000000 --- a/opal/mca/pmix/flux/pmix_flux.h +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2014-2016 Intel, Inc. All rights reserved. - * $COPYRIGHT$ - * - * Additional copyrights may follow - * - * $HEADER$ - */ - -#ifndef MCA_PMIX_FLUX_H -#define MCA_PMIX_FLUX_H - -#include "opal_config.h" - -#include "opal/mca/mca.h" -#include "opal/mca/pmix/pmix.h" -#include "opal/mca/pmix/base/pmix_base_fns.h" - -BEGIN_C_DECLS - -/* - * Globally exported variable - */ - -OPAL_DECLSPEC extern opal_pmix_base_component_t mca_pmix_flux_component; - -OPAL_DECLSPEC extern const opal_pmix_base_module_t opal_pmix_flux_module; - -END_C_DECLS - -#endif /* MCA_PMIX_FLUX_H */ diff --git a/opal/mca/pmix/flux/pmix_flux_component.c b/opal/mca/pmix/flux/pmix_flux_component.c deleted file mode 100644 index 5a5815f8666..00000000000 --- a/opal/mca/pmix/flux/pmix_flux_component.c +++ /dev/null @@ -1,104 +0,0 @@ -/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ -/* - * Copyright (c) 2014-2016 Intel, Inc. All rights reserved. - * Copyright (c) 2015 Los Alamos National Security, LLC. All rights - * reserved. - * Copyright (c) 2016 Cisco Systems, 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 "opal_config.h" - -#include "opal/constants.h" -#include "opal/mca/pmix/pmix.h" -#include "pmix_flux.h" - -/* - * Public string showing the pmix flux component version number - */ -const char *opal_pmix_flux_component_version_string = - "OPAL flux pmix MCA component version " OPAL_VERSION; - -/* - * Local function - */ -static int pmix_flux_component_query(mca_base_module_t **module, int *priority); -static int pmix_flux_component_register(void); - - -/* - * Instantiate the public struct with all of our public information - * and pointers to our public functions in it - */ - -opal_pmix_base_component_t mca_pmix_flux_component = { - - /* First, the mca_component_t struct containing meta information - about the component itself */ - - .base_version = { - /* Indicate that we are a pmix v1.1.0 component (which also - implies a specific MCA version) */ - - OPAL_PMIX_BASE_VERSION_2_0_0, - - /* Component name and version */ - - .mca_component_name = "flux", - MCA_BASE_MAKE_VERSION(component, OPAL_MAJOR_VERSION, OPAL_MINOR_VERSION, - OPAL_RELEASE_VERSION), - - /* Component open and close functions */ - .mca_query_component = pmix_flux_component_query, - .mca_register_component_params = pmix_flux_component_register, - }, - /* Next the MCA v1.0.0 component meta data */ - .base_data = { - /* The component is checkpoint ready */ - MCA_BASE_METADATA_PARAM_CHECKPOINT - }, - .priority = 10, -}; - -static int pmix_flux_component_register(void) -{ - int ret; - mca_base_component_t *component = &mca_pmix_flux_component.base_version; - - mca_pmix_flux_component.priority = 20; - ret = mca_base_component_var_register(component, "priority", - "Priority of the pmix flux component (default: 20)", - MCA_BASE_VAR_TYPE_INT, NULL, 0, 0, - OPAL_INFO_LVL_9, MCA_BASE_VAR_SCOPE_READONLY, - &mca_pmix_flux_component.priority); - if (0 > ret) { - return ret; - } - - return OPAL_SUCCESS; -} - -static int pmix_flux_component_query(mca_base_module_t **module, int *priority) -{ - /* disqualify ourselves if we are not under Flux */ - if (NULL == getenv("FLUX_JOB_ID")) { - *priority = 0; - *module = NULL; - return OPAL_ERROR; - } - - /* we can be considered */ - *priority = mca_pmix_flux_component.priority; - *module = (mca_base_module_t *)&opal_pmix_flux_module; - return OPAL_SUCCESS; -} diff --git a/opal/mca/pmix/isolated/Makefile.am b/opal/mca/pmix/isolated/Makefile.am deleted file mode 100644 index 05552d42200..00000000000 --- a/opal/mca/pmix/isolated/Makefile.am +++ /dev/null @@ -1,36 +0,0 @@ -# -# Copyright (c) 2016 Intel, Inc. All rights reserved. -# Copyright (c) 2017 IBM Corporation. All rights reserved. -# $COPYRIGHT$ -# -# Additional copyrights may follow -# -# $HEADER$ -# - -sources = \ - pmix_isolated.h \ - pmix_isolated_component.c \ - pmix_isolated.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_opal_pmix_isolated_DSO -component_noinst = -component_install = mca_pmix_isolated.la -else -component_noinst = libmca_pmix_isolated.la -component_install = -endif - -mcacomponentdir = $(opallibdir) -mcacomponent_LTLIBRARIES = $(component_install) -mca_pmix_isolated_la_SOURCES = $(sources) -mca_pmix_isolated_la_LDFLAGS = -module -avoid-version -mca_pmix_isolated_la_LIBADD = $(top_builddir)/opal/lib@OPAL_LIB_PREFIX@open-pal.la - -noinst_LTLIBRARIES = $(component_noinst) -libmca_pmix_isolated_la_SOURCES =$(sources) -libmca_pmix_isolated_la_LDFLAGS = -module -avoid-version diff --git a/opal/mca/pmix/isolated/pmix_isolated.c b/opal/mca/pmix/isolated/pmix_isolated.c deleted file mode 100644 index a13ec137836..00000000000 --- a/opal/mca/pmix/isolated/pmix_isolated.c +++ /dev/null @@ -1,506 +0,0 @@ -/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ -/* - * Copyright (c) 2016-2017 Intel, Inc. All rights reserved. - * Copyright (c) 2011-2015 Los Alamos National Security, LLC. All - * rights reserved. - * Copyright (c) 2016 Cisco Systems, Inc. All rights reserved. - * $COPYRIGHT$ - * - * Additional copyrights may follow - * - * $HEADER$ - */ - -#include "opal_config.h" -#include "opal/constants.h" -#include "opal/types.h" - -#ifdef HAVE_STRING_H -#include -#endif -#ifdef HAVE_UNISTD_H -#include -#endif - -#include "opal/dss/dss.h" -#include "opal/mca/event/event.h" -#include "opal/mca/hwloc/base/base.h" -#include "opal/runtime/opal.h" -#include "opal/runtime/opal_progress_threads.h" -#include "opal/util/argv.h" -#include "opal/util/error.h" -#include "opal/util/output.h" -#include "opal/util/proc.h" -#include "opal/util/show_help.h" - -#include "pmix_isolated.h" -#include "opal/mca/pmix/base/base.h" -#include "opal/mca/pmix/base/pmix_base_hash.h" - - -static int isolated_init(opal_list_t *ilist); -static int isolated_fini(void); -static int isolated_initialized(void); -static int isolated_abort(int flat, const char *msg, - opal_list_t *procs); -static int isolated_spawn(opal_list_t *jobinfo, opal_list_t *apps, opal_jobid_t *jobid); -static int isolated_spawn_nb(opal_list_t *jobinfo, opal_list_t *apps, - opal_pmix_spawn_cbfunc_t cbfunc, - void *cbdata); -static int isolated_job_connect(opal_list_t *procs); -static int isolated_job_disconnect(opal_list_t *procs); -static int isolated_job_disconnect_nb(opal_list_t *procs, - opal_pmix_op_cbfunc_t cbfunc, - void *cbdata); -static int isolated_resolve_peers(const char *nodename, - opal_jobid_t jobid, - opal_list_t *procs); -static int isolated_resolve_nodes(opal_jobid_t jobid, char **nodelist); -static int isolated_put(opal_pmix_scope_t scope, opal_value_t *kv); -static int isolated_fence(opal_list_t *procs, int collect_data); -static int isolated_fence_nb(opal_list_t *procs, int collect_data, - opal_pmix_op_cbfunc_t cbfunc, void *cbdata); -static int isolated_commit(void); -static int isolated_get(const opal_process_name_t *id, - const char *key, opal_list_t *info, - opal_value_t **kv); -static int isolated_get_nb(const opal_process_name_t *id, const char *key, - opal_list_t *info, - opal_pmix_value_cbfunc_t cbfunc, void *cbdata); -static int isolated_publish(opal_list_t *info); -static int isolated_publish_nb(opal_list_t *info, - opal_pmix_op_cbfunc_t cbfunc, void *cbdata); -static int isolated_lookup(opal_list_t *data, opal_list_t *info); -static int isolated_lookup_nb(char **keys, opal_list_t *info, - opal_pmix_lookup_cbfunc_t cbfunc, void *cbdata); -static int isolated_unpublish(char **keys, opal_list_t *info); -static int isolated_unpublish_nb(char **keys, opal_list_t *info, - opal_pmix_op_cbfunc_t cbfunc, void *cbdata); -static const char *isolated_get_version(void); -static int isolated_store_local(const opal_process_name_t *proc, - opal_value_t *val); -static const char *isolated_get_nspace(opal_jobid_t jobid); -static void isolated_register_jobid(opal_jobid_t jobid, const char *nspace); - -const opal_pmix_base_module_t opal_pmix_isolated_module = { - .init = isolated_init, - .finalize = isolated_fini, - .initialized = isolated_initialized, - .abort = isolated_abort, - .commit = isolated_commit, - .fence = isolated_fence, - .fence_nb = isolated_fence_nb, - .put = isolated_put, - .get = isolated_get, - .get_nb = isolated_get_nb, - .publish = isolated_publish, - .publish_nb = isolated_publish_nb, - .lookup = isolated_lookup, - .lookup_nb = isolated_lookup_nb, - .unpublish = isolated_unpublish, - .unpublish_nb = isolated_unpublish_nb, - .spawn = isolated_spawn, - .spawn_nb = isolated_spawn_nb, - .connect = isolated_job_connect, - .disconnect = isolated_job_disconnect, - .disconnect_nb = isolated_job_disconnect_nb, - .resolve_peers = isolated_resolve_peers, - .resolve_nodes = isolated_resolve_nodes, - .get_version = isolated_get_version, - .register_evhandler = opal_pmix_base_register_handler, - .deregister_evhandler = opal_pmix_base_deregister_handler, - .notify_event = opal_pmix_base_notify_event, - .store_local = isolated_store_local, - .get_nspace = isolated_get_nspace, - .register_jobid = isolated_register_jobid -}; - -static int isolated_init_count = 0; -static opal_process_name_t isolated_pname; - -static int isolated_init(opal_list_t *ilist) -{ - int rc; - opal_value_t kv; - opal_process_name_t wildcard; - - OPAL_PMIX_ACQUIRE_THREAD(&opal_pmix_base.lock); - ++isolated_init_count; - if (1 < isolated_init_count) { - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - return OPAL_SUCCESS; - } - - - wildcard.jobid = 1; - wildcard.vpid = OPAL_VPID_WILDCARD; - - /* store our name in the opal_proc_t so that - * debug messages will make sense - an upper - * layer will eventually overwrite it, but that - * won't do any harm */ - isolated_pname.jobid = 1; - isolated_pname.vpid = 0; - opal_proc_set_name(&isolated_pname); - opal_output_verbose(10, opal_pmix_base_framework.framework_output, - "%s pmix:isolated: assigned tmp name %d %d", - OPAL_NAME_PRINT(isolated_pname),isolated_pname.jobid,isolated_pname.vpid); - - // setup hash table - opal_pmix_base_hash_init(); - - /* save the job size */ - OBJ_CONSTRUCT(&kv, opal_value_t); - kv.key = strdup(OPAL_PMIX_JOB_SIZE); - kv.type = OPAL_UINT32; - kv.data.uint32 = 1; - if (OPAL_SUCCESS != (rc = opal_pmix_base_store(&OPAL_PROC_MY_NAME, &kv))) { - OPAL_ERROR_LOG(rc); - OBJ_DESTRUCT(&kv); - goto err_exit; - } - OBJ_DESTRUCT(&kv); - - /* save the appnum */ - OBJ_CONSTRUCT(&kv, opal_value_t); - kv.key = strdup(OPAL_PMIX_APPNUM); - kv.type = OPAL_UINT32; - kv.data.uint32 = 0; - if (OPAL_SUCCESS != (rc = opal_pmix_base_store(&OPAL_PROC_MY_NAME, &kv))) { - OPAL_ERROR_LOG(rc); - OBJ_DESTRUCT(&kv); - goto err_exit; - } - OBJ_DESTRUCT(&kv); - - OBJ_CONSTRUCT(&kv, opal_value_t); - kv.key = strdup(OPAL_PMIX_UNIV_SIZE); - kv.type = OPAL_UINT32; - kv.data.uint32 = 1; - if (OPAL_SUCCESS != (rc = opal_pmix_base_store(&OPAL_PROC_MY_NAME, &kv))) { - OPAL_ERROR_LOG(rc); - OBJ_DESTRUCT(&kv); - goto err_exit; - } - OBJ_DESTRUCT(&kv); - - OBJ_CONSTRUCT(&kv, opal_value_t); - kv.key = strdup(OPAL_PMIX_MAX_PROCS); - kv.type = OPAL_UINT32; - kv.data.uint32 = 1; - if (OPAL_SUCCESS != (rc = opal_pmix_base_store(&wildcard, &kv))) { - OPAL_ERROR_LOG(rc); - OBJ_DESTRUCT(&kv); - goto err_exit; - } - OBJ_DESTRUCT(&kv); - - OBJ_CONSTRUCT(&kv, opal_value_t); - kv.key = strdup(OPAL_PMIX_JOBID); - kv.type = OPAL_UINT32; - kv.data.uint32 = 1; - if (OPAL_SUCCESS != (rc = opal_pmix_base_store(&OPAL_PROC_MY_NAME, &kv))) { - OPAL_ERROR_LOG(rc); - OBJ_DESTRUCT(&kv); - goto err_exit; - } - OBJ_DESTRUCT(&kv); - - /* save the local size */ - OBJ_CONSTRUCT(&kv, opal_value_t); - kv.key = strdup(OPAL_PMIX_LOCAL_SIZE); - kv.type = OPAL_UINT32; - kv.data.uint32 = 1; - if (OPAL_SUCCESS != (rc = opal_pmix_base_store(&OPAL_PROC_MY_NAME, &kv))) { - OPAL_ERROR_LOG(rc); - OBJ_DESTRUCT(&kv); - goto err_exit; - } - OBJ_DESTRUCT(&kv); - - OBJ_CONSTRUCT(&kv, opal_value_t); - kv.key = strdup(OPAL_PMIX_LOCAL_PEERS); - kv.type = OPAL_STRING; - kv.data.string = strdup("0"); - if (OPAL_SUCCESS != (rc = opal_pmix_base_store(&OPAL_PROC_MY_NAME, &kv))) { - OPAL_ERROR_LOG(rc); - OBJ_DESTRUCT(&kv); - goto err_exit; - } - OBJ_DESTRUCT(&kv); - - /* save the local leader */ - OBJ_CONSTRUCT(&kv, opal_value_t); - kv.key = strdup(OPAL_PMIX_LOCALLDR); - kv.type = OPAL_UINT64; - kv.data.uint64 = 0; - if (OPAL_SUCCESS != (rc = opal_pmix_base_store(&OPAL_PROC_MY_NAME, &kv))) { - OPAL_ERROR_LOG(rc); - OBJ_DESTRUCT(&kv); - goto err_exit; - } - - /* save our local rank */ - OBJ_CONSTRUCT(&kv, opal_value_t); - kv.key = strdup(OPAL_PMIX_LOCAL_RANK); - kv.type = OPAL_UINT16; - kv.data.uint16 = 0; - if (OPAL_SUCCESS != (rc = opal_pmix_base_store(&OPAL_PROC_MY_NAME, &kv))) { - OPAL_ERROR_LOG(rc); - OBJ_DESTRUCT(&kv); - goto err_exit; - } - - /* and our node rank */ - OBJ_CONSTRUCT(&kv, opal_value_t); - kv.key = strdup(OPAL_PMIX_NODE_RANK); - kv.type = OPAL_UINT16; - kv.data.uint16 = 0; - if (OPAL_SUCCESS != (rc = opal_pmix_base_store(&OPAL_PROC_MY_NAME, &kv))) { - OPAL_ERROR_LOG(rc); - OBJ_DESTRUCT(&kv); - goto err_exit; - } - OBJ_DESTRUCT(&kv); - - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - return OPAL_SUCCESS; - - err_exit: - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - return rc; -} - -static int isolated_fini(void) -{ - OPAL_PMIX_ACQUIRE_THREAD(&opal_pmix_base.lock); - --opal_pmix_base.initialized; - - if (0 == isolated_init_count) { - opal_pmix_base_hash_finalize(); - } - - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - return OPAL_SUCCESS; -} - -static int isolated_initialized(void) -{ - OPAL_PMIX_ACQUIRE_THREAD(&opal_pmix_base.lock); - if (0 < isolated_init_count) { - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - return 1; - } - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - return 0; -} - -static int isolated_abort(int flag, const char *msg, - opal_list_t *procs) -{ - return OPAL_SUCCESS; -} - -static int isolated_spawn(opal_list_t *jobinfo, opal_list_t *apps, opal_jobid_t *jobid) -{ - return OPAL_ERR_NOT_SUPPORTED; -} - -static int isolated_spawn_nb(opal_list_t *jobinfo, opal_list_t *apps, - opal_pmix_spawn_cbfunc_t cbfunc, - void *cbdata) -{ - return OPAL_ERR_NOT_SUPPORTED; -} - -static int isolated_job_connect(opal_list_t *procs) -{ - return OPAL_ERR_NOT_SUPPORTED; -} - -static int isolated_job_disconnect(opal_list_t *procs) -{ - return OPAL_ERR_NOT_SUPPORTED; -} - -static int isolated_job_disconnect_nb(opal_list_t *procs, - opal_pmix_op_cbfunc_t cbfunc, - void *cbdata) -{ - return OPAL_ERR_NOT_SUPPORTED; -} - -static int isolated_resolve_peers(const char *nodename, - opal_jobid_t jobid, - opal_list_t *procs) -{ - return OPAL_ERR_NOT_IMPLEMENTED; -} - -static int isolated_resolve_nodes(opal_jobid_t jobid, char **nodelist) -{ - return OPAL_ERR_NOT_IMPLEMENTED; -} - -static int isolated_put(opal_pmix_scope_t scope, - opal_value_t *kv) -{ - int rc; - - opal_output_verbose(2, opal_pmix_base_framework.framework_output, - "%s pmix:isolated isolated_put key %s scope %d", - OPAL_NAME_PRINT(OPAL_PROC_MY_NAME), kv->key, scope); - - OPAL_PMIX_ACQUIRE_THREAD(&opal_pmix_base.lock); - if (0 == isolated_init_count) { - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - return OPAL_ERROR; - } - OPAL_PMIX_RELEASE_THREAD(&opal_pmix_base.lock); - - rc = opal_pmix_base_store(&isolated_pname, kv); - - return rc; -} - -static int isolated_commit(void) -{ - opal_output_verbose(2, opal_pmix_base_framework.framework_output, - "%s pmix:isolated isolated commit", - OPAL_NAME_PRINT(OPAL_PROC_MY_NAME)); - - return OPAL_SUCCESS; -} - -static int isolated_fence(opal_list_t *procs, int collect_data) -{ - opal_output_verbose(2, opal_pmix_base_framework.framework_output, - "%s pmix:isolated isolated fence", - OPAL_NAME_PRINT(OPAL_PROC_MY_NAME)); - return OPAL_SUCCESS; -} - -static int isolated_fence_nb(opal_list_t *procs, int collect_data, - opal_pmix_op_cbfunc_t cbfunc, void *cbdata) -{ - opal_output_verbose(2, opal_pmix_base_framework.framework_output, - "%s pmix:isolated isolated fence_nb", - OPAL_NAME_PRINT(OPAL_PROC_MY_NAME)); - if (NULL != cbfunc) { - cbfunc(OPAL_SUCCESS, cbdata); - } - return OPAL_SUCCESS; -} - -static int isolated_get(const opal_process_name_t *id, - const char *key, opal_list_t *info, - opal_value_t **kv) -{ - int rc; - opal_list_t vals; - - opal_output_verbose(2, opal_pmix_base_framework.framework_output, - "%s pmix:isolated getting value for proc %s key %s", - OPAL_NAME_PRINT(OPAL_PROC_MY_NAME), - OPAL_NAME_PRINT(*id), key); - - OBJ_CONSTRUCT(&vals, opal_list_t); - rc = opal_pmix_base_fetch(id, key, &vals); - if (OPAL_SUCCESS == rc) { - *kv = (opal_value_t*)opal_list_remove_first(&vals); - return OPAL_SUCCESS; - } else { - opal_output_verbose(2, opal_pmix_base_framework.framework_output, - "%s pmix:isolated fetch from dstore failed: %d", - OPAL_NAME_PRINT(OPAL_PROC_MY_NAME), rc); - } - OPAL_LIST_DESTRUCT(&vals); - - return rc; -} -static int isolated_get_nb(const opal_process_name_t *id, const char *key, - opal_list_t *info, opal_pmix_value_cbfunc_t cbfunc, void *cbdata) -{ - opal_output_verbose(2, opal_pmix_base_framework.framework_output, - "%s pmix:isolated isolated get_nb", - OPAL_NAME_PRINT(OPAL_PROC_MY_NAME)); - return OPAL_ERR_NOT_IMPLEMENTED; -} - -static int isolated_publish(opal_list_t *info) -{ - opal_output_verbose(2, opal_pmix_base_framework.framework_output, - "%s pmix:isolated isolated publish", - OPAL_NAME_PRINT(OPAL_PROC_MY_NAME)); - return OPAL_ERR_NOT_SUPPORTED; -} - -static int isolated_publish_nb(opal_list_t *info, - opal_pmix_op_cbfunc_t cbfunc, void *cbdata) -{ - opal_output_verbose(2, opal_pmix_base_framework.framework_output, - "%s pmix:isolated isolated publish_nb", - OPAL_NAME_PRINT(OPAL_PROC_MY_NAME)); - return OPAL_ERR_NOT_SUPPORTED; -} - -static int isolated_lookup(opal_list_t *data, opal_list_t *info) -{ - opal_output_verbose(2, opal_pmix_base_framework.framework_output, - "%s pmix:isolated isolated lookup", - OPAL_NAME_PRINT(OPAL_PROC_MY_NAME)); - return OPAL_ERR_NOT_SUPPORTED; -} - -static int isolated_lookup_nb(char **keys, opal_list_t *info, - opal_pmix_lookup_cbfunc_t cbfunc, void *cbdata) -{ - opal_output_verbose(2, opal_pmix_base_framework.framework_output, - "%s pmix:isolated isolated lookup_nb", - OPAL_NAME_PRINT(OPAL_PROC_MY_NAME)); - return OPAL_ERR_NOT_SUPPORTED; -} - -static int isolated_unpublish(char **keys, opal_list_t *info) -{ - opal_output_verbose(2, opal_pmix_base_framework.framework_output, - "%s pmix:isolated isolated unpublish", - OPAL_NAME_PRINT(OPAL_PROC_MY_NAME)); - return OPAL_ERR_NOT_SUPPORTED; -} - -static int isolated_unpublish_nb(char **keys, opal_list_t *info, - opal_pmix_op_cbfunc_t cbfunc, void *cbdata) -{ - opal_output_verbose(2, opal_pmix_base_framework.framework_output, - "%s pmix:isolated isolated unpublish_nb", - OPAL_NAME_PRINT(OPAL_PROC_MY_NAME)); - return OPAL_ERR_NOT_SUPPORTED; -} - -static const char *isolated_get_version(void) -{ - return "N/A"; -} - -static int isolated_store_local(const opal_process_name_t *proc, - opal_value_t *val) -{ - opal_output_verbose(2, opal_pmix_base_framework.framework_output, - "%s pmix:isolated isolated store_local", - OPAL_NAME_PRINT(OPAL_PROC_MY_NAME)); - - opal_pmix_base_store(proc, val); - - return OPAL_SUCCESS; -} - -static const char *isolated_get_nspace(opal_jobid_t jobid) -{ - return "N/A"; -} - -static void isolated_register_jobid(opal_jobid_t jobid, const char *nspace) -{ - return; -} diff --git a/opal/mca/pmix/isolated/pmix_isolated.h b/opal/mca/pmix/isolated/pmix_isolated.h deleted file mode 100644 index f66c657d1d0..00000000000 --- a/opal/mca/pmix/isolated/pmix_isolated.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (c) 2016 Intel, Inc. All rights reserved. - * $COPYRIGHT$ - * - * Additional copyrights may follow - * - * $HEADER$ - */ - -#ifndef MCA_PMIX_ISOLATED_H -#define MCA_PMIX_ISOLATED_H - -#include "opal_config.h" - -#include "opal/mca/mca.h" -#include "opal/mca/pmix/pmix.h" - - -BEGIN_C_DECLS - -OPAL_DECLSPEC extern opal_pmix_base_component_t mca_pmix_isolated_component; - -OPAL_DECLSPEC extern const opal_pmix_base_module_t opal_pmix_isolated_module; - - -END_C_DECLS - -#endif /* MCA_PMIX_ISOLATED_H */ diff --git a/opal/mca/pmix/isolated/pmix_isolated_component.c b/opal/mca/pmix/isolated/pmix_isolated_component.c deleted file mode 100644 index c9f04c6989c..00000000000 --- a/opal/mca/pmix/isolated/pmix_isolated_component.c +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Copyright (c) 2016 Intel, Inc. All rights reserved. - * Copyright (c) 2016 Cisco Systems, 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 "opal_config.h" - -#include "opal/constants.h" -#include "opal/class/opal_list.h" -#include "opal/util/proc.h" -#include "opal/mca/pmix/pmix.h" -#include "pmix_isolated.h" - -/* - * Public string showing the pmix isolated component version number - */ -const char *opal_pmix_isolated_component_version_string = - "OPAL isolated pmix MCA component version " OPAL_VERSION; - -/* - * Local function - */ -static int isolated_open(void); -static int isolated_close(void); -static int isolated_component_query(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 - */ - -opal_pmix_base_component_t mca_pmix_isolated_component = { - .base_version = { - /* Indicate that we are a pmix v1.1.0 component (which also - implies a specific MCA version) */ - - OPAL_PMIX_BASE_VERSION_2_0_0, - - /* Component name and version */ - - .mca_component_name = "isolated", - MCA_BASE_MAKE_VERSION(component, OPAL_MAJOR_VERSION, OPAL_MINOR_VERSION, - OPAL_RELEASE_VERSION), - - /* Component open and close functions */ - - .mca_open_component = isolated_open, - .mca_close_component = isolated_close, - .mca_query_component = isolated_component_query, - }, - /* Next the MCA v1.0.0 component meta data */ - .base_data = { - /* The component is checkpoint ready */ - MCA_BASE_METADATA_PARAM_CHECKPOINT - } -}; - -static int isolated_open(void) -{ - return OPAL_SUCCESS; -} - -static int isolated_close(void) -{ - return OPAL_SUCCESS; -} - - -static int isolated_component_query(mca_base_module_t **module, int *priority) -{ - /* ignore us unless requested */ - *priority = 0; - *module = (mca_base_module_t *)&opal_pmix_isolated_module; - return OPAL_SUCCESS; -} diff --git a/opal/mca/pmix/pmix-internal.h b/opal/mca/pmix/pmix-internal.h new file mode 100644 index 00000000000..3094c4d8aad --- /dev/null +++ b/opal/mca/pmix/pmix-internal.h @@ -0,0 +1,550 @@ +/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ +/* + * Copyright (c) 2014-2019 Intel, Inc. All rights reserved. + * Copyright (c) 2015 Los Alamos National Security, LLC. All rights + * reserved. + * Copyright (c) 2019 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +#ifndef OPAL_PMIX_H +#define OPAL_PMIX_H + +#include "opal_config.h" +#include "opal/types.h" + +#ifdef HAVE_SYS_UN_H +#include +#endif + +#include "opal/mca/mca.h" +#include "opal/mca/event/event.h" +#include "opal/dss/dss.h" +#include "opal/runtime/opal.h" +#include "opal/dss/dss.h" +#include "opal/util/error.h" +#include "opal/util/proc.h" +#include "opal/hash_string.h" + +/* include implementation to call */ +#include MCA_pmix_IMPLEMENTATION_HEADER + + +BEGIN_C_DECLS + +/* provide access to the framework verbose output without + * exposing the entire base */ +OPAL_DECLSPEC extern bool opal_pmix_collect_all_data; +OPAL_DECLSPEC extern bool opal_pmix_base_async_modex; +OPAL_DECLSPEC extern int opal_pmix_verbose_output; + +/* define a caddy for pointing to pmix_info_t that + * are to be included in an answer */ +typedef struct { + opal_list_item_t super; + pmix_proc_t source; + pmix_info_t *info; + pmix_persistence_t persistence; +} opal_ds_info_t; +OBJ_CLASS_DECLARATION(opal_ds_info_t); + +/* define another caddy for putting statically defined + * pmix_info_t objects on a list */ +typedef struct { + opal_list_item_t super; + pmix_info_t info; +} opal_info_item_t; +OBJ_CLASS_DECLARATION(opal_info_item_t); + + +typedef struct { + opal_mutex_t mutex; + pthread_cond_t cond; + volatile bool active; + int status; + char *msg; +} opal_pmix_lock_t; + +#define opal_pmix_condition_wait(a,b) pthread_cond_wait(a, &(b)->m_lock_pthread) + +#define OPAL_PMIX_CONSTRUCT_LOCK(l) \ + do { \ + OBJ_CONSTRUCT(&(l)->mutex, opal_mutex_t); \ + pthread_cond_init(&(l)->cond, NULL); \ + (l)->active = true; \ + (l)->status = 0; \ + (l)->msg = NULL; \ + OPAL_POST_OBJECT((l)); \ + } while(0) + +#define OPAL_PMIX_DESTRUCT_LOCK(l) \ + do { \ + OPAL_ACQUIRE_OBJECT((l)); \ + OBJ_DESTRUCT(&(l)->mutex); \ + pthread_cond_destroy(&(l)->cond); \ + if (NULL != (l)->msg) { \ + free((l)->msg); \ + } \ + } while(0) + + +#if OPAL_ENABLE_DEBUG +#define OPAL_PMIX_ACQUIRE_THREAD(lck) \ + do { \ + opal_mutex_lock(&(lck)->mutex); \ + if (opal_debug_threads) { \ + opal_output(0, "Waiting for thread %s:%d", \ + __FILE__, __LINE__); \ + } \ + while ((lck)->active) { \ + opal_pmix_condition_wait(&(lck)->cond, &(lck)->mutex); \ + } \ + if (opal_debug_threads) { \ + opal_output(0, "Thread obtained %s:%d", \ + __FILE__, __LINE__); \ + } \ + (lck)->active = true; \ + } while(0) +#else +#define OPAL_PMIX_ACQUIRE_THREAD(lck) \ + do { \ + opal_mutex_lock(&(lck)->mutex); \ + while ((lck)->active) { \ + opal_pmix_condition_wait(&(lck)->cond, &(lck)->mutex); \ + } \ + (lck)->active = true; \ + } while(0) +#endif + + +#if OPAL_ENABLE_DEBUG +#define OPAL_PMIX_WAIT_THREAD(lck) \ + do { \ + opal_mutex_lock(&(lck)->mutex); \ + if (opal_debug_threads) { \ + opal_output(0, "Waiting for thread %s:%d", \ + __FILE__, __LINE__); \ + } \ + while ((lck)->active) { \ + opal_pmix_condition_wait(&(lck)->cond, &(lck)->mutex); \ + } \ + if (opal_debug_threads) { \ + opal_output(0, "Thread obtained %s:%d", \ + __FILE__, __LINE__); \ + } \ + OPAL_ACQUIRE_OBJECT(&lck); \ + opal_mutex_unlock(&(lck)->mutex); \ + } while(0) +#else +#define OPAL_PMIX_WAIT_THREAD(lck) \ + do { \ + opal_mutex_lock(&(lck)->mutex); \ + while ((lck)->active) { \ + opal_pmix_condition_wait(&(lck)->cond, &(lck)->mutex); \ + } \ + OPAL_ACQUIRE_OBJECT(lck); \ + opal_mutex_unlock(&(lck)->mutex); \ + } while(0) +#endif + + +#if OPAL_ENABLE_DEBUG +#define OPAL_PMIX_RELEASE_THREAD(lck) \ + do { \ + if (opal_debug_threads) { \ + opal_output(0, "Releasing thread %s:%d", \ + __FILE__, __LINE__); \ + } \ + (lck)->active = false; \ + pthread_cond_broadcast(&(lck)->cond); \ + opal_mutex_unlock(&(lck)->mutex); \ + } while(0) +#else +#define OPAL_PMIX_RELEASE_THREAD(lck) \ + do { \ + assert(0 != opal_mutex_trylock(&(lck)->mutex)); \ + (lck)->active = false; \ + pthread_cond_broadcast(&(lck)->cond); \ + opal_mutex_unlock(&(lck)->mutex); \ + } while(0) +#endif + + +#define OPAL_PMIX_WAKEUP_THREAD(lck) \ + do { \ + opal_mutex_lock(&(lck)->mutex); \ + (lck)->active = false; \ + OPAL_POST_OBJECT(lck); \ + pthread_cond_broadcast(&(lck)->cond); \ + opal_mutex_unlock(&(lck)->mutex); \ + } while(0) + +/* + * Count the fash for the the external RM + */ +#define OPAL_HASH_JOBID( str, hash ){ \ + OPAL_HASH_STR( str, hash ); \ + hash &= ~(0x8000); \ +} + +/** + * Provide a simplified macro for sending data via modex + * to other processes. The macro requires four arguments: + * + * r - the integer return status from the modex op + * sc - the PMIX scope of the data + * s - the key to tag the data being posted + * d - pointer to the data object being posted + * t - the type of the data + */ +#define OPAL_MODEX_SEND_VALUE(r, sc, s, d, t) \ + do { \ + pmix_value_t _kv; \ + PMIX_VALUE_LOAD(&_kv, (d), (t)); \ + (r) = PMIx_Put((sc), (s), &(_kv)); \ + OPAL_ERROR_LOG((r)); \ + } while(0); + +/** + * Provide a simplified macro for sending data via modex + * to other processes. The macro requires four arguments: + * + * r - the integer return status from the modex op + * sc - the PMIX scope of the data + * s - the key to tag the data being posted + * d - the data object being posted + * sz - the number of bytes in the data object + */ +#define OPAL_MODEX_SEND_STRING(r, sc, s, d, sz) \ + do { \ + pmix_value_t _kv; \ + _kv.type = PMIX_BYTE_OBJECT; \ + _kv.data.bo.bytes = (char*)(d); \ + _kv.data.bo.size = (sz); \ + (r) = PMIx_Put(sc, (s), &(_kv)); \ + } while(0); + +/** + * Provide a simplified macro for sending data via modex + * to other processes. The macro requires four arguments: + * + * r - the integer return status from the modex op + * sc - the PMIX scope of the data + * s - the MCA component that is posting the data + * d - the data object being posted + * sz - the number of bytes in the data object + */ +#define OPAL_MODEX_SEND(r, sc, s, d, sz) \ + do { \ + char *_key; \ + _key = mca_base_component_to_string((s)); \ + OPAL_MODEX_SEND_STRING((r), (sc), _key, (d), (sz)); \ + free(_key); \ + } while(0); + +/** + * Provide a simplified macro for retrieving modex data + * from another process when we don't want the PMIx module + * to request it from the server if not found: + * + * r - the integer return status from the modex op (int) + * s - string key (char*) + * p - pointer to the opal_process_name_t of the proc that posted + * the data (opal_process_name_t*) + * d - pointer to a location wherein the data object + * is to be returned + * t - the expected data type + */ +#define OPAL_MODEX_RECV_VALUE_OPTIONAL(r, s, p, d, t) \ + do { \ + pmix_proc_t _proc; \ + pmix_value_t *_kv = NULL; \ + pmix_info_t _info; \ + size_t _sz; \ + OPAL_OUTPUT_VERBOSE((1, opal_pmix_verbose_output, \ + "%s[%s:%d] MODEX RECV VALUE OPTIONAL FOR PROC %s KEY %s", \ + OPAL_NAME_PRINT(OPAL_PROC_MY_NAME), \ + __FILE__, __LINE__, \ + OPAL_NAME_PRINT(*(p)), (s))); \ + OPAL_PMIX_CONVERT_NAME(&_proc, (p)); \ + PMIX_INFO_LOAD(&_info, PMIX_OPTIONAL, NULL, PMIX_BOOL); \ + (r) = PMIx_Get(&(_proc), (s), &(_info), 1, &(_kv)); \ + if (NULL == _kv) { \ + (r) = PMIX_ERR_NOT_FOUND; \ + } else if (_kv->type != (t)) { \ + (r) = PMIX_ERR_TYPE_MISMATCH; \ + } else if (PMIX_SUCCESS == (r)) { \ + PMIX_VALUE_UNLOAD((r), _kv, (void**)(d), &_sz); \ + } \ + if (NULL != _kv) { \ + PMIX_VALUE_RELEASE(_kv); \ + } \ + } while(0); + +/** + * Provide a simplified macro for retrieving modex data + * from another process when we want the PMIx module + * to request it from the server if not found, but do not + * want the server to go find it if the server doesn't + * already have it: + * + * r - the integer return status from the modex op (int) + * s - string key (char*) + * p - pointer to the opal_process_name_t of the proc that posted + * the data (opal_process_name_t*) + * d - pointer to a location wherein the data object + * is to be returned + * t - the expected data type + */ +#define OPAL_MODEX_RECV_VALUE_IMMEDIATE(r, s, p, d, t) \ + do { \ + pmix_proc_t _proc; \ + pmix_value_t *_kv = NULL; \ + pmix_info_t _info; \ + size_t _sz; \ + OPAL_OUTPUT_VERBOSE((1, opal_pmix_verbose_output, \ + "%s[%s:%d] MODEX RECV VALUE OPTIONAL FOR PROC %s KEY %s", \ + OPAL_NAME_PRINT(OPAL_PROC_MY_NAME), \ + __FILE__, __LINE__, \ + OPAL_NAME_PRINT(*(p)), (s))); \ + OPAL_PMIX_CONVERT_NAME(&_proc, (p)); \ + PMIX_INFO_LOAD(&_info, PMIX_IMMEDIATE, NULL, PMIX_BOOL); \ + (r) = PMIx_Get(&(_proc), (s), &(_info), 1, &(_kv)); \ + if (NULL == _kv) { \ + (r) = PMIX_ERR_NOT_FOUND; \ + } else if (_kv->type != (t)) { \ + (r) = PMIX_ERR_TYPE_MISMATCH; \ + } else if (PMIX_SUCCESS == (r)) { \ + PMIX_VALUE_UNLOAD((r), _kv, (void**)(d), &_sz); \ + } \ + if (NULL != _kv) { \ + PMIX_VALUE_RELEASE(_kv); \ + } \ + } while(0); + +/** + * Provide a simplified macro for retrieving modex data + * from another process: + * + * r - the integer return status from the modex op (int) + * s - string key (char*) + * p - pointer to the opal_process_name_t of the proc that posted + * the data (opal_process_name_t*) + * d - pointer to a location wherein the data object + * is to be returned + * t - the expected data type + */ +#define OPAL_MODEX_RECV_VALUE(r, s, p, d, t) \ + do { \ + pmix_proc_t _proc; \ + pmix_value_t *_kv = NULL; \ + size_t _sz; \ + OPAL_OUTPUT_VERBOSE((1, opal_pmix_verbose_output, \ + "%s[%s:%d] MODEX RECV VALUE FOR PROC %s KEY %s", \ + OPAL_NAME_PRINT(OPAL_PROC_MY_NAME), \ + __FILE__, __LINE__, \ + OPAL_NAME_PRINT(*(p)), (s))); \ + OPAL_PMIX_CONVERT_NAME(&_proc, (p)); \ + (r) = PMIx_Get(&(_proc), (s), NULL, 0, &(_kv)); \ + if (NULL == _kv) { \ + (r) = PMIX_ERR_NOT_FOUND; \ + } else if (_kv->type != (t)) { \ + (r) = PMIX_ERR_TYPE_MISMATCH; \ + } else if (PMIX_SUCCESS == (r)) { \ + PMIX_VALUE_UNLOAD((r), _kv, (void**)(d), &_sz); \ + } \ + if (NULL != _kv) { \ + PMIX_VALUE_RELEASE(_kv); \ + } \ + } while(0); + +/** + * Provide a simplified macro for retrieving modex data + * from another process: + * + * r - the integer return status from the modex op (int) + * s - string key (char*) + * p - pointer to the opal_process_name_t of the proc that posted + * the data (opal_process_name_t*) + * d - pointer to a location wherein the data object + * it to be returned (char**) + * sz - pointer to a location wherein the number of bytes + * in the data object can be returned (size_t) + */ +#define OPAL_MODEX_RECV_STRING(r, s, p, d, sz) \ + do { \ + pmix_proc_t _proc; \ + pmix_value_t *_kv = NULL; \ + OPAL_OUTPUT_VERBOSE((1, opal_pmix_verbose_output, \ + "%s[%s:%d] MODEX RECV STRING FOR PROC %s KEY %s", \ + OPAL_NAME_PRINT(OPAL_PROC_MY_NAME), \ + __FILE__, __LINE__, \ + OPAL_NAME_PRINT(*(p)), (s))); \ + *(d) = NULL; \ + *(sz) = 0; \ + OPAL_PMIX_CONVERT_NAME(&_proc, (p)); \ + (r) = PMIx_Get(&(_proc), (s), NULL, 0, &(_kv)); \ + if (NULL == _kv) { \ + (r) = PMIX_ERR_NOT_FOUND; \ + } else if (PMIX_SUCCESS == (r)) { \ + *(d) = (uint8_t*)_kv->data.bo.bytes; \ + *(sz) = _kv->data.bo.size; \ + _kv->data.bo.bytes = NULL; /* protect the data */ \ + } \ + if (NULL != _kv) { \ + PMIX_VALUE_RELEASE(_kv); \ + } \ + } while(0); + +/** + * Provide a simplified macro for retrieving modex data + * from another process: + * + * r - the integer return status from the modex op (int) + * s - the MCA component that posted the data (mca_base_component_t*) + * p - pointer to the opal_process_name_t of the proc that posted + * the data (opal_process_name_t*) + * d - pointer to a location wherein the data object + * it to be returned (char**) + * sz - pointer to a location wherein the number of bytes + * in the data object can be returned (size_t) + */ +#define OPAL_MODEX_RECV(r, s, p, d, sz) \ + do { \ + char *_key; \ + _key = mca_base_component_to_string((s)); \ + OPAL_OUTPUT_VERBOSE((1, opal_pmix_verbose_output, \ + "%s[%s:%d] MODEX RECV FOR PROC %s KEY %s", \ + OPAL_NAME_PRINT(OPAL_PROC_MY_NAME), \ + __FILE__, __LINE__, \ + OPAL_NAME_PRINT(*(p)), _key)); \ + if (NULL == _key) { \ + OPAL_ERROR_LOG(OPAL_ERR_OUT_OF_RESOURCE); \ + (r) = OPAL_ERR_OUT_OF_RESOURCE; \ + } else { \ + OPAL_MODEX_RECV_STRING((r), _key, (p), (d), (sz)); \ + free(_key); \ + } \ + } while(0); + +#define PMIX_ERROR_LOG(r) \ + opal_output(0, "[%s:%d] PMIx Error: %s", __FILE__, __LINE__, PMIx_Error_string((r))) + +#define OPAL_PMIX_SHOW_HELP "opal.show.help" + +/* some helper functions */ +OPAL_DECLSPEC pmix_proc_state_t opal_pmix_convert_state(int state); +OPAL_DECLSPEC int opal_pmix_convert_pstate(pmix_proc_state_t); +OPAL_DECLSPEC pmix_status_t opal_pmix_convert_rc(int rc); +OPAL_DECLSPEC int opal_pmix_convert_status(pmix_status_t status); + +#define OPAL_PMIX_CONVERT_JOBID(n, j) \ + (void)opal_snprintf_jobid((n), PMIX_MAX_NSLEN, (j)) + +#define OPAL_PMIX_CONVERT_VPID(r, v) \ + do { \ + if (OPAL_VPID_WILDCARD == (v)) { \ + (r) = PMIX_RANK_WILDCARD; \ + } else { \ + (r) = (v); \ + } \ + } while(0) +#define OPAL_PMIX_CONVERT_NAME(p, n) \ + do { \ + OPAL_PMIX_CONVERT_JOBID((p)->nspace, (n)->jobid); \ + OPAL_PMIX_CONVERT_VPID((p)->rank, (n)->vpid); \ + } while(0) + + +#define OPAL_PMIX_CONVERT_NSPACE(r, j, n) \ + (r) = opal_convert_string_to_jobid((j), (n)) + +#define OPAL_PMIX_CONVERT_RANK(v, r) \ + do { \ + if (PMIX_RANK_WILDCARD == (r)) { \ + (v) = OPAL_VPID_WILDCARD; \ + } else { \ + (v) = (r); \ + } \ + } while(0) + +#define OPAL_PMIX_CONVERT_PROCT(r, n, p) \ + do { \ + OPAL_PMIX_CONVERT_NSPACE((r), &(n)->jobid, (p)->nspace); \ + if (OPAL_SUCCESS == (r)) { \ + OPAL_PMIX_CONVERT_RANK((n)->vpid, (p)->rank); \ + } \ + } while(0) + +OPAL_DECLSPEC void opal_pmix_value_load(pmix_value_t *v, + opal_value_t *kv); + +OPAL_DECLSPEC int opal_pmix_value_unload(opal_value_t *kv, + const pmix_value_t *v); + +OPAL_DECLSPEC int opal_pmix_register_cleanup(char *path, + bool directory, + bool ignore, + bool jobscope); + +/* protect against early versions of PMIx */ +#if PMIX_VERSION_MAJOR == 3 +#if PMIX_VERSION_MINOR == 0 +#if PMIX_VERSION_RELEASE == 0 +#define PMIX_NUMERIC_VERSION 0x00030000 +#define PMIX_OPERATION_SUCCEEDED (PMIX_ERR_OP_BASE - 27) +#elif PMIX_VERSION_RELEASE == 2 +#undef PMIX_NUMERIC_VERSION +#define PMIX_NUMERIC_VERSION 0x00030002 +#endif +#define PMIX_LOAD_KEY(a, b) \ + do { \ + memset((a), 0, PMIX_MAX_KEYLEN+1); \ + pmix_strncpy((a), (b), PMIX_MAX_KEYLEN); \ + }while(0) +#if PMIX_VERSION_RELEASE < 2 +#define PMIX_CHECK_KEY(a, b) \ + (0 == strncmp((a)->key, (b), PMIX_MAX_KEYLEN)) +#endif +#elif PMIX_VERSION_MINOR == 1 +#if PMIX_VERSION_RELEASE == 1 +#undef PMIX_NUMERIC_VERSION +#define PMIX_NUMERIC_VERSION 0x00030101 +#elif PMIX_VERSION_RELEASE == 2 +#undef PMIX_NUMERIC_VERSION +#define PMIX_NUMERIC_VERSION 0x00030102 +#endif +#endif +#endif + +/** + * Structure for pmix components. + */ +struct opal_pmix_base_component_2_0_0_t { + /** MCA base component */ + mca_base_component_t base_version; + /** MCA base data */ + mca_base_component_data_t base_data; +}; + +/** + * Convenience typedef + */ +typedef struct opal_pmix_base_component_2_0_0_t opal_pmix_base_component_2_0_0_t; +typedef struct opal_pmix_base_component_2_0_0_t opal_pmix_component_t; + +/** + * Macro for use in components that are of type hwloc + */ +#define OPAL_PMIX_BASE_VERSION_2_0_0 \ + OPAL_MCA_BASE_VERSION_2_1_0("pmix", 2, 0, 0) + + +END_C_DECLS + +#endif diff --git a/opal/mca/pmix/pmix.h b/opal/mca/pmix/pmix.h deleted file mode 100644 index 3f9fc11dc70..00000000000 --- a/opal/mca/pmix/pmix.h +++ /dev/null @@ -1,989 +0,0 @@ -/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ -/* - * Copyright (c) 2014-2018 Intel, Inc. All rights reserved. - * Copyright (c) 2015 Los Alamos National Security, LLC. All rights - * reserved. - * $COPYRIGHT$ - * - * Additional copyrights may follow - * - * $HEADER$ - */ - -#ifndef OPAL_PMIX_H -#define OPAL_PMIX_H - -#include "opal_config.h" -#include "opal/types.h" - -#ifdef HAVE_SYS_UN_H -#include -#endif - -#include "opal/mca/mca.h" -#include "opal/mca/event/event.h" -#include "opal/dss/dss.h" -#include "opal/runtime/opal.h" -#include "opal/dss/dss.h" -#include "opal/util/error.h" -#include "opal/util/proc.h" -#include "opal/hash_string.h" - -#include "opal/mca/pmix/pmix_types.h" -#include "opal/mca/pmix/pmix_server.h" - -BEGIN_C_DECLS - -/* provide access to the framework verbose output without - * exposing the entire base */ -extern int opal_pmix_verbose_output; -extern bool opal_pmix_collect_all_data; -extern bool opal_pmix_base_async_modex; -extern int opal_pmix_base_exchange(opal_value_t *info, - opal_pmix_pdata_t *pdat, - int timeout); - -/* - * Count the fash for the the external RM - */ -#define OPAL_HASH_JOBID( str, hash ){ \ - OPAL_HASH_STR( str, hash ); \ - hash &= ~(0x8000); \ -} - -/** - * Provide a simplified macro for sending data via modex - * to other processes. The macro requires four arguments: - * - * r - the integer return status from the modex op - * sc - the PMIX scope of the data - * s - the key to tag the data being posted - * d - pointer to the data object being posted - * t - the type of the data - */ -#define OPAL_MODEX_SEND_VALUE(r, sc, s, d, t) \ - do { \ - opal_value_t _kv; \ - OBJ_CONSTRUCT(&(_kv), opal_value_t); \ - _kv.key = (s); \ - if (OPAL_SUCCESS != ((r) = opal_value_load(&(_kv), (d), (t)))) { \ - OPAL_ERROR_LOG((r)); \ - } else { \ - if (OPAL_SUCCESS != ((r) = opal_pmix.put(sc, &(_kv)))) { \ - OPAL_ERROR_LOG((r)); \ - } \ - } \ - /* opal_value_load makes a copy of the data, so release it */ \ - _kv.key = NULL; \ - OBJ_DESTRUCT(&(_kv)); \ - } while(0); - -/** - * Provide a simplified macro for sending data via modex - * to other processes. The macro requires four arguments: - * - * r - the integer return status from the modex op - * sc - the PMIX scope of the data - * s - the key to tag the data being posted - * d - the data object being posted - * sz - the number of bytes in the data object - */ -#define OPAL_MODEX_SEND_STRING(r, sc, s, d, sz) \ - do { \ - opal_value_t _kv; \ - OBJ_CONSTRUCT(&(_kv), opal_value_t); \ - _kv.key = (s); \ - _kv.type = OPAL_BYTE_OBJECT; \ - _kv.data.bo.bytes = (uint8_t*)(d); \ - _kv.data.bo.size = (sz); \ - if (OPAL_SUCCESS != ((r) = opal_pmix.put(sc, &(_kv)))) { \ - OPAL_ERROR_LOG((r)); \ - } \ - _kv.data.bo.bytes = NULL; /* protect the data */ \ - _kv.key = NULL; /* protect the key */ \ - OBJ_DESTRUCT(&(_kv)); \ - } while(0); - -/** - * Provide a simplified macro for sending data via modex - * to other processes. The macro requires four arguments: - * - * r - the integer return status from the modex op - * sc - the PMIX scope of the data - * s - the MCA component that is posting the data - * d - the data object being posted - * sz - the number of bytes in the data object - */ -#define OPAL_MODEX_SEND(r, sc, s, d, sz) \ - do { \ - char *_key; \ - _key = mca_base_component_to_string((s)); \ - OPAL_MODEX_SEND_STRING((r), (sc), _key, (d), (sz)); \ - free(_key); \ - } while(0); - -/** - * Provide a simplified macro for retrieving modex data - * from another process when we don't want the PMIx module - * to request it from the server if not found: - * - * r - the integer return status from the modex op (int) - * s - string key (char*) - * p - pointer to the opal_process_name_t of the proc that posted - * the data (opal_process_name_t*) - * d - pointer to a location wherein the data object - * is to be returned - * t - the expected data type - */ -#define OPAL_MODEX_RECV_VALUE_OPTIONAL(r, s, p, d, t) \ - do { \ - opal_value_t *_kv, *_info; \ - opal_list_t _ilist; \ - OPAL_OUTPUT_VERBOSE((1, opal_pmix_verbose_output, \ - "%s[%s:%d] MODEX RECV VALUE OPTIONAL FOR PROC %s KEY %s", \ - OPAL_NAME_PRINT(OPAL_PROC_MY_NAME), \ - __FILE__, __LINE__, \ - OPAL_NAME_PRINT(*(p)), (s))); \ - OBJ_CONSTRUCT(&(_ilist), opal_list_t); \ - _info = OBJ_NEW(opal_value_t); \ - _info->key = strdup(OPAL_PMIX_OPTIONAL); \ - _info->type = OPAL_BOOL; \ - _info->data.flag = true; \ - opal_list_append(&(_ilist), &(_info)->super); \ - if (OPAL_SUCCESS == ((r) = opal_pmix.get((p), (s), &(_ilist), &(_kv)))) { \ - if (NULL == _kv) { \ - (r) = OPAL_ERR_NOT_FOUND; \ - } else { \ - (r) = opal_value_unload(_kv, (void**)(d), (t)); \ - OBJ_RELEASE(_kv); \ - } \ - } \ - OPAL_LIST_DESTRUCT(&(_ilist)); \ - } while(0); - -/** - * Provide a simplified macro for retrieving modex data - * from another process when we want the PMIx module - * to request it from the server if not found, but do not - * want the server to go find it if the server doesn't - * already have it: - * - * r - the integer return status from the modex op (int) - * s - string key (char*) - * p - pointer to the opal_process_name_t of the proc that posted - * the data (opal_process_name_t*) - * d - pointer to a location wherein the data object - * is to be returned - * t - the expected data type - */ -#define OPAL_MODEX_RECV_VALUE_IMMEDIATE(r, s, p, d, t) \ - do { \ - opal_value_t *_kv, *_info; \ - opal_list_t _ilist; \ - opal_output_verbose(1, opal_pmix_verbose_output, \ - "%s[%s:%d] MODEX RECV VALUE IMMEDIATE FOR PROC %s KEY %s", \ - OPAL_NAME_PRINT(OPAL_PROC_MY_NAME), \ - __FILE__, __LINE__, \ - OPAL_NAME_PRINT(*(p)), (s)); \ - OBJ_CONSTRUCT(&(_ilist), opal_list_t); \ - _info = OBJ_NEW(opal_value_t); \ - _info->key = strdup(OPAL_PMIX_IMMEDIATE); \ - _info->type = OPAL_BOOL; \ - _info->data.flag = true; \ - opal_list_append(&(_ilist), &(_info)->super); \ - if (OPAL_SUCCESS == ((r) = opal_pmix.get((p), (s), &(_ilist), &(_kv)))) { \ - if (NULL == _kv) { \ - (r) = OPAL_ERR_NOT_FOUND; \ - } else { \ - (r) = opal_value_unload(_kv, (void**)(d), (t)); \ - OBJ_RELEASE(_kv); \ - } \ - } \ - OPAL_LIST_DESTRUCT(&(_ilist)); \ - } while(0); - -/** - * Provide a simplified macro for retrieving modex data - * from another process: - * - * r - the integer return status from the modex op (int) - * s - string key (char*) - * p - pointer to the opal_process_name_t of the proc that posted - * the data (opal_process_name_t*) - * d - pointer to a location wherein the data object - * is to be returned - * t - the expected data type - */ -#define OPAL_MODEX_RECV_VALUE(r, s, p, d, t) \ - do { \ - opal_value_t *_kv; \ - OPAL_OUTPUT_VERBOSE((1, opal_pmix_verbose_output, \ - "%s[%s:%d] MODEX RECV VALUE FOR PROC %s KEY %s", \ - OPAL_NAME_PRINT(OPAL_PROC_MY_NAME), \ - __FILE__, __LINE__, \ - OPAL_NAME_PRINT(*(p)), (s))); \ - if (OPAL_SUCCESS == ((r) = opal_pmix.get((p), (s), NULL, &(_kv)))) { \ - if (NULL == _kv) { \ - (r) = OPAL_ERR_NOT_FOUND; \ - } else { \ - (r) = opal_value_unload(_kv, (void**)(d), (t)); \ - OBJ_RELEASE(_kv); \ - } \ - } \ - } while(0); - -/** - * Provide a simplified macro for retrieving modex data - * from another process: - * - * r - the integer return status from the modex op (int) - * s - string key (char*) - * p - pointer to the opal_process_name_t of the proc that posted - * the data (opal_process_name_t*) - * d - pointer to a location wherein the data object - * it to be returned (char**) - * sz - pointer to a location wherein the number of bytes - * in the data object can be returned (size_t) - */ -#define OPAL_MODEX_RECV_STRING(r, s, p, d, sz) \ - do { \ - opal_value_t *_kv; \ - OPAL_OUTPUT_VERBOSE((1, opal_pmix_verbose_output, \ - "%s[%s:%d] MODEX RECV STRING FOR PROC %s KEY %s", \ - OPAL_NAME_PRINT(OPAL_PROC_MY_NAME), \ - __FILE__, __LINE__, \ - OPAL_NAME_PRINT(*(p)), (s))); \ - if (OPAL_SUCCESS == ((r) = opal_pmix.get((p), (s), NULL, &(_kv)))) { \ - if (NULL == _kv) { \ - *(sz) = 0; \ - (r) = OPAL_ERR_NOT_FOUND; \ - } else { \ - *(d) = _kv->data.bo.bytes; \ - *(sz) = _kv->data.bo.size; \ - _kv->data.bo.bytes = NULL; /* protect the data */ \ - OBJ_RELEASE(_kv); \ - } \ - } else { \ - *(sz) = 0; \ - (r) = OPAL_ERR_NOT_FOUND; \ - } \ - } while(0); - -/** - * Provide a simplified macro for retrieving modex data - * from another process: - * - * r - the integer return status from the modex op (int) - * s - the MCA component that posted the data (mca_base_component_t*) - * p - pointer to the opal_process_name_t of the proc that posted - * the data (opal_process_name_t*) - * d - pointer to a location wherein the data object - * it to be returned (char**) - * sz - pointer to a location wherein the number of bytes - * in the data object can be returned (size_t) - */ -#define OPAL_MODEX_RECV(r, s, p, d, sz) \ - do { \ - char *_key; \ - _key = mca_base_component_to_string((s)); \ - OPAL_OUTPUT_VERBOSE((1, opal_pmix_verbose_output, \ - "%s[%s:%d] MODEX RECV FOR PROC %s KEY %s", \ - OPAL_NAME_PRINT(OPAL_PROC_MY_NAME), \ - __FILE__, __LINE__, \ - OPAL_NAME_PRINT(*(p)), _key)); \ - if (NULL == _key) { \ - OPAL_ERROR_LOG(OPAL_ERR_OUT_OF_RESOURCE); \ - (r) = OPAL_ERR_OUT_OF_RESOURCE; \ - } else { \ - OPAL_MODEX_RECV_STRING((r), _key, (p), (d), (sz)); \ - free(_key); \ - } \ - } while(0); - -/** - * Provide a macro for accessing a base function that exchanges - * data values between two procs using the PMIx Publish/Lookup - * APIs */ - #define OPAL_PMIX_EXCHANGE(r, i, p, t) \ - do { \ - OPAL_OUTPUT_VERBOSE((1, opal_pmix_verbose_output, \ - "%s[%s:%d] EXCHANGE %s WITH %s", \ - OPAL_NAME_PRINT(OPAL_PROC_MY_NAME), \ - __FILE__, __LINE__, \ - (i)->key, (p)->value.key)); \ - (r) = opal_pmix_base_exchange((i), (p), (t)); \ - } while(0); - - -/************************************************************ - * CLIENT APIs * - ************************************************************/ - -/* Initialize the PMIx client - * When called the client will check for the required connection - * information of the local server and will establish the connection. - * If the information is not found, or the server connection fails, then - * an appropriate error constant will be returned. - */ -typedef int (*opal_pmix_base_module_init_fn_t)(opal_list_t *ilist); - -/* Finalize the PMIx client, closing the connection to the local server. - * An error code will be returned if, for some reason, the connection - * cannot be closed. */ -typedef int (*opal_pmix_base_module_fini_fn_t)(void); - -/* Returns _true_ if the PMIx client has been successfully initialized, - * returns _false_ otherwise. Note that the function only reports the - * internal state of the PMIx client - it does not verify an active - * connection with the server, nor that the server is functional. */ -typedef int (*opal_pmix_base_module_initialized_fn_t)(void); - -/* Request that the provided list of opal_namelist_t procs be aborted, returning the - * provided _status_ and printing the provided message. A _NULL_ - * for the proc list indicates that all processes in the caller's - * nspace are to be aborted. - * - * The response to this request is somewhat dependent on the specific resource - * manager and its configuration (e.g., some resource managers will - * not abort the application if the provided _status_ is zero unless - * specifically configured to do so), and thus lies outside the control - * of PMIx itself. However, the client will inform the RM of - * the request that the application be aborted, regardless of the - * value of the provided _status_. - * - * Passing a _NULL_ msg parameter is allowed. Note that race conditions - * caused by multiple processes calling PMIx_Abort are left to the - * server implementation to resolve with regard to which status is - * returned and what messages (if any) are printed. - */ -typedef int (*opal_pmix_base_module_abort_fn_t)(int status, const char *msg, - opal_list_t *procs); - -/* Push all previously _PMIx_Put_ values to the local PMIx server. - * This is an asynchronous operation - the library will immediately - * return to the caller while the data is transmitted to the local - * server in the background */ -typedef int (*opal_pmix_base_module_commit_fn_t)(void); - -/* Execute a blocking barrier across the processes identified in the - * specified list of opal_namelist_t. Passing a _NULL_ pointer - * indicates that the barrier is to span all processes in the client's - * namespace. Each provided opal_namelist_t can pass PMIX_RANK_WILDCARD to - * indicate that all processes in the given jobid are - * participating. - * - * The _collect_data_ parameter is passed to the server to indicate whether - * or not the barrier operation is to return the _put_ data from all - * participating processes. A value of _false_ indicates that the callback - * is just used as a release and no data is to be returned at that time. A - * value of _true_ indicates that all _put_ data is to be collected by the - * barrier. Returned data is locally cached so that subsequent calls to _PMIx_Get_ - * can be serviced without communicating to/from the server, but at the cost - * of increased memory footprint - */ -typedef int (*opal_pmix_base_module_fence_fn_t)(opal_list_t *procs, int collect_data); - -/* Fence_nb */ -/* Non-blocking version of PMIx_Fence. Note that the function will return - * an error if a _NULL_ callback function is given. */ -typedef int (*opal_pmix_base_module_fence_nb_fn_t)(opal_list_t *procs, int collect_data, - opal_pmix_op_cbfunc_t cbfunc, void *cbdata); - -/* Push a value into the client's namespace. The client library will cache - * the information locally until _PMIx_Commit_ is called. The provided scope - * value is passed to the local PMIx server, which will distribute the data - * as directed. */ -typedef int (*opal_pmix_base_module_put_fn_t)(opal_pmix_scope_t scope, - opal_value_t *val); - -/* Retrieve information for the specified _key_ as published by the rank - * and jobid i the provided opal_process_name, and subject to any provided - * constraints, returning a pointer to the value in the given address. - * - * This is a blocking operation - the caller will block until - * the specified data has been _PMIx_Put_ by the specified rank. The caller is - * responsible for freeing all memory associated with the returned value when - * no longer required. */ -typedef int (*opal_pmix_base_module_get_fn_t)(const opal_process_name_t *proc, - const char *key, opal_list_t *info, - opal_value_t **val); - -/* Retrieve information for the specified _key_ as published by the given rank - * and jobid in the opal_process_name_t, and subject to any provided - * constraints. This is a non-blocking operation - the - * callback function will be executed once the specified data has been _PMIx_Put_ - * by the specified proc and retrieved by the local server. */ -typedef int (*opal_pmix_base_module_get_nb_fn_t)(const opal_process_name_t *proc, - const char *key, opal_list_t *info, - opal_pmix_value_cbfunc_t cbfunc, void *cbdata); - -/* Publish the given data to the "universal" nspace - * for lookup by others subject to the provided scope. - * Note that the keys must be unique within the specified - * scope or else an error will be returned (first published - * wins). Attempts to access the data by procs outside of - * the provided scope will be rejected. - * - * Note: Some host environments may support user/group level - * access controls on the information in addition to the scope. - * These can be specified in the info array using the appropriately - * defined keys. - * - * The persistence parameter instructs the server as to how long - * the data is to be retained, within the context of the scope. - * For example, data published within _PMIX_NAMESPACE_ will be - * deleted along with the namespace regardless of the persistence. - * However, data published within PMIX_USER would be retained if - * the persistence was set to _PMIX_PERSIST_SESSION_ until the - * allocation terminates. - * - * The blocking form will block until the server confirms that the - * data has been posted and is available. The non-blocking form will - * return immediately, executing the callback when the server confirms - * availability of the data */ -typedef int (*opal_pmix_base_module_publish_fn_t)(opal_list_t *info); -typedef int (*opal_pmix_base_module_publish_nb_fn_t)(opal_list_t *info, - opal_pmix_op_cbfunc_t cbfunc, void *cbdata); - -/* Lookup information published by another process within the - * specified scope. A scope of _PMIX_SCOPE_UNDEF_ requests that - * the search be conducted across _all_ namespaces. The "data" - * parameter consists of an array of pmix_pdata_t struct with the - * keys specifying the requested information. Data will be returned - * for each key in the associated info struct - any key that cannot - * be found will return with a data type of "PMIX_UNDEF". The function - * will return SUCCESS if _any_ values can be found, so the caller - * must check each data element to ensure it was returned. - * - * The proc field in each pmix_pdata_t struct will contain the - * nspace/rank of the process that published the data. - * - * Note: although this is a blocking function, it will _not_ wait - * for the requested data to be published. Instead, it will block - * for the time required by the server to lookup its current data - * and return any found items. Thus, the caller is responsible for - * ensuring that data is published prior to executing a lookup, or - * for retrying until the requested data is found */ -typedef int (*opal_pmix_base_module_lookup_fn_t)(opal_list_t *data, - opal_list_t *info); - -/* Non-blocking form of the _PMIx_Lookup_ function. Data for - * the provided NULL-terminated keys array will be returned - * in the provided callback function. The _wait_ parameter - * is used to indicate if the caller wishes the callback to - * wait for _all_ requested data before executing the callback - * (_true_), or to callback once the server returns whatever - * data is immediately available (_false_) */ -typedef int (*opal_pmix_base_module_lookup_nb_fn_t)(char **keys, opal_list_t *info, - opal_pmix_lookup_cbfunc_t cbfunc, void *cbdata); - -/* Unpublish data posted by this process using the given keys - * within the specified scope. The function will block until - * the data has been removed by the server. A value of _NULL_ - * for the keys parameter instructs the server to remove - * _all_ data published by this process within the given scope */ -typedef int (*opal_pmix_base_module_unpublish_fn_t)(char **keys, opal_list_t *info); - -/* Non-blocking form of the _PMIx_Unpublish_ function. The - * callback function will be executed once the server confirms - * removal of the specified data. A value of _NULL_ - * for the keys parameter instructs the server to remove - * _all_ data published by this process within the given scope */ -typedef int (*opal_pmix_base_module_unpublish_nb_fn_t)(char **keys, opal_list_t *info, - opal_pmix_op_cbfunc_t cbfunc, void *cbdata); - -/* Spawn a new job. The spawned applications are automatically - * connected to the calling process, and their assigned namespace - * is returned in the nspace parameter - a _NULL_ value in that - * location indicates that the caller doesn't wish to have the - * namespace returned. Behavior of individual resource managers - * may differ, but it is expected that failure of any application - * process to start will result in termination/cleanup of _all_ - * processes in the newly spawned job and return of an error - * code to the caller */ -typedef int (*opal_pmix_base_module_spawn_fn_t)(opal_list_t *job_info, - opal_list_t *apps, - opal_jobid_t *jobid); - -/* Non-blocking form of the _PMIx_Spawn_ function. The callback - * will be executed upon launch of the specified applications, - * or upon failure to launch any of them. */ -typedef int (*opal_pmix_base_module_spawn_nb_fn_t)(opal_list_t *job_info, - opal_list_t *apps, - opal_pmix_spawn_cbfunc_t cbfunc, - void *cbdata); - -/* Record the specified processes as "connected". Both blocking and non-blocking - * versions are provided. This means that the resource manager should treat the - * failure of any process in the specified group as a reportable event, and take - * appropriate action. Note that different resource managers may respond to - * failures in different manners. - * - * The list is to be provided as opal_namelist_t objects - * - * The callback function is to be called once all participating processes have - * called connect. The server is required to return any job-level info for the - * connecting processes that might not already have - i.e., if the connect - * request involves procs from different nspaces, then each proc shall receive - * the job-level info from those nspaces other than their own. - * - * Note: a process can only engage in _one_ connect operation involving the identical - * set of ranges at a time. However, a process _can_ be simultaneously engaged - * in multiple connect operations, each involving a different set of ranges */ -typedef int (*opal_pmix_base_module_connect_fn_t)(opal_list_t *procs); - -typedef int (*opal_pmix_base_module_connect_nb_fn_t)(opal_list_t *procs, - opal_pmix_op_cbfunc_t cbfunc, - void *cbdata); - -/* Disconnect a previously connected set of processes. An error will be returned - * if the specified set of procs was not previously "connected". As above, a process - * may be involved in multiple simultaneous disconnect operations. However, a process - * is not allowed to reconnect to a set of procs that has not fully completed - * disconnect - i.e., you have to fully disconnect before you can reconnect to the - * _same_ group of processes. */ -typedef int (*opal_pmix_base_module_disconnect_fn_t)(opal_list_t *procs); - -typedef int (*opal_pmix_base_module_disconnect_nb_fn_t)(opal_list_t *procs, - opal_pmix_op_cbfunc_t cbfunc, - void *cbdata); - -/* Given a node name, return an array of processes within the specified jobid - * on that node. If the jobid is OPAL_JOBID_WILDCARD, then all processes on the node will - * be returned. If the specified node does not currently host any processes, - * then the returned list will be empty. - */ -typedef int (*opal_pmix_base_module_resolve_peers_fn_t)(const char *nodename, - opal_jobid_t jobid, - opal_list_t *procs); - - -/* Given a jobid, return the list of nodes hosting processes within - * that jobid. The returned string will contain a comma-delimited list - * of nodenames. The caller is responsible for releasing the string - * when done with it */ -typedef int (*opal_pmix_base_module_resolve_nodes_fn_t)(opal_jobid_t jobid, char **nodelist); - - -/************************************************************ - * SERVER APIs * - * * - * These are calls that go down (or "south") from the ORTE * - * daemon into the PMIx server library * - ************************************************************/ - -/* Initialize the server support library - must pass the callback - * module for the server to use, plus any attributes we want to - * pass down to it */ -typedef int (*opal_pmix_base_module_server_init_fn_t)(opal_pmix_server_module_t *module, - opal_list_t *info); - -/* Finalize the server support library */ -typedef int (*opal_pmix_base_module_server_finalize_fn_t)(void); - -/* given a semicolon-separated list of input values, generate - * a regex that can be passed down to the client for parsing. - * The caller is responsible for free'ing the resulting - * string - * - * If values have leading zero's, then that is preserved. You - * have to add back any prefix/suffix for node names - * odin[009-015,017-023,076-086] - * - * "pmix:odin[009-015,017-023,076-086]" - * - * Note that the "pmix" at the beginning of each regex indicates - * that the PMIx native parser is to be used by the client for - * parsing the provided regex. Other parsers may be supported - see - * the pmix_client.h header for a list. - */ -typedef int (*opal_pmix_base_module_generate_regex_fn_t)(const char *input, char **regex); - -/* The input is expected to consist of a comma-separated list - * of ranges. Thus, an input of: - * "1-4;2-5;8,10,11,12;6,7,9" - * would generate a regex of - * "[pmix:2x(3);8,10-12;6-7,9]" - * - * Note that the "pmix" at the beginning of each regex indicates - * that the PMIx native parser is to be used by the client for - * parsing the provided regex. Other parsers may be supported - see - * the pmix_client.h header for a list. - */ -typedef int (*opal_pmix_base_module_generate_ppn_fn_t)(const char *input, char **ppn); - -/* Setup the data about a particular nspace so it can - * be passed to any child process upon startup. The PMIx - * connection procedure provides an opportunity for the - * host PMIx server to pass job-related info down to a - * child process. This might include the number of - * processes in the job, relative local ranks of the - * processes within the job, and other information of - * use to the process. The server is free to determine - * which, if any, of the supported elements it will - * provide - defined values are provided in pmix_common.h. - * - * NOTE: the server must register ALL nspaces that will - * participate in collective operations with local processes. - * This means that the server must register an nspace even - * if it will not host any local procs from within that - * nspace IF any local proc might at some point perform - * a collective operation involving one or more procs from - * that nspace. This is necessary so that the collective - * operation can know when it is locally complete. - * - * The caller must also provide the number of local procs - * that will be launched within this nspace. This is required - * for the PMIx server library to correctly handle collectives - * as a collective operation call can occur before all the - * procs have been started */ -typedef int (*opal_pmix_base_module_server_register_nspace_fn_t)(opal_jobid_t jobid, - int nlocalprocs, - opal_list_t *info, - opal_pmix_op_cbfunc_t cbfunc, - void *cbdata); - -/* Deregister an nspace. Instruct the PMIx server to purge - * all info relating to the provided jobid so that memory - * can be freed. Note that the server will automatically - * purge all info relating to any clients it has from - * this nspace */ -typedef void (*opal_pmix_base_module_server_deregister_nspace_fn_t)(opal_jobid_t jobid, - opal_pmix_op_cbfunc_t cbfunc, - void *cbdata); - -/* Register a client process with the PMIx server library. The - * expected user ID and group ID of the child process helps the - * server library to properly authenticate clients as they connect - * by requiring the two values to match. - * - * The host server can also, if it desires, provide an object - * it wishes to be returned when a server function is called - * that relates to a specific process. For example, the host - * server may have an object that tracks the specific client. - * Passing the object to the library allows the library to - * return that object when the client calls "finalize", thus - * allowing the host server to access the object without - * performing a lookup. */ -typedef int (*opal_pmix_base_module_server_register_client_fn_t)(const opal_process_name_t *proc, - uid_t uid, gid_t gid, - void *server_object, - opal_pmix_op_cbfunc_t cbfunc, - void *cbdata); - -/* Deregister a client. Instruct the PMIx server to purge - * all info relating to the provided client so that memory - * can be freed. As per above note, the server will automatically - * free all client-related data when the nspace is deregistered, - * so there is no need to call this function during normal - * finalize operations. Instead, this is provided for use - * during exception operations */ -typedef void (*opal_pmix_base_module_server_deregister_client_fn_t)(const opal_process_name_t *proc, - opal_pmix_op_cbfunc_t cbfunc, - void *cbdata); - -/* Setup the environment of a child process to be forked - * by the host so it can correctly interact with the PMIx - * server. The PMIx client needs some setup information - * so it can properly connect back to the server. This function - * will set appropriate environmental variables for this purpose. */ -typedef int (*opal_pmix_base_module_server_setup_fork_fn_t)(const opal_process_name_t *proc, char ***env); - -/* Define a function by which the host server can request modex data - * from the local PMIx server. This is used to support the direct modex - * operation - i.e., where data is cached locally on each PMIx - * server for its own local clients, and is obtained on-demand - * for remote requests. Upon receiving a request from a remote - * server, the host server will call this function to pass the - * request into the PMIx server. The PMIx server will return a blob - * (once it becomes available) via the cbfunc - the host - * server shall send the blob back to the original requestor */ -typedef int (*opal_pmix_base_module_server_dmodex_request_fn_t)(const opal_process_name_t *proc, - opal_pmix_modex_cbfunc_t cbfunc, - void *cbdata); - -/* Report an event to a process for notification via any - * registered event handler. The handler registration can be - * called by both the server and the client application. On the - * server side, the handler is used to report events detected - * by PMIx to the host server for handling. On the client side, - * the handler is used to notify the process of events - * reported by the server - e.g., the failure of another process. - * - * This function allows the host server to direct the server - * convenience library to notify all registered local procs of - * an event. The event can be local, or anywhere in the cluster. - * The status indicates the event being reported. - * - * The source parameter informs the handler of the source that - * generated the event. This will be NULL if the event came - * from the external resource manager. - * - * The info array contains any further info the RM can and/or chooses - * to provide. - * - * The callback function will be called upon completion of the - * notify_event function's actions. Note that any messages 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 this - * function returns OPAL_SUCCESS! */ -typedef int (*opal_pmix_base_module_server_notify_event_fn_t)(int status, - const opal_process_name_t *source, - opal_list_t *info, - opal_pmix_op_cbfunc_t cbfunc, void *cbdata); - -/* push IO to local clients */ -typedef int (*opal_pmix_base_module_server_push_io_fn_t)(const opal_process_name_t *source, - opal_pmix_iof_channel_t channel, - unsigned char *data, size_t nbytes); - -/* define a callback function for the setup_application API. The returned info - * array is owned by the PMIx server library and will be free'd when the - * provided cbfunc is called. */ -typedef void (*opal_pmix_setup_application_cbfunc_t)(int status, - opal_list_t *info, - void *provided_cbdata, - opal_pmix_op_cbfunc_t cbfunc, void *cbdata); - -/* Provide a function by which we can request - * any application-specific environmental variables prior to - * launch of an application. For example, network libraries may - * opt to provide security credentials for the application. This - * is defined as a non-blocking operation in case network - * libraries need to perform some action before responding. The - * returned env will be distributed along with the application */ -typedef int (*opal_pmix_server_setup_application_fn_t)(opal_jobid_t jobid, - opal_list_t *info, - opal_pmix_setup_application_cbfunc_t cbfunc, void *cbdata); - -/* Provide a function by which the local PMIx server can perform - * any application-specific operations prior to spawning local - * clients of a given application. For example, a network library - * might need to setup the local driver for "instant on" addressing. - */ -typedef int (*opal_pmix_server_setup_local_support_fn_t)(opal_jobid_t jobid, - opal_list_t *info, - opal_pmix_op_cbfunc_t cbfunc, void *cbdata); - - -/************************************************************ - * TOOL APIs * - ************************************************************/ -/* Initialize the PMIx tool support - * When called the library will check for the required connection - * information of the local server and will establish the connection. - * The connection info can be provided either in the environment or - * in the list of attributes. If the information is not found, or the - * server connection fails, then an appropriate error constant will - * be returned. - */ -typedef int (*opal_pmix_base_module_tool_init_fn_t)(opal_list_t *ilist); - -/* Finalize the PMIx tool support */ -typedef int (*opal_pmix_base_module_tool_fini_fn_t)(void); - - -/************************************************************ - * UTILITY APIs * - ************************************************************/ - -/* get the version of the embedded library */ -typedef const char* (*opal_pmix_base_module_get_version_fn_t)(void); - -/* Register an event handler to report event. Three types of events - * can be reported: - * - * (a) those that occur within the client library, but are not - * reportable via the API itself (e.g., loss of connection to - * the server). These events typically occur during behind-the-scenes - * non-blocking operations. - * - * (b) job-related events such as the failure of another process in - * the job or in any connected job, impending failure of hardware - * within the job's usage footprint, etc. - * - * (c) system notifications that are made available by the local - * administrators - * - * By default, only events that directly affect the process and/or - * any process to which it is connected (via the PMIx_Connect call) - * will be reported. Options to modify that behavior can be provided - * in the info array - * - * Both the client application and the resource manager can register - * event handlers for specific events. PMIx client/server calls the registered - * event handler upon receiving event notify notification (via PMIx_Notify_event) - * from the other end (Resource Manager/Client application). - * - * Multiple event handlers can be registered for different events. PMIX returns - * a size_t reference to each register handler in the callback fn. The caller - * must retain the reference in order to deregister the evhandler. - * Modification of the notification behavior can be accomplished by - * deregistering the current evhandler, and then registering it - * using a new set of info values. - * - * A NULL for event_codes indicates registration as a default event handler - * - * See pmix_types.h for a description of the notification function */ -typedef void (*opal_pmix_base_module_register_fn_t)(opal_list_t *event_codes, - opal_list_t *info, - opal_pmix_notification_fn_t evhandler, - opal_pmix_evhandler_reg_cbfunc_t cbfunc, - void *cbdata); - -/* deregister the evhandler - * evhandler_ref is the reference returned by PMIx for the evhandler - * to pmix_evhandler_reg_cbfunc_t */ -typedef void (*opal_pmix_base_module_deregister_fn_t)(size_t evhandler, - opal_pmix_op_cbfunc_t cbfunc, - void *cbdata); - -/* Report an event for notification via any - * registered evhandler. On the PMIx - * server side, this is used to report events detected - * by PMIx to the host server for handling and/or distribution. - * - * The client application can also call this function to notify the - * resource manager of an event it detected. It can specify the - * range over which that notification should occur. - * - * The info array contains any further info the caller can and/or chooses - * to provide. - * - * The callback function will be called upon completion of the - * notify_event function's actions. Note that any messages 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 it - * returns OPAL_SUCCESS! -*/ -typedef int (*opal_pmix_base_module_notify_event_fn_t)(int status, - const opal_process_name_t *source, - opal_pmix_data_range_t range, - opal_list_t *info, - opal_pmix_op_cbfunc_t cbfunc, void *cbdata); - -/* store data internally, but don't push it out to be shared - this is - * intended solely for storage of info on other procs that comes thru - * a non-PMIx channel (e.g., may be computed locally) but is desired - * to be available via a PMIx_Get call */ -typedef int (*opal_pmix_base_module_store_fn_t)(const opal_process_name_t *proc, - opal_value_t *val); - -/* retrieve the nspace corresponding to a given jobid */ -typedef const char* (*opal_pmix_base_module_get_nspace_fn_t)(opal_jobid_t jobid); - -/* register a jobid-to-nspace pair */ -typedef void (*opal_pmix_base_module_register_jobid_fn_t)(opal_jobid_t jobid, const char *nspace); - -/* query information from the system */ -typedef void (*opal_pmix_base_module_query_fn_t)(opal_list_t *queries, - opal_pmix_info_cbfunc_t cbfunc, void *cbdata); - -/* log data to the system */ -typedef void (*opal_pmix_base_log_fn_t)(opal_list_t *info, - opal_pmix_op_cbfunc_t cbfunc, void *cbdata); - -/* allocation */ -typedef int (*opal_pmix_base_alloc_fn_t)(opal_pmix_alloc_directive_t directive, - opal_list_t *info, - opal_pmix_info_cbfunc_t cbfunc, void *cbdata); - -/* job control */ -typedef int (*opal_pmix_base_job_control_fn_t)(opal_list_t *targets, - opal_list_t *directives, - opal_pmix_info_cbfunc_t cbfunc, void *cbdata); - -/* monitoring */ -typedef int (*opal_pmix_base_process_monitor_fn_t)(opal_list_t *monitor, - opal_list_t *directives, - opal_pmix_info_cbfunc_t cbfunc, void *cbdata); - -/* register cleanup */ -typedef int (*opal_pmix_base_register_cleanup_fn_t)(char *path, bool directory, bool ignore, bool jobscope); - -typedef bool (*opal_pmix_base_legacy_get_fn_t)(void); - -/* - * the standard public API data structure - */ -typedef struct { - opal_pmix_base_legacy_get_fn_t legacy_get; - /* client APIs */ - opal_pmix_base_module_init_fn_t init; - opal_pmix_base_module_fini_fn_t finalize; - opal_pmix_base_module_initialized_fn_t initialized; - opal_pmix_base_module_abort_fn_t abort; - opal_pmix_base_module_commit_fn_t commit; - opal_pmix_base_module_fence_fn_t fence; - opal_pmix_base_module_fence_nb_fn_t fence_nb; - opal_pmix_base_module_put_fn_t put; - opal_pmix_base_module_get_fn_t get; - opal_pmix_base_module_get_nb_fn_t get_nb; - opal_pmix_base_module_publish_fn_t publish; - opal_pmix_base_module_publish_nb_fn_t publish_nb; - opal_pmix_base_module_lookup_fn_t lookup; - opal_pmix_base_module_lookup_nb_fn_t lookup_nb; - opal_pmix_base_module_unpublish_fn_t unpublish; - opal_pmix_base_module_unpublish_nb_fn_t unpublish_nb; - opal_pmix_base_module_spawn_fn_t spawn; - opal_pmix_base_module_spawn_nb_fn_t spawn_nb; - opal_pmix_base_module_connect_fn_t connect; - opal_pmix_base_module_connect_nb_fn_t connect_nb; - opal_pmix_base_module_disconnect_fn_t disconnect; - opal_pmix_base_module_disconnect_nb_fn_t disconnect_nb; - opal_pmix_base_module_resolve_peers_fn_t resolve_peers; - opal_pmix_base_module_resolve_nodes_fn_t resolve_nodes; - opal_pmix_base_module_query_fn_t query; - opal_pmix_base_log_fn_t log; - opal_pmix_base_alloc_fn_t allocate; - opal_pmix_base_job_control_fn_t job_control; - opal_pmix_base_process_monitor_fn_t monitor; - opal_pmix_base_register_cleanup_fn_t register_cleanup; - /* server APIs */ - opal_pmix_base_module_server_init_fn_t server_init; - opal_pmix_base_module_server_finalize_fn_t server_finalize; - opal_pmix_base_module_generate_regex_fn_t generate_regex; - opal_pmix_base_module_generate_ppn_fn_t generate_ppn; - opal_pmix_base_module_server_register_nspace_fn_t server_register_nspace; - opal_pmix_base_module_server_deregister_nspace_fn_t server_deregister_nspace; - opal_pmix_base_module_server_register_client_fn_t server_register_client; - opal_pmix_base_module_server_deregister_client_fn_t server_deregister_client; - opal_pmix_base_module_server_setup_fork_fn_t server_setup_fork; - opal_pmix_base_module_server_dmodex_request_fn_t server_dmodex_request; - opal_pmix_base_module_server_notify_event_fn_t server_notify_event; - opal_pmix_base_module_server_push_io_fn_t server_iof_push; - opal_pmix_server_setup_application_fn_t server_setup_application; - opal_pmix_server_setup_local_support_fn_t server_setup_local_support; - /* tool APIs */ - opal_pmix_base_module_tool_init_fn_t tool_init; - opal_pmix_base_module_tool_fini_fn_t tool_finalize; - /* Utility APIs */ - opal_pmix_base_module_get_version_fn_t get_version; - opal_pmix_base_module_register_fn_t register_evhandler; - opal_pmix_base_module_deregister_fn_t deregister_evhandler; - opal_pmix_base_module_notify_event_fn_t notify_event; - opal_pmix_base_module_store_fn_t store_local; - opal_pmix_base_module_get_nspace_fn_t get_nspace; - opal_pmix_base_module_register_jobid_fn_t register_jobid; -} opal_pmix_base_module_t; - -typedef struct { - mca_base_component_t base_version; - mca_base_component_data_t base_data; - int priority; -} opal_pmix_base_component_t; - -/* - * Macro for use in components that are of type pmix - */ -#define OPAL_PMIX_BASE_VERSION_2_0_0 \ - OPAL_MCA_BASE_VERSION_2_1_0("pmix", 2, 0, 0) - -/* Global structure for accessing store functions */ -OPAL_DECLSPEC extern opal_pmix_base_module_t opal_pmix; /* holds base function pointers */ - -END_C_DECLS - -#endif diff --git a/opal/mca/pmix/pmix4x/Makefile.am b/opal/mca/pmix/pmix4x/Makefile.am index d108c5dc881..972d5333cf3 100644 --- a/opal/mca/pmix/pmix4x/Makefile.am +++ b/opal/mca/pmix/pmix4x/Makefile.am @@ -1,5 +1,5 @@ # -# Copyright (c) 2014-2018 Intel, Inc. All rights reserved. +# Copyright (c) 2014-2019 Intel, Inc. All rights reserved. # Copyright (c) 2015 Cisco Systems, Inc. All rights reserved. # Copyright (c) 2015 Research Organization for Information Science # and Technology (RIST). All rights reserved. @@ -13,46 +13,15 @@ EXTRA_DIST = autogen.subdirs -dist_opaldata_DATA = help-pmix-pmix4x.txt - SUBDIRS = openpmix sources = \ pmix4x.h \ - pmix4x_component.c \ - pmix4x.c \ - pmix4x_client.c \ - pmix4x_local.c \ - pmix4x_server_south.c \ - pmix4x_server_north.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_opal_pmix_pmix4x_DSO -component_noinst = -component_install = mca_pmix_pmix4x.la -else -component_noinst = libmca_pmix_pmix4x.la -component_install = -endif - -mcacomponentdir = $(opallibdir) -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)/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) -mca_pmix_pmix4x_la_DEPENDENCIES = $(opal_pmix_pmix4x_DEPENDENCIES) + pmix4x_component.c -noinst_LTLIBRARIES = $(component_noinst) +# We only ever build this component statically +noinst_LTLIBRARIES = libmca_pmix_pmix4x.la libmca_pmix_pmix4x_la_SOURCES =$(sources) -libmca_pmix_pmix4x_la_CFLAGS = $(opal_pmix_pmix4x_CFLAGS) -libmca_pmix_pmix4x_la_CPPFLAGS = $(opal_pmix_pmix4x_CPPFLAGS) +nodist_libmca_pmix_pmix4x_la_SOURCES = $(nodist_headers) libmca_pmix_pmix4x_la_LDFLAGS = -module -avoid-version $(opal_pmix_pmix4x_LDFLAGS) libmca_pmix_pmix4x_la_LIBADD = $(opal_pmix_pmix4x_LIBS) -libmca_pmix_pmix4x_la_DEPENDENCIES = $(opal_pmix_pmix4x_DEPENDENCIES) diff --git a/opal/mca/pmix/pmix4x/configure.m4 b/opal/mca/pmix/pmix4x/configure.m4 index d97f8128881..4e07d0d75a4 100644 --- a/opal/mca/pmix/pmix4x/configure.m4 +++ b/opal/mca/pmix/pmix4x/configure.m4 @@ -23,12 +23,54 @@ # $HEADER$ # +# +# Priority +# +AC_DEFUN([MCA_opal_pmix_pmix4x_PRIORITY], [80]) + +# +# Force this component to compile in static-only mode +# +AC_DEFUN([MCA_opal_pmix_pmix4x_COMPILE_MODE], [ + AC_MSG_CHECKING([for MCA component $2:$3 compile mode]) + $4="static" + AC_MSG_RESULT([$$4]) +]) + +# MCA_pmix_pmix4x_POST_CONFIG() +# --------------------------------- +AC_DEFUN([MCA_opal_pmix_pmix4x_POST_CONFIG],[ + OPAL_VAR_SCOPE_PUSH([opal_pmix_pmix4x_basedir]) + + # If we won, then do all the rest of the setup + AS_IF([test "$1" = "1" && test "$opal_pmix_pmix4x_happy" = "1"], + [ + # Set this variable so that the framework m4 knows what + # file to include in opal/mca/pmix/pmix-internal.h + opal_pmix_pmix4x_basedir=opal/mca/pmix/pmix4x + opal_pmix_base_include="$opal_pmix_pmix4x_basedir/pmix4x.h" + + # Add some stuff to CPPFLAGS so that the rest of the source + # tree can be built + file=$opal_pmix_pmix4x_basedir/openpmix + CPPFLAGS="-I$OPAL_TOP_SRCDIR/$file/include $CPPFLAGS" + AS_IF([test "$OPAL_TOP_BUILDDIR" != "$OPAL_TOP_SRCDIR"], + [CPPFLAGS="-I$OPAL_TOP_BUILDDIR/$file/include $CPPFLAGS"]) + unset file + ]) + OPAL_VAR_SCOPE_POP + + # This must be run unconditionally + # PMIX_DO_AM_CONDITIONALS +])dnl + + # MCA_pmix_pmix4x_CONFIG([action-if-found], [action-if-not-found]) # ----------------------------------------------------------- AC_DEFUN([MCA_opal_pmix_pmix4x_CONFIG],[ AC_CONFIG_FILES([opal/mca/pmix/pmix4x/Makefile]) - OPAL_VAR_SCOPE_PUSH([PMIX_VERSION opal_pmix_pmix4x_save_CPPFLAGS opal_pmix_pmix2_save_CFLAGS opal_pmix_pmix4x_save_LDFLAGS opal_pmix_pmix4x_save_LIBS opal_pmix_pmix4x_basedir opal_pmix_pmix4x_args opal_pmix_pmix4x_happy pmix_pmix4x_status_filename]) + OPAL_VAR_SCOPE_PUSH([PMIX_VERSION opal_pmix_pmix4x_save_CPPFLAGS opal_pmix_pmix2_save_CFLAGS opal_pmix_pmix4x_save_LDFLAGS opal_pmix_pmix4x_save_LIBS opal_pmix_pmix4x_basedir opal_pmix_pmix4x_args pmix_pmix4x_status_filename]) opal_pmix_pmix4x_basedir=opal/mca/pmix/pmix4x @@ -49,7 +91,7 @@ AC_DEFUN([MCA_opal_pmix_pmix4x_CONFIG],[ opal_pmix_pmix4x_timing_flag=--disable-pmix-timing fi - opal_pmix_pmix4x_args="$opal_pmix_pmix4x_timing_flag --without-tests-examples --with-pmix-symbol-rename=OPAL_MCA_PMIX4X_ --disable-pmix-binaries --disable-pmix-backward-compatibility --disable-visibility --enable-embedded-mode --with-libevent-header=\\\"opal/mca/event/$opal_event_base_include\\\" --with-hwloc-header=\\\"$opal_hwloc_base_include\\\"" + opal_pmix_pmix4x_args="$opal_pmix_pmix4x_timing_flag --without-tests-examples --with-pmix-symbol-rename=OPAL_MCA_PMIX4X_ --disable-pmix-binaries --disable-pmix-backward-compatibility --disable-visibility --enable-embedded-mode --with-libevent-header=\\\"opal/mca/event/event.h\\\" --with-hwloc-header=\\\"opal/mca/hwloc/hwloc-internal.h\\\"" AS_IF([test "$enable_debug" = "yes"], [opal_pmix_pmix4x_args="--enable-debug $opal_pmix_pmix4x_args" CFLAGS="$OPAL_CFLAGS_BEFORE_PICKY $OPAL_VISIBILITY_CFLAGS -g"], diff --git a/opal/mca/pmix/pmix4x/help-pmix-pmix4x.txt b/opal/mca/pmix/pmix4x/help-pmix-pmix4x.txt deleted file mode 100644 index b11b4c45498..00000000000 --- a/opal/mca/pmix/pmix4x/help-pmix-pmix4x.txt +++ /dev/null @@ -1,32 +0,0 @@ -# -*- text -*- -# -# 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) 2017-2018 Intel, Inc. All rights reserved. -# $COPYRIGHT$ -# -# Additional copyrights may follow -# -# $HEADER$ -# -# This is the US/English help file for Open MPI MCA error messages. -# -[evars] -We found conflicting directives regarding the location of OPAL vs PMIx -installation directories: - -%s - -This usually indicates that OMPI was configured to use its internal copy -of PMIx, but another installation of PMIx is also in use on this system -and could potentially cause confusion between the two sets of plugins. -Please either unset the indicated environment variables, or configure -OMPI to use the external PMIx installation. diff --git a/opal/mca/pmix/pmix4x/openpmix b/opal/mca/pmix/pmix4x/openpmix new file mode 160000 index 00000000000..84a44fe4b55 --- /dev/null +++ b/opal/mca/pmix/pmix4x/openpmix @@ -0,0 +1 @@ +Subproject commit 84a44fe4b55722885f003ee0994b1b9e0a8f54ab diff --git a/opal/mca/pmix/pmix4x/openpmix/AUTHORS b/opal/mca/pmix/pmix4x/openpmix/AUTHORS deleted file mode 100644 index 98cfbbeb910..00000000000 --- a/opal/mca/pmix/pmix4x/openpmix/AUTHORS +++ /dev/null @@ -1,39 +0,0 @@ -PMIx Authors -================ - -The following cumulative list contains the names and GitHub IDs of -all individuals who have committed code to the PMIx repository. - -GitHub ID Name Affiliation(s) -------------------------------- --------------------------- ------------------- -alinask Elena Shipunova Mellanox -annu13 Annapurna Dasari Intel -artpol84 Artem Polyakov Mellanox -ashleypittman Ashley Pittman Intel -dsolt Dave Solt IBM -garlick Jim Garlick LLNL -ggouaillardet Gilles Gouaillardet RIST -hjelmn Nathan Hjelm LANL -igor-ivanov Igor Ivanov Mellanox -jladd-mlnx Joshua Ladd Mellanox -jjhursey Joshua Hursey IBM -jsquyres Jeff Squyres Cisco -karasevb Boris Karasev Mellanox -kawashima-fj Takahiro Kawashima Fujitsu -nkogteva Nadezhda Kogteva Mellanox -nysal Nysal Jan KA IBM -PHHargrove Paul Hargrove LBNL -rhc54 Ralph Castain Intel -------------------------------- --------------------------- ------------------- - -Affiliation abbreviations: --------------------------- -Cisco = Cisco Systems, Inc. -Fujitsu = Fujitsu -IBM = International Business Machines, Inc. -Intel = Intel, Inc. -LANL = Los Alamos National Laboratory -LBNL = Lawrence Berkeley National Laboratory -LLNL = Lawrence Livermore National Laboratory -Mellanox = Mellanox -RIST = Research Organization for Information Science and Technology diff --git a/opal/mca/pmix/pmix4x/openpmix/HACKING b/opal/mca/pmix/pmix4x/openpmix/HACKING deleted file mode 100644 index 14b2c4c0b39..00000000000 --- a/opal/mca/pmix/pmix4x/openpmix/HACKING +++ /dev/null @@ -1,259 +0,0 @@ -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) 2008-2015 Cisco Systems, Inc. All rights reserved. -Copyright (c) 2013-2019 Intel, Inc. All rights reserved. -$COPYRIGHT$ - -Additional copyrights may follow - -$HEADER$ - -Overview -======== - -This file is here for those who are building/exploring PMIx in its -source code form, most likely through a developer's tree (i.e., a Git -checkout). - - -Debugging vs. Optimized Builds -============================== - -If you are building PMIx from a Git checkout, the default build -includes a lot of debugging features. This happens automatically when -when configure detects the hidden ".git" Git meta directory (that is -present in all Git checkouts) in your source tree, and therefore -activates a number of developer-only debugging features in the PMIx -code base. - -By definition, debugging builds will perform [much] slower than -optimized builds of PMIx. You should *NOT* conduct timing tests -or try to run production performance numbers with debugging builds. - -NOTE: this version of PMIx requires the Libevent package to build -and operate. Any version of Libevent greater than or equal to -2.0.21 is acceptable. It optionally supports the HWLOC package -for providing topology information to both the host environment -(by collecting local inventory for rollup) and local client -processes. Any version of HWLOC greater than 1.10 is supported, -although versions in the 2.x series are recommended. - -If you wish to build an optimized version of PMIx from a -developer's checkout, you have three main options: - -1. Use the "--with-platform=optimized" switch to configure. This is - the preferred (and probably easiest) method. For example: - - shell$ git clone https://github.com/pmix/pmix.git pmix - shell$ cd pmix - shell$ ./autogen.pl - shell$ mkdir build - shell$ cd build - shell$ ./configure --with-platform=optimized ... - [...lots of output...] - shell$ make all install - -2. Use a VPATH build. Simply build PMIx from a different - directory than the source tree -- one where the .git subdirectory - is not present. For example: - - shell$ git clone https://github.com/pmix/pmix.git pmix - shell$ cd pmix - shell$ ./autogen.pl - shell$ mkdir build - shell$ cd build - shell$ ../configure ... - [...lots of output...] - shell$ make all install - -3. Manually specify configure options to disable all the debugging - options (note that this is exactly what "--with-platform=optimized" - does behind the scenes). You'll need to carefully examine the - output of "./configure --help" to see which options to disable. - They are all listed, but some are less obvious than others (they - are not listed here because it is a changing set of flags; by - Murphy's Law, listing them here will pretty much guarantee that - this file will get out of date): - - shell$ ./configure --disable-debug ... - [...lots of output...] - shell$ make all install - - -Note that in all cases you must point configure at the libevent -installation using the --with-libevent= option if it is in -a non-standard location. Similarly, non-standard locations for -the HWLOC package must be specified using the --with-hwloc= -option. In both cases, PMIx will automatically detect these -packages in standard locations and build-in support for them -unless otherwise specified using the respective configure option. - - -Use of GNU Autoconf, Automake, and Libtool (and m4) -=================================================== - -This procedure is *ONLY* necessary if you are building from a -developer's tree. If you have a PMIx distribution tarball, this -procedure is unnecessary -- you can (and should) skip reading this -section. - -If you are building PMIx from a developer's tree, you must first -install fairly recent versions of the GNU tools Autoconf, Automake, -and Libtool (and possibly GNU m4, because recent versions of Autoconf -have specific GNU m4 version requirements). The specific versions -required depend on if you are using the master or a release branch (and -which release branch you are using). The specific versions can be -found at: - - https://pmix.org/code/getting-the-reference-implementation/ - -You can check what versions of the autotools you have installed with -the following: - -shell$ m4 --version -shell$ autoconf --version -shell$ automake --version -shell$ libtoolize --version - -To strengthen the above point: the core PMIx developers typically -use very, very recent versions of the GNU tools. There are known bugs -in older versions of the GNU tools that PMIx no longer compensates -for (it seemed senseless to indefinitely support patches for ancient -versions of Autoconf, for example). You *WILL* have problems if you -do not use recent versions of the GNU tools. - -If you need newer versions, you are *strongly* encouraged to heed the -following advice: - -NOTE: On MacOS/X, the default "libtool" program is different than the - GNU libtool. You must download and install the GNU version - (e.g., via MacPorts, Homebrew, or some other mechanism). - -1. Unless your OS distribution has easy-to-use binary installations, - the sources can be can be downloaded from: - - ftp://ftp.gnu.org/gnu/autoconf/ - ftp://ftp.gnu.org/gnu/automake/ - ftp://ftp.gnu.org/gnu/libtool/ - and if you need it: - ftp://ftp.gnu.org/gnu/m4/ - - NOTE: It is certainly easiest to download/build/install all four of - these tools together. But note that PMIx has no specific m4 - requirements; it is only listed here because Autoconf requires - minimum versions of GNU m4. Hence, you may or may not *need* to - actually install a new version of GNU m4. That being said, if you - are confused or don't know, just install the latest GNU m4 with the - rest of the GNU Autotools and everything will work out fine. - -2. Build and install the tools in the following order: - - 2a. m4 - 2b. Autoconf - 2c. Automake - 2d. Libtool - -3. You MUST install the last three tools (Autoconf, Automake, Libtool) - into the same prefix directory. These three tools are somewhat - inter-related, and if they're going to be used together, they MUST - share a common installation prefix. - - You can install m4 anywhere as long as it can be found in the path; - it may be convenient to install it in the same prefix as the other - three. Or you can use any recent-enough m4 that is in your path. - - 3a. It is *strongly* encouraged that you do not install your new - versions over the OS-installed versions. This could cause - other things on your system to break. Instead, install into - $HOME/local, or /usr/local, or wherever else you tend to - install "local" kinds of software. - 3b. In doing so, be sure to prefix your $path with the directory - where they are installed. For example, if you install into - $HOME/local, you may want to edit your shell startup file - (.bashrc, .cshrc, .tcshrc, etc.) to have something like: - - # For bash/sh: - export PATH=$HOME/local/bin:$PATH - # For csh/tcsh: - set path = ($HOME/local/bin $path) - - 3c. Ensure to set your $path *BEFORE* you configure/build/install - the four packages. - -4. All four packages require two simple commands to build and - install (where PREFIX is the prefix discussed in 3, above). - - shell$ cd m4-1.4.13 - shell$ ./configure --prefix=PREFIX - shell$ make; make install - - --> If you are using the csh or tcsh shells, be sure to run the - "rehash" command after you install each package. - - shell$ cd ../autoconf-2.68 - shell$ ./configure --prefix=PREFIX - shell$ make; make install - - --> If you are using the csh or tcsh shells, be sure to run the - "rehash" command after you install each package. - - shell$ cd ../automake-1.11.1 - shell$ ./configure --prefix=PREFIX - shell$ make; make install - - --> If you are using the csh or tcsh shells, be sure to run the - "rehash" command after you install each package. - - shell$ cd ../libtool-2.2.8 - shell$ ./configure --prefix=PREFIX - shell$ make; make install - - --> If you are using the csh or tcsh shells, be sure to run the - "rehash" command after you install each package. - - m4, Autoconf and Automake build and install very quickly; Libtool will - take a minute or two. - -5. You can now run PMIx’s top-level "autogen.sh" script. This script - will invoke the GNU Autoconf, Automake, and Libtool commands in the - proper order and setup to run PMIx's top-level "configure" script. - - 5a. You generally need to run autogen.sh only when the top-level - file "configure.ac" changes, or any files in the config/ or - /config/ directories change (these directories are - where a lot of "include" files for PMI’xs configure script - live). - - 5b. You do *NOT* need to re-run autogen.sh if you modify a - Makefile.am. - -Use of Flex -=========== - -Flex may be used during the compilation of a developer's checkout (it is -not used to build official distribution tarballs). Other flavors of -lex are *not* supported: given the choice of making parsing code -portable between all flavors of lex and doing more interesting work on -PMIx, we greatly prefer the latter. - -Note that no testing has been performed to see what the minimum -version of Flex is required by PMIx. We suggest that you use -v2.5.35 at the earliest. - -Note that the flex-generated code generates some compiler warnings on -some platforms, but the warnings do not seem to be consistent or -uniform on all platforms, compilers, and flex versions. As such, we -have done little to try to remove those warnings. - -If you do not have Flex installed, it can be downloaded from the -following URL: - - http://flex.sourceforge.net/ diff --git a/opal/mca/pmix/pmix4x/openpmix/INSTALL b/opal/mca/pmix/pmix4x/openpmix/INSTALL deleted file mode 100644 index 3fac5ad5866..00000000000 --- a/opal/mca/pmix/pmix4x/openpmix/INSTALL +++ /dev/null @@ -1,105 +0,0 @@ -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) 2008-2015 Cisco Systems, Inc. All rights reserved. -Copyright (c) 2013-2019 Intel, Inc. All rights reserved. -$COPYRIGHT$ - -Additional copyrights may follow - -$HEADER$ - - -For More Information -==================== - -This file is a *very* short overview of building and installing -the PMIx library. Much more information is available in the -How-To section on the PMIx web site: - - https://pmix.org/support/how-to/ - - -Developer Builds -================ - -If you have checked out a DEVELOPER'S COPY of PMIx (i.e., you checked -out from Git), you should read the HACKING file before attempting to -build PMIx. You must then run: - -shell$ ./autogen.pl - -You will need very recent versions of GNU Autoconf, Automake, and -Libtool. If autogen.sh fails, read the HACKING file. If anything -else fails, read the HACKING file. Finally, we suggest reading the -HACKING file. - -*** NOTE: Developer's copies of PMIx typically include a large -performance penalty at run-time because of extra debugging overhead. - - -User Builds -=========== - -Building PMIx is typically a combination of running "configure" -and "make". Execute the following commands to install the PMIx -system from within the directory at the top of the tree: - -shell$ ./configure --prefix=/where/to/install -[...lots of output...] -shell$ make all install - -NOTE: this version of PMIx requires the Libevent package to build -and operate. Any version of Libevent greater than or equal to -2.0.21 is acceptable. - -NOTE: this version of PMIx optionally supports the HWLOC package -for providing topology information to both the host environment -(by collecting local inventory for rollup) and local client -processes. Any version of HWLOC greater than 1.10 is supported, -although versions in the 2.x series are recommended. - -Note that you must point configure at the libevent installation -using the --with-libevent= option if it is in a non-standard -location. Similarly, non-standard locations for the HWLOC package -must be specified using the --with-hwloc= option. In both -cases, PMIx will automatically detect these packages in standard -locations and build-in support for them unless otherwise specified -using the respective configure option. - -If you need special access to install, then you can execute "make -all" as a user with write permissions in the build tree, and a -separate "make install" as a user with write permissions to the -install tree. - -Compiling support for specific compilers and environments may -require additional command line flags when running configure. See the -README file for more details. Note that VPATH builds are fully -supported. For example: - -shell$ gtar zxf pmix-X.Y.Z.tar.gz -shell$ cd pmix-X.Y.Z -shell$ mkdir build -shell$ cd build -shell$ ../configure ...your options... -[...lots of output...] -shell$ make all install - -Parallel builds are also supported (although some versions of "make", -such as GNU make, will only use the first target listed on the command -line when executable parallel builds). For example (assume GNU make): - -shell$ make -j 4 all -[...lots of output...] -shell$ make install - -Parallel make is generally only helpful in the build phase; the -installation process is mostly serial and does not benefit much from -parallel make. diff --git a/opal/mca/pmix/pmix4x/openpmix/LICENSE b/opal/mca/pmix/pmix4x/openpmix/LICENSE deleted file mode 100644 index 9f9a1b943ba..00000000000 --- a/opal/mca/pmix/pmix4x/openpmix/LICENSE +++ /dev/null @@ -1,95 +0,0 @@ -Most files in this release are marked with the copyrights of the -organizations who have edited them. The copyrights below are in no -particular order and generally reflect members of the Open MPI core -team who have contributed code that may or may not have been ported -to PMIx. Per the terms of that LICENSE, we include the list here. -The copyrights for code used under license from other parties -are included in the corresponding files. - -Copyright (c) 2004-2010 The Trustees of Indiana University and Indiana - University Research and Technology - Corporation. All rights reserved. -Copyright (c) 2004-2010 The University of Tennessee and The University - of Tennessee Research Foundation. All rights - reserved. -Copyright (c) 2004-2010 High Performance Computing Center Stuttgart, - University of Stuttgart. All rights reserved. -Copyright (c) 2004-2008 The Regents of the University of California. - All rights reserved. -Copyright (c) 2006-2010 Los Alamos National Security, LLC. All rights - reserved. -Copyright (c) 2006-2010 Cisco Systems, Inc. All rights reserved. -Copyright (c) 2006-2010 Voltaire, Inc. All rights reserved. -Copyright (c) 2006-2011 Sandia National Laboratories. All rights reserved. -Copyright (c) 2006-2010 Sun Microsystems, Inc. All rights reserved. - Use is subject to license terms. -Copyright (c) 2006-2010 The University of Houston. All rights reserved. -Copyright (c) 2006-2009 Myricom, Inc. All rights reserved. -Copyright (c) 2007-2008 UT-Battelle, LLC. All rights reserved. -Copyright (c) 2007-2019 IBM Corporation. All rights reserved. -Copyright (c) 1998-2005 Forschungszentrum Juelich, Juelich Supercomputing - Centre, Federal Republic of Germany -Copyright (c) 2005-2008 ZIH, TU Dresden, Federal Republic of Germany -Copyright (c) 2007 Evergrid, Inc. All rights reserved. -Copyright (c) 2008 Chelsio, Inc. All rights reserved. -Copyright (c) 2008-2009 Institut National de Recherche en - Informatique. All rights reserved. -Copyright (c) 2007 Lawrence Livermore National Security, LLC. - All rights reserved. -Copyright (c) 2007-2019 Mellanox Technologies. All rights reserved. -Copyright (c) 2006-2010 QLogic Corporation. All rights reserved. -Copyright (c) 2008-2010 Oak Ridge National Labs. All rights reserved. -Copyright (c) 2006-2010 Oracle and/or its affiliates. All rights reserved. -Copyright (c) 2009 Bull SAS. All rights reserved. -Copyright (c) 2010 ARM ltd. All rights reserved. -Copyright (c) 2010-2011 Alex Brick . All rights reserved. -Copyright (c) 2012 The University of Wisconsin-La Crosse. All rights - reserved. -Copyright (c) 2013-2019 Intel, Inc. All rights reserved. -Copyright (c) 2011-2014 NVIDIA Corporation. All rights reserved. -Copyright (c) 2019 Amazon.com, Inc. or its affiliates. All Rights - reserved. - -$COPYRIGHT$ - -Additional copyrights may follow - -$HEADER$ - -The following LICENSE pertains to both PMIx and any code ported -from Open MPI. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - -- Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - -- Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer listed - in this license in the documentation and/or other materials - provided with the distribution. - -- Neither the name of the copyright holders nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - -The copyright holders provide no reassurances that the source code -provided does not infringe any patent, copyright, or any other -intellectual property rights of third parties. The copyright holders -disclaim any liability to any recipient for claims brought against -recipient by any third party for infringement of that parties -intellectual property rights. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/opal/mca/pmix/pmix4x/openpmix/Makefile.am b/opal/mca/pmix/pmix4x/openpmix/Makefile.am deleted file mode 100644 index d39f0d6a878..00000000000 --- a/opal/mca/pmix/pmix4x/openpmix/Makefile.am +++ /dev/null @@ -1,62 +0,0 @@ -# -# 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-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-2016 Cisco Systems, Inc. All rights reserved. -# Copyright (c) 2012-2013 Los Alamos National Security, 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$ -# -# Additional copyrights may follow -# -# $HEADER$ -# - -# Note that the -I directory must *exactly* match what was specified -# via AC_CONFIG_MACRO_DIR in configure.ac. -ACLOCAL_AMFLAGS = -I ./config - -SUBDIRS = config contrib include src etc bindings - -AM_DISTCHECK_CONFIGURE_FLAGS = --disable-dlopen - -headers = -sources = -nodist_headers = -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 -dist_pmixdata_DATA = -if ! PMIX_EMBEDDED_MODE -dist_pmixdata_DATA += contrib/pmix-valgrind.supp - -endif - -if PMIX_TESTS_EXAMPLES -SUBDIRS += . test examples -endif - -if WANT_INSTALL_HEADERS -pmixdir = $(pmixincludedir)/$(subdir) -nobase_pmix_HEADERS = $(headers) - -else - -noinst_HEADERS = $(headers) -endif - -nroff: - (cd man; $(MAKE) nroff) - -dist-hook: - env LS_COLORS= sh "$(top_srcdir)/config/distscript.sh" "$(top_srcdir)" "$(distdir)" "$(PMIX_VERSION)" "$(PMIX_REPO_REV)" diff --git a/opal/mca/pmix/pmix4x/openpmix/Makefile.pmix-rules b/opal/mca/pmix/pmix4x/openpmix/Makefile.pmix-rules deleted file mode 100644 index 4250adb2861..00000000000 --- a/opal/mca/pmix/pmix4x/openpmix/Makefile.pmix-rules +++ /dev/null @@ -1,37 +0,0 @@ -# -*- 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/openpmix/NEWS b/opal/mca/pmix/pmix4x/openpmix/NEWS deleted file mode 100644 index 807ef8103ed..00000000000 --- a/opal/mca/pmix/pmix4x/openpmix/NEWS +++ /dev/null @@ -1,655 +0,0 @@ -Copyright (c) 2015-2019 Intel, Inc. All rights reserved. -Copyright (c) 2017 IBM Corporation. All rights reserved. -$COPYRIGHT$ - -Additional copyrights may follow - -$HEADER$ - -=========================================================================== - -This file contains the main features as well as overviews of specific -bug fixes (and other actions) for each version of PMIx since -version 1.0. - -As more fully described in the "Software Version Number" section in -the README file, PMIx typically maintains two separate version -series simultaneously - the current release and one that is locked -to only bug fixes. Since these series are semi-independent of each -other, a single NEWS-worthy item might apply to different series. For -example, a bug might be fixed in the master, and then moved to -multiple release branches. - -Master (not on release branches yet) ------------------------------------- - -3.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 - - Restore some non-standard macros to the pmix_extend.h - header - these are considered "deprecated" and will be - removed from public-facing headers in future releases - - -3.1.1 -- 18 Jan 2019 ----------------------- -- Fix a bug in registration of default event handlers - that somehow slipped thru testing - - -3.1.0 -- 17 Jan 2019 ----------------------- -**** THIS RELEASE MARKS THE STARTING POINT FOR FULL COMPLIANCE -**** WITH THE PMIX v3 STANDARD. ALL API BEHAVIORS AND ATTRIBUTE -**** DEFINITIONS MEET THE v3 STANDARD SPECIFICATIONS. - - Add a new, faster dstore GDS component 'ds21' - - Performance optimizations for the dstore GDS components. - - Plug miscellaneous memory leaks - - Silence an unnecessary warning message when checking connection - to a non-supporting server - - Ensure lost-connection events get delivered to default event - handlers - - Correctly handle cache refresh for queries - - Protect against race conditions between host and internal library - when dealing with async requests - - Cleanup tool operations and add support for connections to - remote servers. Initial support for debugger direct/indirect - launch verified with PRRTE. Cleanup setting of tmpdir options. - Drop rendezvous files when acting as a launcher - - Automatically store the server URI for easy access by client - - Provide MCA parameter to control TCP connect retry/timeout - - Update event notification system to properly evict oldest events - when more space is needed - - Fix a number of error paths - - Update IOF cache code to properly drop oldest message. Provide - MCA parameter for setting cache size. - - Handle setsockopt(SO_RCVTIMEO) not being supported - - Ensure that epilogs get run even when connections unexpectedly - terminate. Properly split epilog strings to process multiple - paths - - Pass the tool's command line to the server so it can be returned - in queries - - Add support for C11 atomics - - Support collection and forwarding of fabric-specific envars - - Improve handling of hwloc configure option - - Fix PMIx_server_generate_regex to preserve node ordering - - Fix a bug when registering default event handlers - - -3.1.0 -- 17 Jan 2019 ----------------------- -**** THIS RELEASE MARKS THE STARTING POINT FOR FULL COMPLIANCE -**** WITH THE PMIX v3 STANDARD. ALL API BEHAVIORS AND ATTRIBUTE -**** DEFINITIONS MEET THE v3 STANDARD SPECIFICATIONS. - - Add a new, faster dstore GDS component 'ds21' - - Performance optimizations for the dstore GDS components. - - Plug miscellaneous memory leaks - - Silence an unnecessary warning message when checking connection - to a non-supporting server - - Ensure lost-connection events get delivered to default event - handlers - - Correctly handle cache refresh for queries - - Protect against race conditions between host and internal library - when dealing with async requests - - Cleanup tool operations and add support for connections to - remote servers. Initial support for debugger direct/indirect - launch verified with PRRTE. Cleanup setting of tmpdir options. - Drop rendezvous files when acting as a launcher - - Automatically store the server URI for easy access by client - - Provide MCA parameter to control TCP connect retry/timeout - - Update event notification system to properly evict oldest events - when more space is needed - - Fix a number of error paths - - Update IOF cache code to properly drop oldest message. Provide - MCA parameter for setting cache size. - - Handle setsockopt(SO_RCVTIMEO) not being supported - - Ensure that epilogs get run even when connections unexpectedly - terminate. Properly split epilog strings to process multiple - paths - - Pass the tool's command line to the server so it can be returned - in queries - - Add support for C11 atomics - - Support collection and forwarding of fabric-specific envars - - Improve handling of hwloc configure option - - Fix PMIx_server_generate_regex to preserve node ordering - - Fix a bug when registering default event handlers - - -3.0.2 -- 18 Sept 2018 ----------------------- -- Ensure we cleanup any active sensors when a peer departs. Allow the - heartbeat monitor to "reset" if a process stops beating and subsequently - returns -- Fix a few bugs in the event notification system and provide some - missing implementation (support for specifying target procs to - receive the event). -- Add PMIX_PROC_TERMINATED constant -- Properly deal with EOPNOTSUPP from getsockopt() on ARM - - -3.0.1 -- 23 Aug 2018 ----------------------- -**** DEPRECATION WARNING: The pmix_info_array_t struct was -**** initially marked for deprecation in the v2.x series. -**** We failed to provide clear warning at that time. This -**** therefore serves as warning of intended removal of -**** pmix_info_array_t in the future v4 release series. -- Fixed memory corruption bug in event notification - system due to uninitialized variable -- Add numeric version field to pmix_version.h -- Transfer all cached data to client dstore upon first connect -- Implement missing job control and sensor APIs - - -3.0.0 -- 6 July 2018 ------------------------------------- -**** NOTE: This release implements the complete PMIX v3.0 Standard -**** and therefore includes a number of new APIs and features. These -**** can be tracked by their RFC's on the community website: -**** https://pmix.org/pmix-standard. -- Added blocking forms of several existing APIs: - - PMIx_Log - - PMIx_Allocation_request - - PMIx_Job_control - - PMIx_Process_monitor -- Added support for getting/validating security credentials - - PMIx_Get_credential, PMIx_Validate_credential -- Extended support for debuggers/tools - - Added IO forwarding support allowing tools to request - forwarding of output from specific application procs, - and to forward their input to specified target procs - - Extended tool attributes to support synchronization - during startup of applications. This includes the - ability to modify an application's environment - (including support for LD_PRELOAD) and define an - alternate fork/exec agent - - Added ability for a tool to switch server connections - so it can first connect to a system-level server to - launch a starter program, and then reconnect to that - starter for debugging purposes -- Extended network support to collect network inventory by - either rolling it up from individual nodes or by direct - query of fabric managers. Added an API by which the - host can inject any rolled up inventory into the local - PMIx server. Applications and/or the host RM can access - the inventory via the PMIx_Query function. -- Added the ability for applications and/or tools to register - files and directories for cleanup upon their termination -- Added support for inter-library coordination within a process -- Extended PMIx_Log support by adding plugin support for new - channels, including local/remote syslog and email. Added - attributes to query available channels and to tag and - format output. -- 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 - - -2.2.1 -- 18 Jan 2019 ----------------------- - - Fix a bug in registration of default event handlers - that somehow slipped thru testing - - -2.2.0 -- 17 Jan 2019 ----------------------- -**** THIS RELEASE MARKS THE STARTING POINT FOR FULL COMPLIANCE -**** WITH THE PMIX v2.2 STANDARD. ALL API BEHAVIORS AND ATTRIBUTE -**** DEFINITIONS MEET THE v2.2 STANDARD SPECIFICATIONS. - - Add a new, faster dstore GDS component 'ds21' - - Performance optimizations for the dstore GDS components. - - Plug miscellaneous memory leaks - - Silence an unnecessary warning message when checking connection - to a non-supporting server - - Ensure lost-connection events get delivered to default event - handlers - - Correctly handle cache refresh for queries - - Protect against race conditions between host and internal library - when dealing with async requests - - Cleanup tool operations and add support for connections to - remote servers. - - Automatically store the server URI for easy access by client - - Provide MCA parameter to control TCP connect retry/timeout - - Update event notification system to properly evict oldest events - when more space is needed - - Fix a number of error paths - - Handle setsockopt(SO_RCVTIMEO) not being supported - - Pass the tool's command line to the server so it can be returned - in queries - - Add support for C11 atomics - - Fix a bug when registering default event handlers - - -2.1.4 -- 18 Sep 2018 ----------------------- -- Updated configury to silence warnings on older compilers -- Implement job control and sensor APIs -- Update sensor support -- Fix a few bugs in the event notification system and provide some - missing implementation (support for specifying target procs to - receive the event). -- Add PMIX_PROC_TERMINATED constant -- Properly deal with EOPNOTSUPP from getsockopt() on ARM - - -2.1.3 -- 23 Aug 2018 ----------------------- -- Fixed memory corruption bug in event notification - system due to uninitialized variable -- Add numeric version definition -- Transfer all cached data to client dstore upon first connect - - -2.1.2 -- 6 July 2018 ----------------------- -- Added PMIX_VERSION_RELEASE string to pmix_version.h -- Added PMIX_SPAWNED and PMIX_PARENT_ID keys to all procs - started via PMIx_Spawn -- Fixed faulty compares in PMI/PMI2 tests -- Fixed bug in direct modex for data on remote node -- Correctly transfer all cached job info to the client's - shared memory region upon first connection -- Fix potential deadlock in PMIx_server_init in an error case -- Fix uninitialized variable -- Fix several memory and file descriptor leaks - - -2.1.1 -- 23 Feb 2018 ----------------------- -- Fix direct modex when receiving new nspace -- Resolve direct modex of job-level info -- Fix a bug in attribute configuration checks -- Fix a couple of bugs in unpacking of direct modex job-level data -- Correcly handle application setup data during "instant on" launch -- add a PMIX_BYTE_OBJECT_LOAD convenience macro -- Fix two early "free" bugs -- Add an example PMI-1 client program - - -2.1.0 -- 1 Feb 2018 ----------------------- -**** NOTE: This release contains the first implementation of cross-version -**** support. Servers using v2.1.0 are capable of supporting clients using -**** PMIx versions v1.2 and above. Clients using v2.1.0 are able to interact -**** with servers based on v1.2 and above. -- Added cross-version communication support -- Enable reporting of contact URI to stdout, stderr, or file (PR #538) -- Enable support for remote tool connections (PR #540, #542) -- Cleanup libevent configure logi to support default install paths (PR #541) -- Debounce "unreachable" notifications for tools when they disconnect (PR #544) -- Enable the regex generator to support node names that include multiple - sets of numbers - - -2.0.3 -- 1 Feb 2018 ----------------------- -- Fix event notification so all sides of multi-library get notified - of other library's existence -- Update syslog protection to support Mac High Sierra OS -- Remove usock component - unable to support v1.x clients due - to datatype differences -- Cleanup security handshake -- Cleanup separation of PMI-1/2 libraries and PMIx symbols -- Protect against overly-large messages -- Update data buffer APIs to support cross-version operations -- Protect receive callbacks from NULL and/or empty buffers as this - can occur when the peer on a connection disappears. -- Fix tool connection search so it properly descends into the directory - tree while searching for the server's contact file. -- Fix store_local so it doesn't reject a new nspace as that can happen - when working with tools -- Ensure we always complete PMIx_Finalize - don't return if something - goes wrong in the middle of the procedure -- Fix several tool connection issues - - -2.0.2 -- 19 Oct 2017 ----------------------- -- Update RPM spec file (rpmbuild -ta, and --rebuild fixes) (PR #523) -- Support singletons in PMI-1/PMI-2 (PR #537) -- Provide missing implementation support for arrays of pmix_value_t's (PR #531) -- Remove unsupported assembly code for MIPS and ARM processors - prior to v6 (PR #547) -- Fix path separator for PMIx configuration files (PR #547) -- Add configure option to enable/disable the default value for the - show-load-errors MCA param (PR #547) - - -2.0.1 -- 24 Aug. 2017 ----------------------- -- Protect PMIX_INFO_FREE macro from NULL data arrays -- Added attributes to support HWLOC shared memory regions -- Fixed several syntax errors in configure code -- Fixed several visibility errors -- Correctly return status from PMIx_Fence operation -- Restore tool connection support and implement search - operations to discover rendezvous files - - -2.0.0 -- 22 Jun 2017 ----------------------- -**** NOTE: This release implements the complete PMIX v2.0 Standard -**** and therefore includes a number of new APIs and features. These -**** can be tracked by their RFC's in the RFC repository at: -**** https://github.com/pmix/RFCs. A formal standards document will -**** be included in a later v2.x release. Some of the changes are -**** identified below. -- Added the Modular Component Architecture (MCA) plugin manager and - converted a number of operations to plugins, thereby allowing easy - customization and extension (including proprietary offerings) -- Added support for TCP sockets instead of Unix domain sockets for - client-server communications -- Added support for on-the-fly Allocation requests, including requests - for additional resources, extension of time for currently allocated - resources, and return of identified allocated resources to the scheduler - (RFC 0005 - https://github.com/pmix/RFCs/blob/master/RFC0005.md) -- Tightened rules on the processing of PMIx_Get requests, including - reservation of the "pmix" prefix for attribute keys and specifying - behaviors associated with the PMIX_RANK_WILDCARD value - (RFC 0009 - https://github.com/pmix/RFCs/blob/master/RFC0009.md) -- Extended support for tool interactions with a PMIx server aimed at - meeting the needs of debuggers and other tools. Includes support - for rendezvousing with a system-level PMIx server for interacting - with the system management stack (SMS) outside of an allocated - session, and adds two new APIs: - - PMIx_Query: request general information such as the process - table for a specified job, and available SMS capabilities - - PMIx_Log: log messages (e.g., application progress) to a - system-hosted persistent store - (RFC 0010 - https://github.com/pmix/RFCs/blob/master/RFC0010.md) -- Added support for fabric/network interactions associated with - "instant on" application startup - (RFC 0012 - https://github.com/pmix/RFCs/blob/master/RFC0012.md) -- Added an attribute to support getting the time remaining in an - allocation via the PMIx_Query interface - (RFC 0013 - https://github.com/pmix/RFCs/blob/master/RFC0013.md) -- Added interfaces to support job control and monitoring requests, - including heartbeat and file monitors to detect stalled applications. - Job control interface supports standard signal-related operations - (pause, kill, resume, etc.) as well as checkpoint/restart requests. - The interface can also be used by an application to indicate it is - willing to be pre-empted, with the host RM providing an event - notification when the preemption is desired. - (RFC 0015 - https://github.com/pmix/RFCs/blob/master/RFC0015.md) -- Extended the event notification system to support notifications - across threads in the same process, and the ability to direct - ordering of notifications when registering event handlers. - (RFC 0018 - https://github.com/pmix/RFCs/blob/master/RFC0018.md) -- Expose the buffer manipulation functions via a new set of APIs - to support heterogeneous data transfers within the host RM - environment - (RFC 0020 - https://github.com/pmix/RFCs/blob/master/RFC0020.md) -- Fix a number of race condition issues that arose at scale -- Enable PMIx servers to generate notifications to the host RM - and to themselves - - -1.2.5 -- TBD ----------------------- -- Fix cross-version issue when v1.2 client interacts with v2.1 server (PR #564) -- Update client connection for cross-version support (PR #591) -- Fix write memory barrier ASM for PowerPC (PR #606) -- Add protection from overly-large messages - - -1.2.4 -- 13 Oct. 2017 ----------------------- -- Silence some unnecessary warning messages (PR #487) -- Coverity fix - TOCTOU (PR #465) -- automake 1.13 configure fix (PR #486) -- Update RPM spec file (rpmbuild -ta, and --rebuild fixes) (PR #523) -- Support singletons in PMI-1/PMI-2 (PR #537) - - -1.2.3 -- 24 Aug. 2017 ----------------------- -- Resolve visibility issues for public APIs (PR #451) -- Atomics update - remove custom ASM atomics (PR #458) -- Fix job-fence test (PR #423) -- Replace stale PMIX_DECLSPEC with PMIX_EXPORT (PR #448) -- Memory barrier fixes for thread shifting (PR #387) -- Fix race condition in dmodex (PR #346) -- Allow disable backward compatability for PMI-1/2 (PR #350) -- Fix segv in PMIx_server_deregister_nspace (PR #343) -- Fix possible hang in PMIx_Abort (PR #339) - - -1.2.2 -- 21 March 2017 ----------------------- -- Compiler fix for Sun/Oracle CC (PR #322) -- Fix missing include (PR #326) -- Improve error checking around posix_fallocate (PR #329) -- Fix possible memory corruption (PR #331) - - -1.2.1 -- 21 Feb. 2017 ----------------------- -- dstore: Fix data corruption bug in key overwrite cases -- dstore: Performance and scalability fixes -- sm: Use posix_fallocate() before mmap -- pmi1/pmi2: Restore support -- dstore: Fix extension slot size allocation (Issue #280) - - -1.2.0 -- 14 Dec. 2016 ----------------------- -- Add shared memory data storage (dstore) option. Default: enabled - Configure option: --disable-dstore -- PMIx_Commit performance improvements -- Disable errhandler support -- Keep job info in the shared memory dstore -- PMIx_Get performance and memory improvements - -1.1.5 ------ -- Add pmix_version.h to support direct detection of PMIx library version -- Fix support for Solaris 10 by using abstract version of strnlen -- Fix native security module for Solaris by using getpeerucred in - that environment -- Ensure man pages don't get installed in embedded builds -- Pass temporary directory locations in info keys instead of - the environment - -1.1.4 ------ -- Properly increment the reference count for PMIx_Init -- Fix examples so all run properly -- Fix/complete PMI2 backward compatibility support to handle - keys that are not associated with a specific rank -- Do a better job of hiding non-API symbols -- Correct handling of semi-colon terminations on macros. - Thanks to Ashley Pittman for the patch -- Add more man pages -- Improve error checking and messages for connection - attempts from client to server -- If the tmpdir name is too long, provide an appropriate - help message to the user (particularly relevant on - Mac OSX). Thanks to Rainer Keller for the patch. -- Fix some C++ compatibility issues -- Fix/complete PMI-1 backward compatibility support -- Do not install internal headers unless specifically - requested to do so -- Add support for multiple calls to Put/Commit - - -1.1.3 ------ -- Update the symbol hiding file to cover all symbols -- Fix examples and test directory Makefile.am's so - the Makefiles are automatically built and the - code compiled, but not installed -- Do not install the pmix library in embedded use-cases - - -1.1.2 ------ -- Provide a check for hwloc support - if not found, then - don't pass any topology info down to the client as it - won't know how to unpack it anyway. -- Fix a few places where thread safety wasn't provided -- Fix several issues identified by Paul Hargrove: - * PMIx_Init(NULL) is supported - * Incomplete PMIx_constants man page had some lingering cruft - * Missing prototype for pmix_value_load -- Fix race condition in PMIx_Get/PMIx_Get_nb -- Fix double-free error in pmix_server_commit. -- Fix PMIX_LOAD_BUFFER to be safe. - - -1.1.1 ------ -- Fix an issue where the example and test programs - were incorrectly being installed. Thanks to Orion - Poplawski for reporting it - - -1.1.0 ------ -- major update of APIs to reflect comments received from 1.0.0 - non-production release -- fixed thread-safety issues -- fixed a range of pack/unpack issues -- added unit tests for all APIs - - -1.0.0 ------- -Initial public release of draft APIs for comment - not production -intended diff --git a/opal/mca/pmix/pmix4x/openpmix/README b/opal/mca/pmix/pmix4x/openpmix/README deleted file mode 100644 index 1baa1069877..00000000000 --- a/opal/mca/pmix/pmix4x/openpmix/README +++ /dev/null @@ -1,341 +0,0 @@ -Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana - University Research and Technology - Corporation. All rights reserved. -Copyright (c) 2004-2007 The University of Tennessee and The University - of Tennessee Research Foundation. All rights - reserved. -Copyright (c) 2004-2008 High Performance Computing Center Stuttgart, - University of Stuttgart. All rights reserved. -Copyright (c) 2004-2007 The Regents of the University of California. - All rights reserved. -Copyright (c) 2006-2015 Cisco Systems, Inc. All rights reserved. -Copyright (c) 2006-2011 Mellanox Technologies. All rights reserved. -Copyright (c) 2006-2012 Oracle and/or its affiliates. All rights reserved. -Copyright (c) 2007 Myricom, Inc. All rights reserved. -Copyright (c) 2008 IBM Corporation. All rights reserved. -Copyright (c) 2010 Oak Ridge National Labs. All rights reserved. -Copyright (c) 2011 University of Houston. All rights reserved. -Copyright (c) 2013-2017 Intel, Inc. All rights reserved. -$COPYRIGHT$ - -Additional copyrights may follow - -$HEADER$ - -=========================================================================== - -When submitting questions and problems, be sure to include as much -extra information as possible. This web page details all the -information that we request in order to provide assistance: - - http://pmix.github.io/pmix/community/help/ - -The best way to report bugs, send comments, or ask questions is to -sign up on the PMIx mailing list, which is hosted by GoogleGroups: - - pmix@googlegroups.com - -Because of spam, only subscribers are allowed to post to this list -(ensure that you subscribe with and post from exactly the same e-mail -address -- joe@example.com is considered different than -joe@mycomputer.example.com!). You can subscribe to the list here: - - https://groups.google.com/d/forum/pmix - -Thanks for your time. - -=========================================================================== - -More information is available in the PMIx FAQ: - - http://pmix.github.io/pmix/faq/ - -We are in early days, so please be patient - info will grow as questions -are addressed. - -=========================================================================== - -The following abbreviated list of release notes applies to this code -base as of this writing (12 November 2015): - -General notes -------------- - -- The majority of PMIx's documentation is here in this file, the - included man pages, and on the web site FAQ - (http://pmix.github.io/pmix/faq). This will eventually be - supplemented with cohesive installation and user documentation files. - -- Systems that have been tested are: - - Linux (various flavors/distros), 32 bit, with gcc - - Linux (various flavors/distros), 64 bit (x86), with gcc, Intel, - and Portland (*) - - OS X (10.7 and above), 32 and 64 bit (x86_64), with gcc (*) - -(*) Compiler Notes --------------- - -- The Portland Group compilers prior to version 7.0 require the - "-Msignextend" compiler flag to extend the sign bit when converting - from a shorter to longer integer. This is is different than other - compilers (such as GNU). When compiling PMIx with the Portland - compiler suite, the following flags should be passed to PMIx's - configure script: - - shell$ ./configure CFLAGS=-Msignextend ... - - This will compile PMIx with the proper compile flags - -- Running on nodes with different endian and/or different datatype - sizes within a single parallel job is supported in this release. - However, PMIx does not resize data when datatypes differ in size - (for example, sending a 4 byte double and receiving an 8 byte - double will fail). - - -=========================================================================== - -Building PMIx ------------------ - -PMIx uses a traditional configure script paired with "make" to -build. Typical installs can be of the pattern: - ---------------------------------------------------------------------------- -shell$ ./configure [...options...] -shell$ make all install ---------------------------------------------------------------------------- - -There are many available configure options (see "./configure --help" -for a full list); a summary of the more commonly used ones follows: - -INSTALLATION OPTIONS - ---prefix= - Install PMIx into the base directory named . Hence, - PMIx will place its executables in /bin, its header - files in /include, its libraries in /lib, etc. - ---disable-shared - By default, libpmix is built as a shared library. This switch disables - this default; it is really only useful when used with - --enable-static. Specifically, this option does *not* imply - --enable-static; enabling static libraries and disabling shared - libraries are two independent options. - ---enable-static - Build libpmix as a static library. Note that this option does *not* imply - --disable-shared; enabling static libraries and disabling shared - libraries are two independent options. - - --disable-show-load-errors-by-default - Set the default value of the mca_base_component_show_load_errors MCA - variable: the --enable form of this option sets the MCA variable to - true, the --disable form sets the MCA variable to false. The MCA - mca_base_component_show_load_errors variable can still be overridden - at run time via the usual MCA-variable-setting mechanisms; this - configure option simply sets the default value. - - The --disable form of this option is intended for PMIx packagers - who tend to enable support for many different types of networks and - systems in their packages. For example, consider a packager who - includes support for both the FOO and BAR networks in their PMIx - package, both of which require support libraries (libFOO.so and - libBAR.so). If an end user only has BAR hardware, they likely only - have libBAR.so available on their systems -- not libFOO.so. - Disabling load errors by default will prevent the user from seeing - potentially confusing warnings about the FOO components failing to - load because libFOO.so is not available on their systems. - - Conversely, system administrators tend to build a PMIx that is - targeted at their specific environment, and contains few (if any) - components that are not needed. In such cases, they might want - their users to be warned that the FOO network components failed to - load (e.g., if libFOO.so was mistakenly unavailable), and thus - some PMIx calls might unexpectedly return "not supported". - ---with-platform=FILE - Load configure options for the build from FILE. Options on the - command line that are not in FILE are also used. Options on the - command line and in FILE are replaced by what is in FILE. - -Once PMIx has been built and installed, it is safe to run "make -clean" and/or remove the entire build tree. - -VPATH and parallel builds are fully supported. - -Generally speaking, the only thing that users need to do to use PMIx -is ensure that /lib is in their LD_LIBRARY_PATH. Users may -need to ensure to set LD_LIBRARY_PATH in their shell setup files (e.g., -.bashrc, .cshrc) so that non-interactive rsh/ssh-based logins will -be able to find the PMIx library. - -=========================================================================== - -PMIx Version Numbers and Binary Compatibility -------------------------------------------------- - -PMIx has two sets of version numbers that are likely of interest -to end users / system administrator: - - * Software version number - * Shared library version numbers - -Both are described below, followed by a discussion of application -binary interface (ABI) compatibility implications. - -Software Version Number ------------------------ - -PMIx's version numbers are the union of several different values: -major, minor, release, and an optional quantifier. - - * Major: The major number is the first integer in the version string - (e.g., v1.2.3). Changes in the major number typically indicate a - significant change in the code base and/or end-user - functionality. The major number is always included in the version - number. - - * Minor: The minor number is the second integer in the version - string (e.g., v1.2.3). Changes in the minor number typically - indicate a incremental change in the code base and/or end-user - functionality. The minor number is always included in the version - number: - - * Release: The release number is the third integer in the version - string (e.g., v1.2.3). Changes in the release number typically - indicate a bug fix in the code base and/or end-user - functionality. - - * Quantifier: PMIx version numbers sometimes have an arbitrary - string affixed to the end of the version number. Common strings - include: - - o aX: Indicates an alpha release. X is an integer indicating - the number of the alpha release (e.g., v1.2.3a5 indicates the - 5th alpha release of version 1.2.3). - o bX: Indicates a beta release. X is an integer indicating - the number of the beta release (e.g., v1.2.3b3 indicates the 3rd - beta release of version 1.2.3). - o rcX: Indicates a release candidate. X is an integer - indicating the number of the release candidate (e.g., v1.2.3rc4 - indicates the 4th release candidate of version 1.2.3). - -Although the major, minor, and release values (and optional -quantifiers) are reported in PMIx nightly snapshot tarballs, the -filenames of these snapshot tarballs follow a slightly different -convention. - -Specifically, the snapshot tarball filename contains three distinct -values: - - * Most recent Git tag name on the branch from which the tarball was - created. - - * An integer indicating how many Git commits have occurred since - that Git tag. - - * The Git hash of the tip of the branch. - -For example, a snapshot tarball filename of -"pmix-v1.0.2-57-gb9f1fd9.tar.bz2" indicates that this tarball was -created from the v1.0 branch, 57 Git commits after the "v1.0.2" tag, -specifically at Git hash gb9f1fd9. - -PMIx's Git master branch contains a single "dev" tag. For example, -"pmix-dev-8-gf21c349.tar.bz2" represents a snapshot tarball created -from the master branch, 8 Git commits after the "dev" tag, -specifically at Git hash gf21c349. - -The exact value of the "number of Git commits past a tag" integer is -fairly meaningless; its sole purpose is to provide an easy, -human-recognizable ordering for snapshot tarballs. - -Shared Library Version Number ------------------------------ - -PMIx uses the GNU Libtool shared library versioning scheme. - -NOTE: Only official releases of PMIx adhere to this versioning - scheme. "Beta" releases, release candidates, and nightly - tarballs, developer snapshots, and Git snapshot tarballs likely - will all have arbitrary/meaningless shared library version - numbers. - -The GNU Libtool official documentation details how the versioning -scheme works. The quick version is that the shared library versions -are a triple of integers: (current,revision,age), or "c:r:a". This -triple is not related to the PMIx software version number. There -are six simple rules for updating the values (taken almost verbatim -from the Libtool docs): - - 1. Start with version information of "0:0:0" for each shared library. - - 2. Update the version information only immediately before a public - release of your software. More frequent updates are unnecessary, - and only guarantee that the current interface number gets larger - faster. - - 3. If the library source code has changed at all since the last - update, then increment revision ("c:r:a" becomes "c:r+1:a"). - - 4. If any interfaces have been added, removed, or changed since the - last update, increment current, and set revision to 0. - - 5. If any interfaces have been added since the last public release, - then increment age. - - 6. If any interfaces have been removed since the last public release, - then set age to 0. - -Application Binary Interface (ABI) Compatibility ------------------------------------------------- - -PMIx provides forward ABI compatibility in all versions of a given -feature release series and its corresponding -super stable series. For example, on a single platform, an pmix -application linked against PMIx v1.3.2 shared libraries can be -updated to point to the shared libraries in any successive v1.3.x or -v1.4 release and still work properly (e.g., via the LD_LIBRARY_PATH -environment variable or other operating system mechanism). - -PMIx reserves the right to break ABI compatibility at new feature -release series. For example, the same pmix application from above -(linked against PMIx v1.3.2 shared libraries) will *not* work with -PMIx v1.5 shared libraries. - -=========================================================================== - -Common Questions ----------------- - -Many common questions about building and using PMIx are answered -on the FAQ: - - http://pmix.github.io/pmix/faq/ - -=========================================================================== - -Got more questions? -------------------- - -Found a bug? Got a question? Want to make a suggestion? Want to -contribute to PMIx? Please let us know! - -When submitting questions and problems, be sure to include as much -extra information as possible. This web page details all the -information that we request in order to provide assistance: - - http://pmix.github.io/pmix/community/help/ - -Questions and comments should generally be sent to the PMIx mailing -list (pmix@googlegroups.com). Because of spam, only -subscribers are allowed to post to this list (ensure that you -subscribe with and post from *exactly* the same e-mail address -- -joe@example.com is considered different than -joe@mycomputer.example.com!). Visit this page to subscribe to the -user's list: - - https://groups.google.com/d/forum/pmix - -Make today an PMIx day! diff --git a/opal/mca/pmix/pmix4x/openpmix/VERSION b/opal/mca/pmix/pmix4x/openpmix/VERSION deleted file mode 100644 index 078d0259484..00000000000 --- a/opal/mca/pmix/pmix4x/openpmix/VERSION +++ /dev/null @@ -1,87 +0,0 @@ -# Copyright (c) 2008 Sun Microsystems, Inc. All rights reserved. -# Copyright (c) 2008-2011 Cisco Systems, Inc. All rights reserved. -# Copyright (c) 2011 NVIDIA Corporation. All rights reserved. -# Copyright (c) 2013 Mellanox Technologies, Inc. -# All rights reserved. -# Copyright (c) 2014-2016 Intel, Inc. All rights reserved. - -# This is the VERSION file for PMIx, describing the precise -# version of PMIx in this distribution. The various components of -# the version number below are combined to form a single version -# number string. - -# major, minor, and release are generally combined in the form -# ... - -major=4 -minor=0 -release=0 - -# greek is used for alpha or beta release tags. If it is non-empty, -# it will be appended to the version number. It does not have to be -# numeric. Common examples include a1 (alpha release 1), b1 or (beta release 1). -# The only requirement is that it must be entirely printable ASCII -# characters and have no white space. - -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=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 -# this file. For example, if tarball_version is empty, the tarball -# filename will be of the form -# openmpi-...tar.*. However, if -# tarball_version is not empty, the tarball filename will be of the -# form openmpi-.tar.*. - -tarball_version= - -# The date when this release was created - -date="Oct 01, 2019" - -# The shared library version of each of PMIx's public libraries. -# These versions are maintained in accordance with the "Library -# Interface Versions" chapter from the GNU Libtool documentation: -# -# - If the library source code has changed at all since the last -# update, then increment revision (`c:r:a' becomes `c:r+1:a'). -# -# - If any interfaces have been added, removed, or changed since -# the last update, increment current, and set revision to 0. -# -# - If any interfaces have been added since the last public release, -# then increment age. -# -# - If any interfaces have been removed since the last public release, -# then set age to 0. -# -# All changes in these version numbers are dictated by the PMIx -# release managers (not individual developers). Notes: - -# 1. Since these version numbers are associated with *releases*, the -# version numbers maintained on the PMIx Github trunk (and developer -# branches) is always 0:0:0 for all libraries. - -# 2. The version number of libpmix refers to the public pmix interfaces. -# It does not refer to any internal interfaces. - -# Version numbers are described in the Libtool current:revision:age -# format. - -libpmix_so_version=0:0:0 -libpmi_so_version=0:0:0 -libpmi2_so_version=0:0:0 - -# "Common" components install standalone libraries that are run-time -# # linked by one or more components. So they need to be versioned as -# # well. Yuck; this somewhat breaks the -# # components-don't-affect-the-build-system abstraction. -# -libmca_common_dstore_so_version=0:0:0 diff --git a/opal/mca/pmix/pmix4x/openpmix/autogen.pl b/opal/mca/pmix/pmix4x/openpmix/autogen.pl deleted file mode 100755 index 9d365783c8e..00000000000 --- a/opal/mca/pmix/pmix4x/openpmix/autogen.pl +++ /dev/null @@ -1,754 +0,0 @@ -#!/usr/bin/env perl -# -# Copyright (c) 2009-2016 Cisco Systems, Inc. All rights reserved. -# Copyright (c) 2010 Oracle and/or its affiliates. All rights reserved. -# Copyright (c) 2013 Mellanox Technologies, Inc. -# All rights reserved. -# Copyright (c) 2013-2019 Intel, Inc. All rights reserved. -# Copyright (c) 2015 Research Organization for Information Science -# and Technology (RIST). All rights reserved. -# Copyright (c) 2015 IBM Corporation. All rights reserved. -# -# $COPYRIGHT$ -# -# Additional copyrights may follow -# -# $HEADER$ -# - -use strict; - -use Cwd; -use File::Basename; -use File::Find; -use Data::Dumper; -use Getopt::Long; - -# -# Global variables -# - -# Sentinel file to remove if we fail -my $sentinel; - -# The m4 file we'll write at the end -my $m4_output_file = "config/autogen_found_items.m4"; -my $m4; -# Sanity check file -my $topdir_file = "include/pmix.h"; -my $dnl_line = "dnl ---------------------------------------------------------------------------"; -# The text file we'll write at the end that will contain -# all the mca component directory paths -my $mca_library_paths_file = "config/mca_library_paths.txt"; - -# Data structures to fill up with all the stuff we find -my $mca_found; -my @subdirs; - -# Command line parameters -my $quiet_arg = 0; -my $debug_arg = 0; -my $help_arg = 0; -my $include_arg = 0; -my $exclude_arg = 0; -my $force_arg = 0; - -# Include/exclude lists -my $include_list; -my $exclude_list; - -# Minimum versions -my $pmix_automake_version = "1.13.4"; -my $pmix_autoconf_version = "2.69"; -my $pmix_libtool_version = "2.4.2"; - -# Search paths -my $pmix_autoconf_search = "autoconf"; -my $pmix_automake_search = "automake"; -my $pmix_libtoolize_search = "libtoolize;glibtoolize"; - -# One-time setup -my $username; -my $hostname; -my $full_hostname; - -$username = getpwuid($>); -$full_hostname = `hostname`; -chomp($full_hostname); -$hostname = $full_hostname; -$hostname =~ s/^([\w\-]+)\..+/\1/; - -############################################################################## - -sub my_die { - unlink($sentinel) - if ($sentinel); - die @_; -} - -sub my_exit { - my ($ret) = @_; - unlink($sentinel) - if ($sentinel && $ret != 0); - exit($ret); -} - -############################################################################## - -sub verbose { - print @_ - if (!$quiet_arg); -} - -sub debug { - print @_ - if ($debug_arg); -} - -sub debug_dump { - my $d = new Data::Dumper([@_]); - $d->Purity(1)->Indent(1); - debug $d->Dump; -} - -############################################################################## - -sub mca_process_component { - my ($framework, $component) = @_; - - my $cdir = "src/mca/$framework/$component"; - - return - if (! -d $cdir); - - # Process this directory - my $found_component; - - $found_component = { - name => $component, - framework_name => $framework, - abs_dir => $cdir, - }; - - # Does this directory have a configure.m4 file? - if (-f "$cdir/configure.m4") { - $found_component->{"configure.m4"} = 1; - verbose " Found configure.m4 file\n"; - } - - # Push the results onto the $mca_found hash array - push(@{$mca_found->{$framework}->{"components"}}, - $found_component); - - # save the directory for later to create the paths - # to all the component libraries - push(@subdirs, $cdir); -} - -############################################################################## - -sub ignored { - my ($dir) = @_; - - # If this directory does not have .pmix_ignore, or if it has a - # .pmix_unignore that has my username in it, then add it to the - # list of components. - my $ignored = 0; - - if (-f "$dir/.pmix_ignore") { - $ignored = 1; - } - if (-f "$dir/.pmix_unignore") { - open(UNIGNORE, "$dir/.pmix_unignore") || - my_die "Can't open $dir/.pmix_unignore file"; - my $unignore; - $unignore .= $_ - while (); - close(UNIGNORE); - - $ignored = 0 - if ($unignore =~ /^$username$/m || - $unignore =~ /^$username\@$hostname$/m || - $unignore =~ /^$username\@$full_hostname$/m); - } - - return $ignored; -} - -############################################################################## - -sub mca_process_framework { - my ($framework) = @_; - - # Does this framework have a configure.m4 file? - my $dir = "src/mca/$framework"; - if (-f "$dir/configure.m4") { - $mca_found->{$framework}->{"configure.m4"} = 1; - verbose " Found framework configure.m4 file\n"; - } - - # Did we exclude all components for this framework? - if (exists($exclude_list->{$framework}) && - $exclude_list->{$framework}[0] eq "AGEN_EXCLUDE_ALL") { - verbose " => Excluded\n"; - } else { - # Look for component directories in this framework - if (-d $dir) { - $mca_found->{$framework}->{found} = 1; - opendir(DIR, $dir) || - my_die "Can't open $dir directory"; - foreach my $d (sort(readdir(DIR))) { - # Skip any non-directory, "base", or any dir that - # begins with "." - next - if (! -d "$dir/$d" || $d eq "base" || - substr($d, 0, 1) eq "."); - - # Skip any component that doesn't have a configure.m4 - # or Makefile.am as we couldn't build it anyway - if (! -f "$dir/$d/configure.m4" && - ! -f "$dir/$d/Makefile.am" && - ! -f "$dir/$d/configure.ac" && - ! -f "$dir/$d/configure.in") { - verbose " => No sentinel file found in $dir/$d -> Excluded\n"; - next; - } - - verbose "--- Found pmix / $framework / $d component: src/mca/$framework/$d\n"; - - # Skip if specifically excluded - if (exists($exclude_list->{$framework}) && - $exclude_list->{$framework}[0] eq $d) { - verbose " => Excluded\n"; - next; - } - - # Skip if the framework is on the include list, but - # doesn't contain this component - if (exists($include_list->{$framework})) { - my $tst = 0; - foreach my $ck (@{$include_list->{$framework}}) { - if ($ck ne $d) { - verbose " => Not included\n"; - $tst = 1; - last; - } - } - if ($tst) { - next; - } - } - - # Check ignore status - if (ignored("$dir/$d")) { - verbose " => Ignored (found .pmix_ignore file)\n"; - } else { - mca_process_component($framework, $d); - } - } - } - closedir(DIR); - } -} - -############################################################################## - -sub mca_generate_framework_header(\$\@) { - my (@frameworks) = @_; - my $framework_array_output=""; - my $framework_decl_output=""; - - foreach my $framework (@frameworks) { - # There is no common framework object - if ($framework ne "common" and $framework ne "src") { - my $framework_name = "pmix_${framework}_base_framework"; - $framework_array_output .= " &$framework_name,\n"; - $framework_decl_output .= "extern pmix_mca_base_framework_t $framework_name;\n"; - } - } - - my $ifdef_string = uc "pmix_FRAMEWORKS_H"; - open(FRAMEWORKS_OUT, ">src/include/frameworks.h"); - printf FRAMEWORKS_OUT "%s", "/* - * This file is autogenerated by autogen.pl. Do not edit this file by hand. - */ -#ifndef $ifdef_string -#define $ifdef_string - -#include - -$framework_decl_output -static pmix_mca_base_framework_t *pmix_frameworks[] = { -$framework_array_output NULL -}; - -#endif /* $ifdef_string */\n\n"; - close(FRAMEWORKS_OUT); -} - -############################################################################## - -sub mca_process_project { - - # Look for framework directories - my $dir = "src/mca"; - opendir(DIR, $dir) || - my_die "Can't open $dir directory"; - my @my_dirs = readdir(DIR); - @my_dirs = sort(@my_dirs); - - foreach my $d (@my_dirs) { - # Skip any non-directory, "base", or any dir that begins with "." - next - if (! -d "$dir/$d" || $d eq "base" || substr($d, 0, 1) eq "."); - - # If this directory has a $dir.h file and a base/ - # subdirectory, or its name is "common", then it's a - # framework. - if ("common" eq $d || - (-f "$dir/$d/$d.h" && -d "$dir/$d/base")) { - verbose "\n=== Found pmix framework: src/mca/$d\n"; - mca_process_framework($d); - } - } - closedir(DIR); -} - -############################################################################## - -sub mca_run_global { - - # Go find a list of frameworks, and for each of - # those, go find a list of components. - mca_process_project(); - - # Debugging output - debug_dump($mca_found); - - $m4 .= "\n$dnl_line -$dnl_line -$dnl_line - -dnl MCA information\n"; - - # Array for all the m4_includes that we'll need to pick up the - # configure.m4's. - my @includes; - - # Write the list of frameworks - my $frameworks_comma; - - # Print out project-level info - my @mykeys = keys(%{$mca_found}); - @mykeys = sort(@mykeys); - - # Ensure that the "common" framework is listed first - # (if it exists) - my @tmp; - push(@tmp, "common") - if (grep(/common/, @mykeys)); - foreach my $f (@mykeys) { - push(@tmp, $f) - if ($f ne "common"); - } - @mykeys = @tmp; - - foreach my $f (@mykeys) { - $frameworks_comma .= ", $f"; - - # Does this framework have a configure.m4 file? - push(@includes, "src/mca/$f/configure.m4") - if (exists($mca_found->{$f}->{"configure.m4"})); - - # This framework does have a Makefile.am (or at least, - # it should!) - my_die "Missing src/mca/$f/Makefile.am" - if (! -f "src/mca/$f/Makefile.am"); - } - $frameworks_comma =~ s/^, //; - - &mca_generate_framework_header("src", @mykeys); - - $m4 .= "$dnl_line - -dnl Frameworks in the pmix project and their corresponding directories -m4_define([mca_pmix_framework_list], [$frameworks_comma]) - -"; - - # Print out framework-level info - foreach my $f (@mykeys) { - my $components; - my $m4_config_component_list; - my $no_config_component_list; - - # Troll through each of the found components - foreach my $comp (@{$mca_found->{$f}->{components}}) { - my $c = $comp->{name}; - $components .= "$c "; - - # Does this component have a configure.m4 file? - if (exists($comp->{"configure.m4"})) { - push(@includes, "src/mca/$f/$c/configure.m4"); - $m4_config_component_list .= ", $c"; - } else { - $no_config_component_list .= ", $c"; - } - } - $m4_config_component_list =~ s/^, //; - $no_config_component_list =~ s/^, //; - - $m4 .= "dnl Components in the pmix / $f framework -m4_define([mca_pmix_${f}_m4_config_component_list], [$m4_config_component_list]) -m4_define([mca_pmix_${f}_no_config_component_list], [$no_config_component_list]) - -"; - } - - # List out all the m4_include - $m4 .= "$dnl_line - -dnl List of configure.m4 files to include\n"; - foreach my $i (@includes) { - $m4 .= "m4_include([$i])\n"; - } -} - - -############################################################################## -# Find and remove stale files - -sub find_and_delete { - foreach my $file (@_) { - my $removed = 0; - if (-f $file) { - unlink($file); - $removed = 1; - } - if (-f "config/$file") { - unlink("config/$file"); - $removed = 1; - } - debug " Removed stale copy of $file\n" - if ($removed); - } -} - -############################################################################## -# Find a specific executable and ensure that it is a recent enough -# version. - -sub find_and_check { - my ($app, $app_name, $req_version) = @_; - - my @search_path = split(/;/, $app_name); - my @min_version = split(/\./, $req_version); - my @versions_found = (); - - foreach (@search_path) { - verbose " Searching for $_\n"; - my $version = `$_ --version`; - if (!defined($version)) { - verbose " $_ not found\n"; - next; - } - - # Matches a version string with 1 or more parts possibly prefixed with a letter (ex: - # v2.2) or followed by a letter (ex: 2.2.6b). This regex assumes there is a space - # before the version string and that the version is ok if there is no version. - if (!($version =~ m/\s[vV]?(\d[\d\.]*\w?)/m)) { - verbose " WARNING: $_ does not appear to support --version. Assuming it is ok\n"; - - return; - } - - $version = $1; - - verbose " Found $_ version $version; checking version...\n"; - push(@versions_found, $version); - - my @parts = split(/\./, $version); - my $i = 0; - # Check every component of the version number - while ($i <= $#min_version) { - verbose " Found version component $parts[$i] -- need $min_version[$i]\n"; - - # Check to see if there are any characters (!) in the - # version number (e.g., Libtool's "2.2.6b" -- #%@#$%!!!). - # Do separate comparisons between the number and any - # trailing digits. You can't just "lt" compare the whole - # string because "10 lt 2b" will return true. #@$@#$#@$ - # Libtool!! - $parts[$i] =~ m/(\d+)([a-z]*)/i; - my $pn = $1; - my $pa = $2; - $min_version[$i] =~ m/(\d+)([a-z]*)/i; - my $mn = $1; - my $ma = $2; - - # If the version is higher, we're done. - if ($pn > $mn) { - verbose " ==> ACCEPTED\n"; - return; - } - # If the version is lower, we're done. - elsif ($pn < $mn || - ($pn == $mn && $pa lt $ma)) { - verbose " ==> Too low! Skipping this version\n"; - last; - } - - # If the version was equal, keep checking. - ++$i; - } - - # If we found a good version, return. - if ($i > $#min_version) { - verbose " ==> ACCEPTED\n"; - return; - } - } - - # if no acceptable version found, reject it - print " -================================================================= -I could not find a recent enough copy of $app. -I need at least $req_version, but only found the following versions:\n\n"; - - my $i = 0; - foreach (@search_path) { - print " $_: $versions_found[$i]\n"; - $i++; - } - - print "\nI am gonna abort. :-( - -Please make sure you are using at least the following versions of the -tools: - - GNU Autoconf: $pmix_autoconf_version - GNU Automake: $pmix_automake_version - GNU Libtool: $pmix_libtool_version -=================================================================\n"; - my_exit(1); -} - -############################################################################## - -sub safe_system { - print "Running: " . join(/ /, @_) . "\n"; - my $ret = system(@_); - $ret >>= 8; - if (0 != $ret) { - print "Command failed: @_\n"; - my_exit($ret); - } - $ret; -} - -############################################################################## - -sub in_tarball { - my $tarball = 0; - open(IN, "VERSION") || my_die "Can't open VERSION"; - # If repo_rev is not an empty string, we are in a tarball - while () { - my $line = $_; - my @fields = split(/=/,$line); - if ($fields[0] eq "repo_rev") { - if ($fields[1] ne "\n") { - $tarball = 1; - last; - } - } - } - close(IN); - return $tarball; -} - -############################################################################## -############################################################################## -## main - do the real work... -############################################################################## -############################################################################## - -# Command line parameters - -my $ok = Getopt::Long::GetOptions("quiet|q" => \$quiet_arg, - "debug|d" => \$debug_arg, - "help|h" => \$help_arg, - "include=s" => \$include_arg, - "exclude=s" => \$exclude_arg, - "force|f" => \$force_arg, - ); - -if (!$ok || $help_arg) { - print "Invalid command line argument.\n\n" - if (!$ok); - print "Options: - --quiet | -q Do not display normal verbose output - --debug | -d Output lots of debug information - --help | -h This help list - --include | -i Comma-separated list of framework-component pairs - to be exclusively built - i.e., all other components - will be ignored and only those specified will be marked - to build - --exclude | -e Comma-separated list of framework or framework-component - to be excluded from the build - --force | -f Run even if invoked from the source tree of an expanded - distribution tarball\n"; - my_exit($ok ? 0 : 1); -} - -#--------------------------------------------------------------------------- - -# Check for project existence -my $project_name_long = "PMIx"; -my $project_name_short = "PMIx"; - -#--------------------------------------------------------------------------- - -$full_hostname = `hostname`; -chomp($full_hostname); - -$m4 = "dnl -dnl \$HEADER\$ -dnl -$dnl_line -dnl This file is automatically created by autogen.pl; it should not -dnl be edited by hand!! -dnl -dnl Generated by $username at " . localtime(time) . " -dnl on $full_hostname. -$dnl_line\n\n"; - -#--------------------------------------------------------------------------- - -# Verify that we're in the PMIx root directory by checking for a token file. - -my_die "Not at the root directory of an PMIx source tree" - if (! -f "config/pmix_mca.m4"); - -$force_arg = 1; - -my_die "autogen.pl has been invoked in the source tree of a PMIx distribution tarball; aborting... -You likely do not need to invoke \"autogen.pl\" -- you can probably run \"configure\" directly. -If you really know what you are doing, and really need to run autogen.pl, use the \"--force\" flag." - if (!$force_arg && in_tarball()); - -# Now that we've verified that we're in the top-level OMPI directory, -# set the sentinel file to remove if we abort. -$sentinel = Cwd::cwd() . "/configure"; - -#--------------------------------------------------------------------------- - -my $step = 1; -verbose "PMIx autogen (buckle up!) - -$step. Checking tool versions\n\n"; - -# Check the autotools revision levels -&find_and_check("autoconf", $pmix_autoconf_search, $pmix_autoconf_version); -&find_and_check("libtool", $pmix_libtoolize_search, $pmix_libtool_version); -&find_and_check("automake", $pmix_automake_search, $pmix_automake_version); - -#--------------------------------------------------------------------------- - -# No platform file -- write an empty list -$m4 .= "m4_define([autogen_platform_file], [])\n\n"; - -if ($exclude_arg) { - debug "Using exclude list: $exclude_arg"; - my @list = split(/,/, $exclude_arg); - foreach (@list) { - my @pairs = split(/-/, $_); - if (exists($pairs[1])) { - # Remove any trailing newlines - chomp($pairs[1]); - debug " Adding ".$pairs[0]."->".$pairs[1]." to exclude list\n"; - push(@{$exclude_list->{$pairs[0]}}, $pairs[1]); - } else { - debug " Adding $pairs[0] to exclude list\n"; - push(@{$exclude_list->{$pairs[0]}}, "AGEN_EXCLUDE_ALL"); - } - } -} -if ($include_arg) { - debug "Using include list: $include_arg"; - my @list = split(/,/, $include_arg); - foreach (@list) { - my @pairs = split(/-/, $_); - if (exists($pairs[1])) { - # Remove any trailing newlines - chomp($pairs[1]); - debug " Adding ".$pairs[0]."->".$pairs[1]." to include list\n"; - push(@{$include_list->{$pairs[0]}}, $pairs[1]); - } - # NOTE: it makes no sense to include all as that is the default - # so ignore that scenario here, if given - } -} - -#--------------------------------------------------------------------------- - -# Find frameworks, components -++$step; -verbose "\n$step. Searching for MCA frameworks and components\n"; - -my $ret; - -# Figure out if we're at the top level of the PMIx tree or not. -if (! (-f "VERSION" && -f "configure.ac" && -f $topdir_file)) { - print("\n\nYou must run this script from the top-level directory of the PMIx tree.\n\n"); - my_exit(1); -} - -$m4 .= "\ndnl Project names -m4_define([project_name_long], [$project_name_long]) -m4_define([project_name_short], [$project_name_short])\n"; - -# Setup MCA -mca_run_global(); - -#--------------------------------------------------------------------------- - -# If we got here, all was good. Run the auto tools. -++$step; -verbose "\n$step. Running autotools on top-level tree\n\n"; - -# Remove old versions of the files (this is probably overkill, but...) -verbose "==> Remove stale files\n"; -find_and_delete(qw/config.guess config.sub depcomp compile install-sh ltconfig - ltmain.sh missing mkinstalldirs libtool/); - -# Remove the old m4 file and write the new one -verbose "==> Writing m4 file with autogen.pl results\n"; -unlink($m4_output_file); -open(M4, ">$m4_output_file") || - my_die "Can't open $m4_output_file"; -print M4 $m4; -close(M4); - -# Remove the old library path file and write the new one -verbose "==> Writing txt file with all the mca component paths\n"; -unlink($mca_library_paths_file); -open(M4, ">$mca_library_paths_file") || - my_die "Cannot open $mca_library_paths_file"; -my $paths = join(":", @subdirs); -print M4 $paths; -close(M4); - -# Run autoreconf -verbose "==> Running autoreconf\n"; -my $cmd = "autoreconf -ivf --warnings=all,no-obsolete,no-override -I config"; -safe_system($cmd); - -#--------------------------------------------------------------------------- - -verbose " -================================================ -PMIx autogen: completed successfully. w00t! -================================================\n\n"; - -# Done! -exit(0); diff --git a/opal/mca/pmix/pmix4x/openpmix/bindings/Makefile.am b/opal/mca/pmix/pmix4x/openpmix/bindings/Makefile.am deleted file mode 100644 index e1c8d72b977..00000000000 --- a/opal/mca/pmix/pmix4x/openpmix/bindings/Makefile.am +++ /dev/null @@ -1,22 +0,0 @@ -# -# 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-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-2010 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$ -# -# Additional copyrights may follow -# -# $HEADER$ -# - -SUBDIRS = python diff --git a/opal/mca/pmix/pmix4x/openpmix/bindings/README b/opal/mca/pmix/pmix4x/openpmix/bindings/README deleted file mode 100644 index 5175549d191..00000000000 --- a/opal/mca/pmix/pmix4x/openpmix/bindings/README +++ /dev/null @@ -1,21 +0,0 @@ -Copyright (c) 2016-2018 Intel, Inc. All rights reserved. - -$COPYRIGHT$ - -Additional copyrights may follow - -$HEADER$ - -=========================================================================== - -This is where bindings of PMIx functions to alternative programming languages -such as Python reside. All functions defined in the public headers have been -provided with a wrapper. Note that there is no restriction on the number of -wrappers that can exist, nor on what type of function is wrapped. - -There is only one rule to observe: you can wrap a framework, but you cannot wrap a -specific plugin within that framework. This constraint flows from the fact that -plugins are only accessed via the framework interface - thus, there is no way to -guarantee that a particular plugin will be the active selection. - - diff --git a/opal/mca/pmix/pmix4x/openpmix/bindings/python/Makefile.am b/opal/mca/pmix/pmix4x/openpmix/bindings/python/Makefile.am deleted file mode 100644 index fa9c5887681..00000000000 --- a/opal/mca/pmix/pmix4x/openpmix/bindings/python/Makefile.am +++ /dev/null @@ -1,44 +0,0 @@ -# -# 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-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-2010 Cisco Systems, Inc. All rights reserved. -# Copyright (c) 2012-2013 Los Alamos National Security, Inc. All rights reserved. -# Copyright (c) 2013-2019 Intel, Inc. All rights reserved. -# Copyright (c) 2018 Research Organization for Information Science -# and Technology (RIST). All rights reserved. -# $COPYRIGHT$ -# -# Additional copyrights may follow -# -# $HEADER$ -# - -helpers = setup.py pmix.pyx pmix.pxi construct.py - -EXTRA_DIST = $(helpers) - -if WANT_PYTHON_BINDINGS - -install-exec-local: $(helpers) - $(PYTHON) $(top_srcdir)/bindings/python/construct.py --src="$(top_builddir)/include" - $(PYTHON) $(top_srcdir)/bindings/python/setup.py build_ext --include-dirs="$(top_builddir)/include" --library-dirs="$(DESTDIR)$(libdir)" --user - $(PYTHON) $(top_srcdir)/bindings/python/setup.py install --prefix="$(DESTDIR)$(prefix)" - -uninstall-hook: - rm -f $(pythondir)/pmix*.so - rm -f $(pythondir)/pypmix-*.egg-info - -CLEANFILES += pmix.c - -clean-local: - rm -rf build - -endif diff --git a/opal/mca/pmix/pmix4x/openpmix/bindings/python/README b/opal/mca/pmix/pmix4x/openpmix/bindings/python/README deleted file mode 100644 index 0fbdd06fedf..00000000000 --- a/opal/mca/pmix/pmix4x/openpmix/bindings/python/README +++ /dev/null @@ -1,49 +0,0 @@ -=========================================================================== -Cython-based Python wrapper for PMIx -=========================================================================== - - -Example -------- - -This example starts up a persistent DVM and then spawns some tasks using -Python. - -$ virtualenv ve -$ source ve/bin/activate -$ pip install orte-cffi -$ orte-dvm --report-uri dvm_uri -$ python examples/submit.py - - -Create a distfile ----------------------------------------- - -If you want to create a sdist file: - -$ virtualenv ve -$ source ve/bin/activate -$ python setup.py sdist - - -Uploading sdist to pypi ------------------------ - -Assuming you have admin privileges to the pypi package repository for this -package, a new version can be uploaded using twine: - -$ virtualenv ve -$ source ve/bin/activate -$ pip install twine -$ twine upload dist/orte-cffi-`python setup.py --version`.tar.gz - - -Building (for development purposes only) ----------------------------------------- - -If you want to create a non-pip build: - -$ virtualenv ve -$ source ve/bin/activate -$ pip install cffi -$ python src/orte-cffi/build.py diff --git a/opal/mca/pmix/pmix4x/openpmix/bindings/python/construct.py b/opal/mca/pmix/pmix4x/openpmix/bindings/python/construct.py deleted file mode 100755 index 6e74fd0b38b..00000000000 --- a/opal/mca/pmix/pmix4x/openpmix/bindings/python/construct.py +++ /dev/null @@ -1,520 +0,0 @@ -#!/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 deleted file mode 100644 index b2f2548d1a2..00000000000 --- a/opal/mca/pmix/pmix4x/openpmix/bindings/python/pmix.pxi +++ /dev/null @@ -1,1018 +0,0 @@ -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 deleted file mode 100644 index 6dddb98c5d5..00000000000 --- a/opal/mca/pmix/pmix4x/openpmix/bindings/python/pmix.pyx +++ /dev/null @@ -1,2265 +0,0 @@ -#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 deleted file mode 100755 index 4737c60df12..00000000000 --- a/opal/mca/pmix/pmix4x/openpmix/bindings/python/setup.py +++ /dev/null @@ -1,47 +0,0 @@ -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/openpmix/config/Makefile.am b/opal/mca/pmix/pmix4x/openpmix/config/Makefile.am deleted file mode 100644 index 6e3961dfaf2..00000000000 --- a/opal/mca/pmix/pmix4x/openpmix/config/Makefile.am +++ /dev/null @@ -1,51 +0,0 @@ -# Copyright (c) 2013-2019 Intel, Inc. All rights reserved. -# Copyright (c) 2016 Research Organization for Information Science -# and Technology (RIST). All rights reserved. -# Copyright (c) 2006-2016 Cisco Systems, Inc. All rights reserved. -# Copyright (c) 2004-2006 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) 2010 Cisco Systems, Inc. All rights reserved. -# Copyright (c) 2010 Oracle and/or its affiliates. All rights -# reserved. -# Copyright (c) 2016 Intel, Inc. All rights reserved. -# $COPYRIGHT$ -# -# Additional copyrights may follow -# -# $HEADER$ -# - -EXTRA_DIST = \ - c_get_alignment.m4 \ - pmix_get_version.sh \ - distscript.sh \ - pmix_check_attributes.m4 \ - pmix_check_broken_qsort.m4 \ - pmix_check_compiler_version.m4 \ - pmix_check_icc.m4 \ - pmix_check_ident.m4 \ - pmix_check_package.m4 \ - pmix_check_vendor.m4 \ - pmix_check_visibility.m4 \ - pmix_check_lock.m4 \ - pmix_config_subdir.m4 \ - pmix_ensure_contains_optflags.m4 \ - pmix_functions.m4 \ - pmix.m4 \ - pmix_search_libs.m4 \ - pmix_setup_cc.m4 \ - pmix_setup_libevent.m4 \ - pmix_mca_priority_sort.pl \ - mca_library_paths.txt - - -maintainer-clean-local: - rm -f pmix_get_version.sh diff --git a/opal/mca/pmix/pmix4x/openpmix/config/c_get_alignment.m4 b/opal/mca/pmix/pmix4x/openpmix/config/c_get_alignment.m4 deleted file mode 100644 index 4ef0ba25e32..00000000000 --- a/opal/mca/pmix/pmix4x/openpmix/config/c_get_alignment.m4 +++ /dev/null @@ -1,74 +0,0 @@ -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) 2009 Sun Microsystems, 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$ -dnl -dnl Additional copyrights may follow -dnl -dnl $HEADER$ -dnl - -# PMIX_C_GET_ALIGN(type, config_var) -# ---------------------------------- -# Determine datatype alignment. -# First arg is type, 2nd arg is config var to define. -# Now that we require C99 compilers, we include stdbool.h -# in the alignment test so that we can find the definition -# of "bool" when we test for its alignment. We might be able -# to avoid this if we test for alignment of _Bool, but -# since we use "bool" in the code, let's be safe and check -# what we use. Yes, they should be the same - but "should" and -# "are" frequently differ -AC_DEFUN([PMIX_C_GET_ALIGNMENT],[ - AC_CACHE_CHECK([alignment of $1], - [AS_TR_SH([pmix_cv_c_align_$1])], - [AC_RUN_IFELSE([AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT - #include ], -[[ - struct foo { char c; $1 x; }; - struct foo *p = (struct foo *) malloc(sizeof(struct foo)); - int diff; - FILE *f=fopen("conftestval", "w"); - if (!f) exit(1); - diff = ((char *)&p->x) - ((char *)&p->c); - free(p); - fprintf(f, "%d\n", (diff >= 0) ? diff : -diff); - fclose(f); -]])], [AS_TR_SH([pmix_cv_c_align_$1])=`cat conftestval`], - [AC_MSG_WARN([*** Problem running configure test!]) - AC_MSG_WARN([*** See config.log for details.]) - AC_MSG_ERROR([*** Cannot continue.])], - [ # cross compile - do a non-executable test. Trick - # taken from the Autoconf 2.59c. Switch to using - # AC_CHECK_ALIGNOF when we can require Autoconf 2.60. - _AC_COMPUTE_INT([(long int) offsetof (pmix__type_alignof_, y)], - [AS_TR_SH([pmix_cv_c_align_$1])], - [AC_INCLUDES_DEFAULT -#include - -#ifndef offsetof -# define offsetof(type, member) ((char *) &((type *) 0)->member - (char *) 0) -#endif -typedef struct { char x; $1 y; } pmix__type_alignof_; -], - [AC_MSG_WARN([*** Problem running configure test!]) - AC_MSG_WARN([*** See config.log for details.]) - AC_MSG_ERROR([*** Cannot continue.])])])]) - -AC_DEFINE_UNQUOTED([$2], [$AS_TR_SH([pmix_cv_c_align_$1])], [Alignment of type $1]) -eval "$2=$AS_TR_SH([pmix_cv_c_align_$1])" - -rm -rf conftest* ]) dnl diff --git a/opal/mca/pmix/pmix4x/openpmix/config/distscript.sh b/opal/mca/pmix/pmix4x/openpmix/config/distscript.sh deleted file mode 100755 index d4a9dce6ab3..00000000000 --- a/opal/mca/pmix/pmix4x/openpmix/config/distscript.sh +++ /dev/null @@ -1,67 +0,0 @@ -#!/bin/sh -# -# 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) 2009-2015 Cisco Systems, Inc. All rights reserved. -# Copyright (c) 2015-2019 Research Organization for Information Science -# and Technology (RIST). All rights reserved. -# Copyright (c) 2015 Los Alamos National Security, LLC. All rights -# reserved. -# Copyright (c) 2017 Intel, Inc. All rights reserved. -# $COPYRIGHT$ -# -# Additional copyrights may follow -# -# $HEADER$ -# - -srcdir=$1 -builddir=$PWD -distdir=$builddir/$2 -PMIX_REPO_REV=$3 - -if test x"$2" = x ; then - echo "*** ERROR: Must supply relative distdir as argv[2] -- aborting" - exit 1 -elif test ! -d "$distdir" ; then - echo "*** ERROR: dist dir does not exist" - echo "*** ERROR: $distdir" - exit 1 -fi - -# We can catch some hard (but possible) to do mistakes by looking at -# our repo's revision, but only if we are in the source tree. -# Otherwise, use what configure told us, at the cost of allowing one -# or two corner cases in (but otherwise VPATH builds won't work). -repo_rev=$PMIX_REPO_REV -if test -e .git ; then - repo_rev=$(config/pmix_get_version.sh VERSION --repo-rev) -fi - -# -# Update VERSION:repo_rev with the best value we have. -# -perl -pi -e 's/^repo_rev=.*/repo_rev='$repo_rev'/' -- "${distdir}/VERSION" -# need to reset the timestamp to not annoy AM dependencies -touch -r "${srcdir}/VERSION" "${distdir}/VERSION" - -echo "*** Updated VERSION file with repo rev: $repo_rev" -echo "*** (via dist-hook / config/distscript.sh)" - -# -# Update pmix.spec:%{version} with the main version -# -PMIX_SPEC=contrib/pmix.spec -perl -pi -e 's/^Version:.*/Version: '$PMIX_REPO_REV'/' -- "${distdir}/$PMIX_SPEC" -touch -r "${srcdir}/$PMIX_VERSION" "${distdir}/$PMIX_VERSION" - -echo "*** Updated $PMIX_SPEC file with repo rev: $PMIX_REPO_REV" -echo "*** (via dist-hook / config/distscript.sh)" diff --git a/opal/mca/pmix/pmix4x/openpmix/config/pmix.m4 b/opal/mca/pmix/pmix4x/openpmix/config/pmix.m4 deleted file mode 100644 index bf4ba32491e..00000000000 --- a/opal/mca/pmix/pmix4x/openpmix/config/pmix.m4 +++ /dev/null @@ -1,1353 +0,0 @@ -dnl -*- shell-script -*- -dnl -dnl Copyright (c) 2004-2010 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-2016 Cisco Systems, Inc. All rights reserved. -dnl Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved. -dnl Copyright (c) 2009-2018 IBM Corporation. All rights reserved. -dnl Copyright (c) 2009 Los Alamos National Security, LLC. All rights -dnl reserved. -dnl Copyright (c) 2009-2011 Oak Ridge National Labs. All rights reserved. -dnl Copyright (c) 2011-2013 NVIDIA Corporation. All rights reserved. -dnl Copyright (c) 2013-2019 Intel, Inc. All rights reserved. -dnl Copyright (c) 2015-2019 Research Organization for Information Science -dnl and Technology (RIST). All rights reserved. -dnl Copyright (c) 2016 Mellanox Technologies, Inc. -dnl All rights reserved. -dnl -dnl $COPYRIGHT$ -dnl -dnl Additional copyrights may follow -dnl -dnl $HEADER$ -dnl - -AC_DEFUN([PMIX_SETUP_CORE],[ - - AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS]) - AC_REQUIRE([AC_CANONICAL_TARGET]) - - # AM_PROG_CC_C_O AC_REQUIREs AC_PROG_CC, so we have to be a little - # careful about ordering here, and AC_REQUIRE these things so that - # they get stamped out in the right order. - AC_REQUIRE([_PMIX_START_SETUP_CC]) - AC_REQUIRE([_PMIX_PROG_CC]) - AC_REQUIRE([AM_PROG_CC_C_O]) - - - # If no prefix was defined, set a good value - m4_ifval([$1], - [m4_define([pmix_config_prefix],[$1/])], - [m4_define([pmix_config_prefix], [])]) - - # Get pmix's absolute top builddir (which may not be the same as - # the real $top_builddir) - PMIX_startdir=`pwd` - if test x"pmix_config_prefix" != "x" && test ! -d "pmix_config_prefix"; then - mkdir -p "pmix_config_prefix" - fi - if test x"pmix_config_prefix" != "x"; then - cd "pmix_config_prefix" - fi - PMIX_top_builddir=`pwd` - AC_SUBST(PMIX_top_builddir) - - # Get pmix's absolute top srcdir (which may not be the same as the - # real $top_srcdir. First, go back to the startdir incase the - # $srcdir is relative. - - cd "$PMIX_startdir" - cd "$srcdir"/pmix_config_prefix - PMIX_top_srcdir="`pwd`" - AC_SUBST(PMIX_top_srcdir) - - # Go back to where we started - cd "$PMIX_startdir" - - AC_MSG_NOTICE([pmix builddir: $PMIX_top_builddir]) - AC_MSG_NOTICE([pmix srcdir: $PMIX_top_srcdir]) - if test "$PMIX_top_builddir" != "$PMIX_top_srcdir"; then - AC_MSG_NOTICE([Detected VPATH build]) - fi - - # Get the version of pmix that we are installing - AC_MSG_CHECKING([for pmix version]) - PMIX_VERSION="`$PMIX_top_srcdir/config/pmix_get_version.sh $PMIX_top_srcdir/VERSION`" - if test "$?" != "0"; then - AC_MSG_ERROR([Cannot continue]) - fi - AC_MSG_RESULT([$PMIX_VERSION]) - AC_SUBST(PMIX_VERSION) - AC_DEFINE_UNQUOTED([PMIX_VERSION], ["$PMIX_VERSION"], - [The library version is always available, contrary to VERSION]) - - PMIX_RELEASE_DATE="`$PMIX_top_srcdir/config/pmix_get_version.sh $PMIX_top_srcdir/VERSION --release-date`" - AC_SUBST(PMIX_RELEASE_DATE) - - # Save the breakdown the version information - PMIX_MAJOR_VERSION="`$PMIX_top_srcdir/config/pmix_get_version.sh $PMIX_top_srcdir/VERSION --major`" - if test "$?" != "0"; then - AC_MSG_ERROR([Cannot continue]) - fi - AC_SUBST(PMIX_MAJOR_VERSION) - AC_DEFINE_UNQUOTED([PMIX_MAJOR_VERSION], [$PMIX_MAJOR_VERSION], - [The library major version is always available, contrary to VERSION]) - - PMIX_MINOR_VERSION="`$PMIX_top_srcdir/config/pmix_get_version.sh $PMIX_top_srcdir/VERSION --minor`" - if test "$?" != "0"; then - AC_MSG_ERROR([Cannot continue]) - fi - AC_SUBST(PMIX_MINOR_VERSION) - AC_DEFINE_UNQUOTED([PMIX_MINOR_VERSION], [$PMIX_MINOR_VERSION], - [The library minor version is always available, contrary to VERSION]) - - PMIX_RELEASE_VERSION="`$PMIX_top_srcdir/config/pmix_get_version.sh $PMIX_top_srcdir/VERSION --release`" - if test "$?" != "0"; then - AC_MSG_ERROR([Cannot continue]) - fi - AC_SUBST(PMIX_RELEASE_VERSION) - AC_DEFINE_UNQUOTED([PMIX_RELEASE_VERSION], [$PMIX_RELEASE_VERSION], - [The library release version is always available, contrary to VERSION]) - - pmixmajor=${PMIX_MAJOR_VERSION}L - pmixminor=${PMIX_MINOR_VERSION}L - pmixrelease=${PMIX_RELEASE_VERSION}L - pmixnumeric=$(printf 0x%4.4x%2.2x%2.2x $PMIX_MAJOR_VERSION $PMIX_MINOR_VERSION $PMIX_RELEASE_VERSION) - AC_SUBST(pmixmajor) - AC_SUBST(pmixminor) - AC_SUBST(pmixrelease) - AC_SUBST(pmixnumeric) - AC_CONFIG_FILES(pmix_config_prefix[include/pmix_version.h]) - - PMIX_GREEK_VERSION="`$PMIX_top_srcdir/config/pmix_get_version.sh $PMIX_top_srcdir/VERSION --greek`" - if test "$?" != "0"; then - AC_MSG_ERROR([Cannot continue]) - fi - AC_SUBST(PMIX_GREEK_VERSION) - - PMIX_REPO_REV="`$PMIX_top_srcdir/config/pmix_get_version.sh $PMIX_top_srcdir/VERSION --repo-rev`" - if test "$?" != "0"; then - AC_MSG_ERROR([Cannot continue]) - fi - AC_SUBST(PMIX_REPO_REV) - - PMIX_RELEASE_DATE="`$PMIX_top_srcdir/config/pmix_get_version.sh $PMIX_top_srcdir/VERSION --release-date`" - if test "$?" != "0"; then - AC_MSG_ERROR([Cannot continue]) - fi - AC_SUBST(PMIX_RELEASE_DATE) - - # Debug mode? - AC_MSG_CHECKING([if want pmix maintainer support]) - pmix_debug= - AS_IF([test "$pmix_debug" = "" && test "$enable_debug" = "yes"], - [pmix_debug=1 - pmix_debug_msg="enabled"]) - AS_IF([test "$pmix_debug" = ""], - [pmix_debug=0 - pmix_debug_msg="disabled"]) - # Grr; we use #ifndef for PMIX_DEBUG! :-( - AH_TEMPLATE(PMIX_ENABLE_DEBUG, [Whether we are in debugging mode or not]) - AS_IF([test "$pmix_debug" = "1"], [AC_DEFINE([PMIX_ENABLE_DEBUG])]) - AC_MSG_RESULT([$pmix_debug_msg]) - - AC_MSG_CHECKING([for pmix directory prefix]) - AC_MSG_RESULT(m4_ifval([$1], pmix_config_prefix, [(none)])) - - # Note that private/config.h *MUST* be listed first so that it - # becomes the "main" config header file. Any AC-CONFIG-HEADERS - # after that (pmix/config.h) will only have selective #defines - # replaced, not the entire file. - AC_CONFIG_HEADERS(pmix_config_prefix[src/include/pmix_config.h]) - - # Rename symbols? - AC_ARG_WITH([pmix-symbol-rename], - AC_HELP_STRING([--with-pmix-symbol-rename=PREFIX], - [Provide a prefix to rename PMIx symbols])) - AC_MSG_CHECKING([for symbol rename]) - AS_IF([test ! -z "$with_pmix_symbol_rename" && test "$with_pmix_symbol_rename" != "yes"], - [AC_MSG_RESULT([$with_pmix_symbol_rename]) - pmix_symbol_rename="$with_pmix_symbol_rename" - PMIX_RENAME=$with_pmix_symbol_rename], - [AC_MSG_RESULT([no]) - pmix_symbol_rename="" - PMIX_RENAME=]) - AC_DEFINE_UNQUOTED(PMIX_SYMBOL_RENAME, [$pmix_symbol_rename], - [The pmix symbol rename include directive]) - AC_SUBST(PMIX_RENAME) - AC_CONFIG_FILES(pmix_config_prefix[include/pmix_rename.h]) - - # Add any extra lib? - AC_ARG_WITH([pmix-extra-lib], - AC_HELP_STRING([--with-pmix-extra-lib=LIB], - [Link the output PMIx library to this extra lib (used in embedded mode)])) - AC_MSG_CHECKING([for extra lib]) - AS_IF([test ! -z "$with_pmix_extra_lib"], - [AS_IF([test "$with_pmix_extra_lib" = "yes" || test "$with_pmix_extra_lib" = "no"], - [AC_MSG_RESULT([ERROR]) - AC_MSG_WARN([Invalid value for --with-extra-pmix-lib:]) - AC_MSG_WARN([ $with_pmix_extra_lib]) - AC_MSG_WARN([Must be path name of the library to add]) - AC_MSG_ERROR([Cannot continue])], - [AC_MSG_RESULT([$with_pmix_extra_lib]) - PMIX_EXTRA_LIB=$with_pmix_extra_lib])], - [AC_MSG_RESULT([no]) - PMIX_EXTRA_LIB=]) - AC_SUBST(PMIX_EXTRA_LIB) - - # Add any extra libtool lib? - AC_ARG_WITH([pmix-extra-ltlib], - AC_HELP_STRING([--with-pmix-extra-ltlib=LIB], - [Link any embedded components/tools that require it to the provided libtool lib (used in embedded mode)])) - AC_MSG_CHECKING([for extra ltlib]) - AS_IF([test ! -z "$with_pmix_extra_ltlib"], - [AS_IF([test "$with_pmix_extra_ltlib" = "yes" || test "$with_pmix_extra_ltlib" = "no"], - [AC_MSG_RESULT([ERROR]) - AC_MSG_WARN([Invalid value for --with-pmix-extra-ltlib:]) - AC_MSG_WARN([ $with_pmix_extra_ltlib]) - AC_MSG_WARN([Must be path name of the library to add]) - AC_MSG_ERROR([Cannot continue])], - [AC_MSG_RESULT([$with_pmix_extra_ltlib]) - PMIX_EXTRA_LTLIB=$with_pmix_extra_ltlib])], - [AC_MSG_RESULT([no]) - PMIX_EXTRA_LTLIB=]) - AC_SUBST(PMIX_EXTRA_LTLIB) - - # - # Package/brand string - # - AC_MSG_CHECKING([if want package/brand string]) - AC_ARG_WITH([pmix-package-string], - [AC_HELP_STRING([--with-pmix-package-string=STRING], - [Use a branding string throughout PMIx])]) - if test "$with_pmix_package_string" = "" || test "$with_pmix_package_string" = "no"; then - with_package_string="PMIx $PMIX_CONFIGURE_USER@$PMIX_CONFIGURE_HOST Distribution" - fi - AC_DEFINE_UNQUOTED([PMIX_PACKAGE_STRING], ["$with_package_string"], - [package/branding string for PMIx]) - AC_MSG_RESULT([$with_package_string]) - - - # GCC specifics. - if test "x$GCC" = "xyes"; then - PMIX_GCC_CFLAGS="-Wall -Wmissing-prototypes -Wundef" - PMIX_GCC_CFLAGS="$PMIX_GCC_CFLAGS -Wpointer-arith -Wcast-align" - fi - - ############################################################################ - # Check for compilers and preprocessors - ############################################################################ - pmix_show_title "Compiler and preprocessor tests" - - PMIX_SETUP_CC - - # - # Check for some types - # - - AC_CHECK_TYPES(int8_t) - AC_CHECK_TYPES(uint8_t) - AC_CHECK_TYPES(int16_t) - AC_CHECK_TYPES(uint16_t) - AC_CHECK_TYPES(int32_t) - AC_CHECK_TYPES(uint32_t) - AC_CHECK_TYPES(int64_t) - AC_CHECK_TYPES(uint64_t) - AC_CHECK_TYPES(__int128) - AC_CHECK_TYPES(uint128_t) - AC_CHECK_TYPES(long long) - - AC_CHECK_TYPES(intptr_t) - AC_CHECK_TYPES(uintptr_t) - AC_CHECK_TYPES(ptrdiff_t) - - # - # Check for type sizes - # - - AC_CHECK_SIZEOF(_Bool) - AC_CHECK_SIZEOF(char) - AC_CHECK_SIZEOF(short) - AC_CHECK_SIZEOF(int) - AC_CHECK_SIZEOF(long) - if test "$ac_cv_type_long_long" = yes; then - AC_CHECK_SIZEOF(long long) - fi - AC_CHECK_SIZEOF(float) - AC_CHECK_SIZEOF(double) - - AC_CHECK_SIZEOF(void *) - AC_CHECK_SIZEOF(size_t) - if test "$ac_cv_type_ssize_t" = yes ; then - AC_CHECK_SIZEOF(ssize_t) - fi - if test "$ac_cv_type_ptrdiff_t" = yes; then - AC_CHECK_SIZEOF(ptrdiff_t) - fi - AC_CHECK_SIZEOF(wchar_t) - - AC_CHECK_SIZEOF(pid_t) - - # - # Check for type alignments - # - - PMIX_C_GET_ALIGNMENT(bool, PMIX_ALIGNMENT_BOOL) - PMIX_C_GET_ALIGNMENT(int8_t, PMIX_ALIGNMENT_INT8) - PMIX_C_GET_ALIGNMENT(int16_t, PMIX_ALIGNMENT_INT16) - PMIX_C_GET_ALIGNMENT(int32_t, PMIX_ALIGNMENT_INT32) - PMIX_C_GET_ALIGNMENT(int64_t, PMIX_ALIGNMENT_INT64) - PMIX_C_GET_ALIGNMENT(char, PMIX_ALIGNMENT_CHAR) - PMIX_C_GET_ALIGNMENT(short, PMIX_ALIGNMENT_SHORT) - PMIX_C_GET_ALIGNMENT(wchar_t, PMIX_ALIGNMENT_WCHAR) - PMIX_C_GET_ALIGNMENT(int, PMIX_ALIGNMENT_INT) - PMIX_C_GET_ALIGNMENT(long, PMIX_ALIGNMENT_LONG) - if test "$ac_cv_type_long_long" = yes; then - PMIX_C_GET_ALIGNMENT(long long, PMIX_ALIGNMENT_LONG_LONG) - fi - PMIX_C_GET_ALIGNMENT(float, PMIX_ALIGNMENT_FLOAT) - PMIX_C_GET_ALIGNMENT(double, PMIX_ALIGNMENT_DOUBLE) - if test "$ac_cv_type_long_double" = yes; then - PMIX_C_GET_ALIGNMENT(long double, PMIX_ALIGNMENT_LONG_DOUBLE) - fi - PMIX_C_GET_ALIGNMENT(void *, PMIX_ALIGNMENT_VOID_P) - PMIX_C_GET_ALIGNMENT(size_t, PMIX_ALIGNMENT_SIZE_T) - - - # - # Does the C compiler native support "bool"? (i.e., without - # or any other help) - # - - PMIX_VAR_SCOPE_PUSH([MSG]) - AC_MSG_CHECKING(for C bool type) - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([ - AC_INCLUDES_DEFAULT], - [[bool bar, foo = true; bar = foo;]])], - [PMIX_NEED_C_BOOL=0 MSG=yes],[PMIX_NEED_C_BOOL=1 MSG=no]) - AC_DEFINE_UNQUOTED(PMIX_NEED_C_BOOL, $PMIX_NEED_C_BOOL, - [Whether the C compiler supports "bool" without any other help (such as )]) - AC_MSG_RESULT([$MSG]) - AC_CHECK_SIZEOF(_Bool) - PMIX_VAR_SCOPE_POP - - # - # Check for other compiler characteristics - # - - PMIX_VAR_SCOPE_PUSH([PMIX_CFLAGS_save]) - if test "$GCC" = "yes"; then - - # gcc 2.96 will emit oodles of warnings if you use "inline" with - # -pedantic (which we do in developer builds). However, - # "__inline__" is ok. So we have to force gcc to select the - # right one. If you use -pedantic, the AC_C_INLINE test will fail - # (because it names a function foo() -- without the (void)). So - # we turn off all the picky flags, turn on -ansi mode (which is - # implied by -pedantic), and set warnings to be errors. Hence, - # this does the following (for 2.96): - # - # - causes the check for "inline" to emit a warning, which then - # fails - # - checks for __inline__, which then emits no error, and works - # - # This also works nicely for gcc 3.x because "inline" will work on - # the first check, and all is fine. :-) - - PMIX_CFLAGS_save=$CFLAGS - CFLAGS="$PMIX_CFLAGS_BEFORE_PICKY -Werror -ansi" - fi - AC_C_INLINE - if test "$GCC" = "yes"; then - CFLAGS=$PMIX_CFLAGS_save - fi - PMIX_VAR_SCOPE_POP - - if test "x$CC" = "xicc"; then - PMIX_CHECK_ICC_VARARGS - fi - - - ################################## - # Only after setting up - # C do we check compiler attributes. - ################################## - - pmix_show_subtitle "Compiler characteristics" - - PMIX_CHECK_ATTRIBUTES - PMIX_CHECK_COMPILER_VERSION_ID - - ################################## - # Assembler Configuration - ################################## - - pmix_show_subtitle "Assembler" - - AM_PROG_AS - AC_PATH_PROG(PERL, perl, perl) - PMIX_CONFIG_ASM - - - ################################## - # Header files - ################################## - - pmix_show_title "Header file tests" - - AC_CHECK_HEADERS([arpa/inet.h \ - fcntl.h ifaddrs.h inttypes.h libgen.h \ - net/uio.h netinet/in.h \ - stdint.h stddef.h \ - stdlib.h string.h strings.h \ - sys/ioctl.h sys/param.h \ - sys/select.h sys/socket.h sys/sockio.h \ - stdarg.h sys/stat.h sys/time.h \ - sys/types.h sys/un.h sys/uio.h \ - sys/wait.h syslog.h \ - time.h unistd.h dirent.h \ - crt_externs.h signal.h \ - ioLib.h sockLib.h hostLib.h limits.h \ - sys/fcntl.h sys/statfs.h sys/statvfs.h \ - netdb.h ucred.h zlib.h sys/auxv.h \ - sys/sysctl.h termio.h termios.h pty.h \ - libutil.h util.h grp.h sys/cdefs.h utmp.h stropts.h]) - - AC_CHECK_HEADERS([sys/mount.h], [], [], - [AC_INCLUDES_DEFAULT - #if HAVE_SYS_PARAM_H - #include - #endif - ]) - - AC_CHECK_HEADERS([sys/sysctl.h], [], [], - [AC_INCLUDES_DEFAULT - #if HAVE_SYS_PARAM_H - #include - #endif - ]) - - # Needed to work around Darwin requiring sys/socket.h for - # net/if.h - AC_CHECK_HEADERS([net/if.h], [], [], - [#include - #if STDC_HEADERS - # include - # include - #else - # if HAVE_STDLIB_H - # include - # endif - #endif - #if HAVE_SYS_SOCKET_H - # include - #endif - ]) - - # Note that sometimes we have , but it doesn't work (e.g., - # have both Portland and GNU installed; using pgcc will find GNU's - # , which all it does -- by standard -- is define "bool" to - # "_Bool" [see - # http://pmixw.opengroup.org/onlinepubs/009695399/basedefs/stdbool.h.html], - # and Portland has no idea what to do with _Bool). - - # So first figure out if we have (i.e., check the value of - # the macro HAVE_STDBOOL_H from the result of AC_CHECK_HEADERS, - # above). If we do have it, then check to see if it actually works. - # Define PMIX_USE_STDBOOL_H as approrpaite. - AC_CHECK_HEADERS([stdbool.h], [have_stdbool_h=1], [have_stdbool_h=0]) - AC_MSG_CHECKING([if works]) - if test "$have_stdbool_h" = "1"; then - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT[ - #if HAVE_STDBOOL_H - #include - #endif - ]], - [[bool bar, foo = true; bar = foo;]])], - [PMIX_USE_STDBOOL_H=1 MSG=yes],[PMIX_USE_STDBOOL_H=0 MSG=no]) - else - PMIX_USE_STDBOOL_H=0 - MSG="no (don't have )" - fi - AC_DEFINE_UNQUOTED(PMIX_USE_STDBOOL_H, $PMIX_USE_STDBOOL_H, - [Whether to use or not]) - AC_MSG_RESULT([$MSG]) - - # checkpoint results - AC_CACHE_SAVE - - ################################## - # Types - ################################## - - pmix_show_title "Type tests" - - AC_CHECK_TYPES([socklen_t, struct sockaddr_in, struct sockaddr_un, - struct sockaddr_in6, struct sockaddr_storage], - [], [], [AC_INCLUDES_DEFAULT - #if HAVE_SYS_SOCKET_H - #include - #endif - #if HAVE_SYS_UN_H - #include - #endif - #ifdef HAVE_NETINET_IN_H - #include - #endif - ]) - - AC_CHECK_DECLS([AF_UNSPEC, PF_UNSPEC, AF_INET6, PF_INET6], - [], [], [AC_INCLUDES_DEFAULT - #if HAVE_SYS_SOCKET_H - #include - #endif - #ifdef HAVE_NETINET_IN_H - #include - #endif - ]) - - # SA_RESTART in signal.h - PMIX_VAR_SCOPE_PUSH([MSG2]) - AC_MSG_CHECKING([if SA_RESTART defined in signal.h]) - AC_EGREP_CPP(yes, [ - #include - #ifdef SA_RESTART - yes - #endif - ], [MSG2=yes VALUE=1], [MSG2=no VALUE=0]) - AC_DEFINE_UNQUOTED(PMIX_HAVE_SA_RESTART, $VALUE, - [Whether we have SA_RESTART in or not]) - AC_MSG_RESULT([$MSG2]) - PMIX_VAR_SCOPE_POP - - AC_CHECK_MEMBERS([struct sockaddr.sa_len], [], [], [ - #include - #if HAVE_SYS_SOCKET_H - #include - #endif - ]) - - AC_CHECK_MEMBERS([struct dirent.d_type], [], [], [ - #include - #include ]) - - AC_CHECK_MEMBERS([siginfo_t.si_fd],,,[#include ]) - AC_CHECK_MEMBERS([siginfo_t.si_band],,,[#include ]) - - # - # Checks for struct member names in struct statfs - # - AC_CHECK_MEMBERS([struct statfs.f_type], [], [], [ - AC_INCLUDES_DEFAULT - #ifdef HAVE_SYS_VFS_H - #include - #endif - #ifdef HAVE_SYS_STATFS_H - #include - #endif - ]) - - AC_CHECK_MEMBERS([struct statfs.f_fstypename], [], [], [ - AC_INCLUDES_DEFAULT - #ifdef HAVE_SYS_PARAM_H - #include - #endif - #ifdef HAVE_SYS_MOUNT_H - #include - #endif - #ifdef HAVE_SYS_VFS_H - #include - #endif - #ifdef HAVE_SYS_STATFS_H - #include - #endif - ]) - - # - # Checks for struct member names in struct statvfs - # - AC_CHECK_MEMBERS([struct statvfs.f_basetype], [], [], [ - AC_INCLUDES_DEFAULT - #ifdef HAVE_SYS_STATVFS_H - #include - #endif - ]) - - AC_CHECK_MEMBERS([struct statvfs.f_fstypename], [], [], [ - AC_INCLUDES_DEFAULT - #ifdef HAVE_SYS_STATVFS_H - #include - #endif - ]) - - AC_CHECK_MEMBERS([struct ucred.uid, struct ucred.cr_uid, struct sockpeercred.uid], - [], [], - [#include - #include ]) - - # - # Check for ptrdiff type. Yes, there are platforms where - # sizeof(void*) != sizeof(long) (64 bit Windows, apparently). - # - AC_MSG_CHECKING([for pointer diff type]) - if test $ac_cv_type_ptrdiff_t = yes ; then - pmix_ptrdiff_t="ptrdiff_t" - pmix_ptrdiff_size=$ac_cv_sizeof_ptrdiff_t - elif test $ac_cv_sizeof_void_p -eq $ac_cv_sizeof_long ; then - pmix_ptrdiff_t="long" - pmix_ptrdiff_size=$ac_cv_sizeof_long - elif test $ac_cv_type_long_long = yes && test $ac_cv_sizeof_void_p -eq $ac_cv_sizeof_long_long ; then - pmix_ptrdiff_t="long long" - pmix_ptrdiff_size=$ac_cv_sizeof_long_long - #else - # AC_MSG_ERROR([Could not find datatype to emulate ptrdiff_t. Cannot continue]) - fi - AC_DEFINE_UNQUOTED([PMIX_PTRDIFF_TYPE], [$pmix_ptrdiff_t], - [type to use for ptrdiff_t]) - AC_MSG_RESULT([$pmix_ptrdiff_t (size: $pmix_ptrdiff_size)]) - - ################################## - # Linker characteristics - ################################## - - AC_MSG_CHECKING([the linker for support for the -fini option]) - PMIX_VAR_SCOPE_PUSH([LDFLAGS_save]) - LDFLAGS_save=$LDFLAGS - LDFLAGS="$LDFLAGS_save -Wl,-fini -Wl,finalize" - AC_TRY_LINK([void finalize (void) {}], [], [AC_MSG_RESULT([yes]) - pmix_ld_have_fini=1], [AC_MSG_RESULT([no]) - pmix_ld_have_fini=0]) - LDFLAGS=$LDFLAGS_save - PMIX_VAR_SCOPE_POP - - pmix_destructor_use_fini=0 - pmix_no_destructor=0 - if test x$pmix_cv___attribute__destructor = x0 ; then - if test x$pmix_ld_have_fini = x1 ; then - pmix_destructor_use_fini=1 - else - pmix_no_destructor=1; - fi - fi - - AC_DEFINE_UNQUOTED(PMIX_NO_LIB_DESTRUCTOR, [$pmix_no_destructor], - [Whether libraries can be configured with destructor functions]) - AM_CONDITIONAL(PMIX_DESTRUCTOR_USE_FINI, [test x$pmix_destructor_use_fini = x1]) - - ################################## - # Libraries - ################################## - - pmix_show_title "Library and Function tests" - - # Darwin doesn't need -lutil, as it's something other than this -lutil. - PMIX_SEARCH_LIBS_CORE([openpty], [util]) - - PMIX_SEARCH_LIBS_CORE([gethostbyname], [nsl]) - - PMIX_SEARCH_LIBS_CORE([socket], [socket]) - - # IRIX and CentOS have dirname in -lgen, usually in libc - PMIX_SEARCH_LIBS_CORE([dirname], [gen]) - - # Darwin doesn't need -lm, as it's a symlink to libSystem.dylib - PMIX_SEARCH_LIBS_CORE([ceil], [m]) - - # -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 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 - # the magic glibc foo as not implemented. and on other systems, it's - # just not there. This covers all cases. - AC_CACHE_CHECK([for htonl define], - [pmix_cv_htonl_define], - [AC_PREPROC_IFELSE([AC_LANG_PROGRAM([ - #ifdef HAVE_SYS_TYPES_H - #include - #endif - #ifdef HAVE_NETINET_IN_H - #include - #endif - #ifdef HAVE_ARPA_INET_H - #include - #endif],[ - #ifndef ntohl - #error "ntohl not defined" - #endif - ])], [pmix_cv_htonl_define=yes], [pmix_cv_htonl_define=no])]) - AC_CHECK_FUNC([htonl], [pmix_have_htonl=yes], [pmix_have_htonl=no]) - AS_IF([test "$pmix_cv_htonl_define" = "yes" || test "$pmix_have_htonl" = "yes"], - [AC_DEFINE_UNQUOTED([HAVE_UNIX_BYTESWAP], [1], - [whether unix byteswap routines -- htonl, htons, nothl, ntohs -- are available])]) - - # - # Make sure we can copy va_lists (need check declared, not linkable) - # - - AC_CHECK_DECL(va_copy, PMIX_HAVE_VA_COPY=1, PMIX_HAVE_VA_COPY=0, - [#include ]) - AC_DEFINE_UNQUOTED(PMIX_HAVE_VA_COPY, $PMIX_HAVE_VA_COPY, - [Whether we have va_copy or not]) - - AC_CHECK_DECL(__va_copy, PMIX_HAVE_UNDERSCORE_VA_COPY=1, - PMIX_HAVE_UNDERSCORE_VA_COPY=0, [#include ]) - AC_DEFINE_UNQUOTED(PMIX_HAVE_UNDERSCORE_VA_COPY, $PMIX_HAVE_UNDERSCORE_VA_COPY, - [Whether we have __va_copy or not]) - - AC_CHECK_DECLS(__func__) - - # checkpoint results - AC_CACHE_SAVE - - ################################## - # System-specific tests - ################################## - - pmix_show_title "System-specific tests" - - AC_C_BIGENDIAN - PMIX_CHECK_BROKEN_QSORT - - # - # Check out what thread support we have - # - PMIX_CONFIG_THREADS - - CFLAGS="$CFLAGS $THREAD_CFLAGS" - CPPFLAGS="$CPPFLAGS $THREAD_CPPFLAGS" - 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" - # - - AC_PROG_LN_S - - # Check for some common system programs that we need - AC_PROG_GREP - AC_PROG_EGREP - - ################################## - # Visibility - ################################## - - # Check the visibility declspec at the end to avoid problem with - # the previous tests that are not necessarily prepared for - # the visibility feature. - pmix_show_title "Symbol visibility feature" - - PMIX_CHECK_VISIBILITY - - ################################## - # Libevent - ################################## - pmix_show_title "Event libraries" - - PMIX_LIBEV_CONFIG - PMIX_LIBEVENT_CONFIG - - AS_IF([test $pmix_libevent_support -eq 1 && test $pmix_libev_support -eq 1], - [AC_MSG_WARN([Both libevent and libev support have been specified.]) - AC_MSG_WARN([Only one can be configured against at a time. Please]) - AC_MSG_WARN([remove one from the configure command line.]) - AC_MSG_ERROR([Cannot continue])]) - - AS_IF([test $pmix_libevent_support -eq 0 && test $pmix_libev_support -eq 0], - [AC_MSG_WARN([Either libevent or libev support is required, but neither]) - AC_MSG_WARN([was found. Please use the configure options to point us]) - AC_MSG_WARN([to where we can find one or the other library]) - AC_MSG_ERROR([Cannot continue])]) - - - ################################## - # HWLOC - ################################## - pmix_show_title "HWLOC" - - PMIX_HWLOC_CONFIG - - - ################################## - # MCA - ################################## - - pmix_show_title "Modular Component Architecture (MCA) setup" - - # - # Do we want to show component load error messages by default? - # - - AC_MSG_CHECKING([for default value of mca_base_component_show_load_errors]) - AC_ARG_ENABLE([show-load-errors-by-default], - [AC_HELP_STRING([--enable-show-load-errors-by-default], - [Set the default value for the MCA parameter - mca_base_component_show_load_errors (but can be - overridden at run time by the usual - MCA-variable-setting mechansism). This MCA variable - controls whether warnings are displayed when an MCA - component fails to load at run time due to an error. - (default: enabled, meaning that - mca_base_component_show_load_errors is enabled - by default])]) - if test "$enable_show_load_errors_by_default" = "no" ; then - PMIX_SHOW_LOAD_ERRORS_DEFAULT=0 - AC_MSG_RESULT([disabled by default]) - else - PMIX_SHOW_LOAD_ERRORS_DEFAULT=1 - AC_MSG_RESULT([enabled by default]) - fi - AC_DEFINE_UNQUOTED(PMIX_SHOW_LOAD_ERRORS_DEFAULT, $PMIX_SHOW_LOAD_ERRORS_DEFAULT, - [Default value for mca_base_component_show_load_errors MCA variable]) - - AC_MSG_CHECKING([for subdir args]) - PMIX_CONFIG_SUBDIR_ARGS([pmix_subdir_args]) - AC_MSG_RESULT([$pmix_subdir_args]) - - PMIX_MCA - - ################################## - # Dstore Locking - ################################## - - pmix_show_title "Dstore Locking" - - PMIX_CHECK_DSTOR_LOCK - - ############################################################################ - # final compiler config - ############################################################################ - - pmix_show_subtitle "Set path-related compiler flags" - - # - # This is needed for VPATH builds, so that it will -I the appropriate - # include directory. We delayed doing it until now just so that - # '-I$(top_srcdir)' doesn't show up in any of the configure output -- - # purely aesthetic. - # - # Because pmix_config.h is created by AC_CONFIG_HEADERS, we - # don't need to -I the builddir for pmix/include. However, if we - # are VPATH building, we do need to include the source directories. - # - if test "$PMIX_top_builddir" != "$PMIX_top_srcdir"; then - # Note the embedded m4 directives here -- we must embed them - # rather than have successive assignments to these shell - # variables, lest the $(foo) names try to get evaluated here. - # Yuck! - CPPFLAGS="-I$PMIX_top_builddir -I$PMIX_top_srcdir -I$PMIX_top_srcdir/src -I$PMIX_top_builddir/include -I$PMIX_top_srcdir/include $CPPFLAGS" - else - 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' - pmixlibdir='${libdir}/pmix' - pmixincludedir='${includedir}/pmix' - AC_SUBST(pmixdatadir) - AC_SUBST(pmixlibdir) - AC_SUBST(pmixincludedir) - - ############################################################################ - # setup "make check" - ############################################################################ - PMIX_BUILT_TEST_PREFIX=$PMIX_top_builddir - AC_SUBST(PMIX_BUILT_TEST_PREFIX) - # expose the mca component library paths in the build system - pathfile=$PMIX_top_srcdir/config/mca_library_paths.txt - PMIX_COMPONENT_LIBRARY_PATHS=`cat $pathfile` - AC_SUBST(PMIX_COMPONENT_LIBRARY_PATHS) - AC_CONFIG_FILES(pmix_config_prefix[test/run_tests00.pl], [chmod +x test/run_tests00.pl]) - AC_CONFIG_FILES(pmix_config_prefix[test/run_tests01.pl], [chmod +x test/run_tests01.pl]) - AC_CONFIG_FILES(pmix_config_prefix[test/run_tests02.pl], [chmod +x test/run_tests02.pl]) - AC_CONFIG_FILES(pmix_config_prefix[test/run_tests03.pl], [chmod +x test/run_tests03.pl]) - AC_CONFIG_FILES(pmix_config_prefix[test/run_tests04.pl], [chmod +x test/run_tests04.pl]) - AC_CONFIG_FILES(pmix_config_prefix[test/run_tests05.pl], [chmod +x test/run_tests05.pl]) - AC_CONFIG_FILES(pmix_config_prefix[test/run_tests06.pl], [chmod +x test/run_tests06.pl]) - AC_CONFIG_FILES(pmix_config_prefix[test/run_tests07.pl], [chmod +x test/run_tests07.pl]) - AC_CONFIG_FILES(pmix_config_prefix[test/run_tests08.pl], [chmod +x test/run_tests08.pl]) - AC_CONFIG_FILES(pmix_config_prefix[test/run_tests09.pl], [chmod +x test/run_tests09.pl]) - AC_CONFIG_FILES(pmix_config_prefix[test/run_tests10.pl], [chmod +x test/run_tests10.pl]) - AC_CONFIG_FILES(pmix_config_prefix[test/run_tests11.pl], [chmod +x test/run_tests11.pl]) - AC_CONFIG_FILES(pmix_config_prefix[test/run_tests12.pl], [chmod +x test/run_tests12.pl]) - AC_CONFIG_FILES(pmix_config_prefix[test/run_tests13.pl], [chmod +x test/run_tests13.pl]) - AC_CONFIG_FILES(pmix_config_prefix[test/run_tests14.pl], [chmod +x test/run_tests14.pl]) - AC_CONFIG_FILES(pmix_config_prefix[test/run_tests15.pl], [chmod +x test/run_tests15.pl]) - if test "$WANT_PYTHON_BINDINGS" = "1"; then - AC_CONFIG_FILES(pmix_config_prefix[test/python/run_server.sh], [chmod +x test/python/run_server.sh]) - AC_CONFIG_FILES(pmix_config_prefix[test/python/run_sched.sh], [chmod +x test/python/run_sched.sh]) - fi - - ############################################################################ - # final output - ############################################################################ - - pmix_show_subtitle "Final output" - - AC_CONFIG_HEADERS(pmix_config_prefix[include/pmix_common.h]) - - AC_CONFIG_FILES( - pmix_config_prefix[Makefile] - pmix_config_prefix[bindings/Makefile] - pmix_config_prefix[bindings/python/Makefile] - pmix_config_prefix[config/Makefile] - pmix_config_prefix[etc/Makefile] - pmix_config_prefix[include/Makefile] - pmix_config_prefix[src/Makefile] - pmix_config_prefix[src/util/keyval/Makefile] - pmix_config_prefix[src/mca/base/Makefile] - pmix_config_prefix[src/tools/pevent/Makefile] - pmix_config_prefix[src/tools/pmix_info/Makefile] - 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 - AC_SUBST(PMIX_EMBEDDED_LIBS) - AC_SUBST(PMIX_EMBEDDED_LDFLAGS) - AC_SUBST(PMIX_EMBEDDED_CPPFLAGS) - - # Success - $2 -])dnl - -AC_DEFUN([PMIX_DEFINE_ARGS],[ - # do we want dlopen support ? - AC_MSG_CHECKING([if want dlopen support]) - AC_ARG_ENABLE([dlopen], - [AC_HELP_STRING([--enable-dlopen], - [Whether build should attempt to use dlopen (or - similar) to dynamically load components. - (default: enabled)])]) - AS_IF([test "$enable_dlopen" = "unknown"], - [AC_MSG_WARN([enable_dlopen variable has been overwritten by configure]) - AC_MSG_WARN([This is an internal error that should be reported to PMIx developers]) - AC_MSG_ERROR([Cannot continue])]) - AS_IF([test "$enable_dlopen" = "no"], - [enable_mca_dso="no" - enable_mca_static="yes" - PMIX_ENABLE_DLOPEN_SUPPORT=0 - AC_MSG_RESULT([no])], - [PMIX_ENABLE_DLOPEN_SUPPORT=1 - AC_MSG_RESULT([yes])]) - AC_DEFINE_UNQUOTED(PMIX_ENABLE_DLOPEN_SUPPORT, $PMIX_ENABLE_DLOPEN_SUPPORT, - [Whether we want to enable dlopen support]) - - # Embedded mode, or standalone? - AC_MSG_CHECKING([if embedded mode is enabled]) - AC_ARG_ENABLE([embedded-mode], - [AC_HELP_STRING([--enable-embedded-mode], - [Using --enable-embedded-mode causes PMIx to skip a few configure checks and install nothing. It should only be used when building PMIx within the scope of a larger package.])]) - AS_IF([test "$enable_embedded_mode" = "yes"], - [pmix_mode=embedded - pmix_install_primary_headers=no - AC_MSG_RESULT([yes])], - [pmix_mode=standalone - pmix_install_primary_headers=yes - AC_MSG_RESULT([no])]) - -# -# Is this a developer copy? -# - -if test -e $PMIX_TOP_SRCDIR/.git; then - PMIX_DEVEL=1 - # check for Flex - AC_PROG_LEX - if test "x$LEX" != xflex; then - AC_MSG_WARN([PMIx requires Flex to build from non-tarball sources,]) - AC_MSG_WARN([but Flex was not found. Please install Flex into]) - AC_MSG_WARN([your path and try again]) - AC_MSG_ERROR([Cannot continue]) - fi -else - PMIX_DEVEL=0 -fi - - -# -# Developer picky compiler options -# - -AC_MSG_CHECKING([if want developer-level compiler pickyness]) -AC_ARG_ENABLE(picky, - AC_HELP_STRING([--enable-picky], - [enable developer-level compiler pickyness when building PMIx (default: disabled)])) -if test "$enable_picky" = "yes"; then - AC_MSG_RESULT([yes]) - WANT_PICKY_COMPILER=1 -else - AC_MSG_RESULT([no]) - WANT_PICKY_COMPILER=0 -fi -#################### Early development override #################### -if test "$WANT_PICKY_COMPILER" = "0" && test -z "$enable_picky" && test "$PMIX_DEVEL" = "1"; then - WANT_PICKY_COMPILER=1 - echo "--> developer override: enable picky compiler by default" -fi -#################### Early development override #################### - -# -# Developer debugging -# - -AC_MSG_CHECKING([if want developer-level debugging code]) -AC_ARG_ENABLE(debug, - AC_HELP_STRING([--enable-debug], - [enable developer-level debugging code (not for general PMIx users!) (default: disabled)])) -if test "$enable_debug" = "yes"; then - AC_MSG_RESULT([yes]) - WANT_DEBUG=1 -else - AC_MSG_RESULT([no]) - WANT_DEBUG=0 -fi -#################### Early development override #################### -if test "$WANT_DEBUG" = "0" && test -z "$enable_debug" && test "$PMIX_DEVEL" = "1"; then - WANT_DEBUG=1 - echo "--> developer override: enable debugging code by default" -fi -#################### Early development override #################### -if test "$WANT_DEBUG" = "0"; then - CFLAGS="-DNDEBUG $CFLAGS" -fi -AC_DEFINE_UNQUOTED(PMIX_ENABLE_DEBUG, $WANT_DEBUG, - [Whether we want developer-level debugging code or not]) - -AC_ARG_ENABLE(debug-symbols, - AC_HELP_STRING([--disable-debug-symbols], - [Disable adding compiler flags to enable debugging symbols if --enable-debug is specified. For non-debugging builds, this flag has no effect.])) - -# -# Do we want to install the internal devel headers? -# -AC_MSG_CHECKING([if want to install project-internal header files]) -AC_ARG_WITH(devel-headers, - AC_HELP_STRING([--with-devel-headers], - [normal PMIx users/applications do not need this (pmix.h and friends are ALWAYS installed). Developer headers are only necessary for authors doing deeper integration (default: disabled).])) -if test "$with_devel_headers" = "yes"; then - AC_MSG_RESULT([yes]) - WANT_INSTALL_HEADERS=1 - pmix_install_primary_headers=yes -else - AC_MSG_RESULT([no]) - WANT_INSTALL_HEADERS=0 -fi - -# Install tests and examples? -AC_MSG_CHECKING([if tests and examples are to be installed]) -AC_ARG_WITH([tests-examples], - [AC_HELP_STRING([--with-tests-examples], - [Whether or not to install the tests and example programs.])]) -AS_IF([test "$pmix_install_primary_headers" = "no"], - [AS_IF([test -z "$with_tests_examples" || test "$with_tests_examples" = "no"], - [pmix_tests=no - AC_MSG_RESULT([no])], - [AC_MSG_RESULT([no]) - AC_MSG_WARN([Cannot install tests/examples without installing primary headers.]) - AC_MSG_WARN([This situation arises when configured in embedded mode]) - AC_MSG_WARN([and without devel headers.]) - AC_MSG_ERROR([Please correct the configure line and retry])])], - [AS_IF([test ! -z "$with_tests_examples" && test "$with_tests_examples" = "no"], - [pmix_tests=no - AC_MSG_RESULT([no])], - [pmix_tests=yes - AC_MSG_RESULT([yes])])]) - -# -# Support per-user config files? -# -AC_ARG_ENABLE([per-user-config-files], - [AC_HELP_STRING([--enable-per-user-config-files], - [Disable per-user configuration files, to save disk accesses during job start-up. This is likely desirable for large jobs. Note that this can also be acheived by environment variables at run-time. (default: enabled)])]) -if test "$enable_per_user_config_files" = "no" ; then - result=0 -else - result=1 -fi -AC_DEFINE_UNQUOTED([PMIX_WANT_HOME_CONFIG_FILES], [$result], - [Enable per-user config files]) - -# -# Do we want the pretty-print stack trace feature? -# - -AC_MSG_CHECKING([if want pretty-print stacktrace]) -AC_ARG_ENABLE([pretty-print-stacktrace], - [AC_HELP_STRING([--enable-pretty-print-stacktrace], - [Pretty print stacktrace on process signal (default: enabled)])]) -if test "$enable_pretty_print_stacktrace" = "no" ; then - AC_MSG_RESULT([no]) - WANT_PRETTY_PRINT_STACKTRACE=0 -else - AC_MSG_RESULT([yes]) - WANT_PRETTY_PRINT_STACKTRACE=1 -fi -AC_DEFINE_UNQUOTED([PMIX_WANT_PRETTY_PRINT_STACKTRACE], - [$WANT_PRETTY_PRINT_STACKTRACE], - [if want pretty-print stack trace feature]) - -# -# Use pthread-based locking -# -DSTORE_PTHREAD_LOCK="1" -AC_MSG_CHECKING([if want dstore pthread-based locking]) -AC_ARG_ENABLE([dstore-pthlck], - [AC_HELP_STRING([--disable-dstore-pthlck], - [Disable pthread-based locking in dstor (default: enabled)])]) -if test "$enable_dstore_pthlck" = "no" ; then - AC_MSG_RESULT([no]) - DSTORE_PTHREAD_LOCK="0" -else - AC_MSG_RESULT([yes]) - DSTORE_PTHREAD_LOCK="1" -fi - -# -# Ident string -# -AC_MSG_CHECKING([if want ident string]) -AC_ARG_WITH([ident-string], - [AC_HELP_STRING([--with-ident-string=STRING], - [Embed an ident string into PMIx object files])]) -if test "$with_ident_string" = "" || test "$with_ident_string" = "no"; then - with_ident_string="%VERSION%" -fi -# This is complicated, because $PMIX_VERSION may have spaces in it. -# So put the whole sed expr in single quotes -- i.e., directly -# substitute %VERSION% for (not expanded) $PMIX_VERSION. -with_ident_string="`echo $with_ident_string | sed -e 's/%VERSION%/$PMIX_VERSION/'`" - -# Now eval an echo of that so that the "$PMIX_VERSION" token is -# replaced with its value. Enclose the whole thing in "" so that it -# ends up as 1 token. -with_ident_string="`eval echo $with_ident_string`" - -AC_DEFINE_UNQUOTED([PMIX_IDENT_STRING], ["$with_ident_string"], - [ident string for PMIX]) -AC_MSG_RESULT([$with_ident_string]) - -# -# Timing support -# -AC_MSG_CHECKING([if want developer-level timing support]) -AC_ARG_ENABLE(pmix-timing, - AC_HELP_STRING([--enable-pmix-timing], - [enable PMIx developer-level timing code (default: disabled)])) -if test "$enable_pmix_timing" = "yes"; then - AC_MSG_RESULT([yes]) - WANT_PMIX_TIMING=1 -else - AC_MSG_RESULT([no]) - WANT_PMIX_TIMING=0 -fi - -AC_DEFINE_UNQUOTED([PMIX_ENABLE_TIMING], [$WANT_PMIX_TIMING], - [Whether we want developer-level timing support or not]) - -# -# -# Install backward compatibility support for PMI-1 and PMI-2 -# -AC_MSG_CHECKING([if want backward compatibility for PMI-1 and PMI-2]) -AC_ARG_ENABLE(pmi-backward-compatibility, - AC_HELP_STRING([--enable-pmi-backward-compatibility], - [enable PMIx support for PMI-1 and PMI-2 (default: enabled)])) -if test "$enable_pmi_backward_compatibility" = "no"; then - AC_MSG_RESULT([no]) - WANT_PMI_BACKWARD=0 -else - AC_MSG_RESULT([yes]) - WANT_PMI_BACKWARD=1 -fi - -AM_CONDITIONAL([WANT_INSTALL_HEADERS], [test $WANT_INSTALL_HEADERS -eq 1]) - -# -# Do we want to install binaries? -# -AC_MSG_CHECKING([if want to disable binaries]) -AC_ARG_ENABLE(pmix-binaries, - AC_HELP_STRING([--enable-pmix-binaries], - [enable PMIx tools])) -if test "$enable_pmix_binaries" = "no"; then - AC_MSG_RESULT([no]) - WANT_PMIX_BINARIES=0 -else - AC_MSG_RESULT([yes]) - WANT_PMIX_BINARIES=1 -fi - -AM_CONDITIONAL([PMIX_INSTALL_BINARIES], [test $WANT_PMIX_BINARIES -eq 1]) - -# -# Install Python bindings? -# -AC_MSG_CHECKING([if want install Python bindings]) -AC_ARG_ENABLE(python-bindings, - AC_HELP_STRING([--enable-python-bindings], - [enable Python bindings (default: disabled)])) -if test "$enable_python_bindings" != "yes"; then - AC_MSG_RESULT([no]) - WANT_PYTHON_BINDINGS=0 -else - AC_MSG_RESULT([yes]) - WANT_PYTHON_BINDINGS=1 -fi - -AM_CONDITIONAL([WANT_PYTHON_BINDINGS], [test $WANT_PYTHON_BINDINGS -eq 1]) - -if test "$WANT_PYTHON_BINDINGS" = "1"; then - AM_PATH_PYTHON([3.4]) - pyvers=`python3 --version` - python_version=${pyvers#"Python "} - major=$(echo $python_version | cut -d. -f1) - minor=$(echo $python_version | cut -d. -f2) - if test "$major" -lt "3"; then - AC_MSG_WARN([Python bindings were enabled, but no suitable]) - AC_MSG_WARN([interpreter was found. PMIx requires at least]) - AC_MSG_WARN([Python v3.4 to provide Python bindings]) - AC_MSG_ERROR([Cannot continue]) - fi - if test "$major" -eq "3" && test "$minor" -lt "4"; then - AC_MSG_WARN([Python bindings were enabled, but no suitable]) - AC_MSG_WARN([interpreter was found. PMIx requires at least]) - AC_MSG_WARN([Python v3.4 to provide Python bindings]) - AC_MSG_ERROR([Cannot continue]) - fi - - PMIX_SUMMARY_ADD([[Bindings]],[[Python]], [pmix_python], [yes ($python_version)]) - - AC_MSG_CHECKING([if Cython package installed as Python package]) - have_cython=`$srcdir/config/pmix_check_cython.py 2> /dev/null` - if test "$have_cython" = "0"; then - AC_MSG_RESULT([yes]) - AC_MSG_CHECKING([Cython version]) - cython_version=`python -c "from Cython.Compiler.Version import version; print(version)"` - AC_MSG_RESULT([$cython_version]) - PMIX_SUMMARY_ADD([[Bindings]],[[Cython]], [pmix_cython], [yes ($cython_version)]) - else - AC_MSG_RESULT([no]) - # Cython doesn't have any include or lib files - it is just a binary - AC_CHECK_PROG(pmix_cython_rpm, cython, ["found"], ["not found"]) - if test "$pmix_cython_rpm" = "found"; then - AC_MSG_CHECKING([Cython version]) - cyvers=`cython --version 2>&1` - cython_version=${cyvers#"Cython version "} - AC_MSG_RESULT([$cython_version]) - PMIX_SUMMARY_ADD([[Bindings]],[[Cython]], [pmix_cython], [yes ($cython_version)]) - else - AC_MSG_RESULT([no]) - AC_MSG_WARN([Python bindings were enabled, but the Cython]) - AC_MSG_WARN([package was not found. PMIx Python bindings]) - AC_MSG_WARN([require that the Cython package be installed]) - AC_MSG_ERROR([Cannot continue]) - fi - fi - - pmix_pythondir=`eval echo $pythondir` - AC_SUBST([PMIX_PYTHON_EGG_PATH], [$pmix_pythondir], [Path to installed Python egg]) -fi - -# see if they want to disable non-RTLD_GLOBAL dlopen -AC_MSG_CHECKING([if want to support dlopen of non-global namespaces]) -AC_ARG_ENABLE([nonglobal-dlopen], - AC_HELP_STRING([--enable-nonglobal-dlopen], - [enable non-global dlopen (default: enabled)])) -if test "$enable_nonglobal_dlopen" = "no"; then - AC_MSG_RESULT([no]) - pmix_need_libpmix=0 -else - AC_MSG_RESULT([yes]) - pmix_need_libpmix=1 -fi - -# if someone enables embedded mode but doesn't want to install the -# devel headers, then default nonglobal-dlopen to false -AS_IF([test -z "$enable_nonglobal_dlopen" && test "x$pmix_mode" = "xembedded" && test $WANT_INSTALL_HEADERS -eq 0 && test $pmix_need_libpmix -eq 1], - [pmix_need_libpmix=0]) - -# -# Do we want PTY support? -# - -AC_MSG_CHECKING([if want pty support]) -AC_ARG_ENABLE(pty-support, - AC_HELP_STRING([--enable-pty-support], - [Enable/disable PTY support for STDIO forwarding. (default: enabled)])) -if test "$enable_pty_support" = "no" ; then - AC_MSG_RESULT([no]) - PMIX_ENABLE_PTY_SUPPORT=0 -else - AC_MSG_RESULT([yes]) - PMIX_ENABLE_PTY_SUPPORT=1 -fi -AC_DEFINE_UNQUOTED([PMIX_ENABLE_PTY_SUPPORT], [$PMIX_ENABLE_PTY_SUPPORT], - [Whether user wants PTY support or not]) - -# -# psec/dummy_handshake -# - -AC_MSG_CHECKING([if want build psec/dummy_handshake]) -AC_ARG_ENABLE(dummy-handshake, - AC_HELP_STRING([--enable-dummy-handshake], - [Enables psec dummy component intended to check the PTL handshake scenario (default: disabled)])) -if test "$enable_dummy_handshake" != "yes"; then - AC_MSG_RESULT([no]) - eval "DISABLE_psec_dummy_handshake=1" -else - AC_MSG_RESULT([yes]) - eval "DISABLE_psec_dummy_handshake=0" -fi -AM_CONDITIONAL(MCA_BUILD_PSEC_DUMMY_HANDSHAKE, test "$DISABLE_psec_dummy_handshake" = "0") -])dnl - -# This must be a standalone routine so that it can be called both by -# PMIX_INIT and an external caller (if PMIX_INIT is not invoked). -AC_DEFUN([PMIX_DO_AM_CONDITIONALS],[ - AS_IF([test "$pmix_did_am_conditionals" != "yes"],[ - AM_CONDITIONAL([PMIX_EMBEDDED_MODE], [test "x$pmix_mode" = "xembedded"]) - AM_CONDITIONAL([PMIX_TESTS_EXAMPLES], [test "x$pmix_tests" = "xyes"]) - AM_CONDITIONAL([PMIX_COMPILE_TIMING], [test "$WANT_TIMING" = "1"]) - AM_CONDITIONAL([PMIX_WANT_MUNGE], [test "$pmix_munge_support" = "1"]) - AM_CONDITIONAL([PMIX_WANT_SASL], [test "$pmix_sasl_support" = "1"]) - AM_CONDITIONAL([WANT_DSTORE], [test "x$enable_dstore" != "xno"]) - AM_CONDITIONAL([WANT_PRIMARY_HEADERS], [test "x$pmix_install_primary_headers" = "xyes"]) - AM_CONDITIONAL(WANT_INSTALL_HEADERS, test "$WANT_INSTALL_HEADERS" = 1) - AM_CONDITIONAL(WANT_PMI_BACKWARD, test "$WANT_PMI_BACKWARD" = 1) - AM_CONDITIONAL(NEED_LIBPMIX, [test "$pmix_need_libpmix" = "1"]) - ]) - pmix_did_am_conditionals=yes -])dnl diff --git a/opal/mca/pmix/pmix4x/openpmix/config/pmix_check_attributes.m4 b/opal/mca/pmix/pmix4x/openpmix/config/pmix_check_attributes.m4 deleted file mode 100644 index b5005b72c08..00000000000 --- a/opal/mca/pmix/pmix4x/openpmix/config/pmix_check_attributes.m4 +++ /dev/null @@ -1,560 +0,0 @@ -# -*- shell-script -*- -# PMIx copyrights: -# Copyright (c) 2013-2018 Intel, Inc. All rights reserved. -# -######################### -# -# 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-2010 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) 2009 Oak Ridge National Labs. All rights reserved. -# Copyright (c) 2010-2018 Cisco Systems, Inc. All rights reserved. -# Copyright (c) 2013 Mellanox Technologies, Inc. -# All rights reserved. -# Copyright (c) 2015 Intel, Inc. All rights reserved. -######################### -# $COPYRIGHT$ -# -# Additional copyrights may follow -# -# $HEADER$ -# - -# -# Search the generated warnings for -# keywords regarding skipping or ignoring certain attributes -# Intel: ignore -# Sun C++: skip -# -AC_DEFUN([_PMIX_ATTRIBUTE_FAIL_SEARCH],[ - AC_REQUIRE([AC_PROG_GREP]) - if test -s conftest.err ; then - # icc uses 'invalid attribute' and 'attribute "__XXX__" ignored' - # Sun 12.1 emits 'warning: attribute parameter "__printf__" is undefined' - for i in invalid ignore skip undefined ; do - $GREP -iq $i conftest.err - if test "$?" = "0" ; then - pmix_cv___attribute__[$1]=0 - break; - fi - done - fi -]) - -# -# Check for one specific attribute by compiling with C -# -# The last argument is for specific CFLAGS, that need to be set -# for the compiler to generate a warning on the cross-check. -# This may need adaption for future compilers / CFLAG-settings. -# -AC_DEFUN([_PMIX_CHECK_SPECIFIC_ATTRIBUTE], [ - AC_MSG_CHECKING([for __attribute__([$1])]) - AC_CACHE_VAL(pmix_cv___attribute__[$1], [ - # - # Try to compile using the C compiler - # - AC_TRY_COMPILE([$2],[], - [ - # - # In case we did succeed: Fine, but was this due to the - # attribute being ignored/skipped? Grep for IgNoRe/skip in conftest.err - # and if found, reset the pmix_cv__attribute__var=0 - # - pmix_cv___attribute__[$1]=1 - _PMIX_ATTRIBUTE_FAIL_SEARCH([$1]) - ], - [pmix_cv___attribute__[$1]=0]) - ]) - - if test "$pmix_cv___attribute__[$1]" = "1" ; then - AC_MSG_RESULT([yes]) - else - AC_MSG_RESULT([no]) - fi -]) - - -# -# Test the availability of __attribute__ and with the help -# of _PMIX_CHECK_SPECIFIC_ATTRIBUTE for the support of -# particular attributes. Compilers, that do not support an -# attribute most often fail with a warning (when the warning -# level is set). -# The compilers output is parsed in _PMIX_ATTRIBUTE_FAIL_SEARCH -# -# To add a new attributes __NAME__ add the -# pmix_cv___attribute__NAME -# add a new check with _PMIX_CHECK_SPECIFIC_ATTRIBUTE (possibly with a cross-check) -# _PMIX_CHECK_SPECIFIC_ATTRIBUTE([name], [int foo (int arg) __attribute__ ((__name__));], [], []) -# and define the corresponding -# AC_DEFINE_UNQUOTED(PMIX_HAVE_ATTRIBUTE_NAME, [$pmix_cv___attribute__NAME], -# [Whether your compiler has __attribute__ NAME or not]) -# and decide on a correct macro (in pmix/include/pmix_config_bottom.h): -# # define __pmix_attribute_NAME(x) __attribute__(__NAME__) -# -# Please use the "__"-notation of the attribute in order not to -# clash with predefined names or macros (e.g. const, which some compilers -# do not like..) -# - - -AC_DEFUN([PMIX_CHECK_ATTRIBUTES], [ - AC_LANG(C) - AC_MSG_CHECKING(for __attribute__) - - AC_CACHE_VAL(pmix_cv___attribute__, [ - AC_TRY_COMPILE( - [#include - /* Check for the longest available __attribute__ (since gcc-2.3) */ - struct foo { - char a; - int x[2] __attribute__ ((__packed__)); - }; - ], - [], - [pmix_cv___attribute__=1], - [pmix_cv___attribute__=0], - ) - - if test "$pmix_cv___attribute__" = "1" ; then - AC_TRY_COMPILE( - [#include - /* Check for the longest available __attribute__ (since gcc-2.3) */ - struct foo { - char a; - int x[2] __attribute__ ((__packed__)); - }; - ], - [], - [pmix_cv___attribute__=1], - [pmix_cv___attribute__=0], - ) - fi - ]) - AC_DEFINE_UNQUOTED(PMIX_HAVE_ATTRIBUTE, [$pmix_cv___attribute__], - [Whether your compiler has __attribute__ or not]) - -# -# Now that we know the compiler support __attribute__ let's check which kind of -# attributed are supported. -# - if test "$pmix_cv___attribute__" = "0" ; then - AC_MSG_RESULT([no]) - pmix_cv___attribute__aligned=0 - pmix_cv___attribute__always_inline=0 - pmix_cv___attribute__cold=0 - pmix_cv___attribute__const=0 - pmix_cv___attribute__deprecated=0 - pmix_cv___attribute__deprecated_argument=0 - pmix_cv___attribute__format=0 - pmix_cv___attribute__format_funcptr=0 - pmix_cv___attribute__hot=0 - pmix_cv___attribute__malloc=0 - pmix_cv___attribute__may_alias=0 - pmix_cv___attribute__no_instrument_function=0 - pmix_cv___attribute__nonnull=0 - pmix_cv___attribute__noreturn=0 - pmix_cv___attribute__noreturn_funcptr=0 - pmix_cv___attribute__packed=0 - pmix_cv___attribute__pure=0 - pmix_cv___attribute__sentinel=0 - pmix_cv___attribute__unused=0 - pmix_cv___attribute__visibility=0 - pmix_cv___attribute__warn_unused_result=0 - pmix_cv___attribute__destructor=0 - pmix_cv___attribute__optnone=0 - pmix_cv___attribute__extension=0 - else - AC_MSG_RESULT([yes]) - - _PMIX_CHECK_SPECIFIC_ATTRIBUTE([aligned], - [struct foo { char text[4]; } __attribute__ ((__aligned__(8)));], - [], - []) - - # - # Ignored by PGI-6.2.5; -- recognized by output-parser - # - _PMIX_CHECK_SPECIFIC_ATTRIBUTE([always_inline], - [int foo (int arg) __attribute__ ((__always_inline__));], - [], - []) - - _PMIX_CHECK_SPECIFIC_ATTRIBUTE([cold], - [ - int foo(int arg1, int arg2) __attribute__ ((__cold__)); - int foo(int arg1, int arg2) { return arg1 * arg2 + arg1; } - ], - [], - []) - - _PMIX_CHECK_SPECIFIC_ATTRIBUTE([const], - [ - int foo(int arg1, int arg2) __attribute__ ((__const__)); - int foo(int arg1, int arg2) { return arg1 * arg2 + arg1; } - ], - [], - []) - - _PMIX_CHECK_SPECIFIC_ATTRIBUTE([deprecated], - [ - int foo(int arg1, int arg2) __attribute__ ((__deprecated__)); - int foo(int arg1, int arg2) { return arg1 * arg2 + arg1; } - ], - [], - []) - - _PMIX_CHECK_SPECIFIC_ATTRIBUTE([deprecated_argument], - [ - int foo(int arg1, int arg2) __attribute__ ((__deprecated__("compiler allows argument"))); - int foo(int arg1, int arg2) { return arg1 * arg2 + arg1; } - ], - [], - []) - - ATTRIBUTE_CFLAGS= - case "$pmix_c_vendor" in - gnu) - ATTRIBUTE_CFLAGS="-Wall" - ;; - intel) - # we want specifically the warning on format string conversion - ATTRIBUTE_CFLAGS="-we181" - ;; - esac - _PMIX_CHECK_SPECIFIC_ATTRIBUTE([format], - [ - int this_printf (void *my_object, const char *my_format, ...) __attribute__ ((__format__ (__printf__, 2, 3))); - ], - [ - static int usage (int * argument); - extern int this_printf (int arg1, const char *my_format, ...) __attribute__ ((__format__ (__printf__, 2, 3))); - - static int usage (int * argument) { - return this_printf (*argument, "%d", argument); /* This should produce a format warning */ - } - /* The autoconf-generated main-function is int main(), which produces a warning by itself */ - int main(void); - ], - [$ATTRIBUTE_CFLAGS]) - - ATTRIBUTE_CFLAGS= - case "$pmix_c_vendor" in - gnu) - ATTRIBUTE_CFLAGS="-Wall" - ;; - intel) - # we want specifically the warning on format string conversion - ATTRIBUTE_CFLAGS="-we181" - ;; - esac - _PMIX_CHECK_SPECIFIC_ATTRIBUTE([format_funcptr], - [ - int (*this_printf)(void *my_object, const char *my_format, ...) __attribute__ ((__format__ (__printf__, 2, 3))); - ], - [ - static int usage (int * argument); - extern int (*this_printf) (int arg1, const char *my_format, ...) __attribute__ ((__format__ (__printf__, 2, 3))); - - static int usage (int * argument) { - return (*this_printf) (*argument, "%d", argument); /* This should produce a format warning */ - } - /* The autoconf-generated main-function is int main(), which produces a warning by itself */ - int main(void); - ], - [$ATTRIBUTE_CFLAGS]) - - _PMIX_CHECK_SPECIFIC_ATTRIBUTE([hot], - [ - int foo(int arg1, int arg2) __attribute__ ((__hot__)); - int foo(int arg1, int arg2) { return arg1 * arg2 + arg1; } - ], - [], - []) - - _PMIX_CHECK_SPECIFIC_ATTRIBUTE([malloc], - [ -#ifdef HAVE_STDLIB_H -# include -#endif - int * foo(int arg1) __attribute__ ((__malloc__)); - int * foo(int arg1) { return (int*) malloc(arg1); } - ], - [], - []) - - - # - # Attribute may_alias: No suitable cross-check available, that works for non-supporting compilers - # Ignored by intel-9.1.045 -- turn off with -wd1292 - # Ignored by PGI-6.2.5; ignore not detected due to missing cross-check - # - _PMIX_CHECK_SPECIFIC_ATTRIBUTE([may_alias], - [int * p_value __attribute__ ((__may_alias__));], - [], - []) - - - _PMIX_CHECK_SPECIFIC_ATTRIBUTE([no_instrument_function], - [int * foo(int arg1) __attribute__ ((__no_instrument_function__));], - [], - []) - - - # - # Attribute nonnull: - # Ignored by intel-compiler 9.1.045 -- recognized by cross-check - # Ignored by PGI-6.2.5 (pgCC) -- recognized by cross-check - # - ATTRIBUTE_CFLAGS= - case "$pmix_c_vendor" in - gnu) - ATTRIBUTE_CFLAGS="-Wall" - ;; - intel) - # we do not want to get ignored attributes warnings, but rather real warnings - ATTRIBUTE_CFLAGS="-wd1292" - ;; - esac - _PMIX_CHECK_SPECIFIC_ATTRIBUTE([nonnull], - [ - int square(int *arg) __attribute__ ((__nonnull__)); - int square(int *arg) { return *arg; } - ], - [ - static int usage(int * argument); - int square(int * argument) __attribute__ ((__nonnull__)); - int square(int * argument) { return (*argument) * (*argument); } - - static int usage(int * argument) { - return square( ((void*)0) ); /* This should produce an argument must be nonnull warning */ - } - /* The autoconf-generated main-function is int main(), which produces a warning by itself */ - int main(void); - ], - [$ATTRIBUTE_CFLAGS]) - - - _PMIX_CHECK_SPECIFIC_ATTRIBUTE([noreturn], - [ -#ifdef HAVE_UNISTD_H -# include -#endif -#ifdef HAVE_STDLIB_H -# include -#endif - void fatal(int arg1) __attribute__ ((__noreturn__)); - void fatal(int arg1) { exit(arg1); } - ], - [], - []) - - - _PMIX_CHECK_SPECIFIC_ATTRIBUTE([noreturn_funcptr], - [ -#ifdef HAVE_UNISTD_H -# include -#endif -#ifdef HAVE_STDLIB_H -# include -#endif - extern void (*fatal_exit)(int arg1) __attribute__ ((__noreturn__)); - void fatal(int arg1) { fatal_exit (arg1); } - ], - [], - [$ATTRIBUTE_CFLAGS]) - - - _PMIX_CHECK_SPECIFIC_ATTRIBUTE([packed], - [ - struct foo { - char a; - int x[2] __attribute__ ((__packed__)); - }; - ], - [], - []) - - _PMIX_CHECK_SPECIFIC_ATTRIBUTE([pure], - [ - int square(int arg) __attribute__ ((__pure__)); - int square(int arg) { return arg * arg; } - ], - [], - []) - - # - # Attribute sentinel: - # Ignored by the intel-9.1.045 -- recognized by cross-check - # intel-10.0beta works fine - # Ignored by PGI-6.2.5 (pgCC) -- recognized by output-parser and cross-check - # Ignored by pathcc-2.2.1 -- recognized by cross-check (through grep ignore) - # - ATTRIBUTE_CFLAGS= - case "$pmix_c_vendor" in - gnu) - ATTRIBUTE_CFLAGS="-Wall" - ;; - intel) - # we do not want to get ignored attributes warnings - ATTRIBUTE_CFLAGS="-wd1292" - ;; - esac - _PMIX_CHECK_SPECIFIC_ATTRIBUTE([sentinel], - [ - int my_execlp(const char * file, const char *arg, ...) __attribute__ ((__sentinel__)); - ], - [ - static int usage(int * argument); - int my_execlp(const char * file, const char *arg, ...) __attribute__ ((__sentinel__)); - - static int usage(int * argument) { - void * last_arg_should_be_null = argument; - return my_execlp ("lala", "/home/there", last_arg_should_be_null); /* This should produce a warning */ - } - /* The autoconf-generated main-function is int main(), which produces a warning by itself */ - int main(void); - ], - [$ATTRIBUTE_CFLAGS]) - - _PMIX_CHECK_SPECIFIC_ATTRIBUTE([unused], - [ - int square(int arg1 __attribute__ ((__unused__)), int arg2); - int square(int arg1, int arg2) { return arg2; } - ], - [], - []) - - - # - # Ignored by PGI-6.2.5 (pgCC) -- recognized by the output-parser - # - _PMIX_CHECK_SPECIFIC_ATTRIBUTE([visibility], - [ - int square(int arg1) __attribute__ ((__visibility__("hidden"))); - ], - [], - []) - - - # - # Attribute warn_unused_result: - # Ignored by the intel-compiler 9.1.045 -- recognized by cross-check - # Ignored by pathcc-2.2.1 -- recognized by cross-check (through grep ignore) - # - ATTRIBUTE_CFLAGS= - case "$pmix_c_vendor" in - gnu) - ATTRIBUTE_CFLAGS="-Wall" - ;; - intel) - # we do not want to get ignored attributes warnings - ATTRIBUTE_CFLAGS="-wd1292" - ;; - esac - _PMIX_CHECK_SPECIFIC_ATTRIBUTE([warn_unused_result], - [ - int foo(int arg) __attribute__ ((__warn_unused_result__)); - int foo(int arg) { return arg + 3; } - ], - [ - static int usage(int * argument); - int foo(int arg) __attribute__ ((__warn_unused_result__)); - - int foo(int arg) { return arg + 3; } - static int usage(int * argument) { - foo (*argument); /* Should produce an unused result warning */ - return 0; - } - - /* The autoconf-generated main-function is int main(), which produces a warning by itself */ - int main(void); - ], - [$ATTRIBUTE_CFLAGS]) - - - _PMIX_CHECK_SPECIFIC_ATTRIBUTE([destructor], - [ - void foo(void) __attribute__ ((__destructor__)); - void foo(void) { return ; } - ], - [], - []) - - _PMIX_CHECK_SPECIFIC_ATTRIBUTE([optnone], - [ - void __attribute__ ((__optnone__)) foo(void); - void foo(void) { return ; } - ], - [], - []) - - _PMIX_CHECK_SPECIFIC_ATTRIBUTE([extension], - [ - int i = __extension__ 3; - ], - [], - []) - fi - - # Now that all the values are set, define them - - AC_DEFINE_UNQUOTED(PMIX_HAVE_ATTRIBUTE_ALIGNED, [$pmix_cv___attribute__aligned], - [Whether your compiler has __attribute__ aligned or not]) - AC_DEFINE_UNQUOTED(PMIX_HAVE_ATTRIBUTE_ALWAYS_INLINE, [$pmix_cv___attribute__always_inline], - [Whether your compiler has __attribute__ always_inline or not]) - AC_DEFINE_UNQUOTED(PMIX_HAVE_ATTRIBUTE_COLD, [$pmix_cv___attribute__cold], - [Whether your compiler has __attribute__ cold or not]) - AC_DEFINE_UNQUOTED(PMIX_HAVE_ATTRIBUTE_CONST, [$pmix_cv___attribute__const], - [Whether your compiler has __attribute__ const or not]) - AC_DEFINE_UNQUOTED(PMIX_HAVE_ATTRIBUTE_DEPRECATED, [$pmix_cv___attribute__deprecated], - [Whether your compiler has __attribute__ deprecated or not]) - AC_DEFINE_UNQUOTED(PMIX_HAVE_ATTRIBUTE_DEPRECATED_ARGUMENT, [$pmix_cv___attribute__deprecated_argument], - [Whether your compiler has __attribute__ deprecated with optional argument]) - AC_DEFINE_UNQUOTED(PMIX_HAVE_ATTRIBUTE_FORMAT, [$pmix_cv___attribute__format], - [Whether your compiler has __attribute__ format or not]) - AC_DEFINE_UNQUOTED(PMIX_HAVE_ATTRIBUTE_FORMAT_FUNCPTR, [$pmix_cv___attribute__format_funcptr], - [Whether your compiler has __attribute__ format and it works on function pointers]) - AC_DEFINE_UNQUOTED(PMIX_HAVE_ATTRIBUTE_HOT, [$pmix_cv___attribute__hot], - [Whether your compiler has __attribute__ hot or not]) - AC_DEFINE_UNQUOTED(PMIX_HAVE_ATTRIBUTE_MALLOC, [$pmix_cv___attribute__malloc], - [Whether your compiler has __attribute__ malloc or not]) - AC_DEFINE_UNQUOTED(PMIX_HAVE_ATTRIBUTE_MAY_ALIAS, [$pmix_cv___attribute__may_alias], - [Whether your compiler has __attribute__ may_alias or not]) - AC_DEFINE_UNQUOTED(PMIX_HAVE_ATTRIBUTE_NO_INSTRUMENT_FUNCTION, [$pmix_cv___attribute__no_instrument_function], - [Whether your compiler has __attribute__ no_instrument_function or not]) - AC_DEFINE_UNQUOTED(PMIX_HAVE_ATTRIBUTE_NONNULL, [$pmix_cv___attribute__nonnull], - [Whether your compiler has __attribute__ nonnull or not]) - AC_DEFINE_UNQUOTED(PMIX_HAVE_ATTRIBUTE_NORETURN, [$pmix_cv___attribute__noreturn], - [Whether your compiler has __attribute__ noreturn or not]) - AC_DEFINE_UNQUOTED(PMIX_HAVE_ATTRIBUTE_NORETURN_FUNCPTR, [$pmix_cv___attribute__noreturn_funcptr], - [Whether your compiler has __attribute__ noreturn and it works on function pointers]) - AC_DEFINE_UNQUOTED(PMIX_HAVE_ATTRIBUTE_PACKED, [$pmix_cv___attribute__packed], - [Whether your compiler has __attribute__ packed or not]) - AC_DEFINE_UNQUOTED(PMIX_HAVE_ATTRIBUTE_PURE, [$pmix_cv___attribute__pure], - [Whether your compiler has __attribute__ pure or not]) - AC_DEFINE_UNQUOTED(PMIX_HAVE_ATTRIBUTE_SENTINEL, [$pmix_cv___attribute__sentinel], - [Whether your compiler has __attribute__ sentinel or not]) - AC_DEFINE_UNQUOTED(PMIX_HAVE_ATTRIBUTE_UNUSED, [$pmix_cv___attribute__unused], - [Whether your compiler has __attribute__ unused or not]) - AC_DEFINE_UNQUOTED(PMIX_HAVE_ATTRIBUTE_VISIBILITY, [$pmix_cv___attribute__visibility], - [Whether your compiler has __attribute__ visibility or not]) - AC_DEFINE_UNQUOTED(PMIX_HAVE_ATTRIBUTE_WARN_UNUSED_RESULT, [$pmix_cv___attribute__warn_unused_result], - [Whether your compiler has __attribute__ warn unused result or not]) - AC_DEFINE_UNQUOTED(PMIX_HAVE_ATTRIBUTE_WEAK_ALIAS, [$pmix_cv___attribute__weak_alias], - [Whether your compiler has __attribute__ weak alias or not]) - AC_DEFINE_UNQUOTED(PMIX_HAVE_ATTRIBUTE_DESTRUCTOR, [$pmix_cv___attribute__destructor], - [Whether your compiler has __attribute__ destructor or not]) - AC_DEFINE_UNQUOTED(PMIX_HAVE_ATTRIBUTE_OPTNONE, [$pmix_cv___attribute__optnone], - [Whether your compiler has __attribute__ optnone or not]) - AC_DEFINE_UNQUOTED(PMIX_HAVE_ATTRIBUTE_EXTENSION, [$pmix_cv___attribute__extension], - [Whether your compiler has __attribute__ extension or not]) -]) diff --git a/opal/mca/pmix/pmix4x/openpmix/config/pmix_check_broken_qsort.m4 b/opal/mca/pmix/pmix4x/openpmix/config/pmix_check_broken_qsort.m4 deleted file mode 100644 index da4d14047e3..00000000000 --- a/opal/mca/pmix/pmix4x/openpmix/config/pmix_check_broken_qsort.m4 +++ /dev/null @@ -1,55 +0,0 @@ -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) 2007 Sun Microsystems, Inc. All rights reserved. -dnl Copyright (c) 2014-2015 Intel, Inc. All rights reserved. -dnl Copyright (c) 2015 Cisco Systems, Inc. All rights reserved. -dnl $COPYRIGHT$ -dnl -dnl Additional copyrights may follow -dnl -dnl $HEADER$ -dnl -dnl There was some mentioning of broken qsort happened for Solaris that could -dnl cause qsort to return a bad pointer which could cause some badness. -dnl The problem should have been corrected with these patches from SunSolve. -dnl Solaris 10 should be free from this problem. -dnl -dnl 5.8_sparc #108827-27 or later -dnl 5.8_x86 #108828-28 or later -dnl 5.9_sparc #112874-20 or later -dnl 5.9_x86 #114432-07 or later -dnl -dnl For users who could not patch their systems or are convinced that their -dnl native qsort is broken, they could specify this configure flag to use -dnl the pmix_qsort instead. - -# check for broken qsort -# PMIX_CHECK_BROKEN_QSORT(prefix, [action-if-found], [action-if-not-found]) -# -------------------------------------------------------- -AC_DEFUN([PMIX_CHECK_BROKEN_QSORT],[ - AC_ARG_WITH([broken-qsort], - [AC_HELP_STRING([--with-broken-qsort], - [Build with FreeBSD qsort instead of native qsort (default: no)])]) - AC_MSG_CHECKING([for broken qsort]) - - if test "$with_broken_qsort" = "yes"; then - result="yes" - define_result=1 - else - result="no" - define_result=0 - fi - AC_MSG_RESULT([$result]) - AC_DEFINE_UNQUOTED([PMIX_HAVE_BROKEN_QSORT], [$define_result], - [whether qsort is broken or not]) -]) diff --git a/opal/mca/pmix/pmix4x/openpmix/config/pmix_check_compiler_version.m4 b/opal/mca/pmix/pmix4x/openpmix/config/pmix_check_compiler_version.m4 deleted file mode 100644 index 4704b8f1c6c..00000000000 --- a/opal/mca/pmix/pmix4x/openpmix/config/pmix_check_compiler_version.m4 +++ /dev/null @@ -1,131 +0,0 @@ -dnl -*- shell-script -*- -dnl -dnl Copyright (c) 2009 Oak Ridge National Labs. 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 -dnl $COPYRIGHT$ -dnl -dnl Additional copyrights may follow -dnl -dnl $HEADER$ -dnl - - -# PMIX_CHECK_COMPILER_VERSION_ID() -# ---------------------------------------------------- -# Try to figure out the compiler's name and version to detect cases, -# where users compile PMIx with one version and compile the application -# with a different compiler. -# -AC_DEFUN([PMIX_CHECK_COMPILER_VERSION_ID], -[ - PMIX_CHECK_COMPILER(FAMILYID) - PMIX_CHECK_COMPILER_STRINGIFY(FAMILYNAME) - PMIX_CHECK_COMPILER(VERSION) - PMIX_CHECK_COMPILER_STRING(VERSION_STR) -])dnl - - -AC_DEFUN([PMIX_CHECK_COMPILER], [ - lower=m4_tolower($1) - AC_CACHE_CHECK([for compiler $lower], pmix_cv_compiler_[$1], - [ - CPPFLAGS_orig=$CPPFLAGS - CPPFLAGS="-I${top_srcdir}/src/include $CPPFLAGS" - AC_TRY_RUN([ -#include -#include -#include "pmix_portable_platform.h" - -int main (int argc, char * argv[]) -{ - FILE * f; - f=fopen("conftestval", "w"); - if (!f) exit(1); - fprintf (f, "%d", PLATFORM_COMPILER_$1); - fclose(f); - return 0; -} - ], [ - eval pmix_cv_compiler_$1=`cat conftestval`; - ], [ - eval pmix_cv_compiler_$1=0 - ], [ - eval pmix_cv_compiler_$1=0 - ]) - CPPFLAGS=$CPPFLAGS_orig - ]) - AC_DEFINE_UNQUOTED([PMIX_BUILD_PLATFORM_COMPILER_$1], $pmix_cv_compiler_[$1], - [The compiler $lower which PMIx was built with]) -])dnl - -AC_DEFUN([PMIX_CHECK_COMPILER_STRING], [ - lower=m4_tolower($1) - AC_CACHE_CHECK([for compiler $lower], pmix_cv_compiler_[$1], - [ - CPPFLAGS_orig=$CPPFLAGS - CPPFLAGS="-I${top_srcdir}/src/include $CPPFLAGS" - AC_TRY_RUN([ -#include -#include -#include "pmix_portable_platform.h" - -int main (int argc, char * argv[]) -{ - FILE * f; - f=fopen("conftestval", "w"); - if (!f) exit(1); - fprintf (f, "%s", PLATFORM_COMPILER_$1); - fclose(f); - return 0; -} - ], [ - eval pmix_cv_compiler_$1=`cat conftestval`; - ], [ - eval pmix_cv_compiler_$1=UNKNOWN - ], [ - eval pmix_cv_compiler_$1=UNKNOWN - ]) - CPPFLAGS=$CPPFLAGS_orig - ]) - AC_DEFINE_UNQUOTED([PMIX_BUILD_PLATFORM_COMPILER_$1], $pmix_cv_compiler_[$1], - [The compiler $lower which PMIx was built with]) -])dnl - - - - -AC_DEFUN([PMIX_CHECK_COMPILER_STRINGIFY], [ - lower=m4_tolower($1) - AC_CACHE_CHECK([for compiler $lower], pmix_cv_compiler_[$1], - [ - CPPFLAGS_orig=$CPPFLAGS - CPPFLAGS="-I${top_srcdir}/src/include $CPPFLAGS" - AC_TRY_RUN([ -#include -#include -#include "pmix_portable_platform.h" - -int main (int argc, char * argv[]) -{ - FILE * f; - f=fopen("conftestval", "w"); - if (!f) exit(1); - fprintf (f, "%s", _STRINGIFY(PLATFORM_COMPILER_$1)); - fclose(f); - return 0; -} - ], [ - eval pmix_cv_compiler_$1=`cat conftestval`; - ], [ - eval pmix_cv_compiler_$1=UNKNOWN - ], [ - eval pmix_cv_compiler_$1=UNKNOWN - ]) - CPPFLAGS=$CPPFLAGS_orig - ]) - AC_DEFINE_UNQUOTED([PMIX_BUILD_PLATFORM_COMPILER_$1], $pmix_cv_compiler_[$1], - [The compiler $lower which PMIX was built with]) -])dnl diff --git a/opal/mca/pmix/pmix4x/openpmix/config/pmix_check_icc.m4 b/opal/mca/pmix/pmix4x/openpmix/config/pmix_check_icc.m4 deleted file mode 100644 index de92a5d66cf..00000000000 --- a/opal/mca/pmix/pmix4x/openpmix/config/pmix_check_icc.m4 +++ /dev/null @@ -1,63 +0,0 @@ -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) 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$ -dnl -dnl Additional copyrights may follow -dnl -dnl $HEADER$ -dnl - -AC_DEFUN([PMIX_CHECK_ICC_VARARGS],[ -dnl -dnl On EM64T, icc-8.1 before version 8.1.027 segfaulted, since -dnl va_start was miscompiled... -dnl -AC_MSG_CHECKING([whether icc-8.1 for EM64T works with variable arguments]) -AC_TRY_RUN([ -#include -#include -#include - -void func (int c, char * f, ...) -{ - va_list arglist; - va_start (arglist, f); - /* vprintf (f, arglist); */ - va_end (arglist); -} - -int main () -{ - FILE *f; - func (4711, "Help %d [%s]\n", 10, "ten"); - f=fopen ("conftestval", "w"); - if (!f) exit (1); - fclose(f); - return 0; -} - -],[pmix_ac_icc_varargs=`test -f conftestval`],[pmix_ac_icc_varargs=1],[pmix_ac_icc_varargs=1]) - -if test "$pmix_ac_icc_varargs" = "1"; then - AC_MSG_WARN([*** Problem running configure test!]) - AC_MSG_WARN([*** Your icc-8.1 compiler seems to miscompile va_start!]) - AC_MSG_WARN([*** Please upgrade compiler to at least version 8.1.027]) - AC_MSG_ERROR([*** Cannot continue.]) -fi - -AC_MSG_RESULT([yes]) - -rm -rf conftest*])dnl diff --git a/opal/mca/pmix/pmix4x/openpmix/config/pmix_check_ident.m4 b/opal/mca/pmix/pmix4x/openpmix/config/pmix_check_ident.m4 deleted file mode 100644 index de2fa573bc9..00000000000 --- a/opal/mca/pmix/pmix4x/openpmix/config/pmix_check_ident.m4 +++ /dev/null @@ -1,103 +0,0 @@ -dnl -*- shell-script -*- -dnl -dnl Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved. -dnl Copyright (c) 2015 Intel, Inc. All rights reserved -dnl $COPYRIGHT$ -dnl -dnl Additional copyrights may follow -dnl -dnl $HEADER$ -dnl -dnl defines: -dnl PMIX_$1_USE_PRAGMA_IDENT -dnl PMIX_$1_USE_IDENT -dnl PMIX_$1_USE_CONST_CHAR_IDENT -dnl - -# PMIX_CHECK_IDENT(compiler-env, compiler-flags, -# file-suffix, lang) Try to compile a source file containing -# a #pragma ident, and determine whether the ident was -# inserted into the resulting object file -# ----------------------------------------------------------- -AC_DEFUN([PMIX_CHECK_IDENT], [ - AC_MSG_CHECKING([for $4 ident string support]) - - pmix_pragma_ident_happy=0 - pmix_ident_happy=0 - pmix_static_const_char_happy=0 - _PMIX_CHECK_IDENT( - [$1], [$2], [$3], - [[#]pragma ident], [], - [pmix_pragma_ident_happy=1 - pmix_message="[#]pragma ident"], - _PMIX_CHECK_IDENT( - [$1], [$2], [$3], - [[#]ident], [], - [pmix_ident_happy=1 - pmix_message="[#]ident"], - _PMIX_CHECK_IDENT( - [$1], [$2], [$3], - [[#]pragma comment(exestr, ], [)], - [pmix_pragma_comment_happy=1 - pmix_message="[#]pragma comment"], - [pmix_static_const_char_happy=1 - pmix_message="static const char[[]]"]))) - - AC_DEFINE_UNQUOTED([PMIX_$1_USE_PRAGMA_IDENT], - [$pmix_pragma_ident_happy], [Use #pragma ident strings for $4 files]) - AC_DEFINE_UNQUOTED([PMIX_$1_USE_IDENT], - [$pmix_ident_happy], [Use #ident strings for $4 files]) - AC_DEFINE_UNQUOTED([PMIX_$1_USE_PRAGMA_COMMENT], - [$pmix_pragma_comment_happy], [Use #pragma comment for $4 files]) - AC_DEFINE_UNQUOTED([PMIX_$1_USE_CONST_CHAR_IDENT], - [$pmix_static_const_char_happy], [Use static const char[] strings for $4 files]) - - AC_MSG_RESULT([$pmix_message]) - - unset pmix_pragma_ident_happy pmix_ident_happy pmix_static_const_char_happy pmix_message -]) - -# _PMIX_CHECK_IDENT(compiler-env, compiler-flags, -# file-suffix, header_prefix, header_suffix, action-if-success, action-if-fail) -# Try to compile a source file containing a #-style ident, -# and determine whether the ident was inserted into the -# resulting object file -# ----------------------------------------------------------- -AC_DEFUN([_PMIX_CHECK_IDENT], [ - eval pmix_compiler="\$$1" - eval pmix_flags="\$$2" - - pmix_ident="string_not_coincidentally_inserted_by_the_compiler" - cat > conftest.$3 <&5 - pmix_output=`$pmix_compiler $pmix_flags -c conftest.$3 -o conftest.${OBJEXT} 2>&1 1>/dev/null` - pmix_status=$? - AS_IF([test $pmix_status = 0], - [test -z "$pmix_output" - pmix_status=$?]) - PMIX_LOG_MSG([\$? = $pmix_status], 1) - AS_IF([test $pmix_status = 0 && test -f conftest.${OBJEXT}], - [pmix_output="`strings -a conftest.${OBJEXT} | grep $pmix_ident`" - grep $pmix_ident conftest.${OBJEXT} 2>&1 1>/dev/null - pmix_status=$? - AS_IF([test "$pmix_output" != "" || test "$pmix_status" = "0"], - [$6], - [$7])], - [PMIX_LOG_MSG([the failed program was:]) - PMIX_LOG_FILE([conftest.$3]) - $7]) - - unset pmix_compiler pmix_flags pmix_output pmix_status - rm -rf conftest.* conftest${EXEEXT} -])dnl diff --git a/opal/mca/pmix/pmix4x/openpmix/config/pmix_check_lock.m4 b/opal/mca/pmix/pmix4x/openpmix/config/pmix_check_lock.m4 deleted file mode 100644 index 0590dcf56cd..00000000000 --- a/opal/mca/pmix/pmix4x/openpmix/config/pmix_check_lock.m4 +++ /dev/null @@ -1,62 +0,0 @@ -dnl -*- shell-script -*- -dnl -dnl Copyright (c) 2017 Mellanox Technologies, Inc. -dnl All rights reserved. -dnl Copyright (c) 2017 IBM Corporation. All rights reserved. -dnl Copyright (c) 2017 Research Organization for Information Science -dnl and Technology (RIST). All rights reserved. -dnl Copyright (c) 2017 Intel, Inc. All rights reserved. -dnl $COPYRIGHT$ -dnl -dnl Additional copyrights may follow -dnl -dnl $HEADER$ -dnl - -AC_DEFUN([PMIX_CHECK_DSTOR_LOCK],[ - orig_libs=$LIBS - LIBS="-lpthread $LIBS" - - _x_ac_pthread_lock_found="0" - _x_ac_fcntl_lock_found="0" - - AC_CHECK_MEMBERS([struct flock.l_type], - [ - AC_DEFINE([HAVE_FCNTL_FLOCK], [1], - [Define to 1 if you have the locking by fcntl.]) - _x_ac_fcntl_lock_found="1" - ], [], [#include ]) - - if test "$DSTORE_PTHREAD_LOCK" = "1"; then - AC_CHECK_FUNC([pthread_rwlockattr_setkind_np], - [AC_EGREP_HEADER([PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP], - [pthread.h],[ - AC_DEFINE([HAVE_PTHREAD_SETKIND], [1], - [Define to 1 if you have the `pthread_rwlockattr_setkind_np` function.])])]) - - AC_CHECK_FUNC([pthread_rwlockattr_setpshared], - [AC_EGREP_HEADER([PTHREAD_PROCESS_SHARED], - [pthread.h],[ - AC_DEFINE([HAVE_PTHREAD_SHARED], [1], - [Define to 1 if you have the `PTHREAD_PROCESS_SHARED` definition. - ]) - _x_ac_pthread_lock_found="1" - ]) - ]) - - if test "$_x_ac_pthread_lock_found" = "0"; then - if test "$_x_ac_fcntl_lock_found" = "1"; then - AC_MSG_WARN([dstore: pthread-based locking not found, will use fcntl-based locking.]) - else - AC_MSG_ERROR([dstore: no available locking mechanisms was found. Can not continue. Try disabling dstore]) - fi - fi - else - if test "$_x_ac_fcntl_lock_found" = "0"; then - AC_MSG_ERROR([dstore: no available locking mechanisms was found. Can not continue. Try disabling dstore]) - fi - fi - LIBS="$orig_libs" - AM_CONDITIONAL([HAVE_DSTORE_PTHREAD_LOCK], [test "$_x_ac_pthread_lock_found" = "1"]) - AM_CONDITIONAL([HAVE_DSTORE_FCNTL_LOCK], [test "$_x_ac_fcntl_lock_found" = "1"]) -]) diff --git a/opal/mca/pmix/pmix4x/openpmix/config/pmix_check_os_flavors.m4 b/opal/mca/pmix/pmix4x/openpmix/config/pmix_check_os_flavors.m4 deleted file mode 100644 index fa08cf906c5..00000000000 --- a/opal/mca/pmix/pmix4x/openpmix/config/pmix_check_os_flavors.m4 +++ /dev/null @@ -1,76 +0,0 @@ -dnl -*- shell-script -*- -dnl -dnl Copyright (c) 2010 Cisco Systems, Inc. All rights reserved. -dnl Copyright (c) 2014-2019 Intel, Inc. All rights reserved. -dnl Copyright (c) 2014 Research Organization for Information Science -dnl and Technology (RIST). All rights reserved. -dnl -dnl $COPYRIGHT$ -dnl -dnl Additional copyrights may follow -dnl -dnl $HEADER$ -dnl - -# PMIX_CHECK_OS_FLAVOR_SPECIFIC() -# ---------------------------------------------------- -# Helper macro from PMIX-CHECK-OS-FLAVORS(), below. -# $1 = macro to look for -# $2 = suffix of env variable to set with results -AC_DEFUN([PMIX_CHECK_OS_FLAVOR_SPECIFIC], -[ - AC_MSG_CHECKING([$1]) - AC_COMPILE_IFELSE([AC_LANG_PROGRAM( - [[#ifndef $1 - error: this isnt $1 - #endif - ]])], - [pmix_found_$2=yes], - [pmix_found_$2=no]) - AC_MSG_RESULT([$pmix_found_$2]) -])dnl - -# PMIX_CHECK_OS_FLAVORS() -# ---------------------------------------------------- -# Try to figure out the various OS flavors out there. -# -AC_DEFUN([PMIX_CHECK_OS_FLAVORS], -[ - PMIX_CHECK_OS_FLAVOR_SPECIFIC([__NetBSD__], [netbsd]) - PMIX_CHECK_OS_FLAVOR_SPECIFIC([__FreeBSD__], [freebsd]) - PMIX_CHECK_OS_FLAVOR_SPECIFIC([__OpenBSD__], [openbsd]) - PMIX_CHECK_OS_FLAVOR_SPECIFIC([__DragonFly__], [dragonfly]) - PMIX_CHECK_OS_FLAVOR_SPECIFIC([__386BSD__], [386bsd]) - PMIX_CHECK_OS_FLAVOR_SPECIFIC([__bsdi__], [bsdi]) - PMIX_CHECK_OS_FLAVOR_SPECIFIC([__APPLE__], [apple]) - PMIX_CHECK_OS_FLAVOR_SPECIFIC([__linux__], [linux]) - PMIX_CHECK_OS_FLAVOR_SPECIFIC([__sun__], [sun]) - AS_IF([test "$pmix_found_sun" = "no"], - PMIX_CHECK_OS_FLAVOR_SPECIFIC([__sun], [sun])) - - AS_IF([test "$pmix_found_sun" = "yes"], - [pmix_have_solaris=1 - CFLAGS="$CFLAGS -D_REENTRANT" - CPPFLAGS="$CPPFLAGS -D_REENTRANT"], - [pmix_have_solaris=0]) - AC_DEFINE_UNQUOTED([PMIX_HAVE_SOLARIS], - [$pmix_have_solaris], - [Whether or not we have solaris]) - - AS_IF([test "$pmix_found_apple" = "yes"], - [pmix_have_apple=1], - [pmix_have_apple=0]) - AC_DEFINE_UNQUOTED([PMIX_HAVE_APPLE], - [$pmix_have_apple], - [Whether or not we have apple]) - - # check for sockaddr_in (a good sign we have TCP) - AC_CHECK_HEADERS([netdb.h netinet/in.h netinet/tcp.h]) - AC_CHECK_TYPES([struct sockaddr_in], - [pmix_found_sockaddr=yes], - [pmix_found_sockaddr=no], - [AC_INCLUDES_DEFAULT -#ifdef HAVE_NETINET_IN_H -#include -#endif]) -])dnl diff --git a/opal/mca/pmix/pmix4x/openpmix/config/pmix_check_package.m4 b/opal/mca/pmix/pmix4x/openpmix/config/pmix_check_package.m4 deleted file mode 100644 index 7b7271a1957..00000000000 --- a/opal/mca/pmix/pmix4x/openpmix/config/pmix_check_package.m4 +++ /dev/null @@ -1,215 +0,0 @@ -# -*- shell-script -*- -# -# 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-2015 Cisco Systems, Inc. All rights reserved. -# Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved. -# Copyright (c) 2014-2018 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$ -# - -# _PMIX_CHECK_PACKAGE_HEADER(prefix, header, dir-prefix, -# [action-if-found], [action-if-not-found], -# includes) -# -------------------------------------------------------------------- -AC_DEFUN([_PMIX_CHECK_PACKAGE_HEADER], [ - # This is stolen from autoconf to peek under the covers to get the - # cache variable for the library check. one should not copy this - # code into other places unless you want much pain and suffering - AS_VAR_PUSHDEF([pmix_Header], [ac_cv_header_$2]) - - # so this sucks, but there's no way to get through the progression - # of header includes without killing off the cache variable and trying - # again... - unset pmix_Header - pmix_check_package_header_happy="no" - - # get rid of the trailing slash(es) - hdir_prefix=$(echo $3 | sed -e 'sX/*$XXg') - - AS_IF([test "$hdir_prefix" = "" || \ - test "$hdir_prefix" = "/usr" || \ - test "$hdir_prefix" = "/usr/local"], - [ # try as is... - AC_VERBOSE([looking for header without includes]) - AC_CHECK_HEADERS([$2], [pmix_check_package_header_happy="yes"], []) - AS_IF([test "$pmix_check_package_header_happy" = "no"], - [# no go on the as is - reset the cache and try again - unset pmix_Header])]) - - AS_IF([test "$pmix_check_package_header_happy" = "no"], - [AS_IF([test "$hdir_prefix" != ""], - [$1_CPPFLAGS="$$1_CPPFLAGS -I$hdir_prefix" - CPPFLAGS="$CPPFLAGS -I$hdir_prefix" - AC_VERBOSE([looking for header in $hdir_prefix]) - AC_CHECK_HEADERS([$2], [pmix_check_package_header_happy="yes"], [], [$6]) - AS_IF([test "$pmix_check_package_header_happy" = "no"], - [unset pmix_Header - $1_CPPFLAGS="$$1_CPPFLAGS -I$hdir_prefix/include" - CPPFLAGS="$CPPFLAGS -I$hdir_prefix/include" - AC_VERBOSE([looking for header in $hdir_prefix/include]) - AC_CHECK_HEADERS([$2], [pmix_check_package_header_happy="yes"], [], [$6])])])]) - - AS_IF([test "$pmix_check_package_header_happy" = "yes"], - [$4], [$5]) - - unset pmix_check_package_header_happy - - AS_VAR_POPDEF([pmix_Header])dnl -]) - - -# _PMIX_CHECK_PACKAGE_LIB(prefix, library, function, extra-libraries, -# dir-prefix, libdir, -# [action-if-found], [action-if-not-found]]) -# -------------------------------------------------------------------- -AC_DEFUN([_PMIX_CHECK_PACKAGE_LIB], [ - # This is stolen from autoconf to peek under the covers to get the - # cache variable for the library check. one should not copy this - # code into other places unless you want much pain and suffering - AS_LITERAL_IF([$2], - [AS_VAR_PUSHDEF([pmix_Lib], [ac_cv_lib_$2_$3])], - [AS_VAR_PUSHDEF([pmix_Lib], [ac_cv_lib_$2''_$3])])dnl - - # see comment above - unset pmix_Lib - pmix_check_package_lib_happy="no" - - # get rid of the trailing slash(es) - libdir_prefix=$(echo $6 | sed -e 'sX/*$XXg') - - AS_IF([test "$libdir_prefix" != ""], - [# libdir was specified - search only there - $1_LDFLAGS="$$1_LDFLAGS -L$libdir_prefix" - LDFLAGS="$LDFLAGS -L$libdir_prefix" - AC_SEARCH_LIBS([$3], [$2], - [pmix_check_package_lib_happy="yes"], - [pmix_check_package_lib_happy="no"], [$4]) - AS_IF([test "$pmix_check_package_lib_happy" = "no"], - [LDFLAGS="$pmix_check_package_$1_save_LDFLAGS" - $1_LDFLAGS="$pmix_check_package_$1_orig_LDFLAGS" - unset pmix_Lib])], - [ # libdir was not specified - go through search path - # get rid of the trailing slash(es) - libdir_prefix=$(echo $5 | sed -e 'sX/*$XXg') - - # first try standard locations as otherwise our - # searches with libdir_prefix locations might come - # back positive and unnecessarily add an LDFLAG - AC_VERBOSE([looking for library without search path]) - AC_SEARCH_LIBS([$3], [$2], - [pmix_check_package_lib_happy="yes"], - [pmix_check_package_lib_happy="no"], [$4]) - AS_IF([test "$pmix_check_package_lib_happy" = "no"], - [ # no go on the as is.. see what happens later... - LDFLAGS="$pmix_check_package_$1_save_LDFLAGS" - $1_LDFLAGS="$pmix_check_package_$1_orig_LDFLAGS" - unset pmix_Lib]) - - AS_IF([test "$pmix_check_package_lib_happy" = "no"], - # if we didn't find it, check the libdir_prefix/lib64 directory - [AS_IF([test "$libdir_prefix" != "" && \ - test "$libdir_prefix" != "/usr" && \ - test "$libdir_prefix" != "/usr/local"], - [$1_LDFLAGS="$$1_LDFLAGS -L$libdir_prefix/lib64" - LDFLAGS="$LDFLAGS -L$libdir_prefix/lib64" - AC_VERBOSE([looking for library in $libdir_prefix/lib64]) - AC_SEARCH_LIBS([$3], [$2], - [pmix_check_package_lib_happy="yes"], - [pmix_check_package_lib_happy="no"], [$4]) - AS_IF([test "$pmix_check_package_lib_happy" = "no"], - [ # no go on the as is.. see what happens later... - LDFLAGS="$pmix_check_package_$1_save_LDFLAGS" - $1_LDFLAGS="$pmix_check_package_$1_orig_LDFLAGS" - unset pmix_Lib])])]) - - AS_IF([test "$pmix_check_package_lib_happy" = "no"], - # if we still haven't found it, check the libdir_prefix/lib directory - [AS_IF([test "$libdir_prefix" != "" && \ - test "$libdir_prefix" != "/usr" && \ - test "$libdir_prefix" != "/usr/local"], - [$1_LDFLAGS="$$1_LDFLAGS -L$libdir_prefix/lib" - LDFLAGS="$LDFLAGS -L$libdir_prefix/lib" - AC_VERBOSE([looking for library in $libdir_prefix/lib]) - AC_SEARCH_LIBS([$3], [$2], - [pmix_check_package_lib_happy="yes"], - [pmix_check_package_lib_happy="no"], [$4]) - AS_IF([test "$pmix_check_package_lib_happy" = "no"], - [ # no go on the as is.. see what happens later... - LDFLAGS="$pmix_check_package_$1_save_LDFLAGS" - $1_LDFLAGS="$pmix_check_package_$1_orig_LDFLAGS" - unset pmix_Lib])])]) - ]) - - - AS_IF([test "$pmix_check_package_lib_happy" = "yes"], - [$1_LIBS="-l$2 $4" - $7], [$8]) - AS_IF([test "$pmix_check_package_lib_happy" = "yes"], - [ # The result of AC SEARCH_LIBS is cached in $ac_cv_search_[function] - AS_IF([test "$ac_cv_search_$3" != "no" && - test "$ac_cv_search_$3" != "none required"], - [$1_LIBS="$ac_cv_search_$3 $4"], - [$1_LIBS="$4"]) - $7], - [$8]) - - AS_VAR_POPDEF([pmix_Lib])dnl -]) - - -# PMIX_CHECK_PACKAGE(prefix, -# header, -# library, -# function, -# extra-libraries, -# dir-prefix, -# libdir-prefix, -# [action-if-found], [action-if-not-found], -# includes) -# ----------------------------------------------------------- -# check for package defined by header and libs, and probably -# located in dir-prefix, possibly with libs in libdir-prefix. -# Both dir-prefix and libdir-prefix can be empty. Will set -# prefix_{CPPFLAGS, LDFLAGS, LIBS} as needed -AC_DEFUN([PMIX_CHECK_PACKAGE],[ - pmix_check_package_$1_save_CPPFLAGS="$CPPFLAGS" - pmix_check_package_$1_save_LDFLAGS="$LDFLAGS" - pmix_check_package_$1_save_LIBS="$LIBS" - - pmix_check_package_$1_orig_CPPFLAGS="$$1_CPPFLAGS" - pmix_check_package_$1_orig_LDFLAGS="$$1_LDFLAGS" - pmix_check_package_$1_orig_LIBS="$$1_LIBS" - - _PMIX_CHECK_PACKAGE_HEADER([$1], [$2], [$6], - [_PMIX_CHECK_PACKAGE_LIB([$1], [$3], [$4], [$5], [$6], [$7], - [pmix_check_package_happy="yes"], - [pmix_check_package_happy="no"])], - [pmix_check_package_happy="no"], - [$10]) - - AS_IF([test "$pmix_check_package_happy" = "yes"], - [$8], - [$1_CPPFLAGS="$pmix_check_package_$1_orig_CPPFLAGS" - $1_LDFLAGS="$pmix_check_package_$1_orig_LDFLAGS" - $1_LIBS="$pmix_check_package_$1_orig_LIBS" - $9]) - - CPPFLAGS="$pmix_check_package_$1_save_CPPFLAGS" - LDFLAGS="$pmix_check_package_$1_save_LDFLAGS" - LIBS="$pmix_check_package_$1_save_LIBS" -]) diff --git a/opal/mca/pmix/pmix4x/openpmix/config/pmix_check_pthread_pids.m4 b/opal/mca/pmix/pmix4x/openpmix/config/pmix_check_pthread_pids.m4 deleted file mode 100644 index 2bf03579d82..00000000000 --- a/opal/mca/pmix/pmix4x/openpmix/config/pmix_check_pthread_pids.m4 +++ /dev/null @@ -1,109 +0,0 @@ -dnl -dnl Copyright (c) 2004-2006 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) 2008-2013 Cisco Systems, Inc. All rights reserved. -dnl Copyright (c) 2017 Intel, Inc. All rights reserved. -dnl $COPYRIGHT$ -dnl -dnl Additional copyrights may follow -dnl -dnl $HEADER$ -dnl - -AC_DEFUN([PMIX_CHECK_PTHREAD_PIDS],[ -# -# Arguments: none -# -# Dependencies: None -# -# Sets: -# PMIX_THREADS_HAVE_DIFFERENT_PIDS (variable) -# -# Test for Linux-like threads in the system. PMIX does not support -# systems with different PIDs for threads in the same process, so error -# out if we detect that case. -# - -AC_MSG_CHECKING([if threads have different pids (pthreads on linux)]) - -PMIX_VAR_SCOPE_PUSH([tpids_CFLAGS_save tpids_CPPFLAGS_save tpids_LDFLAGS_save tpids_LIBS_save tpids_MSG]) -tpids_CFLAGS_save="$CFLAGS" -CFLAGS="$CFLAGS $THREAD_CFLAGS" -tpids_CPPFLAGS_save="$CPPFLAGS" -CPPFLAGS="$CPPFLAGS $THREAD_CPPFLAGS" -tpids_LDFLAGS_save="$LDFLAGS" -LDFLAGS="$LDFLAGS $THREAD_LDFLAGS" -tpids_LIBS_save="$LIBS" -LIBS="$LIBS $THREAD_LIBS" -AC_RUN_IFELSE([AC_LANG_SOURCE([#include -#include -#include -#include - -void *checkpid(void *arg); -int main() { - pthread_t thr; - int pid, *retval; - pid = getpid(); - pthread_create(&thr, NULL, checkpid, &pid); - pthread_join(thr, (void **) &retval); - exit(*retval); -} - -static int ret; -void *checkpid(void *arg) { - int ppid = *((int *) arg); - if (ppid == getpid()) - ret = 0; - else - ret = 1; - pthread_exit((void *) &ret); -}])], -[tpids_MSG=no PMIX_THREADS_HAVE_DIFFERENT_PIDS=0], -[tpids_MSG=yes PMIX_THREADS_HAVE_DIFFERENT_PIDS=1], -[ - # If we're cross compiling, we can't do another AC_* function here beause - # it we haven't displayed the result from the last one yet. So defer - # another test until below. - PMIX_THREADS_HAVE_DIFFERENT_PIDS= - MSG="cross compiling (need another test)"]) - -CFLAGS="$tpids_CFLAGS_save" -CPPFLAGS="$tpids_CPPFLAGS_save" -LDFLAGS="$tpids_LDFLAGS_save" -LIBS="$tpids_LIBS_save" - -AC_MSG_RESULT([$tpids_MSG]) - -AS_IF([test "x$PMIX_THREADS_HAVE_DIFFERENT_PIDS" = "x"], - [ # If we are cross-compiling, look for the symbol - # __linuxthreads_create_event, which seems to only exist in the - # Linux Threads-based pthreads implementation (i.e., the one - # that has different PIDs for each thread). We *could* switch - # on $host here and only test *linux* hosts, but this test is - # pretty unique, so why bother? Note that AC_CHECK_FUNC works - # properly in cross-compiling environments in recent-enough - # versions of Autoconf (which is one of the reasons we mandate - # recent versions in autogen!). - AC_CHECK_FUNC([__linuxthreads_create_event], - [PMIX_THREADS_HAVE_DIFFERENT_PIDS=1])]) - -AS_IF([test "$PMIX_THREADS_HAVE_DIFFERENT_PIDS" = "1"], - [AC_MSG_WARN([This version of PMIx only supports environments where]) - AC_MSG_WARN([threads have the same PID]) - AC_MSG_ERROR([Cannot continue]) - ]) - -# -# if pthreads is not available, then the system does not have an insane threads -# model -# -PMIX_VAR_SCOPE_POP])dnl diff --git a/opal/mca/pmix/pmix4x/openpmix/config/pmix_check_vendor.m4 b/opal/mca/pmix/pmix4x/openpmix/config/pmix_check_vendor.m4 deleted file mode 100644 index cf96c462563..00000000000 --- a/opal/mca/pmix/pmix4x/openpmix/config/pmix_check_vendor.m4 +++ /dev/null @@ -1,252 +0,0 @@ -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) 2012 Oracle and/or its affiliates. All rights reserved. -dnl Copyright (c) 2013 Intel, Inc. All rights reserved -dnl Copyright (c) 2015 Cisco Systems, Inc. All rights reserved. -dnl Copyright (c) 2015 Research Organization for Information Science -dnl and Technology (RIST). All rights reserved. -dnl $COPYRIGHT$ -dnl -dnl Additional copyrights may follow -dnl -dnl $HEADER$ -dnl - - -# PMIX_C_COMPILER_VENDOR(VENDOR_VARIABLE) -# --------------------------------------- -# Set shell variable VENDOR_VARIABLE to the name of the compiler -# vendor for the current C compiler. -# -# See comment for _PMIX_CHECK_COMPILER_VENDOR for a complete -# list of currently detected compilers. -AC_DEFUN([PMIX_C_COMPILER_VENDOR], [ - AC_REQUIRE([AC_PROG_CC]) - - AC_CACHE_CHECK([for the C compiler vendor], - [pmix_cv_c_compiler_vendor], - [AC_LANG_PUSH(C) - _PMIX_CHECK_COMPILER_VENDOR([pmix_cv_c_compiler_vendor]) - AC_LANG_POP(C)]) - - $1="$pmix_cv_c_compiler_vendor" -]) - - -# workaround to avoid syntax error with Autoconf < 2.68: -m4_ifndef([AC_LANG_DEFINES_PROVIDED], - [m4_define([AC_LANG_DEFINES_PROVIDED])]) - -# PMIX_IFDEF_IFELSE(symbol, [action-if-defined], -# [action-if-not-defined]) -# ---------------------------------------------- -# Run compiler to determine if preprocessor symbol "symbol" is -# defined by the compiler. -AC_DEFUN([PMIX_IFDEF_IFELSE], [ - AC_COMPILE_IFELSE([AC_LANG_DEFINES_PROVIDED -#ifndef $1 -#error "symbol $1 not defined" -choke me -#endif], [$2], [$3])]) - - -# PMIX_IF_IFELSE(symbol, [action-if-defined], -# [action-if-not-defined]) -# ---------------------------------------------- -# Run compiler to determine if preprocessor symbol "symbol" is -# defined by the compiler. -AC_DEFUN([PMIX_IF_IFELSE], [ - AC_COMPILE_IFELSE([AC_LANG_DEFINES_PROVIDED -#if !( $1 ) -#error "condition $1 not met" -choke me -#endif], [$2], [$3])]) - - -# _PMIX_CHECK_COMPILER_VENDOR(VENDOR_VARIABLE) -# -------------------------------------------- -# Set shell variable VENDOR_VARIABLE to the name of the compiler -# vendor for the compiler for the current language. Language must be -# one of C, OBJC, or C++. -# -# thanks to http://predef.sourceforge.net/precomp.html for the list -# of defines to check. -AC_DEFUN([_PMIX_CHECK_COMPILER_VENDOR], [ - pmix_check_compiler_vendor_result="unknown" - - # GNU is probably the most common, so check that one as soon as - # possible. Intel pretends to be GNU, so need to check Intel - # before checking for GNU. - - # Intel - AS_IF([test "$pmix_check_compiler_vendor_result" = "unknown"], - [PMIX_IF_IFELSE([defined(__INTEL_COMPILER) || defined(__ICC)], - [pmix_check_compiler_vendor_result="intel"])]) - - # Fujitsu - AS_IF([test "$pmix_check_compiler_vendor_result" = "unknown"], - [PMIX_IF_IFELSE([defined(__FUJITSU)], - [pmix_check_compiler_vendor_result="fujitsu"])]) - - # GNU - AS_IF([test "$pmix_check_compiler_vendor_result" = "unknown"], - [PMIX_IFDEF_IFELSE([__GNUC__], - [pmix_check_compiler_vendor_result="gnu" - - # We do not support gccfss as a compiler so die if - # someone tries to use said compiler. gccfss (gcc - # for SPARC Systems) is a compiler that is no longer - # supported by Oracle and it has some major flaws - # that prevents it from actually compiling PMIX code. - # So if we detect it we automatically bail. - - if ($CC --version | grep gccfss) >/dev/null 2>&1; then - AC_MSG_RESULT([gccfss]) - AC_MSG_WARN([Detected gccfss being used to compile PMIx.]) - AC_MSG_WARN([Because of several issues PMIx does not support]) - AC_MSG_WARN([the gccfss compiler. Please use a different compiler.]) - AC_MSG_WARN([If you didn't think you used gccfss you may want to]) - AC_MSG_WARN([check to see if the compiler you think you used is]) - AC_MSG_WARN([actually a link to gccfss.]) - AC_MSG_ERROR([Cannot continue]) - fi])]) - - # Borland Turbo C - AS_IF([test "$pmix_check_compiler_vendor_result" = "unknown"], - [PMIX_IFDEF_IFELSE([__TURBOC__], - [pmix_check_compiler_vendor_result="borland"])]) - - # Borland C++ - AS_IF([test "$pmix_check_compiler_vendor_result" = "unknown"], - [PMIX_IFDEF_IFELSE([__BORLANDC__], - [pmix_check_compiler_vendor_result="borland"])]) - - # Comeau C++ - AS_IF([test "$pmix_check_compiler_vendor_result" = "unknown"], - [PMIX_IFDEF_IFELSE([__COMO__], - [pmix_check_compiler_vendor_result="comeau"])]) - - # Compaq C/C++ - AS_IF([test "$pmix_check_compiler_vendor_result" = "unknown"], - [PMIX_IF_IFELSE([defined(__DECC) || defined(VAXC) || defined(__VAXC)], - [pmix_check_compiler_vendor_result="compaq"], - [PMIX_IF_IFELSE([defined(__osf__) && defined(__LANGUAGE_C__)], - [pmix_check_compiler_vendor_result="compaq"], - [PMIX_IFDEF_IFELSE([__DECCXX], - [pmix_check_compiler_vendor_result="compaq"])])])]) - - # Cray C/C++ - AS_IF([test "$pmix_check_compiler_vendor_result" = "unknown"], - [PMIX_IFDEF_IFELSE([_CRAYC], - [pmix_check_compiler_vendor_result="cray"])]) - - # Diab C/C++ - AS_IF([test "$pmix_check_compiler_vendor_result" = "unknown"], - [PMIX_IFDEF_IFELSE([__DCC__], - [pmix_check_compiler_vendor_result="diab"])]) - - # Digital Mars - AS_IF([test "$pmix_check_compiler_vendor_result" = "unknown"], - [PMIX_IF_IFELSE([defined(__DMC__) || defined(__SC__) || defined(__ZTC__)], - [pmix_check_compiler_vendor_result="digital mars"])]) - - # HP ANSI C / aC++ - AS_IF([test "$pmix_check_compiler_vendor_result" = "unknown"], - [PMIX_IF_IFELSE([defined(__HP_cc) || defined(__HP_aCC)], - [pmix_check_compiler_vendor_result="hp"])]) - - # IBM XL C/C++ - AS_IF([test "$pmix_check_compiler_vendor_result" = "unknown"], - [PMIX_IF_IFELSE([defined(__xlC__) || defined(__IBMC__) || defined(__IBMCPP__)], - [pmix_check_compiler_vendor_result="ibm"], - [PMIX_IF_IFELSE([defined(_AIX) && !defined(__GNUC__)], - [pmix_check_compiler_vendor_result="ibm"])])]) - - # KAI C++ (rest in peace) - AS_IF([test "$pmix_check_compiler_vendor_result" = "unknown"], - [PMIX_IFDEF_IFELSE([__KCC], - [pmix_check_compiler_vendor_result="kai"])]) - - # LCC - AS_IF([test "$pmix_check_compiler_vendor_result" = "unknown"], - [PMIX_IFDEF_IFELSE([__LCC__], - [pmix_check_compiler_vendor_result="lcc"])]) - - # MetaWare High C/C++ - AS_IF([test "$pmix_check_compiler_vendor_result" = "unknown"], - [PMIX_IFDEF_IFELSE([__HIGHC__], - [pmix_check_compiler_vendor_result="metaware high"])]) - - # Metrowerks Codewarrior - AS_IF([test "$pmix_check_compiler_vendor_result" = "unknown"], - [PMIX_IFDEF_IFELSE([__MWERKS__], - [pmix_check_compiler_vendor_result="metrowerks"])]) - - # MIPSpro (SGI) - AS_IF([test "$pmix_check_compiler_vendor_result" = "unknown"], - [PMIX_IF_IFELSE([defined(sgi) || defined(__sgi)], - [pmix_check_compiler_vendor_result="sgi"])]) - - # MPW C++ - AS_IF([test "$pmix_check_compiler_vendor_result" = "unknown"], - [PMIX_IF_IFELSE([defined(__MRC__) || defined(MPW_C) || defined(MPW_CPLUS)], - [pmix_check_compiler_vendor_result="mpw"])]) - - # Norcroft C - AS_IF([test "$pmix_check_compiler_vendor_result" = "unknown"], - [PMIX_IFDEF_IFELSE([__CC_NORCROFT], - [pmix_check_compiler_vendor_result="norcroft"])]) - - # Pelles C - AS_IF([test "$pmix_check_compiler_vendor_result" = "unknown"], - [PMIX_IFDEF_IFELSE([__POCC__], - [pmix_check_compiler_vendor_result="pelles"])]) - - # Portland Group - AS_IF([test "$pmix_check_compiler_vendor_result" = "unknown"], - [PMIX_IFDEF_IFELSE([__PGI], - [pmix_check_compiler_vendor_result="portland group"])]) - - # SAS/C - AS_IF([test "$pmix_check_compiler_vendor_result" = "unknown"], - [PMIX_IF_IFELSE([defined(SASC) || defined(__SASC) || defined(__SASC__)], - [pmix_check_compiler_vendor_result="sas"])]) - - # Sun Workshop C/C++ - AS_IF([test "$pmix_check_compiler_vendor_result" = "unknown"], - [PMIX_IF_IFELSE([defined(__SUNPRO_C) || defined(__SUNPRO_CC)], - [pmix_check_compiler_vendor_result="sun"])]) - - # TenDRA C/C++ - AS_IF([test "$pmix_check_compiler_vendor_result" = "unknown"], - [PMIX_IFDEF_IFELSE([__TenDRA__], - [pmix_check_compiler_vendor_result="tendra"])]) - - # Tiny C - AS_IF([test "$pmix_check_compiler_vendor_result" = "unknown"], - [PMIX_IFDEF_IFELSE([__TINYC__], - [pmix_check_compiler_vendor_result="tiny"])]) - - # USL C - AS_IF([test "$pmix_check_compiler_vendor_result" = "unknown"], - [PMIX_IFDEF_IFELSE([__USLC__], - [pmix_check_compiler_vendor_result="usl"])]) - - # Watcom C++ - AS_IF([test "$pmix_check_compiler_vendor_result" = "unknown"], - [PMIX_IFDEF_IFELSE([__WATCOMC__], - [pmix_check_compiler_vendor_result="watcom"])]) - - $1="$pmix_check_compiler_vendor_result" - unset pmix_check_compiler_vendor_result -]) diff --git a/opal/mca/pmix/pmix4x/openpmix/config/pmix_check_visibility.m4 b/opal/mca/pmix/pmix4x/openpmix/config/pmix_check_visibility.m4 deleted file mode 100644 index d92d6211573..00000000000 --- a/opal/mca/pmix/pmix4x/openpmix/config/pmix_check_visibility.m4 +++ /dev/null @@ -1,93 +0,0 @@ -# -*- shell-script -*- -# -# 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-2007 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-2015 Cisco Systems, Inc. All rights reserved. -# Copyright (c) 2009-2011 Oracle and/or its affiliates. All rights reserved. -# Copyright (c) 2017 Intel, Inc. All rights reserved. -# $COPYRIGHT$ -# -# Additional copyrights may follow -# -# $HEADER$ -# - -# PMIX_CHECK_VISIBILITY -# -------------------------------------------------------- -AC_DEFUN([PMIX_CHECK_VISIBILITY],[ - AC_REQUIRE([AC_PROG_GREP]) - - # Check if the compiler has support for visibility, like some - # versions of gcc, icc Sun Studio cc. - AC_ARG_ENABLE(visibility, - AC_HELP_STRING([--enable-visibility], - [enable visibility feature of certain compilers/linkers (default: enabled)])) - - WANT_VISIBILITY=0 - pmix_msg="whether to enable symbol visibility" - - if test "$enable_visibility" = "no"; then - AC_MSG_CHECKING([$pmix_msg]) - AC_MSG_RESULT([no (disabled)]) - else - CFLAGS_orig=$CFLAGS - - pmix_add= - case "$pmix_c_vendor" in - sun) - # Check using Sun Studio -xldscope=hidden flag - pmix_add=-xldscope=hidden - CFLAGS="$PMIX_CFLAGS_BEFORE_PICKY $pmix_add -errwarn=%all" - ;; - - *) - # Check using -fvisibility=hidden - pmix_add=-fvisibility=hidden - CFLAGS="$PMIX_CFLAGS_BEFORE_PICKY $pmix_add -Werror" - ;; - esac - - AC_MSG_CHECKING([if $CC supports $pmix_add]) - AC_LINK_IFELSE([AC_LANG_PROGRAM([[ - #include - __attribute__((visibility("default"))) int foo; - ]],[[fprintf(stderr, "Hello, world\n");]])], - [AS_IF([test -s conftest.err], - [$GREP -iq visibility conftest.err - # If we find "visibility" in the stderr, then - # assume it doesn't work - AS_IF([test "$?" = "0"], [pmix_add=])]) - ], [pmix_add=]) - AS_IF([test "$pmix_add" = ""], - [AC_MSG_RESULT([no])], - [AC_MSG_RESULT([yes])]) - - CFLAGS=$CFLAGS_orig - PMIX_VISIBILITY_CFLAGS=$pmix_add - - if test "$pmix_add" != "" ; then - WANT_VISIBILITY=1 - CFLAGS="$CFLAGS $PMIX_VISIBILITY_CFLAGS" - AC_MSG_CHECKING([$pmix_msg]) - AC_MSG_RESULT([yes (via $pmix_add)]) - elif test "$enable_visibility" = "yes"; then - AC_MSG_ERROR([Symbol visibility support requested but compiler does not seem to support it. Aborting]) - else - AC_MSG_CHECKING([$pmix_msg]) - AC_MSG_RESULT([no (unsupported)]) - fi - unset pmix_add - fi - - AC_DEFINE_UNQUOTED([PMIX_HAVE_VISIBILITY], [$WANT_VISIBILITY], - [Whether C compiler supports symbol visibility or not]) - AM_CONDITIONAL([WANT_HIDDEN],[test "$WANT_VISIBILITY" = "1"]) -]) diff --git a/opal/mca/pmix/pmix4x/openpmix/config/pmix_check_withdir.m4 b/opal/mca/pmix/pmix4x/openpmix/config/pmix_check_withdir.m4 deleted file mode 100644 index 3fdaefb3c05..00000000000 --- a/opal/mca/pmix/pmix4x/openpmix/config/pmix_check_withdir.m4 +++ /dev/null @@ -1,39 +0,0 @@ -dnl -*- shell-script -*- -dnl -dnl Copyright (c) 2004-2006 The Trustees of Indiana University and Indiana -dnl University Research and Technology -dnl Corporation. All rights reserved. -dnl Copyright (c) 2006 Los Alamos National Security, LLC. All rights -dnl reserved. -dnl Copyright (c) 2008-2009 Cisco Systems, Inc. All rights reserved. -dnl Copyright (c) 2015 Research Organization for Information Science -dnl and Technology (RIST). All rights reserved. -dnl Copyright (c) 2016 Intel, Inc. All rights reserved. -dnl $COPYRIGHT$ -dnl -dnl Additional copyrights may follow -dnl -dnl $HEADER$ -dnl - -# PMIX_CHECK_WITHDIR(with_option_name, dir_value, file_in_dir) -# ---------------------------------------------------- -AC_DEFUN([PMIX_CHECK_WITHDIR],[ - AC_MSG_CHECKING([--with-$1 value]) - AS_IF([test "$2" = "yes" || test "$2" = "no" || test "x$2" = "x"], - [AC_MSG_RESULT([simple ok (unspecified)])], - [AS_IF([test ! -d "$2"], - [AC_MSG_RESULT([not found]) - AC_MSG_WARN([Directory $2 not found]) - AC_MSG_ERROR([Cannot continue])], - [AS_IF([test "x`ls $2/$3 2> /dev/null`" = "x"], - [AC_MSG_RESULT([not found]) - AC_MSG_WARN([Expected file $2/$3 not found]) - AC_MSG_ERROR([Cannot continue])], - [AC_MSG_RESULT([sanity check ok ($2)])] - ) - ] - ) - ] - ) -])dnl diff --git a/opal/mca/pmix/pmix4x/openpmix/config/pmix_config_asm.m4 b/opal/mca/pmix/pmix4x/openpmix/config/pmix_config_asm.m4 deleted file mode 100644 index 361372412c7..00000000000 --- a/opal/mca/pmix/pmix4x/openpmix/config/pmix_config_asm.m4 +++ /dev/null @@ -1,1430 +0,0 @@ -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-2018 The University of Tennessee and The University -dnl of Tennessee Research Foundation. All rights -dnl reserved. -dnl Copyright (c) 2004-2006 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) 2008-2018 Cisco Systems, Inc. All rights reserved. -dnl Copyright (c) 2010 Oracle and/or its affiliates. All rights reserved. -dnl Copyright (c) 2015-2017 Research Organization for Information Science -dnl and Technology (RIST). All rights reserved. -dnl Copyright (c) 2014-2018 Los Alamos National Security, LLC. All rights -dnl reserved. -dnl Copyright (c) 2017 Amazon.com, Inc. or its affiliates. All Rights -dnl reserved. -dnl Copyright (c) 2018 Intel, Inc. All rights reserved. -dnl $COPYRIGHT$ -dnl -dnl Additional copyrights may follow -dnl -dnl $HEADER$ -dnl - -dnl This is a C test to see if 128-bit __atomic_compare_exchange_n() -dnl actually works (e.g., it compiles and links successfully on -dnl ARM64+clang, but returns incorrect answers as of August 2018). -AC_DEFUN([PMIX_ATOMIC_COMPARE_EXCHANGE_N_TEST_SOURCE],[[ -#include -#include -#include - -typedef union { - uint64_t fake@<:@2@:>@; - __int128 real; -} pmix128; - -static void test1(void) -{ - // As of Aug 2018, we could not figure out a way to assign 128-bit - // constants -- the compilers would not accept it. So use a fake - // union to assign 2 uin64_t's to make a single __int128. - pmix128 ptr = { .fake = { 0xFFEEDDCCBBAA0099, 0x8877665544332211 }}; - pmix128 expected = { .fake = { 0x11EEDDCCBBAA0099, 0x88776655443322FF }}; - pmix128 desired = { .fake = { 0x1122DDCCBBAA0099, 0x887766554433EEFF }}; - bool r = __atomic_compare_exchange_n(&ptr.real, &expected.real, - desired.real, true, - __ATOMIC_RELAXED, __ATOMIC_RELAXED); - if ( !(r == false && ptr.real == expected.real)) { - exit(1); - } -} - -static void test2(void) -{ - pmix128 ptr = { .fake = { 0xFFEEDDCCBBAA0099, 0x8877665544332211 }}; - pmix128 expected = ptr; - pmix128 desired = { .fake = { 0x1122DDCCBBAA0099, 0x887766554433EEFF }}; - bool r = __atomic_compare_exchange_n(&ptr.real, &expected.real, - desired.real, true, - __ATOMIC_RELAXED, __ATOMIC_RELAXED); - if (!(r == true && ptr.real == desired.real)) { - exit(2); - } -} - -int main(int argc, char** argv) -{ - test1(); - test2(); - return 0; -} -]]) - -dnl ------------------------------------------------------------------ - -dnl This is a C test to see if 128-bit __sync_bool_compare_and_swap() -dnl actually works (e.g., it compiles and links successfully on -dnl ARM64+clang, but returns incorrect answers as of August 2018). -AC_DEFUN([PMIX_SYNC_BOOL_COMPARE_AND_SWAP_TEST_SOURCE],[[ -#include -#include -#include - -typedef union { - uint64_t fake@<:@2@:>@; - __int128 real; -} pmix128; - -static void test1(void) -{ - // As of Aug 2018, we could not figure out a way to assign 128-bit - // constants -- the compilers would not accept it. So use a fake - // union to assign 2 uin64_t's to make a single __int128. - pmix128 ptr = { .fake = { 0xFFEEDDCCBBAA0099, 0x8877665544332211 }}; - pmix128 oldval = { .fake = { 0x11EEDDCCBBAA0099, 0x88776655443322FF }}; - pmix128 newval = { .fake = { 0x1122DDCCBBAA0099, 0x887766554433EEFF }}; - bool r = __sync_bool_compare_and_swap(&ptr.real, oldval.real, newval.real); - if (!(r == false && ptr.real != newval.real)) { - exit(1); - } -} - -static void test2(void) -{ - pmix128 ptr = { .fake = { 0xFFEEDDCCBBAA0099, 0x8877665544332211 }}; - pmix128 oldval = ptr; - pmix128 newval = { .fake = { 0x1122DDCCBBAA0099, 0x887766554433EEFF }}; - bool r = __sync_bool_compare_and_swap(&ptr.real, oldval.real, newval.real); - if (!(r == true && ptr.real == newval.real)) { - exit(2); - } -} - -int main(int argc, char** argv) -{ - test1(); - test2(); - return 0; -} -]]) - -dnl This is a C test to see if 128-bit __atomic_compare_exchange_n() -dnl actually works (e.g., it compiles and links successfully on -dnl ARM64+clang, but returns incorrect answers as of August 2018). -AC_DEFUN([PMIX_ATOMIC_COMPARE_EXCHANGE_STRONG_TEST_SOURCE],[[ -#include -#include -#include -#include - -typedef union { - uint64_t fake@<:@2@:>@; - _Atomic __int128 real; -} pmix128; - -static void test1(void) -{ - // As of Aug 2018, we could not figure out a way to assign 128-bit - // constants -- the compilers would not accept it. So use a fake - // union to assign 2 uin64_t's to make a single __int128. - pmix128 ptr = { .fake = { 0xFFEEDDCCBBAA0099, 0x8877665544332211 }}; - pmix128 expected = { .fake = { 0x11EEDDCCBBAA0099, 0x88776655443322FF }}; - pmix128 desired = { .fake = { 0x1122DDCCBBAA0099, 0x887766554433EEFF }}; - bool r = atomic_compare_exchange_strong (&ptr.real, &expected.real, - desired.real, true, - atomic_relaxed, atomic_relaxed); - if ( !(r == false && ptr.real == expected.real)) { - exit(1); - } -} - -static void test2(void) -{ - pmix128 ptr = { .fake = { 0xFFEEDDCCBBAA0099, 0x8877665544332211 }}; - pmix128 expected = ptr; - pmix128 desired = { .fake = { 0x1122DDCCBBAA0099, 0x887766554433EEFF }}; - bool r = atomic_compare_exchange_strong (&ptr.real, &expected.real, - desired.real, true, - atomic_relaxed, atomic_relaxed); - if (!(r == true && ptr.real == desired.real)) { - exit(2); - } -} - -int main(int argc, char** argv) -{ - test1(); - test2(); - return 0; -} -]]) - -dnl ------------------------------------------------------------------ - -dnl -dnl Check to see if a specific function is linkable. -dnl -dnl Check with: -dnl 1. No compiler/linker flags. -dnl 2. CFLAGS += -mcx16 -dnl 3. LIBS += -latomic -dnl 4. Finally, if it links ok with any of #1, #2, or #3, actually try -dnl to run the test code (if we're not cross-compiling) and verify -dnl that it actually gives us the correct result. -dnl -dnl Note that we unfortunately can't use AC SEARCH_LIBS because its -dnl check incorrectly fails (because these functions are special compiler -dnl intrinsics -- SEARCH_LIBS tries with "check FUNC()", which the -dnl compiler complains doesn't match the internal prototype). So we have -dnl to use our own LINK_IFELSE tests. Indeed, since these functions are -dnl so special, we actually need a valid source code that calls the -dnl functions with correct arguments, etc. It's not enough, for example, -dnl to do the usual "try to set a function pointer to the symbol" trick to -dnl determine if these functions are available, because the compiler may -dnl not implement these as actual symbols. So just try to link a real -dnl test code. -dnl -dnl $1: function name to print -dnl $2: program to test -dnl $3: action if any of 1, 2, or 3 succeeds -dnl #4: action if all of 1, 2, and 3 fail -dnl -AC_DEFUN([PMIX_ASM_CHECK_ATOMIC_FUNC],[ - PMIX_VAR_SCOPE_PUSH([pmix_asm_check_func_happy pmix_asm_check_func_CFLAGS_save pmix_asm_check_func_LIBS_save]) - - pmix_asm_check_func_CFLAGS_save=$CFLAGS - pmix_asm_check_func_LIBS_save=$LIBS - - dnl Check with no compiler/linker flags - AC_MSG_CHECKING([for $1]) - AC_LINK_IFELSE([$2], - [pmix_asm_check_func_happy=1 - AC_MSG_RESULT([yes])], - [pmix_asm_check_func_happy=0 - AC_MSG_RESULT([no])]) - - dnl If that didn't work, try again with CFLAGS+=mcx16 - AS_IF([test $pmix_asm_check_func_happy -eq 0], - [AC_MSG_CHECKING([for $1 with -mcx16]) - CFLAGS="$CFLAGS -mcx16" - AC_LINK_IFELSE([$2], - [pmix_asm_check_func_happy=1 - AC_MSG_RESULT([yes])], - [pmix_asm_check_func_happy=0 - CFLAGS=$pmix_asm_check_func_CFLAGS_save - AC_MSG_RESULT([no])]) - ]) - - dnl If that didn't work, try again with LIBS+=-latomic - AS_IF([test $pmix_asm_check_func_happy -eq 0], - [AC_MSG_CHECKING([for $1 with -latomic]) - LIBS="$LIBS -latomic" - AC_LINK_IFELSE([$2], - [pmix_asm_check_func_happy=1 - AC_MSG_RESULT([yes])], - [pmix_asm_check_func_happy=0 - LIBS=$pmix_asm_check_func_LIBS_save - AC_MSG_RESULT([no])]) - ]) - - dnl If we have it, try it and make sure it gives a correct result. - dnl As of Aug 2018, we know that it links but does *not* work on clang - dnl 6 on ARM64. - AS_IF([test $pmix_asm_check_func_happy -eq 1], - [AC_MSG_CHECKING([if $1() gives correct results]) - AC_RUN_IFELSE([$2], - [AC_MSG_RESULT([yes])], - [pmix_asm_check_func_happy=0 - AC_MSG_RESULT([no])], - [AC_MSG_RESULT([cannot test -- assume yes (cross compiling)])]) - ]) - - dnl If we were unsuccessful, restore CFLAGS/LIBS - AS_IF([test $pmix_asm_check_func_happy -eq 0], - [CFLAGS=$pmix_asm_check_func_CFLAGS_save - LIBS=$pmix_asm_check_func_LIBS_save]) - - dnl Run the user actions - AS_IF([test $pmix_asm_check_func_happy -eq 1], [$3], [$4]) - - PMIX_VAR_SCOPE_POP -]) - -dnl ------------------------------------------------------------------ - -AC_DEFUN([PMIX_CHECK_SYNC_BUILTIN_CSWAP_INT128], [ - PMIX_VAR_SCOPE_PUSH([sync_bool_compare_and_swap_128_result]) - - # Do we have __sync_bool_compare_and_swap? - # Use a special macro because we need to check with a few different - # CFLAGS/LIBS. - PMIX_ASM_CHECK_ATOMIC_FUNC([__sync_bool_compare_and_swap], - [AC_LANG_SOURCE(PMIX_SYNC_BOOL_COMPARE_AND_SWAP_TEST_SOURCE)], - [sync_bool_compare_and_swap_128_result=1], - [sync_bool_compare_and_swap_128_result=0]) - - AC_DEFINE_UNQUOTED([PMIX_HAVE_SYNC_BUILTIN_CSWAP_INT128], - [$sync_bool_compare_and_swap_128_result], - [Whether the __sync builtin atomic compare and swap supports 128-bit values]) - - PMIX_VAR_SCOPE_POP -]) - -AC_DEFUN([PMIX_CHECK_SYNC_BUILTINS], [ - AC_MSG_CHECKING([for __sync builtin atomics]) - - AC_TRY_LINK([long tmp;], [__sync_synchronize(); -__sync_bool_compare_and_swap(&tmp, 0, 1); -__sync_add_and_fetch(&tmp, 1);], - [AC_MSG_RESULT([yes]) - $1], - [AC_MSG_RESULT([no]) - $2]) - - AC_MSG_CHECKING([for 64-bit __sync builtin atomics]) - - AC_TRY_LINK([ -#include -uint64_t tmp;], [ -__sync_bool_compare_and_swap(&tmp, 0, 1); -__sync_add_and_fetch(&tmp, 1);], - [AC_MSG_RESULT([yes]) - pmix_asm_sync_have_64bit=1], - [AC_MSG_RESULT([no]) - pmix_asm_sync_have_64bit=0]) - - AC_DEFINE_UNQUOTED([PMIX_ASM_SYNC_HAVE_64BIT],[$pmix_asm_sync_have_64bit], - [Whether 64-bit is supported by the __sync builtin atomics]) - - # Check for 128-bit support - PMIX_CHECK_SYNC_BUILTIN_CSWAP_INT128 -]) - - -AC_DEFUN([PMIX_CHECK_GCC_BUILTIN_CSWAP_INT128], [ - PMIX_VAR_SCOPE_PUSH([atomic_compare_exchange_n_128_result atomic_compare_exchange_n_128_CFLAGS_save atomic_compare_exchange_n_128_LIBS_save]) - - atomic_compare_exchange_n_128_CFLAGS_save=$CFLAGS - atomic_compare_exchange_n_128_LIBS_save=$LIBS - - # Do we have __sync_bool_compare_and_swap? - # Use a special macro because we need to check with a few different - # CFLAGS/LIBS. - PMIX_ASM_CHECK_ATOMIC_FUNC([__atomic_compare_exchange_n], - [AC_LANG_SOURCE(PMIX_ATOMIC_COMPARE_EXCHANGE_N_TEST_SOURCE)], - [atomic_compare_exchange_n_128_result=1], - [atomic_compare_exchange_n_128_result=0]) - - # If we have it and it works, check to make sure it is always lock - # free. - AS_IF([test $atomic_compare_exchange_n_128_result -eq 1], - [AC_MSG_CHECKING([if __int128 atomic compare-and-swap is always lock-free]) - AC_RUN_IFELSE([AC_LANG_PROGRAM([], [if (!__atomic_always_lock_free(16, 0)) { return 1; }])], - [AC_MSG_RESULT([yes])], - [atomic_compare_exchange_n_128_result=0 - # If this test fails, need to reset CFLAGS/LIBS (the - # above tests atomically set CFLAGS/LIBS or not; this - # test is running after the fact, so we have to undo - # the side-effects of setting CFLAGS/LIBS if the above - # tests passed). - CFLAGS=$atomic_compare_exchange_n_128_CFLAGS_save - LIBS=$atomic_compare_exchange_n_128_LIBS_save - AC_MSG_RESULT([no])], - [AC_MSG_RESULT([cannot test -- assume yes (cross compiling)])]) - ]) - - AC_DEFINE_UNQUOTED([PMIX_HAVE_GCC_BUILTIN_CSWAP_INT128], - [$atomic_compare_exchange_n_128_result], - [Whether the __atomic builtin atomic compare swap is both supported and lock-free on 128-bit values]) - - dnl If we could not find decent support for 128-bits __atomic let's - dnl try the GCC _sync - AS_IF([test $atomic_compare_exchange_n_128_result -eq 0], - [PMIX_CHECK_SYNC_BUILTIN_CSWAP_INT128]) - - PMIX_VAR_SCOPE_POP -]) - -AC_DEFUN([PMIX_CHECK_GCC_ATOMIC_BUILTINS], [ - AC_MSG_CHECKING([for __atomic builtin atomics]) - - AC_TRY_LINK([ -#include -uint32_t tmp, old = 0; -uint64_t tmp64, old64 = 0;], [ -__atomic_thread_fence(__ATOMIC_SEQ_CST); -__atomic_compare_exchange_n(&tmp, &old, 1, 0, __ATOMIC_RELAXED, __ATOMIC_RELAXED); -__atomic_add_fetch(&tmp, 1, __ATOMIC_RELAXED); -__atomic_compare_exchange_n(&tmp64, &old64, 1, 0, __ATOMIC_RELAXED, __ATOMIC_RELAXED); -__atomic_add_fetch(&tmp64, 1, __ATOMIC_RELAXED);], - [AC_MSG_RESULT([yes]) - $1], - [AC_MSG_RESULT([no]) - $2]) - - # Check for 128-bit support - PMIX_CHECK_GCC_BUILTIN_CSWAP_INT128 -]) - -AC_DEFUN([PMIX_CHECK_C11_CSWAP_INT128], [ - PMIX_VAR_SCOPE_PUSH([atomic_compare_exchange_result atomic_compare_exchange_CFLAGS_save atomic_compare_exchange_LIBS_save]) - - atomic_compare_exchange_CFLAGS_save=$CFLAGS - atomic_compare_exchange_LIBS_save=$LIBS - - # Do we have C11 atomics on 128-bit integers? - # Use a special macro because we need to check with a few different - # CFLAGS/LIBS. - PMIX_ASM_CHECK_ATOMIC_FUNC([atomic_compare_exchange_strong_16], - [AC_LANG_SOURCE(PMIX_ATOMIC_COMPARE_EXCHANGE_STRONG_TEST_SOURCE)], - [atomic_compare_exchange_result=1], - [atomic_compare_exchange_result=0]) - - # If we have it and it works, check to make sure it is always lock - # free. - AS_IF([test $atomic_compare_exchange_result -eq 1], - [AC_MSG_CHECKING([if C11 __int128 atomic compare-and-swap is always lock-free]) - AC_RUN_IFELSE([AC_LANG_PROGRAM([#include ], [_Atomic __int128_t x; if (!atomic_is_lock_free(&x)) { return 1; }])], - [AC_MSG_RESULT([yes])], - [atomic_compare_exchange_result=0 - # If this test fails, need to reset CFLAGS/LIBS (the - # above tests atomically set CFLAGS/LIBS or not; this - # test is running after the fact, so we have to undo - # the side-effects of setting CFLAGS/LIBS if the above - # tests passed). - CFLAGS=$atomic_compare_exchange_CFLAGS_save - LIBS=$atomic_compare_exchange_LIBS_save - AC_MSG_RESULT([no])], - [AC_MSG_RESULT([cannot test -- assume yes (cross compiling)])]) - ]) - - AC_DEFINE_UNQUOTED([PMIX_HAVE_C11_CSWAP_INT128], - [$atomic_compare_exchange_result], - [Whether C11 atomic compare swap is both supported and lock-free on 128-bit values]) - - dnl If we could not find decent support for 128-bits atomic let's - dnl try the GCC _sync - AS_IF([test $atomic_compare_exchange_result -eq 0], - [PMIX_CHECK_SYNC_BUILTIN_CSWAP_INT128]) - - PMIX_VAR_SCOPE_POP -]) - -AC_DEFUN([PMIX_CHECK_GCC_ATOMIC_BUILTINS], [ - AC_MSG_CHECKING([for __atomic builtin atomics]) - - AC_TRY_LINK([ -#include -uint32_t tmp, old = 0; -uint64_t tmp64, old64 = 0;], [ -__atomic_thread_fence(__ATOMIC_SEQ_CST); -__atomic_compare_exchange_n(&tmp, &old, 1, 0, __ATOMIC_RELAXED, __ATOMIC_RELAXED); -__atomic_add_fetch(&tmp, 1, __ATOMIC_RELAXED); -__atomic_compare_exchange_n(&tmp64, &old64, 1, 0, __ATOMIC_RELAXED, __ATOMIC_RELAXED); -__atomic_add_fetch(&tmp64, 1, __ATOMIC_RELAXED);], - [AC_MSG_RESULT([yes]) - $1], - [AC_MSG_RESULT([no]) - $2]) - - # Check for 128-bit support - PMIX_CHECK_GCC_BUILTIN_CSWAP_INT128 -]) - - -dnl ################################################################# -dnl -dnl PMIX_CHECK_ASM_TEXT -dnl -dnl Determine how to set current mode as text. -dnl -dnl ################################################################# -AC_DEFUN([PMIX_CHECK_ASM_TEXT],[ - AC_MSG_CHECKING([directive for setting text section]) - pmix_cv_asm_text="" - if test "$pmix_cv_c_compiler_vendor" = "microsoft" ; then - # text section will be brought in with the rest of - # header for MS - leave blank for now - pmix_cv_asm_text="" - else - case $host in - *-aix*) - pmix_cv_asm_text=[".csect .text[PR]"] - ;; - *) - pmix_cv_asm_text=".text" - ;; - esac - fi - AC_MSG_RESULT([$pmix_cv_asm_text]) - AC_DEFINE_UNQUOTED([PMIX_ASM_TEXT], ["$pmix_cv_asm_text"], - [Assembly directive for setting text section]) - PMIX_ASM_TEXT="$pmix_cv_asm_text" - AC_SUBST(PMIX_ASM_TEXT) -])dnl - - -dnl ################################################################# -dnl -dnl PMIX_CHECK_ASM_GLOBAL -dnl -dnl Sets PMIX_ASM_GLOBAL to the value to prefix global values -dnl -dnl I'm sure if I don't have a test for this, there will be some -dnl dumb platform that uses something else -dnl -dnl ################################################################# -AC_DEFUN([PMIX_CHECK_ASM_GLOBAL],[ - AC_MSG_CHECKING([directive for exporting symbols]) - pmix_cv_asm_global="" - if test "$pmix_cv_c_compiler_vendor" = "microsoft" ; then - pmix_cv_asm_global="PUBLIC" - else - case $host in - *) - pmix_cv_asm_global=".globl" - ;; - esac - fi - AC_MSG_RESULT([$pmix_cv_asm_global]) - AC_DEFINE_UNQUOTED([PMIX_ASM_GLOBAL], ["$pmix_cv_asm_global"], - [Assembly directive for exporting symbols]) - PMIX_ASM_GLOBAL="$pmix_cv_asm_global" - AC_SUBST(PMIX_AS_GLOBAL) -])dnl - - -dnl ################################################################# -dnl -dnl PMIX_CHECK_ASM_LSYM -dnl -dnl Sets PMIX_ASM_LSYM to the prefix value on a symbol to make it -dnl an internal label (jump target and whatnot) -dnl -dnl We look for L .L $ L$ (in that order) for something that both -dnl assembles and does not leave a label in the output of nm. Fall -dnl back to L if nothing else seems to work :/ -dnl -dnl ################################################################# - -# _PMIX_CHECK_ASM_LSYM([variable-to-set]) -# --------------------------------------- -AC_DEFUN([_PMIX_CHECK_ASM_LSYM],[ - AC_REQUIRE([AC_PROG_GREP]) - - $1="L" - - for sym in L .L $ L$ ; do - asm_result=0 - echo "configure: trying $sym" >&AC_FD_CC - PMIX_TRY_ASSEMBLE([foobar$pmix_cv_asm_label_suffix -${sym}mytestlabel$pmix_cv_asm_label_suffix], - [# ok, we succeeded at assembling. see if we can nm, - # throwing the results in a file - if $NM conftest.$OBJEXT > conftest.out 2>&AC_FD_CC ; then - if test "`$GREP mytestlabel conftest.out`" = "" ; then - # there was no symbol... looks promising to me - $1="$sym" - asm_result=1 - elif test ["`$GREP ' [Nt] .*mytestlabel' conftest.out`"] = "" ; then - # see if we have a non-global-ish symbol - # but we should see if we can do better. - $1="$sym" - fi - else - # not so much on the NM goodness :/ - echo "$NM failed. Output from NM was:" >&AC_FD_CC - cat conftest.out >&AC_FD_CC - AC_MSG_WARN([$NM could not read object file]) - fi - ]) - if test "$asm_result" = "1" ; then - break - fi - done - rm -f conftest.out - unset asm_result sym -]) - -# PMIX_CHECK_ASM_LSYM() -# --------------------- -AC_DEFUN([PMIX_CHECK_ASM_LSYM],[ - AC_REQUIRE([AC_PROG_NM]) - - AC_CACHE_CHECK([prefix for lsym labels], - [pmix_cv_asm_lsym], - [_PMIX_CHECK_ASM_LSYM([pmix_cv_asm_lsym])]) - AC_DEFINE_UNQUOTED([PMIX_ASM_LSYM], ["$pmix_cv_asm_lsym"], - [Assembly prefix for lsym labels]) - PMIX_ASM_LSYM="$pmix_cv_asm_lsym" - AC_SUBST(PMIX_ASM_LSYM) -])dnl - -dnl ################################################################# -dnl -dnl PMIX_CHECK_ASM_PROC -dnl -dnl Sets a cv-flag, if the compiler needs a proc/endp-definition to -dnl link with C. -dnl -dnl ################################################################# -AC_DEFUN([PMIX_CHECK_ASM_PROC],[ - AC_CACHE_CHECK([if .proc/endp is needed], - [pmix_cv_asm_need_proc], - [pmix_cv_asm_need_proc="no" - PMIX_TRY_ASSEMBLE([ - .proc mysym -mysym: - .endp mysym], - [pmix_cv_asm_need_proc="yes"]) - rm -f conftest.out]) - - if test "$pmix_cv_asm_need_proc" = "yes" ; then - pmix_cv_asm_proc=".proc" - pmix_cv_asm_endproc=".endp" - else - pmix_cv_asm_proc="#" - pmix_cv_asm_endproc="#" - fi -])dnl - - -dnl ################################################################# -dnl -dnl PMIX_CHECK_ASM_GSYM -dnl -dnl Sets PMIX_ASM_GSYM to the prefix value on a symbol to make it -dnl a global linkable from C. Basically, an _ or not. -dnl -dnl ################################################################# -AC_DEFUN([PMIX_CHECK_ASM_GSYM],[ - AC_CACHE_CHECK([prefix for global symbol labels], - [pmix_cv_asm_gsym], - [_PMIX_CHECK_ASM_GSYM]) - - if test "$pmix_cv_asm_gsym" = "none" ; then - AC_MSG_ERROR([Could not determine global symbol label prefix]) - fi - - AC_DEFINE_UNQUOTED([PMIX_ASM_GSYM], ["$pmix_cv_asm_gsym"], - [Assembly prefix for gsym labels]) - PMIX_ASM_GSYM="$pmix_cv_asm_gsym" - AC_SUBST(PMIX_ASM_GSYM) - -]) - -AC_DEFUN([_PMIX_CHECK_ASM_GSYM],[ - pmix_cv_asm_gsym="none" - - for sym in "_" "" "." ; do - asm_result=0 - echo "configure: trying $sym" >&AC_FD_CC -cat > conftest_c.c <&AC_FD_CC - pmix_link="$CC $CFLAGS conftest_c.$OBJEXT conftest.$OBJEXT -o conftest $LDFLAGS $LIBS > conftest.link 2>&1" - if AC_TRY_EVAL(pmix_link) ; then - # save the warnings - cat conftest.link >&AC_FD_CC - asm_result=1 - else - cat conftest.link >&AC_FD_CC - echo "configure: failed C program was: " >&AC_FD_CC - cat conftest_c.c >&AC_FD_CC - echo "configure: failed ASM program was: " >&AC_FD_CC - cat conftest.s >&AC_FD_CC - asm_result=0 - fi - else - # save output and failed program - cat conftest.cmpl >&AC_FD_CC - echo "configure: failed C program was: " >&AC_FD_CC - cat conftest.c >&AC_FD_CC - asm_result=0 - fi], - [asm_result=0]) - if test "$asm_result" = "1" ; then - pmix_cv_asm_gsym="$sym" - break - fi - done - rm -rf conftest.* -])dnl - - -dnl ################################################################# -dnl -dnl PMIX_CHECK_ASM_LABEL_SUFFIX -dnl -dnl Sets PMIX_ASM_LABEL_SUFFIX to the value to suffix for labels -dnl -dnl I'm sure if I don't have a test for this, there will be some -dnl dumb platform that uses something else -dnl -dnl ################################################################# -AC_DEFUN([PMIX_CHECK_ASM_LABEL_SUFFIX],[ - AC_MSG_CHECKING([suffix for labels]) - pmix_cv_asm_label_suffix="" - case $host in - *) - pmix_cv_asm_label_suffix=":" - ;; - esac - AC_MSG_RESULT([$pmix_cv_asm_label_suffix]) - AC_DEFINE_UNQUOTED([PMIX_ASM_LABEL_SUFFIX], ["$pmix_cv_asm_label_suffix"], - [Assembly suffix for labels]) - PMIX_ASM_LABEL_SUFFIX="$pmix_cv_asm_label_suffix" - AC_SUBST(PMIX_AS_LABEL_SUFFIX) -])dnl - - -dnl ################################################################# -dnl -dnl PMIX_CHECK_ASM_ALIGN_LOG -dnl -dnl Sets PMIX_ASM_ALIGN_LOG to 1 if align is specified -dnl logarithmically, 0 otherwise -dnl -dnl ################################################################# -AC_DEFUN([PMIX_CHECK_ASM_ALIGN_LOG],[ - AC_REQUIRE([AC_PROG_NM]) - AC_REQUIRE([AC_PROG_GREP]) - - AC_CACHE_CHECK([if .align directive takes logarithmic value], - [pmix_cv_asm_align_log], - [ PMIX_TRY_ASSEMBLE([ $pmix_cv_asm_text - .align 4 - $pmix_cv_asm_global foo - .byte 1 - .align 4 -foo$pmix_cv_asm_label_suffix - .byte 2], - [pmix_asm_addr=[`$NM conftest.$OBJEXT | $GREP foo | sed -e 's/.*\([0-9a-fA-F][0-9a-fA-F]\).*foo.*/\1/'`]], - [pmix_asm_addr=""]) - # test for both 16 and 10 (decimal and hex notations) - echo "configure: .align test address offset is $pmix_asm_addr" >&AC_FD_CC - if test "$pmix_asm_addr" = "16" || test "$pmix_asm_addr" = "10" ; then - pmix_cv_asm_align_log="yes" - else - pmix_cv_asm_align_log="no" - fi]) - - if test "$pmix_cv_asm_align_log" = "yes" || test "$pmix_cv_asm_align_log" = "1" ; then - pmix_asm_align_log_result=1 - else - pmix_asm_align_log_result=0 - fi - - AC_DEFINE_UNQUOTED([PMIX_ASM_ALIGN_LOG], - [$asm_align_log_result], - [Assembly align directive expects logarithmic value]) - - unset omp_asm_addr asm_result -])dnl - - -dnl ################################################################# -dnl -dnl PMIX_CHECK_ASM_TYPE -dnl -dnl Sets PMIX_ASM_TYPE to the prefix for the function type to -dnl set a symbol's type as function (needed on ELF for shared -dnl libraries). If no .type directive is needed, sets PMIX_ASM_TYPE -dnl to an empty string -dnl -dnl We look for @ \# % -dnl -dnl ################################################################# -AC_DEFUN([PMIX_CHECK_ASM_TYPE],[ - AC_CACHE_CHECK([prefix for function in .type], - [pmix_cv_asm_type], - [_PMIX_CHECK_ASM_TYPE]) - - AC_DEFINE_UNQUOTED([PMIX_ASM_TYPE], ["$pmix_cv_asm_type"], - [How to set function type in .type directive]) - PMIX_ASM_TYPE="$pmix_cv_asm_type" - AC_SUBST(PMIX_ASM_TYPE) -]) - -AC_DEFUN([_PMIX_CHECK_ASM_TYPE],[ - pmix_cv_asm_type="" - - case "${host}" in - *-sun-solaris*) - # GCC on solaris seems to accept just about anything, not - # that what it defines actually works... So just hardwire - # to the right answer - pmix_cv_asm_type="#" - ;; - *) - for type in @ \# % ; do - asm_result=0 - echo "configure: trying $type" >&AC_FD_CC - PMIX_TRY_ASSEMBLE([ .type mysym, ${type}function -mysym:], - [pmix_cv_asm_type="${type}" - asm_result=1]) - if test "$asm_result" = "1" ; then - break - fi - done - ;; - esac - rm -f conftest.out - - unset asm_result type -])dnl - - -dnl ################################################################# -dnl -dnl PMIX_CHECK_ASM_SIZE -dnl -dnl Sets PMIX_ASM_SIZE to 1 if we should set .size directives for -dnl each function, 0 otherwise. -dnl -dnl ################################################################# -AC_DEFUN([PMIX_CHECK_ASM_SIZE],[ - AC_CACHE_CHECK([if .size is needed], - [pmix_cv_asm_need_size], - [pmix_cv_asm_need_size="no" - PMIX_TRY_ASSEMBLE([ .size mysym, 1], - [pmix_cv_asm_need_size="yes"]) - rm -f conftest.out]) - - if test "$pmix_cv_asm_need_size" = "yes" ; then - pmix_asm_size=1 - else - pmix_asm_size=0 - fi - - AC_DEFINE_UNQUOTED([PMIX_ASM_SIZE], ["$pmix_asm_size"], - [Do we need to give a .size directive]) - PMIX_ASM_SIZE="$pmix_asm_size" - AC_SUBST(PMIX_ASM_TYPE) - unset asm_result -])dnl - - -# PMIX_CHECK_ASM_GNU_STACKEXEC(var) -# ---------------------------------- -# sets shell variable var to the things necessary to -# disable execable stacks with GAS -AC_DEFUN([PMIX_CHECK_ASM_GNU_STACKEXEC], [ - AC_REQUIRE([AC_PROG_GREP]) - - AC_CHECK_PROG([OBJDUMP], [objdump], [objdump]) - AC_CACHE_CHECK([if .note.GNU-stack is needed], - [pmix_cv_asm_gnu_stack_result], - [AS_IF([test "$OBJDUMP" != ""], - [ # first, see if a simple C program has it set - cat >conftest.c < /dev/null && pmix_cv_asm_gnu_stack_result=yes], - [PMIX_LOG_MSG([the failed program was:], 1) - PMIX_LOG_FILE([conftest.c]) - pmix_cv_asm_gnu_stack_result=no]) - if test "$pmix_cv_asm_gnu_stack_result" != "yes" ; then - pmix_cv_asm_gnu_stack_result="no" - fi - rm -rf conftest.*], - [pmix_cv_asm_gnu_stack_result="no"])]) - if test "$pmix_cv_asm_gnu_stack_result" = "yes" ; then - pmix_cv_asm_gnu_stack=1 - else - pmix_cv_asm_gnu_stack=0 - fi -])dnl - - -dnl ################################################################# -dnl -dnl PMIX_CHECK_POWERPC_REG -dnl -dnl See if the notation for specifying registers is X (most everyone) -dnl or rX (OS X) -dnl -dnl ################################################################# -AC_DEFUN([PMIX_CHECK_POWERPC_REG],[ - AC_MSG_CHECKING([if PowerPC registers have r prefix]) - PMIX_TRY_ASSEMBLE([$pmix_cv_asm_text - addi 1,1,0], - [pmix_cv_asm_powerpc_r_reg=0], - [PMIX_TRY_ASSEMBLE([$pmix_cv_asm_text - addi r1,r1,0], - [pmix_cv_asm_powerpc_r_reg=1], - [AC_MSG_ERROR([Can not determine how to use PPC registers])])]) - if test "$pmix_cv_asm_powerpc_r_reg" = "1" ; then - AC_MSG_RESULT([yes]) - else - AC_MSG_RESULT([no]) - fi - - AC_DEFINE_UNQUOTED([PMIX_POWERPC_R_REGISTERS], - [$pmix_cv_asm_powerpc_r_reg], - [Whether r notation is used for ppc registers]) -])dnl - - -dnl ################################################################# -dnl -dnl PMIX_CHECK_POWERPC_64BIT -dnl -dnl On some powerpc chips (the PPC970 or G5), the OS usually runs in -dnl 32 bit mode, even though the hardware can do 64bit things. If -dnl the compiler will let us, emit code for 64bit test and set type -dnl operations (on a long long). -dnl -dnl ################################################################# -AC_DEFUN([PMIX_CHECK_POWERPC_64BIT],[ - if test "$ac_cv_sizeof_long" != "4" ; then - # this function should only be called in the 32 bit case - AC_MSG_ERROR([CHECK_POWERPC_64BIT called on 64 bit platform. Internal error.]) - fi - AC_MSG_CHECKING([for 64-bit PowerPC assembly support]) - case $host in - *-darwin*) - ppc64_result=0 - if test "$pmix_cv_asm_powerpc_r_reg" = "1" ; then - ldarx_asm=" ldarx r1,r1,r1"; - else - ldarx_asm=" ldarx 1,1,1"; - fi - PMIX_TRY_ASSEMBLE([$pmix_cv_asm_text - $ldarx_asm], - [ppc64_result=1], - [ppc64_result=0]) - ;; - *) - ppc64_result=0 - ;; - esac - - if test "$ppc64_result" = "1" ; then - AC_MSG_RESULT([yes]) - ifelse([$1],,:,[$1]) - else - AC_MSG_RESULT([no]) - ifelse([$2],,:,[$2]) - fi - - unset ppc64_result ldarx_asm -])dnl - - -dnl ################################################################# -dnl -dnl PMIX_CHECK_SPARCV8PLUS -dnl -dnl ################################################################# -AC_DEFUN([PMIX_CHECK_SPARCV8PLUS],[ - AC_MSG_CHECKING([if have Sparc v8+/v9 support]) - sparc_result=0 - PMIX_TRY_ASSEMBLE([$pmix_cv_asm_text - casa [%o0] 0x80, %o1, %o2], - [sparc_result=1], - [sparc_result=0]) - if test "$sparc_result" = "1" ; then - AC_MSG_RESULT([yes]) - ifelse([$1],,:,[$1]) - else - AC_MSG_RESULT([no]) - ifelse([$2],,:,[$2]) - fi - - unset sparc_result -])dnl - -dnl ################################################################# -dnl -dnl PMIX_CHECK_CMPXCHG16B -dnl -dnl ################################################################# -AC_DEFUN([PMIX_CMPXCHG16B_TEST_SOURCE],[[ -#include -#include - -union pmix_counted_pointer_t { - struct { - uint64_t counter; - uint64_t item; - } data; -#if defined(HAVE___INT128) && HAVE___INT128 - __int128 value; -#elif defined(HAVE_INT128_T) && HAVE_INT128_T - int128_t value; -#endif -}; -typedef union pmix_counted_pointer_t pmix_counted_pointer_t; - -int main(int argc, char* argv) { - volatile pmix_counted_pointer_t a; - pmix_counted_pointer_t b; - - a.data.counter = 0; - a.data.item = 0x1234567890ABCDEF; - - b.data.counter = a.data.counter; - b.data.item = a.data.item; - - /* bozo checks */ - assert(16 == sizeof(pmix_counted_pointer_t)); - assert(a.data.counter == b.data.counter); - assert(a.data.item == b.data.item); - /* - * the following test fails on buggy compilers - * so far, with icc -o conftest conftest.c - * - intel icc 14.0.0.080 (aka 2013sp1) - * - intel icc 14.0.1.106 (aka 2013sp1u1) - * older and more recents compilers work fine - * buggy compilers work also fine but only with -O0 - */ -#if (defined(HAVE___INT128) && HAVE___INT128) || (defined(HAVE_INT128_T) && HAVE_INT128_T) - return (a.value != b.value); -#else - return 0; -#endif -} -]]) - -AC_DEFUN([PMIX_CHECK_CMPXCHG16B],[ - PMIX_VAR_SCOPE_PUSH([cmpxchg16b_result]) - - PMIX_ASM_CHECK_ATOMIC_FUNC([cmpxchg16b], - [AC_LANG_PROGRAM([[unsigned char tmp[16];]], - [[__asm__ __volatile__ ("lock cmpxchg16b (%%rsi)" : : "S" (tmp) : "memory", "cc");]])], - [cmpxchg16b_result=1], - [cmpxchg16b_result=0]) - # If we have it, make sure it works. - AS_IF([test $cmpxchg16b_result -eq 1], - [AC_MSG_CHECKING([if cmpxchg16b_result works]) - AC_RUN_IFELSE([AC_LANG_SOURCE(PMIX_CMPXCHG16B_TEST_SOURCE)], - [AC_MSG_RESULT([yes])], - [cmpxchg16b_result=0 - AC_MSG_RESULT([no])], - [AC_MSG_RESULT([cannot test -- assume yes (cross compiling)])]) - ]) - - AC_DEFINE_UNQUOTED([PMIX_HAVE_CMPXCHG16B], [$cmpxchg16b_result], - [Whether the processor supports the cmpxchg16b instruction]) - PMIX_VAR_SCOPE_POP -])dnl - -dnl ################################################################# -dnl -dnl PMIX_CHECK_INLINE_GCC -dnl -dnl Check if the compiler is capable of doing GCC-style inline -dnl assembly. Some compilers emit a warning and ignore the inline -dnl assembly (xlc on OS X) and compile without error. Therefore, -dnl the test attempts to run the emitted code to check that the -dnl assembly is actually run. To run this test, one argument to -dnl the macro must be an assembly instruction in gcc format to move -dnl the value 0 into the register containing the variable ret. -dnl For PowerPC, this would be: -dnl -dnl "li %0,0" : "=&r"(ret) -dnl -dnl For testing ia32 assembly, the assembly instruction xaddl is -dnl tested. The xaddl instruction is used by some of the atomic -dnl implementations so it makes sense to test for it. In addition, -dnl some compilers (i.e. earlier versions of Sun Studio 12) do not -dnl necessarily handle xaddl properly, so that needs to be detected -dnl during configure time. -dnl -dnl DEFINE PMIX_GCC_INLINE_ASSEMBLY to 0 or 1 depending on GCC -dnl support -dnl -dnl ################################################################# -AC_DEFUN([PMIX_CHECK_INLINE_C_GCC],[ - assembly="$1" - asm_result="unknown" - - AC_MSG_CHECKING([if $CC supports GCC inline assembly]) - - if test ! "$assembly" = "" ; then - AC_RUN_IFELSE([AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT],[[ -int ret = 1; -int negone = -1; -__asm__ __volatile__ ($assembly); -return ret; - ]])], - [asm_result="yes"], [asm_result="no"], - [asm_result="unknown"]) - else - assembly="test skipped - assuming no" - fi - - # if we're cross compiling, just try to compile and figure good enough - if test "$asm_result" = "unknown" ; then - AC_LINK_IFELSE([AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT],[[ -int ret = 1; -int negone = -1; -__asm__ __volatile__ ($assembly); -return ret; - ]])], - [asm_result="yes"], [asm_result="no"]) - fi - - AC_MSG_RESULT([$asm_result]) - - if test "$asm_result" = "yes" ; then - PMIX_C_GCC_INLINE_ASSEMBLY=1 - pmix_cv_asm_inline_supported="yes" - else - PMIX_C_GCC_INLINE_ASSEMBLY=0 - fi - - AC_DEFINE_UNQUOTED([PMIX_C_GCC_INLINE_ASSEMBLY], - [$PMIX_C_GCC_INLINE_ASSEMBLY], - [Whether C compiler supports GCC style inline assembly]) - - unset PMIX_C_GCC_INLINE_ASSEMBLY assembly asm_result -])dnl - -dnl ################################################################# -dnl -dnl PMIX_CONFIG_ASM -dnl -dnl DEFINE PMIX_ASSEMBLY_ARCH to something in sys/architecture.h -dnl DEFINE PMIX_ASSEMBLY_FORMAT to string containing correct -dnl format for assembly (not user friendly) -dnl SUBST PMIX_ASSEMBLY_FORMAT to string containing correct -dnl format for assembly (not user friendly) -dnl -dnl ################################################################# -AC_DEFUN([PMIX_CONFIG_ASM],[ - AC_REQUIRE([PMIX_SETUP_CC]) - AC_REQUIRE([AM_PROG_AS]) - - AC_ARG_ENABLE([c11-atomics],[AC_HELP_STRING([--enable-c11-atomics], - [Enable use of C11 atomics if available (default: enabled)])]) - - AC_ARG_ENABLE([builtin-atomics], - [AC_HELP_STRING([--enable-builtin-atomics], - [Enable use of __sync builtin atomics (default: disabled)])]) - - PMIX_CHECK_C11_CSWAP_INT128 - - if test "x$enable_c11_atomics" != "xno" && test "$pmix_cv_c11_supported" = "yes" ; then - pmix_cv_asm_builtin="BUILTIN_C11" - PMIX_CHECK_C11_CSWAP_INT128 - elif test "x$enable_c11_atomics" = "xyes"; then - AC_MSG_WARN([C11 atomics were requested but are not supported]) - AC_MSG_ERROR([Cannot continue]) - else - pmix_cv_asm_builtin="BUILTIN_NO" - AS_IF([test "$pmix_cv_asm_builtin" = "BUILTIN_NO" && test "$enable_builtin_atomics" = "yes"], - [PMIX_CHECK_GCC_ATOMIC_BUILTINS([pmix_cv_asm_builtin="BUILTIN_GCC"], [])]) - AS_IF([test "$pmix_cv_asm_builtin" = "BUILTIN_NO" && test "$enable_builtin_atomics" = "yes"], - [PMIX_CHECK_SYNC_BUILTINS([pmix_cv_asm_builtin="BUILTIN_SYNC"], [])]) - AS_IF([test "$pmix_cv_asm_builtin" = "BUILTIN_NO" && test "$enable_builtin_atomics" = "yes"], - [AC_MSG_ERROR([__sync builtin atomics requested but not found.])]) - fi - - PMIX_CHECK_ASM_PROC - PMIX_CHECK_ASM_TEXT - PMIX_CHECK_ASM_GLOBAL - PMIX_CHECK_ASM_GNU_STACKEXEC - PMIX_CHECK_ASM_LABEL_SUFFIX - PMIX_CHECK_ASM_GSYM - PMIX_CHECK_ASM_LSYM - PMIX_CHECK_ASM_TYPE - PMIX_CHECK_ASM_SIZE - PMIX_CHECK_ASM_ALIGN_LOG - - # find our architecture for purposes of assembly stuff - pmix_cv_asm_arch="UNSUPPORTED" - PMIX_GCC_INLINE_ASSIGN="" - PMIX_ASM_SUPPORT_64BIT=0 - case "${host}" in - x86_64-*x32) - pmix_cv_asm_arch="X86_64" - PMIX_ASM_SUPPORT_64BIT=1 - PMIX_GCC_INLINE_ASSIGN='"xaddl %1,%0" : "=m"(ret), "+r"(negone) : "m"(ret)' - ;; - i?86-*|x86_64*|amd64*) - if test "$ac_cv_sizeof_long" = "4" ; then - pmix_cv_asm_arch="IA32" - else - pmix_cv_asm_arch="X86_64" - fi - PMIX_ASM_SUPPORT_64BIT=1 - PMIX_GCC_INLINE_ASSIGN='"xaddl %1,%0" : "=m"(ret), "+r"(negone) : "m"(ret)' - PMIX_CHECK_CMPXCHG16B - ;; - - ia64-*) - pmix_cv_asm_arch="IA64" - PMIX_CHECK_SYNC_BUILTINS([pmix_cv_asm_builtin="BUILTIN_SYNC"], - [AC_MSG_ERROR([No atomic primitives available for $host])]) - ;; - aarch64*) - pmix_cv_asm_arch="ARM64" - PMIX_ASM_SUPPORT_64BIT=1 - PMIX_ASM_ARM_VERSION=8 - AC_DEFINE_UNQUOTED([PMIX_ASM_ARM_VERSION], [$PMIX_ASM_ARM_VERSION], - [What ARM assembly version to use]) - PMIX_GCC_INLINE_ASSIGN='"mov %0, #0" : "=&r"(ret)' - ;; - - armv7*|arm-*-linux-gnueabihf) - pmix_cv_asm_arch="ARM" - PMIX_ASM_SUPPORT_64BIT=1 - PMIX_ASM_ARM_VERSION=7 - AC_DEFINE_UNQUOTED([PMIX_ASM_ARM_VERSION], [$PMIX_ASM_ARM_VERSION], - [What ARM assembly version to use]) - PMIX_GCC_INLINE_ASSIGN='"mov %0, #0" : "=&r"(ret)' - ;; - - armv6*) - pmix_cv_asm_arch="ARM" - PMIX_ASM_SUPPORT_64BIT=0 - PMIX_ASM_ARM_VERSION=6 - CCASFLAGS="$CCASFLAGS -march=armv7-a" - AC_DEFINE_UNQUOTED([PMIX_ASM_ARM_VERSION], [$PMIX_ASM_ARM_VERSION], - [What ARM assembly version to use]) - PMIX_GCC_INLINE_ASSIGN='"mov %0, #0" : "=&r"(ret)' - ;; - - armv5*linux*|armv4*linux*|arm-*-linux-gnueabi) - # uses Linux kernel helpers for some atomic operations - pmix_cv_asm_arch="ARM" - PMIX_CHECK_SYNC_BUILTINS([pmix_cv_asm_builtin="BUILTIN_SYNC"], - [AC_MSG_ERROR([No atomic primitives available for $host])]) - ;; - - mips-*|mips64*) - # Should really find some way to make sure that we are on - # a MIPS III machine (r4000 and later) - pmix_cv_asm_arch="MIPS" - PMIX_CHECK_SYNC_BUILTINS([pmix_cv_asm_builtin="BUILTIN_SYNC"], - [AC_MSG_ERROR([No atomic primitives available for $host])]) - ;; - - powerpc-*|powerpc64-*|powerpcle-*|powerpc64le-*|rs6000-*|ppc-*) - PMIX_CHECK_POWERPC_REG - if test "$ac_cv_sizeof_long" = "4" ; then - pmix_cv_asm_arch="POWERPC32" - - # Note that on some platforms (Apple G5), even if we are - # compiling in 32 bit mode (and therefore should assume - # sizeof(long) == 4), we can use the 64 bit test and set - # operations. - PMIX_CHECK_POWERPC_64BIT(PMIX_ASM_SUPPORT_64BIT=1) - elif test "$ac_cv_sizeof_long" = "8" ; then - PMIX_ASM_SUPPORT_64BIT=1 - pmix_cv_asm_arch="POWERPC64" - else - AC_MSG_ERROR([Could not determine PowerPC word size: $ac_cv_sizeof_long]) - fi - PMIX_GCC_INLINE_ASSIGN='"1: li %0,0" : "=&r"(ret)' - ;; - # There is no current difference between s390 and s390x - # But use two different defines in case some come later - # as s390 is 31bits while s390x is 64bits - s390-*) - pmix_cv_asm_arch="S390" - PMIX_CHECK_SYNC_BUILTINS([pmix_cv_asm_builtin="BUILTIN_SYNC"], - [AC_MSG_ERROR([No atomic primitives available for $host])]) - ;; - s390x-*) - pmix_cv_asm_arch="S390X" - PMIX_CHECK_SYNC_BUILTINS([pmix_cv_asm_builtin="BUILTIN_SYNC"], - [AC_MSG_ERROR([No atomic primitives available for $host])]) - ;; - sparc*-*) - # SPARC v9 (and above) are the only ones with 64bit support - # if compiling 32 bit, see if we are v9 (aka v8plus) or - # earlier (casa is v8+/v9). - if test "$ac_cv_sizeof_long" = "4" ; then - have_v8plus=0 - PMIX_CHECK_SPARCV8PLUS([have_v8plus=1]) - if test "$have_v8plus" = "0" ; then - PMIX_ASM_SUPPORT_64BIT=0 - pmix_cv_asm_arch="SPARC" -AC_MSG_WARN([Sparc v8 target is not supported in this release of Open MPI.]) -AC_MSG_WARN([You must specify the target architecture v8plus to compile]) -AC_MSG_WARN([Open MPI in 32 bit mode on Sparc processors (see the README).]) -AC_MSG_ERROR([Can not continue.]) - else - PMIX_ASM_SUPPORT_64BIT=1 - pmix_cv_asm_arch="SPARCV9_32" - fi - - elif test "$ac_cv_sizeof_long" = "8" ; then - PMIX_ASM_SUPPORT_64BIT=1 - pmix_cv_asm_arch="SPARCV9_64" - else - AC_MSG_ERROR([Could not determine Sparc word size: $ac_cv_sizeof_long]) - fi - PMIX_GCC_INLINE_ASSIGN='"mov 0,%0" : "=&r"(ret)' - ;; - - *) - PMIX_CHECK_SYNC_BUILTINS([pmix_cv_asm_builtin="BUILTIN_SYNC"], - [AC_MSG_ERROR([No atomic primitives available for $host])]) - ;; - esac - - if test "x$PMIX_ASM_SUPPORT_64BIT" = "x1" && test "$pmix_cv_asm_builtin" = "BUILTIN_SYNC" && - test "$pmix_asm_sync_have_64bit" = "0" ; then - # __sync builtins exist but do not implement 64-bit support. Fall back on inline asm. - pmix_cv_asm_builtin="BUILTIN_NO" - fi - - if test "$pmix_cv_asm_builtin" = "BUILTIN_SYNC" || test "$pmix_cv_asm_builtin" = "BUILTIN_GCC" ; then - AC_DEFINE([PMIX_C_GCC_INLINE_ASSEMBLY], [1], - [Whether C compiler supports GCC style inline assembly]) - else - AC_DEFINE_UNQUOTED([PMIX_ASM_SUPPORT_64BIT], - [$PMIX_ASM_SUPPORT_64BIT], - [Whether we can do 64bit assembly operations or not. Should not be used outside of the assembly header files]) - AC_SUBST([PMIX_ASM_SUPPORT_64BIT]) - - # - # figure out if we need any special function start / stop code - # - case $host_os in - aix*) - pmix_asm_arch_config="aix" - ;; - *) - pmix_asm_arch_config="default" - ;; - esac - - pmix_cv_asm_inline_supported="no" - # now that we know our architecture, try to inline assemble - PMIX_CHECK_INLINE_C_GCC([$PMIX_GCC_INLINE_ASSIGN]) - - # format: - # config_file-text-global-label_suffix-gsym-lsym-type-size-align_log-ppc_r_reg-64_bit-gnu_stack - asm_format="${pmix_asm_arch_config}" - asm_format="${asm_format}-${pmix_cv_asm_text}-${pmix_cv_asm_global}" - asm_format="${asm_format}-${pmix_cv_asm_label_suffix}-${pmix_cv_asm_gsym}" - asm_format="${asm_format}-${pmix_cv_asm_lsym}" - asm_format="${asm_format}-${pmix_cv_asm_type}-${pmix_asm_size}" - asm_format="${asm_format}-${pmix_asm_align_log_result}" - if test "$pmix_cv_asm_arch" = "POWERPC32" || test "$pmix_cv_asm_arch" = "POWERPC64" ; then - asm_format="${asm_format}-${pmix_cv_asm_powerpc_r_reg}" - else - asm_format="${asm_format}-1" - fi - asm_format="${asm_format}-${PMIX_ASM_SUPPORT_64BIT}" - pmix_cv_asm_format="${asm_format}-${pmix_cv_asm_gnu_stack}" - # For the Makefile, need to escape the $ as $$. Don't display - # this version, but make sure the Makefile gives the right thing - # when regenerating the files because the base has been touched. - PMIX_ASSEMBLY_FORMAT=`echo "$pmix_cv_asm_format" | sed -e 's/\\\$/\\\$\\\$/'` - - AC_MSG_CHECKING([for assembly format]) - AC_MSG_RESULT([$pmix_cv_asm_format]) - AC_DEFINE_UNQUOTED([PMIX_ASSEMBLY_FORMAT], ["$PMIX_ASSEMBLY_FORMAT"], - [Format of assembly file]) - AC_SUBST([PMIX_ASSEMBLY_FORMAT]) - fi # if pmix_cv_asm_builtin = BUILTIN_SYNC - - result="PMIX_$pmix_cv_asm_arch" - PMIX_ASSEMBLY_ARCH="$pmix_cv_asm_arch" - AC_MSG_CHECKING([for assembly architecture]) - AC_MSG_RESULT([$pmix_cv_asm_arch]) - AC_DEFINE_UNQUOTED([PMIX_ASSEMBLY_ARCH], [$result], - [Architecture type of assembly to use for atomic operations and CMA]) - AC_SUBST([PMIX_ASSEMBLY_ARCH]) - - # Check for RDTSCP support - result=0 - AS_IF([test "$pmix_cv_asm_arch" = "PMIX_X86_64" || test "$pmix_cv_asm_arch" = "PMIX_IA32"], - [AC_MSG_CHECKING([for RDTSCP assembly support]) - AC_LANG_PUSH([C]) - AC_TRY_RUN([[ -int main(int argc, char* argv[]) -{ - unsigned int rax, rdx; - __asm__ __volatile__ ("rdtscp\n": "=a" (rax), "=d" (rdx):: "%rax", "%rdx"); - return 0; -} - ]], - [result=1 - AC_MSG_RESULT([yes])], - [AC_MSG_RESULT([no])], - [#cross compile not supported - AC_MSG_RESULT(["no (cross compiling)"])]) - AC_LANG_POP([C])]) - AC_DEFINE_UNQUOTED([PMIX_ASSEMBLY_SUPPORTS_RDTSCP], [$result], - [Whether we have support for RDTSCP instruction]) - - result="PMIX_$pmix_cv_asm_builtin" - PMIX_ASSEMBLY_BUILTIN="$pmix_cv_asm_builtin" - AC_MSG_CHECKING([for builtin atomics]) - AC_MSG_RESULT([$pmix_cv_asm_builtin]) - AC_DEFINE_UNQUOTED([PMIX_ASSEMBLY_BUILTIN], [$result], - [Whether to use builtin atomics]) - AC_SUBST([PMIX_ASSEMBLY_BUILTIN]) - - PMIX_ASM_FIND_FILE - - unset result asm_format -])dnl - - -dnl ################################################################# -dnl -dnl PMIX_ASM_FIND_FILE -dnl -dnl -dnl do all the evil mojo to provide a working assembly file -dnl -dnl ################################################################# -AC_DEFUN([PMIX_ASM_FIND_FILE], [ - AC_REQUIRE([AC_PROG_GREP]) - AC_REQUIRE([AC_PROG_FGREP]) - -if test "$pmix_cv_asm_arch" != "WINDOWS" && test "$pmix_cv_asm_builtin" != "BUILTIN_SYNC" && test "$pmix_cv_asm_builtin" != "BUILTIN_GCC" && test "$pmix_cv_asm_builtin" != "BUILTIN_OSX" && test "$pmix_cv_asm_inline_arch" = "no" ; then - AC_MSG_ERROR([no atomic support available. exiting]) -else - # On windows with VC++, atomics are done with compiler primitives - pmix_cv_asm_file="" -fi -])dnl diff --git a/opal/mca/pmix/pmix4x/openpmix/config/pmix_config_pthreads.m4 b/opal/mca/pmix/pmix4x/openpmix/config/pmix_config_pthreads.m4 deleted file mode 100644 index b23f66ebb01..00000000000 --- a/opal/mca/pmix/pmix4x/openpmix/config/pmix_config_pthreads.m4 +++ /dev/null @@ -1,322 +0,0 @@ -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) 2012 Cisco Systems, Inc. All rights reserved. -dnl Copyright (c) 2014-2019 Intel, Inc. All rights reserved. -dnl Copyright (c) 2014-2016 Research Organization for Information Science -dnl and Technology (RIST). All rights reserved. -dnl $COPYRIGHT$ -dnl -dnl Additional copyrights may follow -dnl -dnl $HEADER$ -dnl -dnl PMIX_CONFIG_POSIX_THREADS() -dnl -dnl Configure posix threads, setting the following variables (but -dnl not calling AC_SUBST on them). - -# ******************************************************************** -# -# Internal macros - do not call from outside PMIX_CONFIG_POSIX_THREADS -# -# ******************************************************************** - - -AC_DEFUN([PMIX_INTL_PTHREAD_TRY_LINK], [ -# BEGIN: PMIX_INTL_PTHREAD_TRY_LINK -# -# Make sure that we can run a small application in C or C++, which -# ever is the current language. Do make sure that C or C++ is the -# current language. -# -# As long as this is not being run.... -# pthread_t may be anything from an int to a struct -- init with self-tid. -# - AC_LINK_IFELSE([AC_LANG_SOURCE([[ -#include - -int i = 3; -pthread_t me, newthread; - -void cleanup_routine(void *foo); -void *thread_main(void *foo); - -void cleanup_routine(void *foo) { i = 4; } -void *thread_main(void *foo) { i = 2; return (void*) &i; } - -int main(int argc, char* argv[]) -{ - pthread_attr_t attr; - - me = pthread_self(); - pthread_atfork(NULL, NULL, NULL); - pthread_attr_init(&attr); - pthread_cleanup_push(cleanup_routine, 0); - pthread_create(&newthread, &attr, thread_main, 0); - pthread_join(newthread, 0); - pthread_cleanup_pop(0); - - return 0; -}]])], - [$1], [$2]) -# END: PMIX_INTL_PTHREAD_TRY_LINK -])dnl - -# ******************************************************************** -# -# Try to compile thread support without any special flags -# -# ******************************************************************** -AC_DEFUN([PMIX_INTL_POSIX_THREADS_PLAIN_C], [ -# -# C compiler -# -if test "$pmix_pthread_c_success" = "0"; then - AC_MSG_CHECKING([if C compiler and POSIX threads work as is]) - - AC_LANG_PUSH(C) - PMIX_INTL_PTHREAD_TRY_LINK(pmix_pthread_c_success=1, - pmix_pthread_c_success=0) - AC_LANG_POP(C) - if test "$pmix_pthread_c_success" = "1"; then - AC_MSG_RESULT([yes]) - else - AC_MSG_RESULT([no]) - fi -fi -])dnl - - -AC_DEFUN([PMIX_INTL_POSIX_THREADS_PLAIN], [ -# BEGIN: PMIX_INTL_POSIX_THREADS_PLAIN -# -# Check if can compile without any special flags -# we throw -D_REENTRANT or -D_THREAD_SAFE in here, just in -# case. Some systems (OS X, for example) generally don't need -# the defines, but then will on one system header here or there -# why take chances? -# - -AC_PROVIDE_IFELSE([AC_PROG_CC], - [PMIX_INTL_POSIX_THREADS_PLAIN_C], - [pmix_pthread_c_success=1]) - -# End: PMIX_INTL_POSIX_THREADS_PLAIN -])dnl - - -# ******************************************************************** -# -# Try to compile thread support with special compiler flags -# -# ******************************************************************** -AC_DEFUN([PMIX_INTL_POSIX_THREADS_SPECIAL_FLAGS_C], [ -# -# C compiler -# -if test "$pmix_pthread_c_success" = "0"; then - for pf in $pflags; do - AC_MSG_CHECKING([if C compiler and POSIX threads work with $pf]) - CFLAGS="$orig_CFLAGS $pf" - AC_LANG_PUSH(C) - PMIX_INTL_PTHREAD_TRY_LINK(pmix_pthread_c_success=1, - pmix_pthread_c_success=0) - AC_LANG_POP(C) - if test "$pmix_pthread_c_success" = "1"; then - PTHREAD_CFLAGS="$pf" - AC_MSG_RESULT([yes]) - break - else - PTHREAD_CFLAGS= - CFLAGS="$orig_CFLAGS" - AC_MSG_RESULT([no]) - fi - done -fi -]) - - -AC_DEFUN([PMIX_INTL_POSIX_THREADS_SPECIAL_FLAGS],[ -# Begin: PMIX_INTL_POSIX_THREADS_SPECIAL_FLAGS -# -# If above didn't work, try some super-special compiler flags -# that get evaluated to the "right" things. -# -# -Kthread: -# -kthread: FreeBSD kernel threads -# -pthread: Modern GCC (most all platforms) -# -pthreads: GCC on solaris -# -mthreads: -# -mt: Solaris native compilers / HP-UX aCC -# -# Put -mt before -mthreads because HP-UX aCC will properly compile -# with -mthreads (reading as -mt), but emit a warning about unknown -# flags hreads. Stupid compilers. - -case "${host_cpu}-${host_os}" in - *solaris*) - pflags="-pthread -pthreads -mt" - ;; - *) - pflags="-Kthread -kthread -pthread -pthreads -mt -mthreads" - ;; -esac - -AC_PROVIDE_IFELSE([AC_PROG_CC], - [PMIX_INTL_POSIX_THREADS_SPECIAL_FLAGS_C], - [pmix_pthread_c_success=1]) - -# End: PMIX_INTL_POSIX_THREADS_SPECIAL_FLAGS -])dnl - - -# ******************************************************************** -# -# Try to compile thread support with extra libs -# -# ******************************************************************** -AC_DEFUN([PMIX_INTL_POSIX_THREADS_LIBS_C],[ -# -# C compiler -# -if test "$pmix_pthread_c_success" = "0"; then - for pl in $plibs; do - AC_MSG_CHECKING([if C compiler and POSIX threads work with $pl]) - case "${host_cpu}-${host-_os}" in - *-aix* | *-freebsd*) - if test "`echo $CPPFLAGS | $GREP 'D_THREAD_SAFE'`" = ""; then - PTHREAD_CPPFLAGS="-D_THREAD_SAFE" - CPPFLAGS="$CPPFLAGS $PTHREAD_CPPFLAGS" - fi - ;; - *) - if test "`echo $CPPFLAGS | $GREP 'D_REENTRANT'`" = ""; then - PTHREAD_CPPFLAGS="-D_REENTRANT" - CPPFLAGS="$CPPFLAGS $PTHREAD_CPPFLAGS" - fi - ;; - esac - LIBS="$orig_LIBS $pl" - AC_LANG_PUSH(C) - PMIX_INTL_PTHREAD_TRY_LINK(pmix_pthread_c_success=1, - pmix_pthread_c_success=0) - AC_LANG_POP(C) - if test "$pmix_pthread_c_success" = "1"; then - PTHREAD_LIBS="$pl" - AC_MSG_RESULT([yes]) - else - PTHREAD_CPPFLAGS= - CPPFLAGS="$orig_CPPFLAGS" - LIBS="$orig_LIBS" - AC_MSG_RESULT([no]) - fi - done -fi -])dnl - -AC_DEFUN([PMIX_INTL_POSIX_THREADS_LIBS],[ -# Begin: PMIX_INTL_POSIX_THREADS_LIBS -# -# if we can't find a super-special compiler flags, try some libraries. -# we throw -D_REENTRANT or -D_THREAD_SAFE in here, just in case. Some -# systems (OS X, for example) generally don't need the defines, but -# then will on one system header here or there why take chances? -# -# libpthreads: AIX - must check before libpthread -# liblthread: LinuxThreads on FreeBSD -# libpthread: The usual place (like we can define usual!) -plibs="-lpthreads -llthread -lpthread" - -AC_PROVIDE_IFELSE([AC_PROG_CC], - [PMIX_INTL_POSIX_THREADS_LIBS_C], - [pmix_pthread_c_success=1]) - -# End: PMIX_INTL_POSIX_THREADS_LIBS] -)dnl - - -#******************************************************************** -# -# External macro (aka, the real thing) -# -#******************************************************************** -AC_DEFUN([PMIX_CONFIG_POSIX_THREADS],[ - AC_REQUIRE([AC_PROG_GREP]) - -pmix_pthread_c_success=0 - -orig_CFLAGS="$CFLAGS" -orig_CPPFLAGS="$CPPFLAGS" -orig_LDFLAGS="$LDFLAGS" -orig_LIBS="$LIBS" - -PTHREAD_CFLAGS= -PTHREAD_CPPFLAGS= -PTHREAD_LDFLAGS= -PTHREAD_LIBS= - -# Try with the basics, mam. -PMIX_INTL_POSIX_THREADS_PLAIN - -# Try the super-special compiler flags. -PMIX_INTL_POSIX_THREADS_SPECIAL_FLAGS - -# Try the normal linking methods (that's no fun) -PMIX_INTL_POSIX_THREADS_LIBS - -# -# check to see if we can create shared memory mutexes and conditions -# -AC_CHECK_FUNCS([pthread_mutexattr_setpshared pthread_condattr_setpshared]) - -# -# check to see if we can set error checking mutexes -# - -# LinuxThreads -AC_MSG_CHECKING([for PTHREAD_MUTEX_ERRORCHECK_NP]) -AC_LINK_IFELSE( - [AC_LANG_PROGRAM( - [[#include ]], - [[pthread_mutexattr_settype(NULL, PTHREAD_MUTEX_ERRORCHECK_NP);]])], - [result="yes" defval=1], [result="no" defval=0]) -AC_MSG_RESULT([$result]) -AC_DEFINE_UNQUOTED([PMIX_HAVE_PTHREAD_MUTEX_ERRORCHECK_NP], [$defval], - [If PTHREADS implementation supports PTHREAD_MUTEX_ERRORCHECK_NP]) - -# Mac OS X -AC_MSG_CHECKING([for PTHREAD_MUTEX_ERRORCHECK]) -AC_LINK_IFELSE( - [AC_LANG_PROGRAM( - [[#include ]], - [[pthread_mutexattr_settype(NULL, PTHREAD_MUTEX_ERRORCHECK);]])], - [result="yes" defval=1], [result="no" defval=0]) -AC_MSG_RESULT([$result]) -AC_DEFINE_UNQUOTED([PMIX_HAVE_PTHREAD_MUTEX_ERRORCHECK], [$defval], - [If PTHREADS implementation supports PTHREAD_MUTEX_ERRORCHECK]) - -CFLAGS="$orig_CFLAGS" -CPPFLAGS="$orig_CPPFLAGS" -LDFLAGS="$orig_LDFLAGS" -LIBS="$orig_LIBS" - -if test "$pmix_pthread_c_success" = "1"; then - internal_useless=1 - $1 -else - internal_useless=1 - $2 -fi - -unset pmix_pthread_c_success -unset internal_useless -])dnl diff --git a/opal/mca/pmix/pmix4x/openpmix/config/pmix_config_subdir.m4 b/opal/mca/pmix/pmix4x/openpmix/config/pmix_config_subdir.m4 deleted file mode 100644 index ff60f311b05..00000000000 --- a/opal/mca/pmix/pmix4x/openpmix/config/pmix_config_subdir.m4 +++ /dev/null @@ -1,147 +0,0 @@ -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) 2012-2016 Cisco Systems, Inc. All rights reserved. -dnl Copyright (c) 2014 Intel, Inc. All rights reserved. -dnl Copyright (c) 2015 Research Organization for Information Science -dnl and Technology (RIST). All rights reserved. -dnl $COPYRIGHT$ -dnl -dnl Additional copyrights may follow -dnl -dnl $HEADER$ -dnl - -AC_DEFUN([PMIX_CONFIG_SUBDIR],[ -PMIX_VAR_SCOPE_PUSH([subdir_parent sub_configure subdir_dir subdir_srcdir subdir_cache_file subdir_args subdir_dots total_dir dir_part temp]) - -# -# Invoke configure in a specific subdirectory. -# -# $1 is the directory to invoke in -# $2 is the list of arguments to pass -# $3 is actions to execute upon success -# $4 is actions to execute upon failure -# -subdir_dir="$1" -subdir_args="$2" -subdir_success="$3" -subdir_failure="$4" - -# -# Sanity checks -# - -if test "$subdir_dir" != ":" && test -d $srcdir/$subdir_dir; then - AC_MSG_NOTICE([PMIX configuring in $subdir_dir]) - - # - # Gotta check where srcdir is for VPATH builds. If srcdir is not - # ., then we need to mkdir the subdir. Otherwise, we can just cd - # into it. - # - - case $srcdir in - .) - ;; - *) - { case $subdir_dir in - [[\\/]]* | ?:[[\\/]]* ) total_dir=;; - *) total_dir=.;; - esac - temp=$subdir_dir - for dir_part in `IFS='/\\'; set X $temp; shift; echo "$[@]"`; do - case $dir_part in - # Skip DOS drivespec - ?:) total_dir=$dir_part ;; - *) total_dir=$total_dir/$dir_part - test -d "$total_dir" || - mkdir "$total_dir" || - AC_MSG_ERROR([cannot create $subdir_dir]) - ;; - esac - done; } - - if test -d ./$subdir_dir; then :; - else - AC_MSG_ERROR([cannot create `pwd`/$subdir_dir]) - fi - ;; - esac - - # - # Move into the target directory - # - - subdir_parent=`pwd` - cd $subdir_dir - - # - # Make a "../" for each directory in $subdir_dir. - # - - subdir_dots=`[echo $subdir_dir | sed 's,^\./,,;s,[^/]$,&/,;s,[^/]*/,../,g]'` - # - # Construct the --srcdir argument - # - - case $srcdir in - .) - # In place - subdir_srcdir="$srcdir" - ;; - [[\\/]* | ?:[\\/]*] ) - # Absolute path - subdir_srcdir="$srcdir/$subdir_dir" - ;; - *) - # Relative path - subdir_srcdir="$subdir_dots$srcdir/$subdir_dir" - ;; - esac - - # - # Construct the --cache-file argument - # - - # BWB - subdir caching is a pain since we change CFLAGS and all that. - # Just disable it for now - subdir_cache_file="/dev/null" - - # - # Invoke the configure script in the subdirectory - # - - sub_configure="$SHELL '$subdir_srcdir/configure'" - AC_MSG_NOTICE([running $sub_configure $subdir_args --cache-file=$subdir_cache_file --srcdir=$subdir_srcdir --disable-option-checking]) - eval "$sub_configure $subdir_args \ - --cache-file=\"\$subdir_cache_file\" --srcdir=\"$subdir_srcdir\" --disable-option-checking" - if test "$?" = "0"; then - eval $subdir_success - AC_MSG_NOTICE([$sub_configure succeeded for $subdir_dir]) - else - eval $subdir_failure - AC_MSG_NOTICE([$sub_configure *failed* for $subdir_dir]) - fi - - # - # Go back to the topdir - # - - cd $subdir_parent -fi - -# -# Clean up -# - -PMIX_VAR_SCOPE_POP])dnl diff --git a/opal/mca/pmix/pmix4x/openpmix/config/pmix_config_subdir_args.m4 b/opal/mca/pmix/pmix4x/openpmix/config/pmix_config_subdir_args.m4 deleted file mode 100644 index 2702383796e..00000000000 --- a/opal/mca/pmix/pmix4x/openpmix/config/pmix_config_subdir_args.m4 +++ /dev/null @@ -1,84 +0,0 @@ -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) 2014-2016 Intel, Inc. All rights reserved. -dnl Copyright (c) 2015 Cisco Systems, Inc. All rights reserved. -dnl $COPYRIGHT$ -dnl -dnl Additional copyrights may follow -dnl -dnl $HEADER$ -dnl - -AC_DEFUN([PMIX_CONFIG_SUBDIR_ARGS],[ -PMIX_VAR_SCOPE_PUSH([subdirs_str subdirs_skip subdirs_args subdirs_arg]) -# -# Invoke configure in subdirectories. -# -# $1 is the name of the variable to assign the output to -# - -# -# Make a list of command line args --eliminate the --srcdir and -# --cache-file args, because we need to replace them with our own -# values when invoking the sub-configure script. Also eliminate -# the --with-platform as this will confuse any subdir with -# similar options -# - -subdirs_args= -subdirs_skip=no - -eval "set x $ac_configure_args" -shift -for subdirs_arg -do - if test "$subdirs_skip" = "yes"; then - subdirs_skip=no - else - case $subdirs_arg in - -cache-file | --cache-file | -cache | --cache) - subdirs_skip=yes - ;; - --config-cache | -C) - ;; - -cache-file=* | --cache-file=*) - ;; - -srcdir | --srcdir) - subdirs_skip=yes - ;; - -srcdir=* | --srcdir=*) - ;; - -with-platform=* | --with-platform=*) - ;; - *) - case $subdir_arg in - *\'*) subdir_arg=`echo "$subdir_arg" | sed "s/'/'\\\\\\\\''/g"` ;; - esac - subdirs_args="$subdirs_args '$subdirs_arg'" - ;; - esac - fi -done - -# -# Assign the output -# - -subdirs_str=$1=\"$subdirs_args\" -eval "$subdirs_str" - -# -# Clean up -# - -PMIX_VAR_SCOPE_POP])dnl diff --git a/opal/mca/pmix/pmix4x/openpmix/config/pmix_config_threads.m4 b/opal/mca/pmix/pmix4x/openpmix/config/pmix_config_threads.m4 deleted file mode 100644 index 050f8735577..00000000000 --- a/opal/mca/pmix/pmix4x/openpmix/config/pmix_config_threads.m4 +++ /dev/null @@ -1,68 +0,0 @@ -dnl -dnl Copyright (c) 2004-2010 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) 2010 Cisco Systems, Inc. All rights reserved. -dnl Copyright (c) 2009-2011 Oak Ridge National Labs. All rights reserved. -dnl Copyright (c) 2014-2019 Intel, Inc. All rights reserved. -dnl Copyright (c) 2015 Research Organization for Information Science -dnl and Technology (RIST). All rights reserved. -dnl $COPYRIGHT$ -dnl -dnl Additional copyrights may follow -dnl -dnl $HEADER$ -dnl - -AC_DEFUN([PMIX_CONFIG_THREADS],[ -# -# Arguments: none -# -# Dependencies: None -# -# Modifies: -# none - see called tests -# -# configure threads -# - -# -# Check we have POSIX threads -# -PMIX_CONFIG_POSIX_THREADS(HAVE_POSIX_THREADS=1, HAVE_POSIX_THREADS=0) -AC_MSG_CHECKING([for working POSIX threads package]) -if test "$HAVE_POSIX_THREADS" = "1" ; then - AC_MSG_RESULT([yes]) -else - AC_MSG_RESULT([no]) -fi -export HAVE_POSIX_THREADS - -# -# Ask what threading we want (allow posix right now) -# - -if test "$HAVE_POSIX_THREADS" = "0"; then - AC_MSG_WARN(["*** POSIX threads are not"]) - AC_MSG_WARN(["*** available on your system "]) - AC_MSG_ERROR(["*** Can not continue"]) -fi - -THREAD_CFLAGS="$PTHREAD_CFLAGS" -THREAD_CPPFLAGS="$PTHREAD_CPPFLAGS" -THREAD_LDFLAGS="$PTHREAD_LDFLAGS" -THREAD_LIBS="$PTHREAD_LIBS" - -PMIX_CHECK_PTHREAD_PIDS - -AC_DEFINE_UNQUOTED([PMIX_ENABLE_MULTI_THREADS], [1], - [Whether we should enable thread support within the PMIX code base]) - -])dnl diff --git a/opal/mca/pmix/pmix4x/openpmix/config/pmix_ensure_contains_optflags.m4 b/opal/mca/pmix/pmix4x/openpmix/config/pmix_ensure_contains_optflags.m4 deleted file mode 100644 index 68bf36090ba..00000000000 --- a/opal/mca/pmix/pmix4x/openpmix/config/pmix_ensure_contains_optflags.m4 +++ /dev/null @@ -1,67 +0,0 @@ -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-2007 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) 2007-2009 Sun Microsystems, Inc. All rights reserved. -dnl Copyright (c) 2008-2015 Cisco Systems, Inc. All rights reserved. -dnl Copyright (c) 2013 Intel, Inc. All rights reserved -dnl $COPYRIGHT$ -dnl -dnl Additional copyrights may follow -dnl -dnl $HEADER$ -dnl - -AC_DEFUN([PMIX_ENSURE_CONTAINS_OPTFLAGS],[ - -# Modularize this setup so that sub-configure.in scripts can use this -# same setup code. - -################################## -# Optimization flags -################################## - -# If the user did not specify optimization flags, add some (the value -# from $OPTFLAGS) - -co_arg="$1" -co_found=0 -for co_word in $co_arg; do - # See http://www.gnu.org/software/autoconf/manual/html_node/Quadrigraphs.html#Quadrigraphs - # for an explanation of @<:@ and @:>@ -- they m4 expand to [ and ] - case $co_word in - -g) co_found=1 ;; - -g@<:@1-3@:>@) co_found=1 ;; - +K@<:@0-5@:>@) co_found=1 ;; - -O) co_found=1 ;; - -O@<:@0-9@:>@) co_found=1 ;; - -xO) co_found=1 ;; - -xO@<:@0-9@:>@) co_found=1 ;; - -fast) co_found=1 ;; - - # The below Sun Studio flags require or - # trigger -xO optimization - -xvector*) co_found=1 ;; - -xdepend=yes) co_found=1 ;; - - esac -done - -if test "$co_found" = "0"; then - co_result="$OPTFLAGS $co_arg" -else - co_result="$co_arg" -fi - -# Clean up - -unset co_found co_word co_arg -]) diff --git a/opal/mca/pmix/pmix4x/openpmix/config/pmix_functions.m4 b/opal/mca/pmix/pmix4x/openpmix/config/pmix_functions.m4 deleted file mode 100644 index e9b237cd53f..00000000000 --- a/opal/mca/pmix/pmix4x/openpmix/config/pmix_functions.m4 +++ /dev/null @@ -1,670 +0,0 @@ -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) 2007 Sun Microsystems, Inc. All rights reserved. -dnl Copyright (c) 2009 Oak Ridge National Labs. All rights reserved. -dnl Copyright (c) 2009-2016 Cisco Systems, Inc. All rights reserved. -dnl Copyright (c) 2013-2017 Intel, Inc. All rights reserved. -dnl Copyright (c) 2017 Research Organization for Information Science -dnl and Technology (RIST). All rights reserved. -dnl -dnl $COPYRIGHT$ -dnl -dnl Additional copyrights may follow -dnl -dnl $HEADER$ -dnl -dnl Portions of this file derived from GASNet v1.12 (see "GASNet" -dnl comments, below) -dnl Copyright 2004, Dan Bonachea -dnl -dnl IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR -dnl DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT -dnl OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF -dnl CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -dnl -dnl THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, -dnl INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY -dnl AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS -dnl ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO -dnl PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. -dnl - -AC_DEFUN([PMIX_CONFIGURE_SETUP],[ - -# Some helper script functions. Unfortunately, we cannot use $1 kinds -# of arugments here because of the m4 substitution. So we have to set -# special variable names before invoking the function. :-\ - -pmix_show_title() { - cat <@:*) - echo installing to directory \"$prefix\" - ;; - *) - AC_MSG_ERROR(prefix "$prefix" must be an absolute directory path) - ;; -esac - -# BEGIN: Derived from GASNet - -# Suggestion from Paul Hargrove to disable --program-prefix and -# friends. Heavily influenced by GASNet 1.12 acinclude.m4 -# functionality to do the same thing (copyright listed at top of this -# file). - -# echo program_prefix=$program_prefix program_suffix=$program_suffix program_transform_name=$program_transform_name -# undo prefix autoconf automatically adds during cross-compilation -if test "$cross_compiling" = yes && test "$program_prefix" = "${target_alias}-" ; then - program_prefix=NONE -fi -# normalize empty prefix/suffix -if test -z "$program_prefix" ; then - program_prefix=NONE -fi -if test -z "$program_suffix" ; then - program_suffix=NONE -fi -# undo transforms caused by empty prefix/suffix -if expr "$program_transform_name" : 's.^..$' >/dev/null || \ - expr "$program_transform_name" : 's.$$..$' >/dev/null || \ - expr "$program_transform_name" : 's.$$..;s.^..$' >/dev/null ; then - program_transform_name="s,x,x," -fi -if test "$program_prefix$program_suffix$program_transform_name" != "NONENONEs,x,x," ; then - AC_MSG_WARN([*** The PMIx configure script does not support --program-prefix, --program-suffix or --program-transform-name. Users are recommended to instead use --prefix with a unique directory and make symbolic links as desired for renaming.]) - AC_MSG_ERROR([*** Cannot continue]) -fi - -# END: Derived from GASNet -])dnl - -dnl ####################################################################### -dnl ####################################################################### -dnl ####################################################################### - -AC_DEFUN([PMIX_LOG_MSG],[ -# 1 is the message -# 2 is whether to put a prefix or not -if test -n "$2"; then - echo "configure:__oline__: $1" >&5 -else - echo $1 >&5 -fi])dnl - -dnl ####################################################################### -dnl ####################################################################### -dnl ####################################################################### - -AC_DEFUN([PMIX_LOG_FILE],[ -# 1 is the filename -if test -n "$1" && test -f "$1"; then - cat $1 >&5 -fi])dnl - -dnl ####################################################################### -dnl ####################################################################### -dnl ####################################################################### - -AC_DEFUN([PMIX_LOG_COMMAND],[ -# 1 is the command -# 2 is actions to do if success -# 3 is actions to do if fail -echo "configure:__oline__: $1" >&5 -$1 1>&5 2>&1 -pmix_status=$? -PMIX_LOG_MSG([\$? = $pmix_status], 1) -if test "$pmix_status" = "0"; then - unset pmix_status - $2 -else - unset pmix_status - $3 -fi])dnl - -dnl ####################################################################### -dnl ####################################################################### -dnl ####################################################################### - -AC_DEFUN([PMIX_UNIQ],[ -# 1 is the variable name to be uniq-ized -pmix_name=$1 - -# Go through each item in the variable and only keep the unique ones - -pmix_count=0 -for val in ${$1}; do - pmix_done=0 - pmix_i=1 - pmix_found=0 - - # Loop over every token we've seen so far - - pmix_done="`expr $pmix_i \> $pmix_count`" - while test "$pmix_found" = "0" && test "$pmix_done" = "0"; do - - # Have we seen this token already? Prefix the comparison with - # "x" so that "-Lfoo" values won't be cause an error. - - pmix_eval="expr x$val = x\$pmix_array_$pmix_i" - pmix_found=`eval $pmix_eval` - - # Check the ending condition - - pmix_done="`expr $pmix_i \>= $pmix_count`" - - # Increment the counter - - pmix_i="`expr $pmix_i + 1`" - done - - # Check for special cases where we do want to allow repeated - # arguments (per - # http://www.open-mpi.org/community/lists/devel/2012/08/11362.php). - - case $val in - -Xclang|-Xg) - pmix_found=0 - pmix_i=`expr $pmix_count + 1` - ;; - esac - - # If we didn't find the token, add it to the "array" - - if test "$pmix_found" = "0"; then - pmix_eval="pmix_array_$pmix_i=$val" - eval $pmix_eval - pmix_count="`expr $pmix_count + 1`" - else - pmix_i="`expr $pmix_i - 1`" - fi -done - -# Take all the items in the "array" and assemble them back into a -# single variable - -pmix_i=1 -pmix_done="`expr $pmix_i \> $pmix_count`" -pmix_newval= -while test "$pmix_done" = "0"; do - pmix_eval="pmix_newval=\"$pmix_newval \$pmix_array_$pmix_i\"" - eval $pmix_eval - - pmix_eval="unset pmix_array_$pmix_i" - eval $pmix_eval - - pmix_done="`expr $pmix_i \>= $pmix_count`" - pmix_i="`expr $pmix_i + 1`" -done - -# Done; do the assignment - -pmix_newval="`echo $pmix_newval`" -pmix_eval="$pmix_name=\"$pmix_newval\"" -eval $pmix_eval - -# Clean up - -unset pmix_name pmix_i pmix_done pmix_newval pmix_eval pmix_count])dnl - -dnl ####################################################################### -dnl ####################################################################### -dnl ####################################################################### - -# Remove all duplicate -I, -L, and -l flags from the variable named $1 -AC_DEFUN([PMIX_FLAGS_UNIQ],[ - # 1 is the variable name to be uniq-ized - pmix_name=$1 - - # Go through each item in the variable and only keep the unique ones - - pmix_count=0 - for val in ${$1}; do - pmix_done=0 - pmix_i=1 - pmix_found=0 - - # Loop over every token we've seen so far - - pmix_done="`expr $pmix_i \> $pmix_count`" - while test "$pmix_found" = "0" && test "$pmix_done" = "0"; do - - # Have we seen this token already? Prefix the comparison - # with "x" so that "-Lfoo" values won't be cause an error. - - pmix_eval="expr x$val = x\$pmix_array_$pmix_i" - pmix_found=`eval $pmix_eval` - - # Check the ending condition - - pmix_done="`expr $pmix_i \>= $pmix_count`" - - # Increment the counter - - pmix_i="`expr $pmix_i + 1`" - done - - # Check for special cases where we do want to allow repeated - # arguments (per - # http://www.open-mpi.org/community/lists/devel/2012/08/11362.php - # and - # https://github.com/open-mpi/ompi/issues/324). - - case $val in - -Xclang|-Xg) - pmix_found=0 - pmix_i=`expr $pmix_count + 1` - ;; - -framework) - pmix_found=0 - pmix_i=`expr $pmix_count + 1` - ;; - --param) - pmix_found=0 - pmix_i=`expr $pmix_count + 1` - ;; - esac - - # If we didn't find the token, add it to the "array" - - if test "$pmix_found" = "0"; then - pmix_eval="pmix_array_$pmix_i=$val" - eval $pmix_eval - pmix_count="`expr $pmix_count + 1`" - else - pmix_i="`expr $pmix_i - 1`" - fi - done - - # Take all the items in the "array" and assemble them back into a - # single variable - - pmix_i=1 - pmix_done="`expr $pmix_i \> $pmix_count`" - pmix_newval= - while test "$pmix_done" = "0"; do - pmix_eval="pmix_newval=\"$pmix_newval \$pmix_array_$pmix_i\"" - eval $pmix_eval - - pmix_eval="unset pmix_array_$pmix_i" - eval $pmix_eval - - pmix_done="`expr $pmix_i \>= $pmix_count`" - pmix_i="`expr $pmix_i + 1`" - done - - # Done; do the assignment - - pmix_newval="`echo $pmix_newval`" - pmix_eval="$pmix_name=\"$pmix_newval\"" - eval $pmix_eval - - # Clean up - - unset pmix_name pmix_i pmix_done pmix_newval pmix_eval pmix_count -])dnl - -dnl ####################################################################### -dnl ####################################################################### -dnl ####################################################################### - -# PMIX_APPEND_UNIQ(variable, new_argument) -# ---------------------------------------- -# Append new_argument to variable if not already in variable. This assumes a -# space seperated list. -# -# This could probably be made more efficient :(. -AC_DEFUN([PMIX_APPEND_UNIQ], [ -for arg in $2; do - pmix_found=0; - for val in ${$1}; do - if test "x$val" = "x$arg" ; then - pmix_found=1 - break - fi - done - if test "$pmix_found" = "0" ; then - if test -z "$$1"; then - $1="$arg" - else - $1="$$1 $arg" - fi - fi -done -unset pmix_found -]) - -dnl ####################################################################### -dnl ####################################################################### -dnl ####################################################################### - -# PMIX_FLAGS_APPEND_UNIQ(variable, new_argument) -# ---------------------------------------------- -# Append new_argument to variable if: -# -# - the argument does not begin with -I, -L, or -l, or -# - the argument begins with -I, -L, or -l, and it's not already in variable -# -# This macro assumes a space seperated list. -AC_DEFUN([PMIX_FLAGS_APPEND_UNIQ], [ - PMIX_VAR_SCOPE_PUSH([pmix_tmp pmix_append]) - - for arg in $2; do - pmix_tmp=`echo $arg | cut -c1-2` - pmix_append=1 - AS_IF([test "$pmix_tmp" = "-I" || test "$pmix_tmp" = "-L" || test "$pmix_tmp" = "-l"], - [for val in ${$1}; do - AS_IF([test "x$val" = "x$arg"], [pmix_append=0]) - done]) - AS_IF([test "$pmix_append" = "1"], - [AS_IF([test -z "$$1"], [$1=$arg], [$1="$$1 $arg"])]) - done - - PMIX_VAR_SCOPE_POP -]) - -dnl ####################################################################### -dnl ####################################################################### -dnl ####################################################################### - -# Macro that serves as an alternative to using `which `. It is -# preferable to simply using `which ` because backticks (`) (aka -# backquotes) invoke a sub-shell which may source a "noisy" -# ~/.whatever file (and we do not want the error messages to be part -# of the assignment in foo=`which `). This macro ensures that we -# get a sane executable value. -AC_DEFUN([PMIX_WHICH],[ -# 1 is the variable name to do "which" on -# 2 is the variable name to assign the return value to - -PMIX_VAR_SCOPE_PUSH([pmix_prog pmix_file pmix_dir pmix_sentinel]) - -pmix_prog=$1 - -IFS_SAVE=$IFS -IFS="$PATH_SEPARATOR" -for pmix_dir in $PATH; do - if test -x "$pmix_dir/$pmix_prog"; then - $2="$pmix_dir/$pmix_prog" - break - fi -done -IFS=$IFS_SAVE - -PMIX_VAR_SCOPE_POP -])dnl - -dnl ####################################################################### -dnl ####################################################################### -dnl ####################################################################### - -# Declare some variables; use PMIX_VAR_SCOPE_END to ensure that they -# are cleaned up / undefined. -AC_DEFUN([PMIX_VAR_SCOPE_PUSH],[ - - # Is the private index set? If not, set it. - if test "x$pmix_scope_index" = "x"; then - pmix_scope_index=1 - fi - - # First, check to see if any of these variables are already set. - # This is a simple sanity check to ensure we're not already - # overwriting pre-existing variables (that have a non-empty - # value). It's not a perfect check, but at least it's something. - for pmix_var in $1; do - pmix_str="pmix_str=\"\$$pmix_var\"" - eval $pmix_str - - if test "x$pmix_str" != "x"; then - AC_MSG_WARN([Found configure shell variable clash!]) - AC_MSG_WARN([[PMIX_VAR_SCOPE_PUSH] called on "$pmix_var",]) - AC_MSG_WARN([but it is already defined with value "$pmix_str"]) - AC_MSG_WARN([This usually indicates an error in configure.]) - AC_MSG_ERROR([Cannot continue]) - fi - done - - # Ok, we passed the simple sanity check. Save all these names so - # that we can unset them at the end of the scope. - pmix_str="pmix_scope_$pmix_scope_index=\"$1\"" - eval $pmix_str - unset pmix_str - - env | grep pmix_scope - pmix_scope_index=`expr $pmix_scope_index + 1` -])dnl - -# Unset a bunch of variables that were previously set -AC_DEFUN([PMIX_VAR_SCOPE_POP],[ - # Unwind the index - pmix_scope_index=`expr $pmix_scope_index - 1` - pmix_scope_test=`expr $pmix_scope_index \> 0` - if test "$pmix_scope_test" = "0"; then - AC_MSG_WARN([[PMIX_VAR_SCOPE_POP] popped too many PMIX configure scopes.]) - AC_MSG_WARN([This usually indicates an error in configure.]) - AC_MSG_ERROR([Cannot continue]) - fi - - # Get the variable names from that index - pmix_str="pmix_str=\"\$pmix_scope_$pmix_scope_index\"" - eval $pmix_str - - # Iterate over all the variables and unset them all - for pmix_var in $pmix_str; do - unset $pmix_var - done -])dnl - - -dnl ####################################################################### -dnl ####################################################################### -dnl ####################################################################### - -# -# PMIX_WITH_OPTION_MIN_MAX_VALUE(NAME,DEFAULT_VALUE,LOWER_BOUND,UPPER_BOUND) -# Defines a variable PMIX_MAX_xxx, with "xxx" being specified as parameter $1 as "variable_name". -# If not set at configure-time using --with-max-xxx, the default-value ($2) is assumed. -# If set, value is checked against lower (value >= $3) and upper bound (value <= $4) -# -AC_DEFUN([PMIX_WITH_OPTION_MIN_MAX_VALUE], [ - max_value=[$2] - AC_MSG_CHECKING([maximum length of ]m4_translit($1, [_], [ ])) - AC_ARG_WITH([max-]m4_translit($1, [_], [-]), - AC_HELP_STRING([--with-max-]m4_translit($1, [_], [-])[=VALUE], - [maximum length of ]m4_translit($1, [_], [ ])[s. VALUE argument has to be specified (default: [$2]).])) - if test ! -z "$with_max_[$1]" && test "$with_max_[$1]" != "no" ; then - # Ensure it's a number (hopefully an integer!), and >0 - expr $with_max_[$1] + 1 > /dev/null 2> /dev/null - AS_IF([test "$?" != "0"], [happy=0], - [AS_IF([test $with_max_[$1] -ge $3 && test $with_max_[$1] -le $4], - [happy=1], [happy=0])]) - - # If badness in the above tests, bail - AS_IF([test "$happy" = "0"], - [AC_MSG_RESULT([bad value ($with_max_[$1])]) - AC_MSG_WARN([--with-max-]m4_translit($1, [_], [-])[s value must be >= $3 and <= $4]) - AC_MSG_ERROR([Cannot continue])]) - max_value=$with_max_[$1] - fi - AC_MSG_RESULT([$max_value]) - AC_DEFINE_UNQUOTED([PMIX_MAX_]m4_toupper($1), $max_value, - [Maximum length of ]m4_translit($1, [_], [ ])[s (default is $2)]) - [PMIX_MAX_]m4_toupper($1)=$max_value - AC_SUBST([PMIX_MAX_]m4_toupper($1)) -])dnl - -dnl ####################################################################### -dnl ####################################################################### -dnl ####################################################################### - -# Usage: PMIX_COMPUTE_MAX_VALUE(number_bytes, variable_to_set, action if overflow) -# Compute maximum value of datatype of -# number_bytes, setting the result in the second argument. Assumes a -# signed datatype. -AC_DEFUN([PMIX_COMPUTE_MAX_VALUE], [ - # This is more complicated than it really should be. But some - # expr implementations (OpenBSD) have an expr with a max value of - # 2^31 - 1, and we sometimes want to compute the max value of a - # type as big or bigger than that... - pmix_num_bits=`expr $1 \* 8 - 1` - newval=1 - value=1 - overflow=0 - - while test $pmix_num_bits -ne 0 ; do - newval=`expr $value \* 2` - if test 0 -eq `expr $newval \< 0` ; then - # if the new value is not negative, next iteration... - value=$newval - pmix_num_bits=`expr $pmix_num_bits - 1` - # if this was the last iteration, subtract 1 (as signed - # max positive is 2^num_bits - 1). Do this here instead - # of outside of the while loop because we might have - # already subtracted 1 by then if we're trying to find the - # max value of the same datatype expr uses as it's - # internal representation (ie, if we hit the else - # below...) - if test 0 -eq $pmix_num_bits ; then - value=`expr $value - 1` - fi - else - # if the new value is negative, we've over flowed. First, - # try adding value - 1 instead of value (see if we can get - # to positive max of expr) - newval=`expr $value - 1 + $value` - if test 0 -eq `expr $newval \< 0` ; then - value=$newval - # Still positive, this is as high as we can go. If - # pmix_num_bits is 1, we didn't actually overflow. - # Otherwise, we overflowed. - if test 1 -ne $pmix_num_bits ; then - overflow=1 - fi - else - # stil negative. Time to give up. - overflow=1 - fi - pmix_num_bits=0 - fi - done - - AS_VAR_SET([$2], [$value]) - AS_IF([test $overflow -ne 0], [$3]) -])dnl diff --git a/opal/mca/pmix/pmix4x/openpmix/config/pmix_get_version.sh b/opal/mca/pmix/pmix4x/openpmix/config/pmix_get_version.sh deleted file mode 100755 index 6106af60c38..00000000000 --- a/opal/mca/pmix/pmix4x/openpmix/config/pmix_get_version.sh +++ /dev/null @@ -1,161 +0,0 @@ -#!/bin/sh -# -# Copyright (c) 2004-2006 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) 2008-2015 Cisco Systems, Inc. All rights reserved. -# Copyright (c) 2015 Intel, Inc. All rights reserved -# $COPYRIGHT$ -# -# Additional copyrights may follow -# -# $HEADER$ -# - - - -# PMIX_GET_VERSION(version_file, variable_prefix) -# ----------------------------------------------- -# parse version_file for version information, setting -# the following shell variables: -# -# prefix_VERSION -# prefix_BASE_VERSION -# prefix_MAJOR_VERSION -# prefix_MINOR_VERSION -# prefix_RELEASE_VERSION -# prefix_GREEK_VERSION -# prefix_REPO_REV -# prefix_TARBALL_VERSION -# prefix_RELEASE_DATE - - - -srcfile="$1" -option="$2" - -if test -z "$srcfile"; then - option="--help" -else - - if test -f "$srcfile"; then - srcdir=`dirname $srcfile` - pmix_vers=`sed -n " - t clear - : clear - s/^major/PMIX_MAJOR_VERSION/ - s/^minor/PMIX_MINOR_VERSION/ - s/^release/PMIX_RELEASE_VERSION/ - s/^greek/PMIX_GREEK_VERSION/ - s/^repo_rev/PMIX_REPO_REV/ - s/^tarball_version/PMIX_TARBALL_VERSION/ - s/^date/PMIX_RELEASE_DATE/ - t print - b - : print - p" < "$srcfile"` - eval "$pmix_vers" - - PMIX_VERSION="$PMIX_MAJOR_VERSION.$PMIX_MINOR_VERSION.$PMIX_RELEASE_VERSION" - PMIX_VERSION="${PMIX_VERSION}${PMIX_GREEK_VERSION}" - - if test "$PMIX_TARBALL_VERSION" = ""; then - PMIX_TARBALL_VERSION=$PMIX_VERSION - fi - - # If repo_rev was not set in the VERSION file, then get it now - if test "$PMIX_REPO_REV" = ""; then - # See if we can find the "git" command. - git_happy=0 - git --version > /dev/null 2>&1 - if test $? -eq 0; then - git_happy=1 - fi - - # If we're in a git repo and we found the git command, use - # git describe to get the repo rev - if test -d "$srcdir/.git" && test $git_happy -eq 1; then - if test "$srcdir" != "`pwd`"; then - git_save_dir=`pwd` - cd $srcdir - PMIX_REPO_REV=`git describe --tags --always` - cd $git_save_dir - unset git_save_dir - else - PMIX_REPO_REV=`git describe --tags --always` - fi - else - PMIX_REPO_REV="date`date '+%Y-%m-%d'`" - fi - fi - - - fi - - - if test "$option" = ""; then - option="--full" - fi -fi - -case "$option" in - --full|-v|--version) - echo $PMIX_VERSION - ;; - --major) - echo $PMIX_MAJOR_VERSION - ;; - --minor) - echo $PMIX_MINOR_VERSION - ;; - --release) - echo $PMIX_RELEASE_VERSION - ;; - --greek) - echo $PMIX_GREEK_VERSION - ;; - --repo-rev) - echo $PMIX_REPO_REV - ;; - --tarball) - echo $PMIX_TARBALL_VERSION - ;; - --release-date) - echo $PMIX_RELEASE_DATE - ;; - --all) - echo ${PMIX_VERSION} : ${PMIX_MAJOR_VERSION} : ${PMIX_MINOR_VERSION} : ${PMIX_RELEASE_VERSION} : ${PMIX_GREEK_VERSION} : ${PMIX_REPO_REV} : ${PMIX_TARBALL_VERSION} - ;; - -h|--help) - cat <