1
1

ompi_comm_all allocate memory and retain the objects. Therefore, after

each call to ompi_comm_all we should parse the communicator list and
release the objects ...

This commit was SVN r20525.
Этот коммит содержится в:
George Bosilca 2009-02-11 21:48:11 +00:00
родитель 84d3ca0c9e
Коммит 4747a4bb53
3 изменённых файлов: 31 добавлений и 10 удалений

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

@ -1,8 +1,9 @@
/* -*- Mode: C; c-basic-offset:4 ; -*- */
/* /*
* Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana * Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana
* University Research and Technology * University Research and Technology
* Corporation. All rights reserved. * Corporation. All rights reserved.
* Copyright (c) 2004-2008 The University of Tennessee and The University * Copyright (c) 2004-2009 The University of Tennessee and The University
* of Tennessee Research Foundation. All rights * of Tennessee Research Foundation. All rights
* reserved. * reserved.
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
@ -620,11 +621,16 @@ int mca_bml_r2_finalize( void )
bml_r2_remove_btl_progress(btl); bml_r2_remove_btl_progress(btl);
/* dont use this btl for any peers */ /* dont use this btl for any peers */
for(p=0; p<num_procs; p++) { for( p = 0; p < num_procs; p++ ) {
ompi_proc_t* proc = procs[p]; ompi_proc_t* proc = procs[p];
mca_bml_r2_del_proc_btl(proc, sm->btl_module); mca_bml_r2_del_proc_btl(proc, sm->btl_module);
} }
} }
/* Release the procs as the ompi_proc_all increase their ref_count */
for( p = 0; p < num_procs; p++ ) {
OBJ_RELEASE(procs[p]);
}
free(procs);
CLEANUP: CLEANUP:
mca_bml_r2.num_btl_modules = 0; mca_bml_r2.num_btl_modules = 0;
@ -658,15 +664,15 @@ static int mca_bml_r2_del_btl(mca_btl_base_module_t* btl)
mca_btl_base_module_t** modules; mca_btl_base_module_t** modules;
bool found = false; bool found = false;
if(opal_list_get_size(&mca_btl_base_modules_initialized) == 2) {
opal_output(0, "only one BTL left, can't failover");
return OMPI_SUCCESS;
}
procs = ompi_proc_all(&num_procs); procs = ompi_proc_all(&num_procs);
if(NULL == procs) if(NULL == procs)
return OMPI_SUCCESS; return OMPI_SUCCESS;
if(opal_list_get_size(&mca_btl_base_modules_initialized) == 2) {
opal_output(0, "only one BTL left, can't failover");
goto CLEANUP;
}
/* Get rid of the associated progress function */ /* Get rid of the associated progress function */
bml_r2_remove_btl_progress(btl); bml_r2_remove_btl_progress(btl);
@ -706,6 +712,10 @@ static int mca_bml_r2_del_btl(mca_btl_base_module_t* btl)
/* cleanup */ /* cleanup */
btl->btl_finalize(btl); btl->btl_finalize(btl);
CLEANUP: CLEANUP:
/* Decrease the ref_count increased by the call to ompi_proc_all */
for( p = 0; p < num_procs; p++ ) {
OBJ_RELEASE(procs[p]);
}
free(procs); free(procs);
return OMPI_SUCCESS; return OMPI_SUCCESS;
} }

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

@ -1,8 +1,9 @@
/* -*- Mode: C; c-basic-offset:4 ; -*- */
/* /*
* Copyright (c) 2004-2008 The Trustees of Indiana University and Indiana * Copyright (c) 2004-2008 The Trustees of Indiana University and Indiana
* University Research and Technology * University Research and Technology
* Corporation. All rights reserved. * Corporation. All rights reserved.
* Copyright (c) 2004-2008 The University of Tennessee and The University * Copyright (c) 2004-2009 The University of Tennessee and The University
* of Tennessee Research Foundation. All rights * of Tennessee Research Foundation. All rights
* reserved. * reserved.
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
@ -76,7 +77,9 @@ void mca_pml_ob1_error_handler( struct mca_btl_base_module_t* btl,
int mca_pml_ob1_enable(bool enable) int mca_pml_ob1_enable(bool enable)
{ {
if( false == enable ) return OMPI_SUCCESS; if( false == enable ) {
return OMPI_SUCCESS;
}
OBJ_CONSTRUCT(&mca_pml_ob1.lock, opal_mutex_t); OBJ_CONSTRUCT(&mca_pml_ob1.lock, opal_mutex_t);
@ -600,6 +603,9 @@ int mca_pml_ob1_ft_event( int state )
opal_output(0, opal_output(0,
"pml:ob1: ft_event(Restart): proc_refresh Failed %d", "pml:ob1: ft_event(Restart): proc_refresh Failed %d",
ret); ret);
for(p = 0; p < (int)num_procs; ++p) {
OBJ_RELEASE(procs[p]);
}
free (procs); free (procs);
return ret; return ret;
} }
@ -636,6 +642,9 @@ int mca_pml_ob1_ft_event( int state )
opal_output(0, opal_output(0,
"pml:ob1: ft_event(Restart): proc_refresh Failed %d", "pml:ob1: ft_event(Restart): proc_refresh Failed %d",
ret); ret);
for(p = 0; p < (int)num_procs; ++p) {
OBJ_RELEASE(procs[p]);
}
free (procs); free (procs);
return ret; return ret;
} }

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

@ -1,8 +1,9 @@
/* -*- Mode: C; c-basic-offset:4 ; -*- */
/* /*
* Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana * Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana
* University Research and Technology * University Research and Technology
* Corporation. All rights reserved. * Corporation. All rights reserved.
* Copyright (c) 2004-2007 The University of Tennessee and The University * Copyright (c) 2004-2009 The University of Tennessee and The University
* of Tennessee Research Foundation. All rights * of Tennessee Research Foundation. All rights
* reserved. * reserved.
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
@ -127,6 +128,7 @@ static int mca_pml_ob1_component_open(void)
opal_output(0, "mca_pml_ob1_component_open: can't find allocator: %s\n", mca_pml_ob1.allocator_name); opal_output(0, "mca_pml_ob1_component_open: can't find allocator: %s\n", mca_pml_ob1.allocator_name);
return OMPI_ERROR; return OMPI_ERROR;
} }
mca_pml_ob1.allocator = allocator_component->allocator_init(true, mca_pml_ob1.allocator = allocator_component->allocator_init(true,
mca_pml_ob1_seg_alloc, mca_pml_ob1_seg_alloc,
mca_pml_ob1_seg_free, NULL); mca_pml_ob1_seg_free, NULL);