1
1

coll/ml: fix leaks

Thanks to ggouaillardet for finding and fixing these issues.

Closes trac:4460

cmr=v1.8.1:reviewer=manjugv

This commit was SVN r31264.

The following Trac tickets were found above:
  Ticket 4460 --> https://svn.open-mpi.org/trac/ompi/ticket/4460
This commit is contained in:
Nathan Hjelm 2014-03-27 23:25:31 +00:00
parent 595a6e94e6
commit bd3b550c6d
20 changed files with 451 additions and 13 deletions

View File

@ -3,8 +3,10 @@
* Copyright (c) 2009-2012 Oak Ridge National Laboratory. All rights reserved.
* Copyright (c) 2009-2012 Mellanox Technologies. All rights reserved.
* Copyright (c) 2013 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2013 Los Alamos National Security, LLC. All rights
* Copyright (c) 2013-2014 Los Alamos National Security, LLC. All rights
* reserved.
* Copyright (c) 2014 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -336,10 +338,22 @@ int mca_bcol_base_bcol_fns_table_init(struct mca_bcol_base_module_t *bcol_module
return OMPI_SUCCESS;
}
static void mca_bcol_base_coll_fn_desc_constructor(mca_bcol_base_coll_fn_desc_t *fn)
{
fn->comm_attr = NULL;
fn->inv_attr = NULL;
}
static void mca_bcol_base_coll_fn_desc_destructor(mca_bcol_base_coll_fn_desc_t *fn)
{
free(fn->comm_attr);
free(fn->inv_attr);
}
OBJ_CLASS_INSTANCE(mca_bcol_base_coll_fn_desc_t,
opal_list_item_t,
NULL,
NULL);
mca_bcol_base_coll_fn_desc_constructor,
mca_bcol_base_coll_fn_desc_destructor);
static void lmngr_block_constructor(mca_bcol_base_lmngr_block_t *item)
{

View File

@ -5,6 +5,8 @@
* Copyright (c) 2013-2014 Los Alamos National Security, LLC. All rights
* reserved.
* Copyright (c) 2014 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2014 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -1175,6 +1177,12 @@ int bcol_basesmuma_bank_init_opti(struct mca_bcol_base_memory_block_desc_t *payl
mca_bcol_base_module_t *bcol_module,
void *reg_data);
/* cleanup nb_coll_buff_desc */
void cleanup_nb_coll_buff_desc(mca_bcol_basesmuma_nb_coll_buff_desc_t **desc,
uint32_t num_banks,
uint32_t num_buffers_per_bank);
/* used for shared memory offset exchange */
int base_bcol_basesmuma_exchange_offsets(
mca_bcol_basesmuma_module_t *sm_bcol_module,

View File

@ -5,6 +5,8 @@
* Copyright (c) 2013-2014 Los Alamos National Security, LLC.
* All rights reserved.
* Copyright (c) 2014 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2014 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -210,6 +212,27 @@ static int init_nb_coll_buff_desc(mca_bcol_basesmuma_nb_coll_buff_desc_t **desc,
}
/*
* Free buffers for storing non-blocking collective descriptions.
*
*/
void cleanup_nb_coll_buff_desc(mca_bcol_basesmuma_nb_coll_buff_desc_t **desc,
uint32_t num_banks,
uint32_t num_buffers_per_bank)
{
uint32_t ci;
if (NULL != *desc) {
for (ci=0; ci<num_banks*num_buffers_per_bank; ci++) {
if (NULL != ((*desc)[ci]).requests) {
free(((*desc)[ci]).requests);
((*desc))[ci].requests = NULL;
}
}
free(*desc);
*desc = NULL;
}
}
#if 1
/* New init function used for new control scheme where we put the control

View File

@ -4,6 +4,8 @@
* Copyright (c) 2009-2012 Mellanox Technologies. All rights reserved.
* Copyright (c) 2012-2014 Los Alamos National Security, LLC. All rights
* reserved.
* Copyright (c) 2014 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -211,9 +213,40 @@ mca_bcol_basesmuma_module_destruct(mca_bcol_basesmuma_module_t *sm_module)
sm_module->super.list_n_connected = NULL;
}
cleanup_nb_coll_buff_desc(&sm_module->ml_mem.nb_coll_desc,
sm_module->ml_mem.num_banks,
sm_module->ml_mem.num_buffers_per_bank);
for (i = 0; i < BCOL_NUM_OF_FUNCTIONS; i++){
/* gvm FIX: Go through the list and destroy each item */
/* Destroy the function table object for each bcol type list */
OPAL_LIST_DESTRUCT((&sm_module->super.bcol_fns_table[i]));
}
if (NULL != sm_module->payload_backing_files_info) {
free(sm_module->payload_backing_files_info);
sm_module->payload_backing_files_info = NULL;
}
if (NULL != sm_module->ctl_backing_files_info) {
free(sm_module->ctl_backing_files_info);
sm_module->ctl_backing_files_info = NULL;
}
if (NULL != sm_module->ml_mem.bank_release_counter) {
free(sm_module->ml_mem.bank_release_counter);
sm_module->ml_mem.bank_release_counter = NULL;
}
if (NULL != sm_module->colls_with_user_data.data_buffs) {
free((void *)sm_module->colls_with_user_data.data_buffs);
sm_module->colls_with_user_data.data_buffs = NULL;
}
/* free the k-nomial allgather tree here */
netpatterns_cleanup_recursive_knomial_allgather_tree_node(&sm_module->knomial_allgather_tree);
netpatterns_cleanup_recursive_doubling_tree_node(&sm_module->recursive_doubling_tree);
netpatterns_cleanup_recursive_knomial_tree_node(&sm_module->knomial_exchange_tree);
/* done */
}

View File

@ -5,6 +5,8 @@
* Copyright (c) 2013-2014 Los Alamos National Security, LLC.
* All rights reserved.
* Copyright (c) 2014 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2014 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -554,6 +556,15 @@ int base_bcol_basesmuma_setup_library_buffers(
goto exit_ERROR;
}
/* FIXME base_bcol_basesmuma_setup_ctl_struct will allocate
* sm_bcol_module->shared_memory_scratch_space which was previously
* allocated by the previous call to base_bcol_basesmuma_setup_ctl_struct
* so let's free it in order to avoid a memory leak */
if (sm_bcol_module->shared_memory_scratch_space) {
free(sm_bcol_module->shared_memory_scratch_space);
sm_bcol_module->shared_memory_scratch_space = NULL;
}
ret=base_bcol_basesmuma_setup_ctl_struct(
sm_bcol_module, cs, &(sm_bcol_module->colls_with_user_data));
if( OMPI_SUCCESS != ret ) {

View File

@ -6,6 +6,8 @@
* Copyright (c) 2012-2014 Los Alamos National Security, LLC. All rights
* reserved.
* Copyright (c) 2014 Intel, Inc. All rights reserved.
* Copyright (c) 2014 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -185,6 +187,11 @@ int bcol_basesmuma_smcm_allgather_connection(
return OMPI_ERR_OUT_OF_RESOURCE;
}
/* FIXME *back_files might have been already allocated
* so free it in order to avoid a memory leak */
if (NULL != *back_files) {
free (*back_files);
}
*back_files = backing_files;
my_id = ompi_proc_local();

View File

@ -4,6 +4,8 @@
* Copyright (c) 2009-2012 Mellanox Technologies. All rights reserved.
* Copyright (c) 2012-2014 Los Alamos National Security, LLC. All rights
* reserved.
* Copyright (c) 2014 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -147,11 +149,37 @@ mca_bcol_ptpcoll_module_destruct(mca_bcol_ptpcoll_module_t *ptpcoll_module)
OBJ_DESTRUCT(&ptpcoll_module->collreqs_free);
if( NULL != ptpcoll_module->super.list_n_connected ){
if (NULL != ptpcoll_module->super.list_n_connected) {
free(ptpcoll_module->super.list_n_connected);
ptpcoll_module->super.list_n_connected = NULL;
}
for (i = 0; i < BCOL_NUM_OF_FUNCTIONS; i++){
OPAL_LIST_DESTRUCT((&ptpcoll_module->super.bcol_fns_table[i]));
}
if (NULL != ptpcoll_module->kn_proxy_extra_index) {
free(ptpcoll_module->kn_proxy_extra_index);
ptpcoll_module->kn_proxy_extra_index = NULL;
}
if (NULL != ptpcoll_module->alltoall_iovec) {
free(ptpcoll_module->alltoall_iovec);
ptpcoll_module->alltoall_iovec = NULL;
}
if (NULL != ptpcoll_module->narray_knomial_proxy_extra_index) {
free(ptpcoll_module->narray_knomial_proxy_extra_index);
ptpcoll_module->narray_knomial_proxy_extra_index = NULL;
}
if (NULL != ptpcoll_module->narray_knomial_node) {
free(ptpcoll_module->narray_knomial_node);
ptpcoll_module->narray_knomial_node = NULL;
}
netpatterns_cleanup_recursive_knomial_allgather_tree_node(&ptpcoll_module->knomial_allgather_tree);
netpatterns_cleanup_recursive_knomial_tree_node(&ptpcoll_module->knomial_exchange_tree);
}

View File

@ -4,6 +4,8 @@
* Copyright (c) 2009-2012 Mellanox Technologies. All rights reserved.
* Copyright (c) 2013 Los Alamos National Security, LLC. All rights
* reserved.
* Copyright (c) 2014 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -262,6 +264,7 @@ int ml_coll_hier_barrier_setup(struct mca_coll_ml_module_t *ml_module);
/* allreduce */
int ml_coll_hier_allreduce_setup(struct mca_coll_ml_module_t *ml_module);
int ml_coll_hier_allreduce_setup_new(struct mca_coll_ml_module_t *ml_module);
void ml_coll_hier_allreduce_cleanup_new(struct mca_coll_ml_module_t *ml_module);
/* alltoall */
int ml_coll_hier_alltoall_setup(struct mca_coll_ml_module_t *ml_module);
@ -269,15 +272,18 @@ int ml_coll_hier_alltoall_setup_new(struct mca_coll_ml_module_t *ml_module);
/* allgather */
int ml_coll_hier_allgather_setup(struct mca_coll_ml_module_t *ml_module);
void ml_coll_hier_allgather_cleanup(struct mca_coll_ml_module_t *ml_module);
/* gather */
int ml_coll_hier_gather_setup(struct mca_coll_ml_module_t *ml_module);
/* broadcast */
int ml_coll_hier_bcast_setup(struct mca_coll_ml_module_t *ml_module);
void ml_coll_hier_bcast_cleanup(struct mca_coll_ml_module_t *ml_module);
/* reduce */
int ml_coll_hier_reduce_setup(struct mca_coll_ml_module_t *ml_module);
void ml_coll_hier_reduce_cleanup(struct mca_coll_ml_module_t *ml_module);
/* reduce */
int ml_coll_hier_scatter_setup(struct mca_coll_ml_module_t *ml_module);

View File

@ -1,6 +1,11 @@
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
/*
* Copyright (c) 2009-2012 Oak Ridge National Laboratory. All rights reserved.
* Copyright (c) 2009-2012 Mellanox Technologies. All rights reserved.
* Copyright (c) 2014 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* Copyright (c) 2014 Los Alamos National Security, LLC. All rights
* reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -14,12 +19,15 @@
static inline void mca_coll_ml_fragment_constructor(mca_coll_ml_fragment_t *frag)
{
frag->fn_args = NULL;
}
static inline void mca_coll_ml_fragment_destructor(mca_coll_ml_fragment_t *frag)
{
if (frag->fn_args) {
free(frag->fn_args);
frag->fn_args = NULL;
}
}
static inline void mca_coll_ml_descriptor_constructor(mca_coll_ml_descriptor_t *descriptor)

View File

@ -4,6 +4,8 @@
* Copyright (c) 2009-2012 Mellanox Technologies. All rights reserved.
* Copyright (c) 2013 Los Alamos National Security, LLC. All rights
* reserved.
* Copyright (c) 2014 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -191,3 +193,36 @@ int ml_coll_hier_allgather_setup(mca_coll_ml_module_t *ml_module)
return OMPI_SUCCESS;
}
void ml_coll_hier_allgather_cleanup(mca_coll_ml_module_t *ml_module)
{
/* Hierarchy Setup */
int ret, topo_index, alg;
mca_coll_ml_topology_t *topo_info = ml_module->topo_list;
alg = mca_coll_ml_component.coll_config[ML_ALLGATHER][ML_SMALL_MSG].algorithm_id;
topo_index = ml_module->collectives_topology_map[ML_ALLGATHER][alg];
if (ML_UNDEFINED == alg || ML_UNDEFINED == topo_index) {
ML_ERROR(("No topology index or algorithm was defined"));
topo_info->hierarchical_algorithms[ML_ALLGATHER] = NULL;
return;
}
free(ml_module->coll_ml_allgather_functions[alg]->component_functions);
ml_module->coll_ml_allgather_functions[alg]->component_functions = NULL;
free(ml_module->coll_ml_allgather_functions[alg]);
ml_module->coll_ml_allgather_functions[alg] = NULL;
alg = mca_coll_ml_component.coll_config[ML_ALLGATHER][ML_LARGE_MSG].algorithm_id;
topo_index = ml_module->collectives_topology_map[ML_ALLGATHER][alg];
if (ML_UNDEFINED == alg || ML_UNDEFINED == topo_index) {
ML_ERROR(("No topology index or algorithm was defined"));
topo_info->hierarchical_algorithms[ML_ALLGATHER] = NULL;
return;
}
free(ml_module->coll_ml_allgather_functions[alg]->component_functions);
ml_module->coll_ml_allgather_functions[alg]->component_functions = NULL;
free(ml_module->coll_ml_allgather_functions[alg]);
ml_module->coll_ml_allgather_functions[alg] = NULL;
}

View File

@ -4,6 +4,8 @@
* Copyright (c) 2009-2012 Mellanox Technologies. All rights reserved.
* Copyright (c) 2014 Los Alamos National Security, LLC. All rights
* reserved.
* Copyright (c) 2014 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -363,3 +365,66 @@ int ml_coll_hier_allreduce_setup_new(mca_coll_ml_module_t *ml_module)
return OMPI_SUCCESS;
}
void ml_coll_hier_allreduce_cleanup_new(mca_coll_ml_module_t *ml_module)
{
/* Hierarchy Setup */
int ret;
int topo_index;
int alg;
mca_coll_ml_topology_t *topo_info = ml_module->topo_list;
alg = mca_coll_ml_component.coll_config[ML_ALLREDUCE][ML_SMALL_MSG].algorithm_id;
topo_index = ml_module->collectives_topology_map[ML_ALLREDUCE][alg];
if (ML_UNDEFINED == alg || ML_UNDEFINED == topo_index) {
ML_ERROR(("No topology index or algorithm was defined"));
topo_info->hierarchical_algorithms[ML_ALLREDUCE] = NULL;
return;
}
free(ml_module->coll_ml_allreduce_functions[alg]->component_functions);
ml_module->coll_ml_allreduce_functions[alg]->component_functions = NULL;
free(ml_module->coll_ml_allreduce_functions[alg]);
ml_module->coll_ml_allreduce_functions[alg] = NULL;
alg = mca_coll_ml_component.coll_config[ML_ALLREDUCE][ML_LARGE_MSG].algorithm_id;
topo_index = ml_module->collectives_topology_map[ML_ALLREDUCE][alg];
if (ML_UNDEFINED == alg || ML_UNDEFINED == topo_index) {
ML_ERROR(("No topology index or algorithm was defined"));
topo_info->hierarchical_algorithms[ML_ALLREDUCE] = NULL;
return;
}
free(ml_module->coll_ml_allreduce_functions[alg]->component_functions);
ml_module->coll_ml_allreduce_functions[alg]->component_functions = NULL;
free(ml_module->coll_ml_allreduce_functions[alg]);
ml_module->coll_ml_allreduce_functions[alg] = NULL;
if (true == mca_coll_ml_component.need_allreduce_support) {
topo_index = ml_module->collectives_topology_map[ML_ALLREDUCE][ML_SMALL_DATA_EXTRA_TOPO_ALLREDUCE];
if (ML_UNDEFINED == topo_index) {
ML_ERROR(("No topology index was defined"));
topo_info->hierarchical_algorithms[ML_ALLREDUCE] = NULL;
return;
}
alg = ML_SMALL_DATA_EXTRA_TOPO_ALLREDUCE;
free(ml_module->coll_ml_allreduce_functions[alg]->component_functions);
ml_module->coll_ml_allreduce_functions[alg]->component_functions = NULL;
free(ml_module->coll_ml_allreduce_functions[alg]);
ml_module->coll_ml_allreduce_functions[alg] = NULL;
topo_index = ml_module->collectives_topology_map[ML_ALLREDUCE][ML_LARGE_DATA_EXTRA_TOPO_ALLREDUCE];
if (ML_UNDEFINED == topo_index) {
ML_ERROR(("No topology index was defined"));
topo_info->hierarchical_algorithms[ML_ALLREDUCE] = NULL;
return;
}
alg = ML_LARGE_DATA_EXTRA_TOPO_ALLREDUCE;
free(ml_module->coll_ml_allreduce_functions[alg]->component_functions);
ml_module->coll_ml_allreduce_functions[alg]->component_functions = NULL;
free(ml_module->coll_ml_allreduce_functions[alg]);
ml_module->coll_ml_allreduce_functions[alg] = NULL;
}
}

View File

@ -1,6 +1,8 @@
/*
* Copyright (c) 2009-2012 Oak Ridge National Laboratory. All rights reserved.
* Copyright (c) 2009-2012 Mellanox Technologies. All rights reserved.
* Copyright (c) 2014 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -800,3 +802,48 @@ int ml_coll_hier_bcast_setup(mca_coll_ml_module_t *ml_module)
topo_info->hierarchical_algorithms[BCOL_BCAST] = NULL;
return ret;
}
void ml_coll_hier_bcast_cleanup(mca_coll_ml_module_t *ml_module)
{
/* Hierarchy Setup */
int ret, i , size_code, alg;
int topo_index = 0;
mca_coll_ml_topology_t *topo_info = ml_module->topo_list;
for (i = 0; i < ML_NUM_MSG; i++) {
switch (i) {
case ML_SMALL_MSG:
case ML_LARGE_MSG:
break;
default:
topo_info->hierarchical_algorithms[ML_BCAST] = NULL;
return;
}
alg = mca_coll_ml_component.coll_config[ML_BCAST][i].algorithm_id;
topo_index = ml_module->collectives_topology_map[ML_BCAST][alg];
if (ML_UNDEFINED == alg || ML_UNDEFINED == topo_index) {
ML_ERROR(("No topology index or algorithm was defined"));
topo_info->hierarchical_algorithms[ML_BCAST] = NULL;
return;
}
switch (alg) {
case ML_BCAST_SMALL_DATA_KNOWN:
case ML_BCAST_LARGE_DATA_KNOWN:
case ML_BCAST_SMALL_DATA_UNKNOWN:
case ML_BCAST_LARGE_DATA_UNKNOWN:
case ML_BCAST_SMALL_DATA_SEQUENTIAL:
case ML_BCAST_LARGE_DATA_SEQUENTIAL:
free(ml_module->coll_ml_bcast_functions[alg]->component_functions);
ml_module->coll_ml_bcast_functions[alg]->component_functions = NULL;
free(ml_module->coll_ml_bcast_functions[alg]);
ml_module->coll_ml_bcast_functions[alg] = NULL;
break;
default:
topo_info->hierarchical_algorithms[ML_BCAST] = NULL;
return;
}
}
}

View File

@ -4,6 +4,8 @@
* Copyright (c) 2009-2012 Mellanox Technologies. All rights reserved.
* Copyright (c) 2014 Los Alamos National Security, LLC. All rights
* reserved.
* Copyright (c) 2014 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -309,3 +311,36 @@ int ml_coll_hier_reduce_setup(mca_coll_ml_module_t *ml_module)
return OMPI_SUCCESS;
}
void ml_coll_hier_reduce_cleanup(mca_coll_ml_module_t *ml_module)
{
int alg, i, topo_index=0;
mca_coll_ml_topology_t *topo_info =
&ml_module->topo_list[ml_module->collectives_topology_map[ML_REDUCE][ML_SMALL_MSG]];
if ( ml_module->max_fn_calls < topo_info->n_levels ) {
ml_module->max_fn_calls = topo_info->n_levels;
}
alg = mca_coll_ml_component.coll_config[ML_REDUCE][ML_SMALL_MSG].algorithm_id;
topo_index = ml_module->collectives_topology_map[ML_REDUCE][alg];
if (ML_UNDEFINED == alg || ML_UNDEFINED == topo_index) {
ML_ERROR(("No topology index or algorithm was defined"));
topo_info->hierarchical_algorithms[ML_REDUCE] = NULL;
return;
}
for (i=0; i<ml_module->topo_list[topo_index].n_levels; i++) {
free(ml_module->coll_ml_reduce_functions[alg]->comp_fn_arr[i]);
ml_module->coll_ml_reduce_functions[alg]->comp_fn_arr[i] = NULL;
}
free(ml_module->coll_ml_reduce_functions[alg]->comp_fn_arr);
ml_module->coll_ml_reduce_functions[alg]->comp_fn_arr = NULL;
free(ml_module->coll_ml_reduce_functions[alg]->component_functions);
ml_module->coll_ml_reduce_functions[alg]->component_functions = NULL;
free(ml_module->coll_ml_reduce_functions[alg]);
ml_module->coll_ml_reduce_functions[alg] = NULL;
}

View File

@ -5,6 +5,8 @@
* Copyright (c) 2012-2014 Los Alamos National Security, LLC. All rights
* reserved.
* Copyright (c) 2013-2014 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2014 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -159,11 +161,13 @@ mca_coll_ml_module_construct(mca_coll_ml_module_t *module)
static void
mca_coll_ml_module_destruct(mca_coll_ml_module_t *module)
{
int i, j, k,fnc, index_topo;
int i, j, k,fnc, index_topo, alg;
mca_coll_ml_topology_t *topo;
ML_VERBOSE(4, ("ML module destruct"));
ml_coll_hier_reduce_cleanup(module);
for (index_topo = 0; index_topo < COLL_ML_TOPO_MAX; index_topo++) {
topo = &module->topo_list[index_topo];
if (COLL_ML_TOPO_DISABLED == topo->status) {
@ -207,9 +211,13 @@ mca_coll_ml_module_destruct(mca_coll_ml_module_t *module)
free(topo->array_of_all_subgroups);
topo->array_of_all_subgroups = NULL;
}
if (NULL != topo->hier_layout_info) {
free(topo->hier_layout_info);
topo->hier_layout_info = NULL;
}
}
OBJ_DESTRUCT(&(module->active_bcols_list));
OPAL_LIST_DESTRUCT(&(module->active_bcols_list));
OBJ_DESTRUCT(&(module->waiting_for_memory_list));
/* gvm Leak FIX Remove fragment free list */
@ -225,9 +233,27 @@ mca_coll_ml_module_destruct(mca_coll_ml_module_t *module)
OBJ_DESTRUCT(&(module->coll_ml_collective_descriptors));
if (NULL != module->coll_ml_barrier_function) {
if (NULL != module->coll_ml_barrier_function->component_functions) {
free(module->coll_ml_barrier_function->component_functions);
module->coll_ml_barrier_function->component_functions = NULL;
}
free(module->coll_ml_barrier_function);
module->coll_ml_barrier_function = NULL;
}
if (module->coll_ml_memsync_function) {
if (module->coll_ml_memsync_function->component_functions) {
free(module->coll_ml_memsync_function->component_functions);
module->coll_ml_memsync_function->component_functions = NULL;
}
free(module->coll_ml_memsync_function);
module->coll_ml_memsync_function = NULL;
}
ml_coll_hier_allreduce_cleanup_new(module);
ml_coll_hier_allgather_cleanup(module);
ml_coll_hier_bcast_cleanup(module);
/* release saved collectives */
ML_RELEASE_FALLBACK(module, allreduce);
ML_RELEASE_FALLBACK(module, allgather);
@ -1555,6 +1581,8 @@ static int ml_discover_hierarchy(mca_coll_ml_module_t *ml_module)
MPI_MIN, ompi_comm_size(ml_module->comm), comm_ranks,
ml_module->comm);
free(comm_ranks);
if (OMPI_SUCCESS != ret) {
ML_ERROR(("comm_allreduce - failed to collect max_comm data"));
return ret;

View File

@ -1,3 +1,18 @@
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
/*
* Copyright (c) 2009-2013 Oak Ridge National Laboratory. All rights reserved.
* Copyright (c) 2009-2012 Mellanox Technologies. All rights reserved.
* Copyright (c) 2012-2014 Los Alamos National Security, LLC. All rights
* reserved.
* Copyright (c) 2013-2014 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2014 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
/*
* Code for selecting a collective function. The selection is based on
* comm-time attributes and invoke-time attributes.
@ -279,6 +294,8 @@ int mca_coll_ml_build_filtered_fn_table(mca_coll_ml_module_t *ml_module)
return OMPI_ERROR;
}
free(my_comm_attrib);
return OMPI_SUCCESS;
}

View File

@ -3,6 +3,8 @@
* Copyright (c) 2009-2012 Oak Ridge National Laboratory. All rights reserved.
* Copyright (c) 2012 Los Alamos National Security, LLC.
* All rights reserved.
* Copyright (c) 2014 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -73,6 +75,7 @@ OMPI_DECLSPEC int comm_allgather_pml(void *src_buf, void *dest_buf, int count,
}
/* get my reduction communication pattern */
memset(&my_exchange_node, 0, sizeof(netpatterns_pair_exchange_node_t));
rc = netpatterns_setup_recursive_doubling_tree_node(n_peers,
my_rank_in_group, &my_exchange_node);
if(OMPI_SUCCESS != rc){
@ -280,6 +283,8 @@ OMPI_DECLSPEC int comm_allgather_pml(void *src_buf, void *dest_buf, int count,
}
}
netpatterns_cleanup_recursive_doubling_tree_node(&my_exchange_node);
/* return */
return OMPI_SUCCESS;

View File

@ -3,6 +3,8 @@
* Copyright (c) 2009-2012 Oak Ridge National Laboratory. All rights reserved.
* Copyright (c) 2012 Los Alamos National Security, LLC.
* All rights reserved.
* Copyright (c) 2014 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -76,6 +78,7 @@ OMPI_DECLSPEC int comm_allreduce_pml(void *sbuf, void *rbuf, int count,
n_data_segments=(count+n_dts_per_buffer -1 ) / n_dts_per_buffer ;
/* get my reduction communication pattern */
memset(&my_exchange_node, 0, sizeof(netpatterns_pair_exchange_node_t));
rc = netpatterns_setup_recursive_doubling_tree_node(n_peers,
my_rank_in_group, &my_exchange_node);
if(OMPI_SUCCESS != rc){
@ -247,6 +250,8 @@ OMPI_DECLSPEC int comm_allreduce_pml(void *sbuf, void *rbuf, int count,
count_processed += count_this_stripe;
}
netpatterns_cleanup_recursive_doubling_tree_node(&my_exchange_node);
/* return */
return OMPI_SUCCESS;

View File

@ -3,6 +3,8 @@
* Copyright (c) 2009-2012 Oak Ridge National Laboratory. All rights reserved.
* Copyright (c) 2012 Los Alamos National Security, LLC.
* All rights reserved.
* Copyright (c) 2014 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -89,6 +91,10 @@ OMPI_DECLSPEC int comm_bcast_pml(void *buffer, int root, int count,
ompi_request_wait_all(msg_cnt,requests,MPI_STATUSES_IGNORE);
}
if (node_data.children_ranks) {
free(node_data.children_ranks);
}
/* return */
return OMPI_SUCCESS;

View File

@ -1,7 +1,9 @@
/*
* Copyright (c) 2009-2012 Mellanox Technologies. All rights reserved.
* Copyright (c) 2009-2012 Oak Ridge National Laboratory. All rights reserved.
* $COPYRIGHT$
* Copyright (c) 2014 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
@ -499,6 +501,33 @@ Error:
return OMPI_ERROR;
}
OMPI_DECLSPEC void netpatterns_cleanup_recursive_knomial_allgather_tree_node(
netpatterns_k_exchange_node_t *exchange_node)
{
int i;
free(exchange_node->reindex_map);
free(exchange_node->inv_reindex_map);
if (exchange_node->n_extra_sources > 0) {
free(exchange_node->rank_extra_sources_array) ;
exchange_node->n_extra_sources = 0;
exchange_node->rank_extra_sources_array = NULL;
}
if (exchange_node->n_exchanges > 0) {
for (i=0; i < exchange_node->n_exchanges; i++) {
free(exchange_node->rank_exchanges[i]);
exchange_node->rank_exchanges[i] = NULL;
}
free(exchange_node->rank_exchanges);
exchange_node->rank_exchanges = NULL;
exchange_node->n_exchanges = 0;
}
for(i = 0; i < exchange_node->log_tree_order; i++){
free(exchange_node->payload_info[i]);
}
free(exchange_node->payload_info);
}
OMPI_DECLSPEC int netpatterns_setup_recursive_knomial_tree_node(
int num_nodes, int node_rank, int tree_order,
@ -655,6 +684,27 @@ Error:
return OMPI_ERROR;
}
OMPI_DECLSPEC void netpatterns_cleanup_recursive_knomial_tree_node(
netpatterns_k_exchange_node_t *exchange_node)
{
int i;
if (exchange_node->n_extra_sources > 0) {
free(exchange_node->rank_extra_sources_array);
exchange_node->rank_extra_sources_array = NULL;
exchange_node->n_extra_sources = 0;
}
if (exchange_node->n_exchanges > 0) {
for (i=0 ; i<exchange_node->n_exchanges; i++) {
free(exchange_node->rank_exchanges[i]);
exchange_node->rank_exchanges[i] = NULL;
}
free(exchange_node->rank_exchanges);
exchange_node->rank_exchanges = NULL;
exchange_node->n_exchanges = 0;
}
}
#if 1
OMPI_DECLSPEC int netpatterns_setup_recursive_doubling_n_tree_node(int num_nodes, int node_rank, int tree_order,
netpatterns_pair_exchange_node_t *exchange_node)
@ -797,7 +847,7 @@ Error:
return OMPI_ERROR;
}
OMPI_DECLSPEC void netpatterns_free_recursive_doubling_tree_node(
OMPI_DECLSPEC void netpatterns_cleanup_recursive_doubling_tree_node(
netpatterns_pair_exchange_node_t *exchange_node)
{
NETPATTERNS_VERBOSE(("About to release rank_extra_sources_array and rank_exchanges"));

View File

@ -3,6 +3,8 @@
* Copyright (c) 2009-2012 Oak Ridge National Laboratory. All rights reserved.
* Copyright (c) 2012 Los Alamos National Security, LLC.
* All rights reserved.
* Copyright (c) 2014 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -111,7 +113,7 @@ typedef struct netpatterns_k_exchange_node_t
OMPI_DECLSPEC int netpatterns_setup_recursive_doubling_n_tree_node(int num_nodes, int node_rank, int tree_order,
netpatterns_pair_exchange_node_t *exchange_node);
OMPI_DECLSPEC void netpatterns_free_recursive_doubling_tree_node(
OMPI_DECLSPEC void netpatterns_cleanup_recursive_doubling_tree_node(
netpatterns_pair_exchange_node_t *exchange_node);
OMPI_DECLSPEC int netpatterns_setup_recursive_doubling_tree_node(int num_nodes, int node_rank,
@ -121,10 +123,15 @@ OMPI_DECLSPEC int netpatterns_setup_recursive_knomial_tree_node(
int num_nodes, int node_rank, int tree_order,
netpatterns_k_exchange_node_t *exchange_node);
OMPI_DECLSPEC void netpatterns_cleanup_recursive_knomial_tree_node(
netpatterns_k_exchange_node_t *exchange_node);
OMPI_DECLSPEC int netpatterns_setup_recursive_knomial_allgather_tree_node(
int num_nodes, int node_rank, int tree_order, int *hier_ranks,
netpatterns_k_exchange_node_t *exchange_node);
OMPI_DECLSPEC void netpatterns_cleanup_recursive_knomial_allgather_tree_node(
netpatterns_k_exchange_node_t *exchange_node);
/* Input: k_exchange_node structure
Output: index in rank_exchanges array that points