In accordance with prior releases, we are supposed to default to looking at the openmpi-default-hostfile as a default hostfile. Restore that behavior, but ignore the file if it is empty. Allow the user to ignore any MCA param setting pointing to a default hostfile by setting the param to "none" (via cmd line or whatever) - this allows them to override a setting in the system default MCA param file.
This commit was SVN r25851.
Этот коммит содержится в:
родитель
b9026ccbd0
Коммит
a5e4dc6803
@ -28,6 +28,7 @@
|
||||
#include <stdio.h>
|
||||
|
||||
#include "opal/mca/base/mca_base_param.h"
|
||||
#include "opal/mca/installdirs/installdirs.h"
|
||||
#include "opal/util/output.h"
|
||||
#include "opal/util/argv.h"
|
||||
|
||||
@ -250,9 +251,15 @@ int orte_register_params(void)
|
||||
false, false, 1000, &orte_timeout_usec_per_proc);
|
||||
|
||||
/* default hostfile */
|
||||
asprintf(&orte_default_hostfile, "%s/etc/openmpi-default-hostfile", opal_install_dirs.prefix);
|
||||
mca_base_param_reg_string_name("orte", "default_hostfile",
|
||||
"Name of the default hostfile (relative or absolute path)",
|
||||
false, false, NULL, &orte_default_hostfile);
|
||||
"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);
|
||||
if (0 == strcmp(orte_default_hostfile, "none")) {
|
||||
free(orte_default_hostfile);
|
||||
orte_default_hostfile = NULL;
|
||||
}
|
||||
|
||||
|
||||
#ifdef __WINDOWS__
|
||||
mca_base_param_reg_string_name("orte", "ccp_headnode",
|
||||
|
@ -556,9 +556,17 @@ int orte_util_filter_hostfile_nodes(opal_list_t *nodes,
|
||||
OBJ_CONSTRUCT(&exclude, opal_list_t);
|
||||
if (ORTE_SUCCESS != (rc = hostfile_parse(hostfile, &newnodes, &exclude, false))) {
|
||||
OBJ_DESTRUCT(&newnodes);
|
||||
OBJ_DESTRUCT(&exclude);
|
||||
return rc;
|
||||
}
|
||||
|
||||
/* if the hostfile was empty, then treat it as a no-op filter */
|
||||
if (0 == opal_list_get_size(&newnodes)) {
|
||||
OBJ_DESTRUCT(&newnodes);
|
||||
OBJ_DESTRUCT(&exclude);
|
||||
return ORTE_SUCCESS;
|
||||
}
|
||||
|
||||
/* remove from the list of newnodes those that are in the exclude list
|
||||
* since we could have added duplicate names above due to the */
|
||||
while (NULL != (item1 = opal_list_remove_first(&exclude))) {
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user