1
1

Add some protection against PMIx v4

Ensure we can build against PMIx v3.1.5

Fixes #8089

Signed-off-by: Ralph Castain <rhc@pmix.org>
Этот коммит содержится в:
Ralph Castain 2020-10-12 13:54:47 -07:00
родитель 0bcef049c9
Коммит 9db78938c4
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B63B630167D26BB5
2 изменённых файлов: 19 добавлений и 2 удалений

Просмотреть файл

@ -696,7 +696,11 @@ static int dpm_convert(opal_list_t *infos,
/* does it conflict? */ /* does it conflict? */
if (0 != strncasecmp(ck, directive, strlen(directive))) { if (0 != strncasecmp(ck, directive, strlen(directive))) {
opal_asprintf(&help_str, "Conflicting directives \"%s %s\"", ck, directive); opal_asprintf(&help_str, "Conflicting directives \"%s %s\"", ck, directive);
#if PMIX_NUMERIC_VERSION >= 0x00040000
attr = PMIx_Get_attribute_string(option); attr = PMIx_Get_attribute_string(option);
#else
attr = option;
#endif
opal_show_help("help-dpm.txt", "deprecated-fail", true, opal_show_help("help-dpm.txt", "deprecated-fail", true,
infokey, attr, help_str); infokey, attr, help_str);
free(help_str); free(help_str);
@ -723,7 +727,11 @@ static int dpm_convert(opal_list_t *infos,
if (OMPI_SUCCESS != rc) { if (OMPI_SUCCESS != rc) {
/* we have a conflict */ /* we have a conflict */
opal_asprintf(&ptr, " Option %s\n Conflicting modifiers \"%s %s\"", option, infokey, modifier); opal_asprintf(&ptr, " Option %s\n Conflicting modifiers \"%s %s\"", option, infokey, modifier);
#if PMIX_NUMERIC_VERSION >= 0x00040000
attr = PMIx_Get_attribute_string(option); attr = PMIx_Get_attribute_string(option);
#else
attr = option;
#endif
opal_show_help("help-dpm.txt", "deprecated-fail", true, opal_show_help("help-dpm.txt", "deprecated-fail", true,
infokey, attr, ptr); infokey, attr, ptr);
free(ptr); free(ptr);
@ -983,9 +991,9 @@ int ompi_dpm_spawn(int count, const char *array_of_commands[],
/* non-standard keys /* non-standard keys
* Keys that correspond to prun/mpiexec parameters * 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; * 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 */ * deprecated in the non-prefixed form */
/* check for 'hostfile' */ /* check for 'hostfile' */

Просмотреть файл

@ -668,6 +668,7 @@ int ompi_rte_init(int *pargc, char ***pargv)
} }
} }
#ifdef PMIX_APP_ARGV
/* get our command - defaults to our appnum */ /* get our command - defaults to our appnum */
ev1 = NULL; ev1 = NULL;
OPAL_MODEX_RECV_VALUE_OPTIONAL(rc, PMIX_APP_ARGV, 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, ' '); 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 */ /* get our reincarnation number */
OPAL_MODEX_RECV_VALUE_OPTIONAL(rc, PMIX_REINCARNATION, OPAL_MODEX_RECV_VALUE_OPTIONAL(rc, PMIX_REINCARNATION,
&OPAL_PROC_MY_NAME, &u32ptr, PMIX_UINT32); &OPAL_PROC_MY_NAME, &u32ptr, PMIX_UINT32);
if (PMIX_SUCCESS == rc) { if (PMIX_SUCCESS == rc) {
opal_process_info.reincarnation = u32; opal_process_info.reincarnation = u32;
} }
#endif
/* get the number of local peers - required for wireup of /* get the number of local peers - required for wireup of
* shared memory BTL, defaults to local node */ * shared memory BTL, defaults to local node */