Skip to content

Commit

Permalink
Silence warnings
Browse files Browse the repository at this point in the history
Signed-off-by: Ralph Castain <rhc@open-mpi.org>
  • Loading branch information
Ralph Castain committed Feb 3, 2018
1 parent 1adf087 commit 73ef976
Showing 1 changed file with 12 additions and 21 deletions.
33 changes: 12 additions & 21 deletions orte/mca/rmaps/base/rmaps_base_support_fns.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* Copyright (c) 2011 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2011-2012 Los Alamos National Security, LLC.
* All rights reserved.
* Copyright (c) 2014-2017 Intel, Inc. All rights reserved.
* Copyright (c) 2014-2018 Intel, Inc. All rights reserved.
* Copyright (c) 2016 IBM Corporation. All rights reserved.
* $COPYRIGHT$
*
Expand Down Expand Up @@ -140,8 +140,8 @@ int orte_rmaps_base_get_target_nodes(opal_list_t *allocated_nodes, orte_std_cntr
orte_app_context_t *app, orte_mapping_policy_t policy,
bool initial_map, bool silent)
{
opal_list_item_t *item, *next;
orte_node_t *node, *nd, *nptr;
opal_list_item_t *item;
orte_node_t *node, *nd, *nptr, *next;
orte_std_cntr_t num_slots;
orte_std_cntr_t i;
int rc;
Expand Down Expand Up @@ -470,17 +470,13 @@ int orte_rmaps_base_get_target_nodes(opal_list_t *allocated_nodes, orte_std_cntr
num_slots = opal_list_get_size(allocated_nodes); // tell the mapper there is one slot/node for debuggers
} else {
item = opal_list_get_first(allocated_nodes);
while (item != opal_list_get_end(allocated_nodes)) {
node = (orte_node_t*)item;
/** save the next pointer in case we remove this node */
next = opal_list_get_next(item);
OPAL_LIST_FOREACH_SAFE(node, next, allocated_nodes, orte_node_t) {
/* if the hnp was not allocated, or flagged not to be used,
* then remove it here */
if (!orte_hnp_is_allocated || (ORTE_GET_MAPPING_DIRECTIVE(policy) & ORTE_MAPPING_NO_USE_LOCAL)) {
if (0 == node->index) {
opal_list_remove_item(allocated_nodes, item);
OBJ_RELEASE(item); /* "un-retain" it */
item = next;
opal_list_remove_item(allocated_nodes, &node->super);
OBJ_RELEASE(node); /* "un-retain" it */
continue;
}
}
Expand All @@ -490,9 +486,8 @@ int orte_rmaps_base_get_target_nodes(opal_list_t *allocated_nodes, orte_std_cntr
"%s Removing node %s: max %d inuse %d",
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),
node->name, node->slots_max, node->slots_inuse));
opal_list_remove_item(allocated_nodes, item);
OBJ_RELEASE(item); /* "un-retain" it */
item = next;
opal_list_remove_item(allocated_nodes, &node->super);
OBJ_RELEASE(node); /* "un-retain" it */
continue;
}
if (node->slots <= node->slots_inuse &&
Expand All @@ -502,9 +497,8 @@ int orte_rmaps_base_get_target_nodes(opal_list_t *allocated_nodes, orte_std_cntr
"%s Removing node %s slots %d inuse %d",
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),
node->name, node->slots, node->slots_inuse));
opal_list_remove_item(allocated_nodes, item);
OBJ_RELEASE(item); /* "un-retain" it */
item = next;
opal_list_remove_item(allocated_nodes, &node->super);
OBJ_RELEASE(node); /* "un-retain" it */
continue;
}
if (node->slots > node->slots_inuse) {
Expand All @@ -514,7 +508,6 @@ int orte_rmaps_base_get_target_nodes(opal_list_t *allocated_nodes, orte_std_cntr
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),
node->name, node->slots - node->slots_inuse));
num_slots += node->slots - node->slots_inuse;
item = next;
continue;
}
if (!(ORTE_MAPPING_NO_OVERSUBSCRIBE & ORTE_GET_MAPPING_DIRECTIVE(policy))) {
Expand All @@ -528,11 +521,9 @@ int orte_rmaps_base_get_target_nodes(opal_list_t *allocated_nodes, orte_std_cntr
node->name));
} else {
/* if we cannot use it, remove it from list */
opal_list_remove_item(allocated_nodes, item);
OBJ_RELEASE(item); /* "un-retain" it */
opal_list_remove_item(allocated_nodes, &node->super);
OBJ_RELEASE(node); /* "un-retain" it */
}
/** go on to next item */
item = next;
}
}

Expand Down

0 comments on commit 73ef976

Please sign in to comment.