Fix for bug #370
The POE ras did not correctly enter the number of slots per node. This fixes that. This commit was SVN r11716.
Этот коммит содержится в:
родитель
d1402cf8f5
Коммит
c4db5654fa
@ -34,7 +34,6 @@ extern "C" {
|
|||||||
*/
|
*/
|
||||||
struct orte_ras_poe_component_t {
|
struct orte_ras_poe_component_t {
|
||||||
orte_ras_base_component_t super;
|
orte_ras_base_component_t super;
|
||||||
int debug;
|
|
||||||
int priority;
|
int priority;
|
||||||
};
|
};
|
||||||
typedef struct orte_ras_poe_component_t orte_ras_poe_component_t;
|
typedef struct orte_ras_poe_component_t orte_ras_poe_component_t;
|
||||||
|
@ -20,6 +20,8 @@
|
|||||||
#include "orte/orte_constants.h"
|
#include "orte/orte_constants.h"
|
||||||
#include "opal/mca/base/base.h"
|
#include "opal/mca/base/base.h"
|
||||||
#include "opal/mca/base/mca_base_param.h"
|
#include "opal/mca/base/mca_base_param.h"
|
||||||
|
#include "orte/mca/ras/ras.h"
|
||||||
|
#include "orte/mca/ras/base/base.h"
|
||||||
#include "orte/util/proc_info.h"
|
#include "orte/util/proc_info.h"
|
||||||
#include "opal/util/output.h"
|
#include "opal/util/output.h"
|
||||||
#include "ras_poe.h"
|
#include "ras_poe.h"
|
||||||
@ -68,10 +70,6 @@ static int orte_ras_poe_open(void)
|
|||||||
{
|
{
|
||||||
mca_base_component_t *c = &mca_ras_poe_component.super.ras_version;
|
mca_base_component_t *c = &mca_ras_poe_component.super.ras_version;
|
||||||
|
|
||||||
mca_base_param_reg_int(c, "debug",
|
|
||||||
"Whether or not to enable debugging output for the poe ras component (0 or 1)",
|
|
||||||
false, false, 0, &mca_ras_poe_component.debug);
|
|
||||||
|
|
||||||
mca_base_param_reg_int(c, "priority",
|
mca_base_param_reg_int(c, "priority",
|
||||||
"Priority of the poe ras component",
|
"Priority of the poe ras component",
|
||||||
false , false, 100, &mca_ras_poe_component.priority);
|
false , false, 100, &mca_ras_poe_component.priority);
|
||||||
@ -88,9 +86,15 @@ static orte_ras_base_module_t *orte_ras_poe_init(int* priority)
|
|||||||
|
|
||||||
*priority = mca_ras_poe_component.priority;
|
*priority = mca_ras_poe_component.priority;
|
||||||
|
|
||||||
if ( NULL != getenv("LOADL_PID") ) {
|
if ( NULL != getenv("LOADL_PROCESSOR_LIST") ) {
|
||||||
|
opal_output(orte_ras_base.ras_output,
|
||||||
|
"ras:poe: available for selection with priority %d",
|
||||||
|
mca_ras_poe_component.priority);
|
||||||
return &orte_ras_poe_module;
|
return &orte_ras_poe_module;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
opal_output(orte_ras_base.ras_output,
|
||||||
|
"ras:poe: NOT available for selection");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -38,26 +38,42 @@ static int orte_ras_poe_allocate(orte_jobid_t jobid)
|
|||||||
if (NULL == poe_node_str) {
|
if (NULL == poe_node_str) {
|
||||||
return ORTE_ERR_NOT_FOUND;
|
return ORTE_ERR_NOT_FOUND;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* poe_node_str is something like "nodeA nodeA nodeB nodeB" */
|
/* poe_node_str is something like "nodeA nodeA nodeB nodeB" */
|
||||||
|
|
||||||
names = opal_argv_copy(opal_argv_split(poe_node_str, ' '));
|
names = opal_argv_copy(opal_argv_split(poe_node_str, ' '));
|
||||||
nnode = opal_argv_count(names);
|
nnode = opal_argv_count(names);
|
||||||
|
|
||||||
|
/* iterate through all the nodes listed. If a single node is listed more than once,
|
||||||
|
* it means that we have multiple slots allocated on that node */
|
||||||
OBJ_CONSTRUCT(&nodes_list, opal_list_t);
|
OBJ_CONSTRUCT(&nodes_list, opal_list_t);
|
||||||
for (i = 0; i < nnode; i++) {
|
for (i = 0; i < nnode; i++) {
|
||||||
node = OBJ_NEW(orte_ras_node_t);
|
/* check for duplicated nodes */
|
||||||
if (NULL == node) {
|
for (item = opal_list_get_first(&nodes_list);
|
||||||
return ORTE_ERR_OUT_OF_RESOURCE;
|
opal_list_get_end(&nodes_list) != item;
|
||||||
|
item = opal_list_get_next(item)) {
|
||||||
|
node = (orte_ras_node_t*) item;
|
||||||
|
if (0 == strcmp(node->node_name, names[i])) {
|
||||||
|
++node->node_slots;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(opal_list_get_end(&nodes_list) == item) {
|
||||||
|
/* we did not find a duplicate, so add a new item to the list */
|
||||||
|
node = OBJ_NEW(orte_ras_node_t);
|
||||||
|
if (NULL == node) {
|
||||||
|
return ORTE_ERR_OUT_OF_RESOURCE;
|
||||||
|
}
|
||||||
|
node->node_name = strdup(names[i]);
|
||||||
|
node->node_arch = NULL;
|
||||||
|
node->node_state = ORTE_NODE_STATE_UP;
|
||||||
|
node->node_cellid = 0;
|
||||||
|
node->node_slots_inuse = 0;
|
||||||
|
node->node_slots_max = 0;
|
||||||
|
node->node_slots = 1;
|
||||||
|
opal_list_append(&nodes_list, &node->super);
|
||||||
}
|
}
|
||||||
node->node_name = strdup(names[i]);
|
|
||||||
node->node_arch = NULL;
|
|
||||||
node->node_state = ORTE_NODE_STATE_UP;
|
|
||||||
node->node_cellid = 0;
|
|
||||||
node->node_slots_inuse = 0;
|
|
||||||
node->node_slots_max = 0;
|
|
||||||
node->node_slots = 1;
|
|
||||||
opal_list_append(&nodes_list, &node->super);
|
|
||||||
}
|
}
|
||||||
ret = orte_ras_base_node_insert(&nodes_list);
|
ret = orte_ras_base_node_insert(&nodes_list);
|
||||||
ret = orte_ras_base_allocate_nodes(jobid, &nodes_list);
|
ret = orte_ras_base_allocate_nodes(jobid, &nodes_list);
|
||||||
@ -66,7 +82,6 @@ static int orte_ras_poe_allocate(orte_jobid_t jobid)
|
|||||||
OBJ_RELEASE(item);
|
OBJ_RELEASE(item);
|
||||||
}
|
}
|
||||||
OBJ_DESTRUCT(&nodes_list);
|
OBJ_DESTRUCT(&nodes_list);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user