From 5ba62469a05be6978b07106dbc4a39302ca772bb Mon Sep 17 00:00:00 2001 From: Aurelien Bouteiller Date: Mon, 5 May 2008 19:12:41 +0000 Subject: [PATCH] Add a route_is_defined implementation for the linear oob routing. This commit was SVN r18375. --- orte/mca/routed/linear/routed_linear.c | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/orte/mca/routed/linear/routed_linear.c b/orte/mca/routed/linear/routed_linear.c index bd46c34792..8fdb46bf2b 100644 --- a/orte/mca/routed/linear/routed_linear.c +++ b/orte/mca/routed/linear/routed_linear.c @@ -578,11 +578,29 @@ static int route_lost(const orte_process_name_t *route) } - -/******* stub functions - to be implemented ******/ static bool route_is_defined(const orte_process_name_t *target) { - return true; + orte_process_name_t *ret; + int rc; + + /* if it is me, then the route is just direct */ + if (OPAL_EQUAL == opal_dss.compare(ORTE_PROC_MY_NAME, target, ORTE_NAME)) + return true; + + /* check exact matches */ + rc = opal_hash_table_get_value_uint64(&peer_list, + orte_util_hash_name(target), (void**)&ret); + if (ORTE_SUCCESS == rc) { + return true; + } + /* didn't find an exact match - check to see if a route for this job was defined */ + rc = opal_hash_table_get_value_uint32(&vpid_wildcard_list, + target->jobid, (void**)&ret); + if (ORTE_SUCCESS == rc) { + return true; + } + + return false; } static int update_routing_tree(void)