Allow there to be no default hostfile without generating an error
This commit was SVN r25930.
Этот коммит содержится в:
родитель
91977444af
Коммит
3da1787c06
@ -150,6 +150,7 @@ bool orte_report_launch_progress = false;
|
|||||||
|
|
||||||
/* allocation specification */
|
/* allocation specification */
|
||||||
char *orte_default_hostfile = NULL;
|
char *orte_default_hostfile = NULL;
|
||||||
|
bool orte_default_hostfile_given = false;
|
||||||
char *orte_rankfile = NULL;
|
char *orte_rankfile = NULL;
|
||||||
#ifdef __WINDOWS__
|
#ifdef __WINDOWS__
|
||||||
char *orte_ccp_headnode;
|
char *orte_ccp_headnode;
|
||||||
|
@ -615,6 +615,7 @@ ORTE_DECLSPEC extern bool orte_report_launch_progress;
|
|||||||
|
|
||||||
/* allocation specification */
|
/* allocation specification */
|
||||||
ORTE_DECLSPEC extern char *orte_default_hostfile;
|
ORTE_DECLSPEC extern char *orte_default_hostfile;
|
||||||
|
ORTE_DECLSPEC extern bool orte_default_hostfile_given;
|
||||||
ORTE_DECLSPEC extern char *orte_rankfile;
|
ORTE_DECLSPEC extern char *orte_rankfile;
|
||||||
#ifdef __WINDOWS__
|
#ifdef __WINDOWS__
|
||||||
ORTE_DECLSPEC extern char *orte_ccp_headnode;
|
ORTE_DECLSPEC extern char *orte_ccp_headnode;
|
||||||
|
@ -251,16 +251,24 @@ int orte_register_params(void)
|
|||||||
false, false, 1000, &orte_timeout_usec_per_proc);
|
false, false, 1000, &orte_timeout_usec_per_proc);
|
||||||
|
|
||||||
/* default hostfile */
|
/* default hostfile */
|
||||||
asprintf(&orte_default_hostfile, "%s/etc/openmpi-default-hostfile", opal_install_dirs.prefix);
|
|
||||||
mca_base_param_reg_string_name("orte", "default_hostfile",
|
mca_base_param_reg_string_name("orte", "default_hostfile",
|
||||||
"Name of the default hostfile (relative or absolute path, \"none\" to ignore environmental or default MCA param setting)",
|
"Name of the default hostfile (relative or absolute path, \"none\" to ignore environmental or default MCA param setting)",
|
||||||
false, false, orte_default_hostfile, &orte_default_hostfile);
|
false, false, NULL, &strval);
|
||||||
if (0 == strcmp(orte_default_hostfile, "none")) {
|
if (NULL == strval) {
|
||||||
free(orte_default_hostfile);
|
/* nothing was given, so define the default */
|
||||||
|
asprintf(&orte_default_hostfile, "%s/etc/openmpi-default-hostfile", opal_install_dirs.prefix);
|
||||||
|
/* flag that nothing was given */
|
||||||
|
orte_default_hostfile_given = false;
|
||||||
|
} else if (0 == strcmp(orte_default_hostfile, "none")) {
|
||||||
orte_default_hostfile = NULL;
|
orte_default_hostfile = NULL;
|
||||||
|
/* flag that it was given */
|
||||||
|
orte_default_hostfile_given = true;
|
||||||
|
} else {
|
||||||
|
orte_default_hostfile = strval;
|
||||||
|
/* flag that it was given */
|
||||||
|
orte_default_hostfile_given = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#ifdef __WINDOWS__
|
#ifdef __WINDOWS__
|
||||||
mca_base_param_reg_string_name("orte", "ccp_headnode",
|
mca_base_param_reg_string_name("orte", "ccp_headnode",
|
||||||
"Name of the cluster head node. (For Windows CCP only.)",
|
"Name of the cluster head node. (For Windows CCP only.)",
|
||||||
|
@ -419,8 +419,25 @@ static int hostfile_parse(const char *hostfile, opal_list_t* updates, opal_list_
|
|||||||
orte_util_hostfile_done = false;
|
orte_util_hostfile_done = false;
|
||||||
orte_util_hostfile_in = fopen(hostfile, "r");
|
orte_util_hostfile_in = fopen(hostfile, "r");
|
||||||
if (NULL == orte_util_hostfile_in) {
|
if (NULL == orte_util_hostfile_in) {
|
||||||
orte_show_help("help-hostfile.txt", "no-hostfile", true, hostfile);
|
if (NULL == orte_default_hostfile ||
|
||||||
rc = ORTE_ERR_NOT_FOUND;
|
0 != strcmp(orte_default_hostfile, hostfile)) {
|
||||||
|
/* not the default hostfile, so not finding it
|
||||||
|
* is an error
|
||||||
|
*/
|
||||||
|
orte_show_help("help-hostfile.txt", "no-hostfile", true, hostfile);
|
||||||
|
rc = ORTE_ERR_SILENT;
|
||||||
|
goto unlock;
|
||||||
|
}
|
||||||
|
/* if this is the default hostfile and it was given,
|
||||||
|
* then it's an error
|
||||||
|
*/
|
||||||
|
if (orte_default_hostfile_given) {
|
||||||
|
orte_show_help("help-hostfile.txt", "no-hostfile", true, hostfile);
|
||||||
|
rc = ORTE_ERR_NOT_FOUND;
|
||||||
|
goto unlock;
|
||||||
|
}
|
||||||
|
/* otherwise, not finding it is okay */
|
||||||
|
rc = ORTE_SUCCESS;
|
||||||
goto unlock;
|
goto unlock;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user