From 9bedb25ddae668fce3700704a0cbe910b3f312b6 Mon Sep 17 00:00:00 2001 From: Ralph Castain Date: Tue, 29 May 2012 20:11:51 +0000 Subject: [PATCH] Cleanup some compiler warnings, some of which are actual logic errors This commit was SVN r26519. --- opal/mca/hwloc/base/hwloc_base_util.c | 2 +- orte/mca/plm/slurm/plm_slurm_module.c | 2 +- orte/mca/rmaps/resilient/rmaps_resilient.c | 2 +- orte/mca/rmaps/round_robin/rmaps_rr_mappers.c | 2 +- orte/util/nidmap.c | 10 +++++----- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/opal/mca/hwloc/base/hwloc_base_util.c b/opal/mca/hwloc/base/hwloc_base_util.c index 628a3a8ea6..0e952179ec 100644 --- a/opal/mca/hwloc/base/hwloc_base_util.c +++ b/opal/mca/hwloc/base/hwloc_base_util.c @@ -1047,7 +1047,7 @@ int opal_hwloc_base_slot_list_parse(const char *slot_str, static opal_hwloc_locality_t get_locality(opal_hwloc_level_t level) { - opal_hwloc_locality_t lvl; + opal_hwloc_locality_t lvl = OPAL_PROC_LOCALITY_UNKNOWN; switch(level) { case OPAL_HWLOC_NODE_LEVEL: diff --git a/orte/mca/plm/slurm/plm_slurm_module.c b/orte/mca/plm/slurm/plm_slurm_module.c index e482036c97..021c7a9c91 100644 --- a/orte/mca/plm/slurm/plm_slurm_module.c +++ b/orte/mca/plm/slurm/plm_slurm_module.c @@ -442,7 +442,7 @@ static void launch_daemons(int fd, short args, void *cbdata) */ static int plm_slurm_terminate_orteds(void) { - int rc; + int rc=ORTE_SUCCESS; orte_job_t *jdata; /* check to see if the primary pid is set. If not, this indicates diff --git a/orte/mca/rmaps/resilient/rmaps_resilient.c b/orte/mca/rmaps/resilient/rmaps_resilient.c index 92b8ac67b7..72bfd94e54 100644 --- a/orte/mca/rmaps/resilient/rmaps_resilient.c +++ b/orte/mca/rmaps/resilient/rmaps_resilient.c @@ -824,7 +824,7 @@ static int map_to_ftgrps(orte_job_t *jdata) (NULL == target) ? -1 : target->ftgrp, nd->name)); /* if the node isn't in the map, add it */ if (!nd->mapped) { - OBJ_RETAIN(node); + OBJ_RETAIN(nd); opal_pointer_array_add(map->nodes, nd); nd->mapped = true; } diff --git a/orte/mca/rmaps/round_robin/rmaps_rr_mappers.c b/orte/mca/rmaps/round_robin/rmaps_rr_mappers.c index f10d870d11..64140f4477 100644 --- a/orte/mca/rmaps/round_robin/rmaps_rr_mappers.c +++ b/orte/mca/rmaps/round_robin/rmaps_rr_mappers.c @@ -666,7 +666,7 @@ static int byobj_span(orte_job_t *jdata, * safely remove this node as we don't need it */ if (0 == extra_procs_to_assign) { - opal_pointer_array_set_item(jdata->map->nodes, idx, NULL); + opal_pointer_array_set_item(jdata->map->nodes, node->index, NULL); OBJ_RELEASE(node); --(jdata->map->num_nodes); /* update how many we are lagging behind */ diff --git a/orte/util/nidmap.c b/orte/util/nidmap.c index f905cbb8fa..173877f643 100644 --- a/orte/util/nidmap.c +++ b/orte/util/nidmap.c @@ -1252,6 +1252,11 @@ int orte_util_decode_daemon_pidmap(opal_byte_object_t *bo) proc->name.vpid = i; opal_pointer_array_set_item(jdata->procs, i, proc); } + if (NULL == (node = (orte_node_t*)opal_pointer_array_get_item(orte_node_pool, nodes[i]))) { + /* this should never happen, but protect ourselves anyway */ + node = OBJ_NEW(orte_node_t); + opal_pointer_array_set_item(orte_node_pool, nodes[i], node); + } if (NULL != proc->node) { if (node != proc->node) { /* proc has moved - cleanup the prior node proc array */ @@ -1285,11 +1290,6 @@ int orte_util_decode_daemon_pidmap(opal_byte_object_t *bo) } OBJ_RELEASE(proc->node); } - if (NULL == (node = (orte_node_t*)opal_pointer_array_get_item(orte_node_pool, nodes[i]))) { - /* this should never happen, but protect ourselves anyway */ - node = OBJ_NEW(orte_node_t); - opal_pointer_array_set_item(orte_node_pool, nodes[i], node); - } /* see if this node is already in the map */ found = false; for (j=0; j < map->nodes->size; j++) {