coll/ml: fix leaks and close all the framework opened
It is essential to call mca_base_framework_close for every framework that is opened. coll/ml was not doing this so neither bcol nor sbgp were getting cleaned up. This commit fixes this omission. Also fixed a leak caused by calling OBJ_DESTRUCT for something created with OBJ_NEW. With these changes coll/ml appears to be valgrind clean. cmr=v1.8.2:reviewer=manjugv This commit was SVN r31743.
Этот коммит содержится в:
родитель
71998ad67b
Коммит
c32d84154a
@ -2,7 +2,7 @@
|
||||
/*
|
||||
* Copyright (c) 2009-2012 Oak Ridge National Laboratory. All rights reserved.
|
||||
* Copyright (c) 2009-2012 Mellanox Technologies. 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$
|
||||
*
|
||||
@ -394,12 +394,28 @@ static int ml_close(void)
|
||||
}
|
||||
|
||||
OBJ_DESTRUCT(&cs->memory_manager);
|
||||
OBJ_DESTRUCT(&cs->pending_tasks_mutex);
|
||||
OBJ_DESTRUCT(&cs->pending_tasks);
|
||||
OBJ_DESTRUCT(&cs->active_tasks_mutex);
|
||||
OBJ_DESTRUCT(&cs->active_tasks);
|
||||
OBJ_DESTRUCT(&cs->sequential_collectives_mutex);
|
||||
OBJ_DESTRUCT(&cs->sequential_collectives);
|
||||
|
||||
/* deregister progress function */
|
||||
ret=opal_progress_unregister(coll_ml_progress);
|
||||
ret = opal_progress_unregister(coll_ml_progress);
|
||||
if (OMPI_SUCCESS != ret ) {
|
||||
fprintf(stderr," failed to un-register the ml progress function \n");
|
||||
fflush(stderr);
|
||||
OMPI_ERROR_LOG(ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* close the sbgp and bcol frameworks */
|
||||
if (OMPI_SUCCESS != (ret = mca_base_framework_close(&ompi_sbgp_base_framework))) {
|
||||
OMPI_ERROR_LOG(ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
if (OMPI_SUCCESS != (ret = mca_base_framework_close(&ompi_bcol_base_framework))) {
|
||||
OMPI_ERROR_LOG(ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -59,7 +59,7 @@ static void destruct_lmngr(mca_coll_ml_lmngr_t *lmngr)
|
||||
|
||||
while(!opal_list_is_empty(&lmngr->blocks_list)) {
|
||||
item = opal_list_remove_first(&lmngr->blocks_list);
|
||||
OBJ_DESTRUCT(item);
|
||||
OBJ_RELEASE(item);
|
||||
}
|
||||
|
||||
OBJ_DESTRUCT(&lmngr->blocks_list);
|
||||
|
@ -251,6 +251,7 @@ int mca_coll_ml_register_params(void)
|
||||
"Algorithm to use for broadcast", MCA_BASE_VAR_TYPE_INT,
|
||||
new_enum, 0, 0, OPAL_INFO_LVL_9, MCA_BASE_VAR_SCOPE_READONLY,
|
||||
&mca_coll_ml_component.bcast_algorithm);
|
||||
OBJ_RELEASE(new_enum);
|
||||
if (0 > tmp) {
|
||||
ret = tmp;
|
||||
}
|
||||
|
Загрузка…
Ссылка в новой задаче
Block a user