From 9db78938c45eb51354a802a2be7f23f6d15a7a04 Mon Sep 17 00:00:00 2001 From: Ralph Castain Date: Mon, 12 Oct 2020 13:54:47 -0700 Subject: [PATCH] Add some protection against PMIx v4 Ensure we can build against PMIx v3.1.5 Fixes #8089 Signed-off-by: Ralph Castain --- ompi/dpm/dpm.c | 12 ++++++++++-- ompi/runtime/ompi_rte.c | 9 +++++++++ 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/ompi/dpm/dpm.c b/ompi/dpm/dpm.c index af205f8a01..b77b21586a 100644 --- a/ompi/dpm/dpm.c +++ b/ompi/dpm/dpm.c @@ -696,7 +696,11 @@ static int dpm_convert(opal_list_t *infos, /* does it conflict? */ if (0 != strncasecmp(ck, directive, strlen(directive))) { opal_asprintf(&help_str, "Conflicting directives \"%s %s\"", ck, directive); +#if PMIX_NUMERIC_VERSION >= 0x00040000 attr = PMIx_Get_attribute_string(option); +#else + attr = option; +#endif opal_show_help("help-dpm.txt", "deprecated-fail", true, infokey, attr, help_str); free(help_str); @@ -723,7 +727,11 @@ static int dpm_convert(opal_list_t *infos, if (OMPI_SUCCESS != rc) { /* we have a conflict */ opal_asprintf(&ptr, " Option %s\n Conflicting modifiers \"%s %s\"", option, infokey, modifier); +#if PMIX_NUMERIC_VERSION >= 0x00040000 attr = PMIx_Get_attribute_string(option); +#else + attr = option; +#endif opal_show_help("help-dpm.txt", "deprecated-fail", true, infokey, attr, ptr); free(ptr); @@ -983,9 +991,9 @@ int ompi_dpm_spawn(int count, const char *array_of_commands[], /* non-standard keys * Keys that correspond to prun/mpiexec parameters - * do not deprecate PMIX unprefixed forms to remain identical + * do not deprecate PMIX unprefixed forms to remain identical * to the command line parameter; - * Keys that are not corresponding to an mpiexec parameter are + * Keys that are not corresponding to an mpiexec parameter are * deprecated in the non-prefixed form */ /* check for 'hostfile' */ diff --git a/ompi/runtime/ompi_rte.c b/ompi/runtime/ompi_rte.c index 9e4eba1b30..fe110cbc0f 100644 --- a/ompi/runtime/ompi_rte.c +++ b/ompi/runtime/ompi_rte.c @@ -668,6 +668,7 @@ int ompi_rte_init(int *pargc, char ***pargv) } } +#ifdef PMIX_APP_ARGV /* get our command - defaults to our appnum */ ev1 = NULL; OPAL_MODEX_RECV_VALUE_OPTIONAL(rc, PMIX_APP_ARGV, @@ -681,13 +682,21 @@ int ompi_rte_init(int *pargc, char ***pargv) opal_process_info.command = opal_argv_join(tmp, ' '); } } +#else + tmp = *pargv; + if (NULL != tmp) { + opal_process_info.command = opal_argv_join(tmp, ' '); + } +#endif +#ifdef PMIX_REINCARNATION /* get our reincarnation number */ OPAL_MODEX_RECV_VALUE_OPTIONAL(rc, PMIX_REINCARNATION, &OPAL_PROC_MY_NAME, &u32ptr, PMIX_UINT32); if (PMIX_SUCCESS == rc) { opal_process_info.reincarnation = u32; } +#endif /* get the number of local peers - required for wireup of * shared memory BTL, defaults to local node */