diff --git a/src/communicator/comm_init.c b/src/communicator/comm_init.c index 6930e36cf8..881d5b0574 100644 --- a/src/communicator/comm_init.c +++ b/src/communicator/comm_init.c @@ -267,8 +267,9 @@ static void ompi_comm_destruct(ompi_communicator_t* comm) } /* reset the ompi_comm_f_to_c_table entry */ - if ( NULL != ompi_pointer_array_get_item ( &ompi_mpi_communicators, - comm->c_f_to_c_index )) { + if ( MPI_UNDEFINED != comm->c_f_to_c_index && + NULL != ompi_pointer_array_get_item(&ompi_mpi_communicators, + comm->c_f_to_c_index )) { ompi_pointer_array_set_item ( &ompi_mpi_communicators, comm->c_f_to_c_index, NULL); } diff --git a/src/mpi/f77/comm_split_f.c b/src/mpi/f77/comm_split_f.c index 341cdbce31..06a582a46b 100644 --- a/src/mpi/f77/comm_split_f.c +++ b/src/mpi/f77/comm_split_f.c @@ -52,6 +52,6 @@ void mpi_comm_split_f(MPI_Fint *comm, MPI_Fint *color, MPI_Fint *key, MPI_Fint * MPI_Comm c_newcomm; MPI_Comm c_comm = MPI_Comm_f2c ( *comm ); - *ierr = MPI_Comm_split ( c_comm, (int) color, (int) key, &c_newcomm ); + *ierr = MPI_Comm_split ( c_comm, (int) *color, (int) *key, &c_newcomm ); *newcomm = MPI_Comm_c2f (c_newcomm); }