From 0f08e87a1f38614eae7894d5286e32831eeeb9b0 Mon Sep 17 00:00:00 2001 From: Josh Hursey Date: Wed, 12 Oct 2005 02:09:56 +0000 Subject: [PATCH] Fixed a max_slots off by one problem that Brian highlighted. Also cleaned up the error message when allocating over the number of slots available. This commit was SVN r7715. --- orte/mca/rmaps/round_robin/help-orte-rmaps-rr.txt | 4 +++- orte/mca/rmaps/round_robin/rmaps_rr.c | 8 ++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/orte/mca/rmaps/round_robin/help-orte-rmaps-rr.txt b/orte/mca/rmaps/round_robin/help-orte-rmaps-rr.txt index c8dc0a094b..8bb67db6ae 100644 --- a/orte/mca/rmaps/round_robin/help-orte-rmaps-rr.txt +++ b/orte/mca/rmaps/round_robin/help-orte-rmaps-rr.txt @@ -17,7 +17,9 @@ # This is the US/English general help file for Open RTE's orterun. # [orte-rmaps-rr:alloc-error] -%d slots were requested, but only %d slots were available. +There are not enough slots available in the system to satisfy the %d slots +that were requested by the application: + %s Either request fewer slots for your application, or make more slots available for use. diff --git a/orte/mca/rmaps/round_robin/rmaps_rr.c b/orte/mca/rmaps/round_robin/rmaps_rr.c index 36ee490ba3..b01d563690 100644 --- a/orte/mca/rmaps/round_robin/rmaps_rr.c +++ b/orte/mca/rmaps/round_robin/rmaps_rr.c @@ -237,12 +237,12 @@ static int map_app_by_node( /* Remove this node if it has reached its max number of allocatable slots */ if( 0 != node->node_slots_max && - node->node_slots_inuse >= node->node_slots_max) { + node->node_slots_inuse > node->node_slots_max) { opal_list_remove_item(nodes, (opal_list_item_t*)node); if(0 >= opal_list_get_size(nodes) ) { /* No more nodes to allocate :( */ opal_show_help("help-orte-rmaps-rr.txt", "orte-rmaps-rr:alloc-error", - true, num_alloc, app->num_procs); + true, app->num_procs, app->app); rc = ORTE_ERR_OUT_OF_RESOURCE; goto cleanup; } @@ -339,12 +339,12 @@ static int map_app_by_slot( /* If this node has reached its max number of slots, * take it out of the list, and skip it */ else if( 0 != node->node_slots_max && - node->node_slots_inuse >= node->node_slots_max){ + node->node_slots_inuse > node->node_slots_max){ opal_list_remove_item(nodes, (opal_list_item_t*)node); if( 0 >= opal_list_get_size(nodes) ) { /* No more nodes to allocate */ opal_show_help("help-orte-rmaps-rr.txt", "orte-rmaps-rr:alloc-error", - true, num_alloc, app->num_procs); + true, app->num_procs, app->app); rc = ORTE_ERR_OUT_OF_RESOURCE; goto cleanup; }