From 2ae30fe1269964f364745673204901f15c37479a Mon Sep 17 00:00:00 2001 From: Aurelien Bouteiller Date: Mon, 5 May 2008 18:23:26 +0000 Subject: [PATCH] Implementation of the route_is_defined stub for direct oob routing. This commit was SVN r18373. --- orte/mca/routed/direct/routed_direct.c | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/orte/mca/routed/direct/routed_direct.c b/orte/mca/routed/direct/routed_direct.c index 1792fd4fb0..13179876bd 100644 --- a/orte/mca/routed/direct/routed_direct.c +++ b/orte/mca/routed/direct/routed_direct.c @@ -583,10 +583,30 @@ 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, lookup; + int rc; + + if (ORTE_JOB_FAMILY(target->jobid) == ORTE_JOB_FAMILY(ORTE_PROC_MY_NAME->jobid)) + /* we always have a route to our own job */ + return true; + else { + rc = opal_hash_table_get_value_uint64(&peer_list, orte_util_hash_name(target), + (void**)&ret); + if (ORTE_SUCCESS == rc) { + return true; + } + /* check to see if we specified the route to be for all vpids in the job */ + lookup = *target; + lookup.vpid = ORTE_VPID_WILDCARD; + rc = opal_hash_table_get_value_uint64(&peer_list, orte_util_hash_name(&lookup), + (void**)&ret); + if (ORTE_SUCCESS == rc) { + return true; + } + } + return false; } static int update_routing_tree(void)