From 1ba8bbe1a91e9b2452a14d4ec96eb06d8209c6aa Mon Sep 17 00:00:00 2001 From: Ralph Castain Date: Mon, 26 Jul 2010 15:09:57 +0000 Subject: [PATCH] Don't require the existence of a multicast interface if --enable-multicast wasn't specified. This commit was SVN r23494. --- orte/mca/rmcast/base/rmcast_base_open.c | 44 ++++++++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-) diff --git a/orte/mca/rmcast/base/rmcast_base_open.c b/orte/mca/rmcast/base/rmcast_base_open.c index 073c9ae85c..bdfac58c4f 100644 --- a/orte/mca/rmcast/base/rmcast_base_open.c +++ b/orte/mca/rmcast/base/rmcast_base_open.c @@ -82,10 +82,12 @@ orte_rmcast_module_t orte_rmcast = { orte_rmcast_base_t orte_rmcast_base; static bool opened=false; + /** * Function for finding and opening either all MCA components, or the one * that was specifically requested via a MCA parameter. */ +#if ORTE_ENABLE_MULTICAST int orte_rmcast_base_open(void) { int value, pval, i; @@ -282,7 +284,7 @@ int orte_rmcast_base_open(void) /* Debugging / verbose output. Always have stream open, with verbose set by the mca open system... */ orte_rmcast_base.rmcast_output = opal_output_open(NULL); - + /* Open up all available components */ if (ORTE_SUCCESS != mca_base_components_open("rmcast", orte_rmcast_base.rmcast_output, @@ -294,7 +296,47 @@ int orte_rmcast_base_open(void) /* All done */ return ORTE_SUCCESS; } +#else +int orte_rmcast_base_open(void) +{ + int i; + + if (opened) { + /* ensure we don't go through here twice */ + return ORTE_SUCCESS; + } + opened = true; + orte_rmcast_base.opened = true; + + /* ensure all global values are initialized */ + OBJ_CONSTRUCT(&orte_rmcast_base.lock, opal_mutex_t); + OBJ_CONSTRUCT(&orte_rmcast_base.cond, opal_condition_t); + orte_rmcast_base.active = false; + OBJ_CONSTRUCT(&orte_rmcast_base.recvs, opal_list_t); + OBJ_CONSTRUCT(&orte_rmcast_base.channels, opal_list_t); + orte_rmcast_base.xmit_network = 0; + orte_rmcast_base.my_group_name = NULL; + orte_rmcast_base.my_group_number = 0; + orte_rmcast_base.interface = 0; + for (i=0; i < 255; i++) { + orte_rmcast_base.ports[i] = 0; + } + orte_rmcast_base.my_output_channel = NULL; + orte_rmcast_base.my_input_channel = NULL; + + /* Open up all available components */ + if (ORTE_SUCCESS != + mca_base_components_open("rmcast", orte_rmcast_base.rmcast_output, + mca_rmcast_base_static_components, + &orte_rmcast_base.rmcast_opened, true)) { + return ORTE_ERROR; + } + + /* All done */ + return ORTE_SUCCESS; +} +#endif /**** CLASS INSTANCES ****/ static void mcast_event_constructor(orte_mcast_msg_event_t *ev)