quick fix for the cart create problem caused by the previous memory leak
fix This commit was SVN r14195.
Этот коммит содержится в:
родитель
8273c5eeba
Коммит
0e98bf2ac6
@ -1380,10 +1380,19 @@ static int ompi_comm_fill_rest (ompi_communicator_t *comm,
|
|||||||
ompi_errhandler_t *errh )
|
ompi_errhandler_t *errh )
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
|
/* properly decrement the ref counts on the groups.
|
||||||
|
We are doing this because this function is sort of a redo
|
||||||
|
of what is done in comm.c.. No need to decrement the ref
|
||||||
|
count on the proc pointers
|
||||||
|
This is just a quick fix, and will be looking for a
|
||||||
|
better solution */
|
||||||
|
OBJ_RELEASE ( comm->c_local_group );
|
||||||
|
OBJ_RELEASE ( comm->c_local_group );
|
||||||
|
|
||||||
/* allocate a group structure for the new communicator */
|
/* allocate a group structure for the new communicator */
|
||||||
comm->c_local_group = ompi_group_allocate(num_procs);
|
comm->c_local_group = ompi_group_allocate(num_procs);
|
||||||
|
|
||||||
/* free the malloced proc pointers */
|
/* free the malloced proc pointers */
|
||||||
free(comm->c_local_group->grp_proc_pointers);
|
free(comm->c_local_group->grp_proc_pointers);
|
||||||
|
|
||||||
@ -1392,6 +1401,7 @@ static int ompi_comm_fill_rest (ompi_communicator_t *comm,
|
|||||||
|
|
||||||
/* set the remote group to be the same as local group */
|
/* set the remote group to be the same as local group */
|
||||||
comm->c_remote_group = comm->c_local_group;
|
comm->c_remote_group = comm->c_local_group;
|
||||||
|
OBJ_RETAIN ( comm->c_remote_group );
|
||||||
|
|
||||||
/* retain these proc pointers */
|
/* retain these proc pointers */
|
||||||
ompi_group_increment_proc_count(comm->c_local_group);
|
ompi_group_increment_proc_count(comm->c_local_group);
|
||||||
|
@ -374,8 +374,8 @@ static void ompi_comm_destruct(ompi_communicator_t* comm)
|
|||||||
OBJ_RELEASE ( comm->c_local_group );
|
OBJ_RELEASE ( comm->c_local_group );
|
||||||
comm->c_local_group = NULL;
|
comm->c_local_group = NULL;
|
||||||
if ( OMPI_COMM_IS_INTRA(comm) ) {
|
if ( OMPI_COMM_IS_INTRA(comm) ) {
|
||||||
/* WE HAVE TO DECREMENT THE REF COUNT ON THE REMOTE GROUP
|
/* We have to decrement the ref count on the remote group
|
||||||
EVEN IF IT'S IDENTICAL TO THE LOCAL ONE IN CASE OF INTRA-COMM */
|
even if it is identical to the local one in case of intra-comm */
|
||||||
OBJ_RELEASE ( comm->c_remote_group );
|
OBJ_RELEASE ( comm->c_remote_group );
|
||||||
comm->c_remote_group = NULL;
|
comm->c_remote_group = NULL;
|
||||||
}
|
}
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user