1
1

usnic: only setup the connectivity checker if we have modules

If we ended up with no modules (e.g., all usnic devices were
excluded), there was a race condition in that the connectivity agent
could tear down its local socket before one or more of the local
clients saw it.  Therefore, the local clients would timeout waiting
for the socket to appear.

So move the connectivity checker init later in the bootstrapping
process (it *must* be setup before module_init()), and have it only
invoked if we actually ended up with one or more modules.
Этот коммит содержится в:
Jeff Squyres 2015-03-10 07:41:28 -07:00
родитель 06accb721c
Коммит afec1454f5

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

@ -662,14 +662,6 @@ static mca_btl_base_module_t** usnic_component_init(int* num_btl_modules,
opal_output_verbose(5, USNIC_OUT,
"btl:usnic: usNIC fabrics found");
/* Setup the connectivity checking agent and client. */
if (mca_btl_usnic_component.connectivity_enabled) {
if (OPAL_SUCCESS != opal_btl_usnic_connectivity_agent_init() ||
OPAL_SUCCESS != opal_btl_usnic_connectivity_client_init()) {
return NULL;
}
}
/* libnl initialization */
opal_proc_t *me = opal_proc_local_get();
opal_process_name_t *name = &(me->proc_name);
@ -863,6 +855,16 @@ static mca_btl_base_module_t** usnic_component_init(int* num_btl_modules,
filter = NULL;
}
/* If we actually have some modules, setup the connectivity
checking agent and client. */
if (mca_btl_usnic_component.num_modules > 0 &&
mca_btl_usnic_component.connectivity_enabled) {
if (OPAL_SUCCESS != opal_btl_usnic_connectivity_agent_init() ||
OPAL_SUCCESS != opal_btl_usnic_connectivity_client_init()) {
return NULL;
}
}
/* Now that we know how many modules there are, let the modules
initialize themselves (it's useful to know how many modules
there are before doing this). */