Cleanup various leaks in ompi_info reported by valgrind.
cmr=v1.7.4:reviewer=jsquyres This commit was SVN r30058.
Этот коммит содержится в:
родитель
f329f170e4
Коммит
3be4536d9b
@ -302,6 +302,7 @@ struct mca_btl_openib_component_t {
|
||||
int gid_index;
|
||||
/** Whether we want a dynamically resizing srq, enabled by default */
|
||||
bool enable_srq_resize;
|
||||
int memory_registration_verbose_level;
|
||||
int memory_registration_verbose;
|
||||
#if BTL_OPENIB_FAILOVER_ENABLED
|
||||
int verbose_failover;
|
||||
|
@ -228,6 +228,7 @@ static int btl_openib_component_open(void)
|
||||
|
||||
/* initialize objects */
|
||||
OBJ_CONSTRUCT(&mca_btl_openib_component.ib_procs, opal_list_t);
|
||||
mca_btl_openib_component.memory_registration_verbose = -1;
|
||||
|
||||
srand48(getpid() * time(NULL));
|
||||
return OMPI_SUCCESS;
|
||||
@ -284,6 +285,9 @@ static int btl_openib_component_close(void)
|
||||
}
|
||||
#endif
|
||||
|
||||
/* close memory registration debugging output */
|
||||
opal_output_close (mca_btl_openib_component.memory_registration_verbose);
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
@ -2978,6 +2982,10 @@ btl_openib_component_init(int *num_btl_modules,
|
||||
mca_btl_openib_component.if_exclude_list = NULL;
|
||||
}
|
||||
|
||||
mca_btl_openib_component.memory_registration_verbose = opal_output_open(NULL);
|
||||
opal_output_set_verbosity (mca_btl_openib_component.memory_registration_verbose,
|
||||
mca_btl_openib_component.memory_registration_verbose_level);
|
||||
|
||||
/* setup the fork warning message as we are sensitive
|
||||
* to memory corruption issues when fork is called
|
||||
*/
|
||||
|
@ -534,9 +534,8 @@ int btl_openib_register_mca_params(void)
|
||||
/* Help debug memory registration issues */
|
||||
CHECK(reg_int("memory_registration_verbose", NULL,
|
||||
"Output some verbose memory registration information "
|
||||
"(0 = no output, nonzero = output)", 0, &tmp1, 0));
|
||||
mca_btl_openib_component.memory_registration_verbose = opal_output_open(NULL);
|
||||
opal_output_set_verbosity(mca_btl_openib_component.memory_registration_verbose, tmp1);
|
||||
"(0 = no output, nonzero = output)", 0,
|
||||
&mca_btl_openib_component.memory_registration_verbose_level, 0));
|
||||
|
||||
/* Info only */
|
||||
tmp = mca_base_component_var_register(&mca_btl_openib_component.super.btl_version,
|
||||
@ -654,12 +653,7 @@ int btl_openib_register_mca_params(void)
|
||||
(uint32_t)mca_btl_openib_module.super.btl_eager_limit,
|
||||
(uint32_t)mca_btl_openib_module.super.btl_max_send_size);
|
||||
|
||||
mca_btl_openib_component.default_recv_qps = strdup(default_qps);
|
||||
if(NULL == mca_btl_openib_component.default_recv_qps) {
|
||||
BTL_ERROR(("Unable to allocate memory for default receive queues string.\n"));
|
||||
return OMPI_ERROR;
|
||||
}
|
||||
|
||||
mca_btl_openib_component.default_recv_qps = default_qps;
|
||||
CHECK(reg_string("receive_queues", NULL,
|
||||
"Colon-delimited, comma-delimited list of receive queues: P,4096,8,6,4:P,32768,8,6,4",
|
||||
default_qps, &mca_btl_openib_component.receive_queues,
|
||||
|
@ -59,7 +59,9 @@ static ompi_btl_openib_connect_base_component_t *all[] = {
|
||||
|
||||
NULL
|
||||
};
|
||||
static ompi_btl_openib_connect_base_component_t **available = NULL;
|
||||
|
||||
/* increase this count if any more cpcs are added */
|
||||
static ompi_btl_openib_connect_base_component_t *available[5];
|
||||
static int num_available = 0;
|
||||
|
||||
static char *btl_openib_cpc_include;
|
||||
@ -108,11 +110,6 @@ int ompi_btl_openib_connect_base_register(void)
|
||||
|
||||
/* Parse the if_[in|ex]clude paramters to come up with a list of
|
||||
CPCs that are available */
|
||||
available = (ompi_btl_openib_connect_base_component_t **) calloc(1, sizeof(all));
|
||||
if (NULL == available) {
|
||||
return OMPI_ERR_OUT_OF_RESOURCE;
|
||||
}
|
||||
|
||||
/* If we have an "include" list, then find all those CPCs and put
|
||||
them in available[] */
|
||||
if (NULL != btl_openib_cpc_include) {
|
||||
@ -197,6 +194,7 @@ int ompi_btl_openib_connect_base_register(void)
|
||||
}
|
||||
}
|
||||
|
||||
free (all_cpc_names);
|
||||
return OMPI_SUCCESS;
|
||||
}
|
||||
|
||||
@ -511,13 +509,9 @@ void ompi_btl_openib_connect_base_finalize(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
if (NULL != available) {
|
||||
for (i = 0; NULL != available[i]; ++i) {
|
||||
if (NULL != available[i]->cbc_finalize) {
|
||||
available[i]->cbc_finalize();
|
||||
}
|
||||
for (i = 0 ; i < num_available ; ++i) {
|
||||
if (NULL != available[i]->cbc_finalize) {
|
||||
available[i]->cbc_finalize();
|
||||
}
|
||||
free(available);
|
||||
available = NULL;
|
||||
}
|
||||
}
|
||||
|
@ -225,6 +225,7 @@ int opal_info_init(int argc, char **argv,
|
||||
|
||||
void opal_info_finalize(void)
|
||||
{
|
||||
opal_info_close_components ();
|
||||
mca_base_close();
|
||||
opal_finalize_util();
|
||||
}
|
||||
|
@ -174,7 +174,7 @@ static int rsh_component_register(void)
|
||||
&mca_plm_rsh_component.no_tree_spawn);
|
||||
|
||||
/* local rsh/ssh launch agent */
|
||||
mca_plm_rsh_component.agent = strdup ("ssh : rsh");
|
||||
mca_plm_rsh_component.agent = "ssh : rsh";
|
||||
var_id = mca_base_component_var_register (c, "agent",
|
||||
"The command used to launch executables on remote nodes (typically either \"ssh\" or \"rsh\")",
|
||||
MCA_BASE_VAR_TYPE_STRING, NULL, 0, 0,
|
||||
|
@ -67,7 +67,7 @@ static int ras_sim_register(void)
|
||||
{
|
||||
mca_base_component_t *component = &mca_ras_simulator_component.super.base_version;
|
||||
|
||||
mca_ras_simulator_component.slots = strdup ("1");
|
||||
mca_ras_simulator_component.slots = "1";
|
||||
(void) mca_base_component_var_register (component, "slots",
|
||||
"Comma-separated list of number of slots on each node to simulate",
|
||||
MCA_BASE_VAR_TYPE_STRING, NULL, 0, 0,
|
||||
@ -75,7 +75,7 @@ static int ras_sim_register(void)
|
||||
MCA_BASE_VAR_SCOPE_READONLY,
|
||||
&mca_ras_simulator_component.slots);
|
||||
|
||||
mca_ras_simulator_component.slots_max = strdup ("0");
|
||||
mca_ras_simulator_component.slots_max = "0";
|
||||
(void) mca_base_component_var_register (component, "max_slots",
|
||||
"Comma-separated list of number of max slots on each node to simulate",
|
||||
MCA_BASE_VAR_TYPE_STRING, NULL, 0, 0,
|
||||
|
Загрузка…
Ссылка в новой задаче
Block a user