some further refcount fixes. Now the static scenario should really be correct... :-)
This commit was SVN r3691.
Этот коммит содержится в:
родитель
4019ca4403
Коммит
a4c8e4f15c
@ -197,9 +197,12 @@ int ompi_comm_set ( ompi_communicator_t *newcomm,
|
||||
*/
|
||||
int ompi_comm_group ( ompi_communicator_t* comm, ompi_group_t **group )
|
||||
{
|
||||
/* increment proc reference counters */
|
||||
/* increment reference counters for the group */
|
||||
OBJ_RETAIN(comm->c_local_group);
|
||||
|
||||
/* increase also the reference counter for the procs */
|
||||
ompi_group_increment_proc_count(comm->c_local_group);
|
||||
|
||||
*group = comm->c_local_group;
|
||||
return OMPI_SUCCESS;
|
||||
}
|
||||
|
@ -73,7 +73,6 @@ int ompi_comm_init(void)
|
||||
group->grp_flags |= OMPI_GROUP_INTRINSIC;
|
||||
ompi_set_group_rank(group, ompi_proc_local());
|
||||
ompi_group_increment_proc_count (group);
|
||||
OBJ_RETAIN(group); /* bump reference count for remote reference */
|
||||
|
||||
ompi_mpi_comm_world.c_contextid = 0;
|
||||
ompi_mpi_comm_world.c_f_to_c_index = 0;
|
||||
@ -104,7 +103,6 @@ int ompi_comm_init(void)
|
||||
group->grp_my_rank = 0;
|
||||
group->grp_proc_count = size;
|
||||
group->grp_flags |= OMPI_GROUP_INTRINSIC;
|
||||
OBJ_RETAIN(group); /* bump reference count for remote reference */
|
||||
|
||||
ompi_mpi_comm_self.c_contextid = 1;
|
||||
ompi_mpi_comm_self.c_f_to_c_index = 1;
|
||||
@ -130,7 +128,6 @@ int ompi_comm_init(void)
|
||||
ompi_mpi_comm_null.c_local_group = &ompi_mpi_group_null;
|
||||
ompi_mpi_comm_null.c_remote_group = &ompi_mpi_group_null;
|
||||
OBJ_RETAIN(&ompi_mpi_group_null);
|
||||
OBJ_RETAIN(&ompi_mpi_group_null);
|
||||
|
||||
ompi_mpi_comm_null.c_contextid = 2;
|
||||
ompi_mpi_comm_null.c_f_to_c_index = 2;
|
||||
@ -148,7 +145,6 @@ int ompi_comm_init(void)
|
||||
ompi_mpi_comm_parent = &ompi_mpi_comm_null;
|
||||
OBJ_RETAIN(&ompi_mpi_comm_null);
|
||||
OBJ_RETAIN(&ompi_mpi_group_null);
|
||||
OBJ_RETAIN(&ompi_mpi_group_null);
|
||||
OBJ_RETAIN(&ompi_mpi_errors_are_fatal);
|
||||
|
||||
/* initialize the comm_reg stuff for multi-threaded comm_cid
|
||||
@ -198,22 +194,13 @@ int ompi_comm_finalize(void)
|
||||
ompi_comm_dyn_finalize();
|
||||
|
||||
/* Destroy all predefined communicators */
|
||||
ompi_mpi_comm_world.c_local_group->grp_flags = 0;
|
||||
ompi_mpi_comm_world.c_flags = 0;
|
||||
OBJ_DESTRUCT( &ompi_mpi_comm_world );
|
||||
|
||||
ompi_mpi_comm_self.c_local_group->grp_flags = 0;
|
||||
ompi_mpi_comm_self.c_flags = 0;
|
||||
OBJ_DESTRUCT( &ompi_mpi_comm_self );
|
||||
|
||||
if( ompi_mpi_comm_parent != &ompi_mpi_comm_null ) {
|
||||
ompi_mpi_comm_parent->c_local_group->grp_flags = 0;
|
||||
ompi_mpi_comm_parent->c_flags = 0;
|
||||
OBJ_DESTRUCT (&ompi_mpi_comm_parent);
|
||||
}
|
||||
|
||||
ompi_mpi_comm_null.c_local_group->grp_flags = 0;
|
||||
ompi_mpi_comm_null.c_flags = 0;
|
||||
OBJ_DESTRUCT( &ompi_mpi_comm_null );
|
||||
|
||||
/* Check whether we have some communicators left */
|
||||
@ -356,11 +343,11 @@ static void ompi_comm_destruct(ompi_communicator_t* comm)
|
||||
ompi_group_decrement_proc_count (comm->c_local_group);
|
||||
OBJ_RELEASE ( comm->c_local_group );
|
||||
comm->c_local_group = NULL;
|
||||
if ( OMPI_COMM_IS_INTRA(comm) ) {
|
||||
comm->c_remote_group = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
/* the reference count is always popped up for the
|
||||
remote group (even for intra-comms), so we have to
|
||||
decrement it again in all cases. */
|
||||
if (NULL != comm->c_remote_group) {
|
||||
ompi_group_decrement_proc_count (comm->c_remote_group);
|
||||
OBJ_RELEASE ( comm->c_remote_group );
|
||||
|
@ -138,9 +138,10 @@ static void ompi_group_destruct(ompi_group_t *group)
|
||||
int proc;
|
||||
|
||||
/* decrement proc reference count */
|
||||
for (proc = 0; proc < group->grp_proc_count; proc++) {
|
||||
/* for (proc = 0; proc < group->grp_proc_count; proc++) {
|
||||
OBJ_RELEASE(group->grp_proc_pointers[proc]);
|
||||
}
|
||||
*/
|
||||
/* release thegrp_proc_pointers memory */
|
||||
if (NULL != group->grp_proc_pointers)
|
||||
free(group->grp_proc_pointers);
|
||||
|
@ -58,5 +58,6 @@ int MPI_Comm_remote_group(MPI_Comm comm, MPI_Group *group)
|
||||
}
|
||||
|
||||
*group = (MPI_Group) comm->c_remote_group;
|
||||
ompi_group_increment_proc_count(*group);
|
||||
return MPI_SUCCESS;
|
||||
}
|
||||
|
Загрузка…
Ссылка в новой задаче
Block a user