Handle the default hostfile case a little better...
This commit was SVN r25928.
Этот коммит содержится в:
родитель
14457accd7
Коммит
bba6508b4b
@ -1017,6 +1017,7 @@ int orte_plm_base_setup_virtual_machine(orte_job_t *jdata)
|
|||||||
opal_list_t nodes;
|
opal_list_t nodes;
|
||||||
opal_list_item_t *item, *next;
|
opal_list_item_t *item, *next;
|
||||||
orte_app_context_t *app;
|
orte_app_context_t *app;
|
||||||
|
bool one_filter = false;
|
||||||
|
|
||||||
OPAL_OUTPUT_VERBOSE((5, orte_plm_globals.output,
|
OPAL_OUTPUT_VERBOSE((5, orte_plm_globals.output,
|
||||||
"%s plm:base:setup_vm",
|
"%s plm:base:setup_vm",
|
||||||
@ -1090,10 +1091,15 @@ int orte_plm_base_setup_virtual_machine(orte_job_t *jdata)
|
|||||||
/* yes - filter the node list through the file, marking
|
/* yes - filter the node list through the file, marking
|
||||||
* any nodes not in the file -or- excluded via ^
|
* any nodes not in the file -or- excluded via ^
|
||||||
*/
|
*/
|
||||||
if (ORTE_SUCCESS != (rc = orte_util_filter_hostfile_nodes(&nodes, orte_default_hostfile, false))) {
|
if (ORTE_SUCCESS != (rc = orte_util_filter_hostfile_nodes(&nodes, orte_default_hostfile, false)) &&
|
||||||
|
ORTE_ERR_TAKE_NEXT_OPTION != rc) {
|
||||||
ORTE_ERROR_LOG(rc);
|
ORTE_ERROR_LOG(rc);
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
if (ORTE_SUCCESS == rc) {
|
||||||
|
/* we filtered something */
|
||||||
|
one_filter = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* filter across the union of all app_context specs */
|
/* filter across the union of all app_context specs */
|
||||||
@ -1106,10 +1112,13 @@ int orte_plm_base_setup_virtual_machine(orte_job_t *jdata)
|
|||||||
ORTE_ERROR_LOG(rc);
|
ORTE_ERROR_LOG(rc);
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
if (ORTE_SUCCESS == rc) {
|
||||||
|
/* we filtered something */
|
||||||
|
one_filter = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (NULL != orte_default_hostfile ||
|
if (one_filter) {
|
||||||
ORTE_ERR_TAKE_NEXT_OPTION != rc) {
|
|
||||||
/* at least one filtering option was executed, so
|
/* at least one filtering option was executed, so
|
||||||
* remove all nodes that were not mapped
|
* remove all nodes that were not mapped
|
||||||
*/
|
*/
|
||||||
|
@ -224,6 +224,11 @@ int orte_rmaps_base_get_target_nodes(opal_list_t *allocated_nodes, orte_std_cntr
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
OPAL_OUTPUT_VERBOSE((5, orte_rmaps_base.rmaps_output,
|
||||||
|
"%s Starting with %d nodes in list",
|
||||||
|
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),
|
||||||
|
(int)opal_list_get_size(allocated_nodes)));
|
||||||
|
|
||||||
/** check that anything is here */
|
/** check that anything is here */
|
||||||
if (0 == opal_list_get_size(allocated_nodes)) {
|
if (0 == opal_list_get_size(allocated_nodes)) {
|
||||||
orte_show_help("help-orte-rmaps-base.txt",
|
orte_show_help("help-orte-rmaps-base.txt",
|
||||||
@ -234,15 +239,25 @@ int orte_rmaps_base_get_target_nodes(opal_list_t *allocated_nodes, orte_std_cntr
|
|||||||
|
|
||||||
/* is there a default hostfile? */
|
/* is there a default hostfile? */
|
||||||
if (NULL != orte_default_hostfile) {
|
if (NULL != orte_default_hostfile) {
|
||||||
|
OPAL_OUTPUT_VERBOSE((5, orte_rmaps_base.rmaps_output,
|
||||||
|
"%s Filtering thru default hostfile",
|
||||||
|
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME)));
|
||||||
|
|
||||||
/* yes - filter the node list through the file, removing
|
/* yes - filter the node list through the file, removing
|
||||||
* any nodes not in the file -or- excluded via ^
|
* any nodes not in the file -or- excluded via ^
|
||||||
*/
|
*/
|
||||||
if (ORTE_SUCCESS != (rc = orte_util_filter_hostfile_nodes(allocated_nodes,
|
if (ORTE_SUCCESS != (rc = orte_util_filter_hostfile_nodes(allocated_nodes,
|
||||||
orte_default_hostfile,
|
orte_default_hostfile,
|
||||||
true))) {
|
true)) &&
|
||||||
|
ORTE_ERR_TAKE_NEXT_OPTION != rc) {
|
||||||
ORTE_ERROR_LOG(rc);
|
ORTE_ERROR_LOG(rc);
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
OPAL_OUTPUT_VERBOSE((5, orte_rmaps_base.rmaps_output,
|
||||||
|
"%s Resulted in %d nodes in list",
|
||||||
|
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),
|
||||||
|
(int)opal_list_get_size(allocated_nodes)));
|
||||||
|
|
||||||
/** check that anything is here */
|
/** check that anything is here */
|
||||||
if (0 == opal_list_get_size(allocated_nodes)) {
|
if (0 == opal_list_get_size(allocated_nodes)) {
|
||||||
orte_show_help("help-orte-rmaps-base.txt",
|
orte_show_help("help-orte-rmaps-base.txt",
|
||||||
@ -253,11 +268,20 @@ int orte_rmaps_base_get_target_nodes(opal_list_t *allocated_nodes, orte_std_cntr
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* filter the nodes thru any hostfile and dash-host options */
|
/* filter the nodes thru any hostfile and dash-host options */
|
||||||
|
OPAL_OUTPUT_VERBOSE((5, orte_rmaps_base.rmaps_output,
|
||||||
|
"%s Filtering thru apps",
|
||||||
|
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME)));
|
||||||
|
|
||||||
if (ORTE_SUCCESS != (rc = orte_rmaps_base_filter_nodes(app, allocated_nodes, true))
|
if (ORTE_SUCCESS != (rc = orte_rmaps_base_filter_nodes(app, allocated_nodes, true))
|
||||||
&& ORTE_ERR_TAKE_NEXT_OPTION != rc) {
|
&& ORTE_ERR_TAKE_NEXT_OPTION != rc) {
|
||||||
ORTE_ERROR_LOG(rc);
|
ORTE_ERROR_LOG(rc);
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
OPAL_OUTPUT_VERBOSE((5, orte_rmaps_base.rmaps_output,
|
||||||
|
"%s Retained %d nodes in list",
|
||||||
|
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),
|
||||||
|
(int)opal_list_get_size(allocated_nodes)));
|
||||||
|
|
||||||
|
|
||||||
/* remove all nodes that are already at max usage, and
|
/* remove all nodes that are already at max usage, and
|
||||||
* compute the total number of allocated slots while
|
* compute the total number of allocated slots while
|
||||||
@ -271,11 +295,19 @@ int orte_rmaps_base_get_target_nodes(opal_list_t *allocated_nodes, orte_std_cntr
|
|||||||
/** check to see if this node is fully used - remove if so */
|
/** check to see if this node is fully used - remove if so */
|
||||||
node = (orte_node_t*)item;
|
node = (orte_node_t*)item;
|
||||||
if (0 != node->slots_max && node->slots_inuse > node->slots_max) {
|
if (0 != node->slots_max && node->slots_inuse > node->slots_max) {
|
||||||
|
OPAL_OUTPUT_VERBOSE((5, orte_rmaps_base.rmaps_output,
|
||||||
|
"%s Removing node %s",
|
||||||
|
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),
|
||||||
|
node->name));
|
||||||
opal_list_remove_item(allocated_nodes, item);
|
opal_list_remove_item(allocated_nodes, item);
|
||||||
OBJ_RELEASE(item); /* "un-retain" it */
|
OBJ_RELEASE(item); /* "un-retain" it */
|
||||||
} else if (node->slots_alloc <= node->slots_inuse &&
|
} else if (node->slots_alloc <= node->slots_inuse &&
|
||||||
(ORTE_MAPPING_NO_OVERSUBSCRIBE & ORTE_GET_MAPPING_DIRECTIVE(policy))) {
|
(ORTE_MAPPING_NO_OVERSUBSCRIBE & ORTE_GET_MAPPING_DIRECTIVE(policy))) {
|
||||||
/* remove the node as fully used */
|
/* remove the node as fully used */
|
||||||
|
OPAL_OUTPUT_VERBOSE((5, orte_rmaps_base.rmaps_output,
|
||||||
|
"%s Removing node %s",
|
||||||
|
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),
|
||||||
|
node->name));
|
||||||
opal_list_remove_item(allocated_nodes, item);
|
opal_list_remove_item(allocated_nodes, item);
|
||||||
OBJ_RELEASE(item); /* "un-retain" it */
|
OBJ_RELEASE(item); /* "un-retain" it */
|
||||||
} else {
|
} else {
|
||||||
|
@ -564,7 +564,8 @@ int orte_util_filter_hostfile_nodes(opal_list_t *nodes,
|
|||||||
if (0 == opal_list_get_size(&newnodes)) {
|
if (0 == opal_list_get_size(&newnodes)) {
|
||||||
OBJ_DESTRUCT(&newnodes);
|
OBJ_DESTRUCT(&newnodes);
|
||||||
OBJ_DESTRUCT(&exclude);
|
OBJ_DESTRUCT(&exclude);
|
||||||
return ORTE_SUCCESS;
|
/* indicate that the hostfile was empty */
|
||||||
|
return ORTE_ERR_TAKE_NEXT_OPTION;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* remove from the list of newnodes those that are in the exclude list
|
/* remove from the list of newnodes those that are in the exclude list
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user