@@ -253,13 +253,12 @@ int orte_rmaps_base_get_target_nodes(opal_list_t *allocated_nodes, orte_std_cntr
253
253
/* find the nodes in our node array and assemble them
254
254
* in daemon order if the vm was launched
255
255
*/
256
- while (NULL != (item = opal_list_remove_first (& nodes ))) {
257
- nptr = (orte_node_t * )item ;
256
+ for (i = 0 ; i < orte_node_pool -> size ; i ++ ) {
258
257
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
- }
258
+ if ( NULL == ( node = ( orte_node_t * ) opal_pointer_array_get_item ( orte_node_pool , i )) ) {
259
+ continue ;
260
+ }
261
+ OPAL_LIST_FOREACH_SAFE ( nptr , next , & nodes , orte_node_t ) {
263
262
if (0 != strcmp (node -> name , nptr -> name )) {
264
263
OPAL_OUTPUT_VERBOSE ((10 , orte_rmaps_base_framework .framework_output ,
265
264
"NODE %s DOESNT MATCH NODE %s" ,
@@ -332,8 +331,9 @@ int orte_rmaps_base_get_target_nodes(opal_list_t *allocated_nodes, orte_std_cntr
332
331
/* reset us back to the end for the next node */
333
332
nd = (orte_node_t * )opal_list_get_last (allocated_nodes );
334
333
}
334
+ opal_list_remove_item (& nodes , (opal_list_item_t * )nptr );
335
+ OBJ_RELEASE (nptr );
335
336
}
336
- OBJ_RELEASE (nptr );
337
337
}
338
338
OBJ_DESTRUCT (& nodes );
339
339
/* now prune for usage and compute total slots */
0 commit comments