1
1

Don't always retain the proc, do it only for new procs. This enforce a strict policy in the BML, it has one and only one ref on each proc.

This commit was SVN r30429.
Этот коммит содержится в:
George Bosilca 2014-01-26 17:26:04 +00:00
родитель 18ae20022a
Коммит d265981c55

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

@ -158,12 +158,11 @@ static int mca_bml_r2_add_procs( size_t nprocs,
} }
/* Select only the procs that don't yet have the BML proc struct. This prevent /* Select only the procs that don't yet have the BML proc struct. This prevent
* us from calling btl->add_procs several this on the same destination proc. * us from calling btl->add_procs several times on the same destination proc.
*/ */
for(p_index = 0; p_index < nprocs; p_index++) { for(p_index = 0; p_index < nprocs; p_index++) {
struct ompi_proc_t* proc = procs[p_index]; struct ompi_proc_t* proc = procs[p_index];
OBJ_RETAIN(proc);
if(NULL != proc->proc_endpoints[OMPI_PROC_ENDPOINT_TAG_BML]) { if(NULL != proc->proc_endpoints[OMPI_PROC_ENDPOINT_TAG_BML]) {
continue; /* go to the next proc */ continue; /* go to the next proc */
} }
@ -174,6 +173,7 @@ static int mca_bml_r2_add_procs( size_t nprocs,
return OMPI_ERR_OUT_OF_RESOURCE; return OMPI_ERR_OUT_OF_RESOURCE;
} }
} }
OBJ_RETAIN(proc);
new_procs[n_new_procs++] = proc; new_procs[n_new_procs++] = proc;
} }
@ -442,7 +442,7 @@ static int mca_bml_r2_del_procs(size_t nprocs,
return OMPI_ERR_OUT_OF_RESOURCE; return OMPI_ERR_OUT_OF_RESOURCE;
} }
for(p =0; p < nprocs; p++) { for(p = 0; p < nprocs; p++) {
ompi_proc_t *proc = procs[p]; ompi_proc_t *proc = procs[p];
if(((opal_object_t*)proc)->obj_reference_count == 1) { if(((opal_object_t*)proc)->obj_reference_count == 1) {
del_procs[n_del_procs++] = proc; del_procs[n_del_procs++] = proc;
@ -644,11 +644,11 @@ int mca_bml_r2_finalize( void )
mca_bml_r2.num_btl_progress = 0; mca_bml_r2.num_btl_progress = 0;
if( NULL != mca_bml_r2.btl_modules) { if( NULL != mca_bml_r2.btl_modules) {
free( mca_bml_r2.btl_modules); free(mca_bml_r2.btl_modules);
mca_bml_r2.btl_modules = NULL; mca_bml_r2.btl_modules = NULL;
} }
if( NULL != mca_bml_r2.btl_progress ) { if( NULL != mca_bml_r2.btl_progress ) {
free( mca_bml_r2.btl_progress); free(mca_bml_r2.btl_progress);
mca_bml_r2.btl_progress = NULL; mca_bml_r2.btl_progress = NULL;
} }