1
1

Ensure we don't go through rml open/select more than once.

Open the rml to get the uri when bootstrapping daemons

This commit was SVN r22538.
Этот коммит содержится в:
Ralph Castain 2010-02-03 15:38:32 +00:00
родитель cb1007b5a9
Коммит e88627a7ca
2 изменённых файлов: 38 добавлений и 2 удалений

Просмотреть файл

@ -34,6 +34,8 @@
#include "orte/mca/errmgr/errmgr.h" #include "orte/mca/errmgr/errmgr.h"
#include "orte/mca/odls/odls_types.h" #include "orte/mca/odls/odls_types.h"
#include "orte/mca/plm/base/base.h" #include "orte/mca/plm/base/base.h"
#include "orte/mca/rml/base/base.h"
#include "orte/mca/rml/rml.h"
#include "orte/util/show_help.h" #include "orte/util/show_help.h"
#include "orte/util/proc_info.h" #include "orte/util/proc_info.h"
#include "orte/util/name_fns.h" #include "orte/util/name_fns.h"
@ -95,6 +97,20 @@ static int rte_init(void)
* use the multicast system to find it * use the multicast system to find it
*/ */
if (NULL == orte_process_info.my_hnp_uri) { if (NULL == orte_process_info.my_hnp_uri) {
/* Runtime Messaging Layer - this opens/selects the OOB as well
* so we can get our url
*/
if (ORTE_SUCCESS != (ret = orte_rml_base_open())) {
ORTE_ERROR_LOG(ret);
error = "orte_rml_base_open";
goto error;
}
if (ORTE_SUCCESS != (ret = orte_rml_base_select())) {
ORTE_ERROR_LOG(ret);
error = "orte_rml_base_select";
goto error;
}
/* open the reliable multicast framework */ /* open the reliable multicast framework */
if (ORTE_SUCCESS != (ret = orte_rmcast_base_open())) { if (ORTE_SUCCESS != (ret = orte_rmcast_base_open())) {
ORTE_ERROR_LOG(ret); ORTE_ERROR_LOG(ret);
@ -499,6 +515,7 @@ static int cm_set_name(void)
opal_list_item_t *item; opal_list_item_t *item;
opal_sysinfo_value_t *info; opal_sysinfo_value_t *info;
int32_t num_values; int32_t num_values;
char *rml_uri;
/* setup the query */ /* setup the query */
OBJ_CONSTRUCT(&buf, opal_buffer_t); OBJ_CONSTRUCT(&buf, opal_buffer_t);
@ -517,8 +534,8 @@ static int cm_set_name(void)
/* always include our node name */ /* always include our node name */
opal_dss.pack(&buf, &orte_process_info.nodename, 1, OPAL_STRING); opal_dss.pack(&buf, &orte_process_info.nodename, 1, OPAL_STRING);
/* get our local resources */
if (ORTE_PROC_IS_DAEMON) { if (ORTE_PROC_IS_DAEMON) {
/* get our local resources */
OBJ_CONSTRUCT(&resources, opal_list_t); OBJ_CONSTRUCT(&resources, opal_list_t);
opal_sysinfo.query(keys, &resources); opal_sysinfo.query(keys, &resources);
/* add number of values to the buffer */ /* add number of values to the buffer */
@ -541,6 +558,13 @@ static int cm_set_name(void)
OBJ_RELEASE(info); OBJ_RELEASE(info);
} }
OBJ_DESTRUCT(&resources); OBJ_DESTRUCT(&resources);
/* get and send our url */
if (NULL == (rml_uri = orte_rml.get_contact_info())) {
ORTE_ERROR_LOG(ORTE_ERR_NOT_FOUND);
return ORTE_ERR_NOT_FOUND;
}
opal_dss.pack(&buf, &rml_uri, 1, OPAL_STRING);
free(rml_uri);
} }
/* set the recv to get the answer */ /* set the recv to get the answer */

Просмотреть файл

@ -57,6 +57,8 @@ opal_list_t orte_rml_base_components;
orte_rml_component_t *orte_rml_component = NULL; orte_rml_component_t *orte_rml_component = NULL;
static bool component_open_called = false; static bool component_open_called = false;
static bool opened = false;
static bool selected = false;
/* instantiate the msg_pkt object */ /* instantiate the msg_pkt object */
static void msg_pkt_constructor(orte_msg_packet_t *pkt) static void msg_pkt_constructor(orte_msg_packet_t *pkt)
@ -83,6 +85,11 @@ orte_rml_base_open(void)
{ {
int ret; int ret;
if (opened) {
return ORTE_SUCCESS;
}
opened = true;
/* Initialize globals */ /* Initialize globals */
OBJ_CONSTRUCT(&orte_rml_base_components, opal_list_t); OBJ_CONSTRUCT(&orte_rml_base_components, opal_list_t);
OBJ_CONSTRUCT(&orte_rml_base_subscriptions, opal_list_t); OBJ_CONSTRUCT(&orte_rml_base_subscriptions, opal_list_t);
@ -127,6 +134,11 @@ orte_rml_base_select(void)
orte_rml_module_t *wrapper_module = NULL; orte_rml_module_t *wrapper_module = NULL;
char *rml_wrapper = NULL; char *rml_wrapper = NULL;
if (selected) {
return ORTE_SUCCESS;
}
selected = true;
mca_base_param_reg_string_name("rml", "wrapper", mca_base_param_reg_string_name("rml", "wrapper",
"Use a Wrapper component around the selected RML component", "Use a Wrapper component around the selected RML component",
false, false, false, false,