|
14 | 14 | * All rights reserved. |
15 | 15 | * Copyright (c) 2014-2017 Intel, Inc. All rights reserved. |
16 | 16 | * Copyright (c) 2016 IBM Corporation. All rights reserved. |
| 17 | + * Copyright (c) 2018 Mellanox Technologies, Inc. |
| 18 | + * All rights reserved. |
17 | 19 | * $COPYRIGHT$ |
18 | 20 | * |
19 | 21 | * Additional copyrights may follow |
@@ -253,13 +255,12 @@ int orte_rmaps_base_get_target_nodes(opal_list_t *allocated_nodes, orte_std_cntr |
253 | 255 | /* find the nodes in our node array and assemble them |
254 | 256 | * in daemon order if the vm was launched |
255 | 257 | */ |
256 | | - while (NULL != (item = opal_list_remove_first(&nodes))) { |
257 | | - nptr = (orte_node_t*)item; |
| 258 | + for (i=0; i < orte_node_pool->size; i++) { |
258 | 259 | nd = NULL; |
259 | | - for (i=0; i < orte_node_pool->size; i++) { |
260 | | - if (NULL == (node = (orte_node_t*)opal_pointer_array_get_item(orte_node_pool, i))) { |
261 | | - continue; |
262 | | - } |
| 260 | + if (NULL == (node = (orte_node_t*)opal_pointer_array_get_item(orte_node_pool, i))) { |
| 261 | + continue; |
| 262 | + } |
| 263 | + OPAL_LIST_FOREACH_SAFE(nptr, next, &nodes, orte_node_t) { |
263 | 264 | if (0 != strcmp(node->name, nptr->name)) { |
264 | 265 | OPAL_OUTPUT_VERBOSE((10, orte_rmaps_base_framework.framework_output, |
265 | 266 | "NODE %s DOESNT MATCH NODE %s", |
@@ -332,8 +333,9 @@ int orte_rmaps_base_get_target_nodes(opal_list_t *allocated_nodes, orte_std_cntr |
332 | 333 | /* reset us back to the end for the next node */ |
333 | 334 | nd = (orte_node_t*)opal_list_get_last(allocated_nodes); |
334 | 335 | } |
| 336 | + opal_list_remove_item(&nodes, (opal_list_item_t*)nptr); |
| 337 | + OBJ_RELEASE(nptr); |
335 | 338 | } |
336 | | - OBJ_RELEASE(nptr); |
337 | 339 | } |
338 | 340 | OBJ_DESTRUCT(&nodes); |
339 | 341 | /* now prune for usage and compute total slots */ |
|
0 commit comments