1
1

fixing a stupid bug in comm_nextcid: forgot to free the value in the pointer_array in case the others did not agree with my suggestion for the cid.

This commit was SVN r2631.
Этот коммит содержится в:
Edgar Gabriel 2004-09-13 15:14:09 +00:00
родитель 64e983a88a
Коммит d2d6379578
2 изменённых файлов: 17 добавлений и 5 удалений

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

@ -129,8 +129,9 @@ int ompi_comm_nextcid ( ompi_communicator_t* newcomm,
else {
ompi_pointer_array_set_item(&ompi_mpi_communicators,
nextlocal_cid, NULL);
nextlocal_cid = nextcid;
flag = ompi_pointer_array_test_and_set_item(&ompi_mpi_communicators,
nextcid, comm );
nextlocal_cid, comm );
if (true == flag) {
response = 1; /* works as well */
}
@ -142,10 +143,16 @@ int ompi_comm_nextcid ( ompi_communicator_t* newcomm,
(allredfnct)(&response, &glresponse, 1, MPI_MIN, comm, bridgecomm,
local_leader, remote_leader, send_first );
if (glresponse == 1) {
if (1 == glresponse) {
done = 1; /* we are done */
break;
}
else if ( 0 == glresponse ) {
/* we could use that, but other don't agree */
ompi_pointer_array_set_item(&ompi_mpi_communicators,
nextlocal_cid, NULL);
start = nextcid+1;
}
}
/* set the according values to the newcomm */

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

@ -177,9 +177,14 @@ int ompi_comm_finalize(void)
ompi_mpi_comm_self.c_flags = 0;
OBJ_DESTRUCT( &ompi_mpi_comm_self );
ompi_mpi_comm_parent->c_local_group->grp_flags = 0;
ompi_mpi_comm_parent->c_flags = 0;
OBJ_RETAIN (&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 */
max = ompi_pointer_array_get_size(&ompi_mpi_communicators);
@ -285,12 +290,12 @@ static void ompi_comm_destruct(ompi_communicator_t* comm)
}
if (NULL != comm->c_local_group) {
OBJ_RELEASE ( comm->c_local_group );
}
if (NULL != comm->c_remote_group) {
OBJ_RELEASE ( comm->c_remote_group );
}
if (NULL != comm->c_local_group) {
OBJ_RELEASE ( comm->c_local_group );
}
if (NULL != comm->error_handler) {
OBJ_RELEASE ( comm->error_handler );
}