diff --git a/orte/mca/plm/rsh/plm_rsh_module.c b/orte/mca/plm/rsh/plm_rsh_module.c index 03060e06f7..b3ed48859d 100644 --- a/orte/mca/plm/rsh/plm_rsh_module.c +++ b/orte/mca/plm/rsh/plm_rsh_module.c @@ -764,12 +764,11 @@ static int construct_daemonmap(opal_buffer_t *data) ORTE_ERROR_LOG(rc); return rc; } - /* unpack the nodemap */ + /* unpack the nodemap - this will free the bytes in bo */ if (ORTE_SUCCESS != (rc = orte_util_decode_nodemap(bo, &orte_daemonmap))) { ORTE_ERROR_LOG(rc); return rc; } - free(bo->bytes); return ORTE_SUCCESS; } diff --git a/orte/mca/rmaps/round_robin/rmaps_rr.c b/orte/mca/rmaps/round_robin/rmaps_rr.c index d4252292db..61f35101a1 100644 --- a/orte/mca/rmaps/round_robin/rmaps_rr.c +++ b/orte/mca/rmaps/round_robin/rmaps_rr.c @@ -229,11 +229,15 @@ static int map_app_by_slot( /* Update the number of procs allocated */ ++num_alloc; - /** if all the procs have been mapped OR we have fully used up this node + /** if all the procs have been mapped, we return */ + if (num_alloc == app->num_procs) { + return ORTE_SUCCESS; + } + + /* if we have fully used up this node * OR we are at our ppn and loadbalancing, then break from the loop */ - if (num_alloc == app->num_procs || - ORTE_ERR_NODE_FULLY_USED == rc || + if (ORTE_ERR_NODE_FULLY_USED == rc || (orte_rmaps_base.loadbalance && i == ppn)) { break; } @@ -246,7 +250,7 @@ static int map_app_by_slot( */ if (i < (num_slots_to_take-1) && ORTE_ERR_NODE_FULLY_USED != rc && - i != ppn) { + (orte_rmaps_base.loadbalance && i != ppn)) { continue; } cur_node_item = next;