Skip to content

Commit 9db7893

Browse files
committed
Add some protection against PMIx v4
Ensure we can build against PMIx v3.1.5 Fixes #8089 Signed-off-by: Ralph Castain <[email protected]>
1 parent 0bcef04 commit 9db7893

File tree

2 files changed

+19
-2
lines changed

2 files changed

+19
-2
lines changed

ompi/dpm/dpm.c

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -696,7 +696,11 @@ static int dpm_convert(opal_list_t *infos,
696696
/* does it conflict? */
697697
if (0 != strncasecmp(ck, directive, strlen(directive))) {
698698
opal_asprintf(&help_str, "Conflicting directives \"%s %s\"", ck, directive);
699+
#if PMIX_NUMERIC_VERSION >= 0x00040000
699700
attr = PMIx_Get_attribute_string(option);
701+
#else
702+
attr = option;
703+
#endif
700704
opal_show_help("help-dpm.txt", "deprecated-fail", true,
701705
infokey, attr, help_str);
702706
free(help_str);
@@ -723,7 +727,11 @@ static int dpm_convert(opal_list_t *infos,
723727
if (OMPI_SUCCESS != rc) {
724728
/* we have a conflict */
725729
opal_asprintf(&ptr, " Option %s\n Conflicting modifiers \"%s %s\"", option, infokey, modifier);
730+
#if PMIX_NUMERIC_VERSION >= 0x00040000
726731
attr = PMIx_Get_attribute_string(option);
732+
#else
733+
attr = option;
734+
#endif
727735
opal_show_help("help-dpm.txt", "deprecated-fail", true,
728736
infokey, attr, ptr);
729737
free(ptr);
@@ -983,9 +991,9 @@ int ompi_dpm_spawn(int count, const char *array_of_commands[],
983991

984992
/* non-standard keys
985993
* Keys that correspond to prun/mpiexec parameters
986-
* do not deprecate PMIX unprefixed forms to remain identical
994+
* do not deprecate PMIX unprefixed forms to remain identical
987995
* to the command line parameter;
988-
* Keys that are not corresponding to an mpiexec parameter are
996+
* Keys that are not corresponding to an mpiexec parameter are
989997
* deprecated in the non-prefixed form */
990998

991999
/* check for 'hostfile' */

ompi/runtime/ompi_rte.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -668,6 +668,7 @@ int ompi_rte_init(int *pargc, char ***pargv)
668668
}
669669
}
670670

671+
#ifdef PMIX_APP_ARGV
671672
/* get our command - defaults to our appnum */
672673
ev1 = NULL;
673674
OPAL_MODEX_RECV_VALUE_OPTIONAL(rc, PMIX_APP_ARGV,
@@ -681,13 +682,21 @@ int ompi_rte_init(int *pargc, char ***pargv)
681682
opal_process_info.command = opal_argv_join(tmp, ' ');
682683
}
683684
}
685+
#else
686+
tmp = *pargv;
687+
if (NULL != tmp) {
688+
opal_process_info.command = opal_argv_join(tmp, ' ');
689+
}
690+
#endif
684691

692+
#ifdef PMIX_REINCARNATION
685693
/* get our reincarnation number */
686694
OPAL_MODEX_RECV_VALUE_OPTIONAL(rc, PMIX_REINCARNATION,
687695
&OPAL_PROC_MY_NAME, &u32ptr, PMIX_UINT32);
688696
if (PMIX_SUCCESS == rc) {
689697
opal_process_info.reincarnation = u32;
690698
}
699+
#endif
691700

692701
/* get the number of local peers - required for wireup of
693702
* shared memory BTL, defaults to local node */

0 commit comments

Comments
 (0)