1
1

Don't treat the HNP node entry separately - this was just a holdover from the days when we didn't have the regex generator.

Ensure we get an accurate count of the number of daemons in the system.

This commit was SVN r21582.
Этот коммит содержится в:
Ralph Castain 2009-07-01 20:46:05 +00:00
родитель 4adb3ed80f
Коммит dd5e195a7d

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

@ -308,39 +308,20 @@ int orte_util_encode_nodemap(opal_byte_object_t *boptr)
} }
++num_nodes; ++num_nodes;
} }
/* pack number of nodes */ /* pack number of nodes */
if (ORTE_SUCCESS != (rc = opal_dss.pack(&buf, &num_nodes, 1, OPAL_INT32))) { if (ORTE_SUCCESS != (rc = opal_dss.pack(&buf, &num_nodes, 1, OPAL_INT32))) {
ORTE_ERROR_LOG(rc); ORTE_ERROR_LOG(rc);
return rc; return rc;
} }
/* pack the HNP's node name - don't mess with /* the HNP always has an entry at posn 0 - get its pointer as
* trying to encode it - it could be different * we will need it later
*/ */
/* the HNP always has an entry */
hnp = (orte_node_t*)opal_pointer_array_get_item(orte_node_pool, 0); hnp = (orte_node_t*)opal_pointer_array_get_item(orte_node_pool, 0);
/* if we are not keeping FQDN hostnames, abbreviate
* the nodename as required
*/
if (!orte_keep_fqdn_hostnames) {
nodename = strdup(hnp->name);
if (NULL != (ptr = strchr(nodename, '.'))) {
*ptr = '\0';
}
if (ORTE_SUCCESS != (rc = opal_dss.pack(&buf, &nodename, 1, OPAL_STRING))) {
ORTE_ERROR_LOG(rc);
return rc;
}
free(nodename);
} else {
if (ORTE_SUCCESS != (rc = opal_dss.pack(&buf, &hnp->name, 1, OPAL_STRING))) {
ORTE_ERROR_LOG(rc);
return rc;
}
}
/* pack every nodename individually */ /* pack every nodename individually */
for (i=1; i < orte_node_pool->size; i++) { for (i=0; i < orte_node_pool->size; i++) {
if (NULL == (node = (orte_node_t*)opal_pointer_array_get_item(orte_node_pool, i))) { if (NULL == (node = (orte_node_t*)opal_pointer_array_get_item(orte_node_pool, i))) {
continue; continue;
} }
@ -375,7 +356,7 @@ int orte_util_encode_nodemap(opal_byte_object_t *boptr)
/* allocate space for the daemon vpids */ /* allocate space for the daemon vpids */
vpids = (orte_vpid_t*)malloc(num_nodes * sizeof(orte_vpid_t)); vpids = (orte_vpid_t*)malloc(num_nodes * sizeof(orte_vpid_t));
for (i=1; i < orte_node_pool->size; i++) { for (i=0; i < orte_node_pool->size; i++) {
if (NULL == (node = (orte_node_t*)opal_pointer_array_get_item(orte_node_pool, i))) { if (NULL == (node = (orte_node_t*)opal_pointer_array_get_item(orte_node_pool, i))) {
continue; continue;
} }
@ -531,8 +512,8 @@ int orte_util_decode_nodemap(opal_byte_object_t *bo)
} }
OPAL_OUTPUT_VERBOSE((2, orte_debug_output, OPAL_OUTPUT_VERBOSE((2, orte_debug_output,
"%s decode:nidmap decoding %d nodes with %d already loaded", "%s decode:nidmap decoding %d nodes",
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME), num_nodes, orte_nidmap.lowest_free)); ORTE_NAME_PRINT(ORTE_PROC_MY_NAME), num_nodes));
/* set the size of the nidmap storage so we minimize realloc's */ /* set the size of the nidmap storage so we minimize realloc's */
if (ORTE_SUCCESS != (rc = opal_pointer_array_set_size(&orte_nidmap, num_nodes))) { if (ORTE_SUCCESS != (rc = opal_pointer_array_set_size(&orte_nidmap, num_nodes))) {
@ -540,24 +521,8 @@ int orte_util_decode_nodemap(opal_byte_object_t *bo)
return rc; return rc;
} }
/* create the struct for the HNP's node */
node = OBJ_NEW(orte_nid_t);
/* the arch defaults to our arch so that non-hetero
* case will yield correct behavior
*/
opal_pointer_array_set_item(&orte_nidmap, 0, node);
/* unpack the name of the HNP's node */
n=1;
if (ORTE_SUCCESS != (rc = opal_dss.unpack(&buf, &(node->name), &n, OPAL_STRING))) {
ORTE_ERROR_LOG(rc);
return rc;
}
/* set the daemon to 0 */
node->daemon = 0;
/* loop over nodes and unpack the raw nodename */ /* loop over nodes and unpack the raw nodename */
for (i=1; i < num_nodes; i++) { for (i=0; i < num_nodes; i++) {
node = OBJ_NEW(orte_nid_t); node = OBJ_NEW(orte_nid_t);
/* the arch defaults to our arch so that non-hetero /* the arch defaults to our arch so that non-hetero
* case will yield correct behavior * case will yield correct behavior
@ -583,7 +548,7 @@ int orte_util_decode_nodemap(opal_byte_object_t *bo)
* daemons in the system * daemons in the system
*/ */
num_daemons = 0; num_daemons = 0;
for (i=1; i < num_nodes; i++) { for (i=0; i < num_nodes; i++) {
if (NULL != (ndptr = (orte_nid_t*)opal_pointer_array_get_item(&orte_nidmap, i))) { if (NULL != (ndptr = (orte_nid_t*)opal_pointer_array_get_item(&orte_nidmap, i))) {
ndptr->daemon = vpids[i]; ndptr->daemon = vpids[i];
if (ORTE_VPID_INVALID != vpids[i]) { if (ORTE_VPID_INVALID != vpids[i]) {