From d3ed4e68b79217598150e48fc6cc8b10ebb38d35 Mon Sep 17 00:00:00 2001 From: Ralph Castain Date: Sat, 10 Apr 2010 05:02:47 +0000 Subject: [PATCH] Utilize a non-used mapping policy bit to define a policy that uses only existing alive daemons to support virtual machines and restarting processes on already-active nodes This commit was SVN r22951. --- orte/mca/rmaps/base/rmaps_base_support_fns.c | 23 ++++++++++++++++++++ orte/runtime/orte_globals.h | 2 +- 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/orte/mca/rmaps/base/rmaps_base_support_fns.c b/orte/mca/rmaps/base/rmaps_base_support_fns.c index 957b0c0202..21d04a6249 100644 --- a/orte/mca/rmaps/base/rmaps_base_support_fns.c +++ b/orte/mca/rmaps/base/rmaps_base_support_fns.c @@ -230,6 +230,29 @@ int orte_rmaps_base_get_target_nodes(opal_list_t *allocated_nodes, orte_std_cntr return ORTE_SUCCESS; } + /* if we are mapping an application, check to see if we are to + * use a virtual machine + */ + if (policy & ORTE_MAPPING_USE_VM) { + /* remove all nodes that do NOT have an "alive" daemon on them */ + item = opal_list_get_first(allocated_nodes); + while (item != opal_list_get_end(allocated_nodes)) { + + /** save the next pointer in case we remove this node */ + next = opal_list_get_next(item); + + /** already have a daemon? */ + node = (orte_node_t*)item; + if (NULL == node->daemon || NULL == node->daemon->rml_uri) { + opal_list_remove_item(allocated_nodes, item); + OBJ_RELEASE(item); /* "un-retain" it */ + } + + /** go on to next item */ + item = next; + } + } + /* remove all nodes that are already at max usage, and * compute the total number of allocated slots while * we do so diff --git a/orte/runtime/orte_globals.h b/orte/runtime/orte_globals.h index 1886490b41..ece7899872 100644 --- a/orte/runtime/orte_globals.h +++ b/orte/runtime/orte_globals.h @@ -290,7 +290,7 @@ typedef uint8_t orte_job_controls_t; #define ORTE_MAPPING_POLICY OPAL_UINT16 /* put the rank assignment method in the upper 8 bits */ -#define ORTE_MAPPING_NOPOL 0x0100 +#define ORTE_MAPPING_USE_VM 0x0100 #define ORTE_MAPPING_BYNODE 0x0200 #define ORTE_MAPPING_BYSLOT 0x0400 #define ORTE_MAPPING_BYSOCKET 0x0800