1
1
- It is possible to leave a byslot/bynode routine and have cur_node_item be NULL, so check for that.
- After we do an allocation where the user has provided a map (i.e. with --host), cur_node_item is pointing into the map list, not the global list. Change it to point into the global list.

This commit was SVN r12232.
Этот коммит содержится в:
Tim Prins 2006-10-20 19:00:17 +00:00
родитель 955d11fa7b
Коммит 28bf4d85ab

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

@ -499,8 +499,10 @@ static int orte_rmaps_rr_map(orte_jobid_t jobid, opal_list_t *attributes)
/* save the next node name bookmark as we will - in the case of mapped nodes -
* release the node information being pointed to by cur_node_item
*/
free(save_bookmark);
save_bookmark = strdup(((orte_ras_node_t*)cur_node_item)->node_name);
if(NULL != cur_node_item) {
free(save_bookmark);
save_bookmark = strdup(((orte_ras_node_t*)cur_node_item)->node_name);
}
/** cleanup the mapped_node_list, if necessary */
if (0 < app->num_map) {
@ -565,6 +567,23 @@ static int orte_rmaps_rr_map(orte_jobid_t jobid, opal_list_t *attributes)
/** now put that node on the fully_used_nodes list */
opal_list_append(&fully_used_nodes, &node->super);
}
/* now we need to update cur_node_item, as it was previously pointing into
* the mapped_node_list. First we see if we can find our bookmark */
cur_node_item = NULL;
for (item = opal_list_get_first(&master_node_list);
item != opal_list_get_end(&master_node_list);
item = opal_list_get_next(item)) {
node = (orte_ras_node_t*)item;
if (0 == strcmp(save_bookmark, node->node_name)) {
cur_node_item = item;
break;
}
}
/* see if we found it - if not, just start at the beginning */
if (NULL == cur_node_item) {
cur_node_item = opal_list_get_first(&master_node_list);
}
} else {
/** this mapping wasn't specified, so all we have to do is add any nodes