diff --git a/ompi/mpi/c/intercomm_merge.c b/ompi/mpi/c/intercomm_merge.c index fa23b6dd80..a8651eb12b 100644 --- a/ompi/mpi/c/intercomm_merge.c +++ b/ompi/mpi/c/intercomm_merge.c @@ -43,7 +43,6 @@ int MPI_Intercomm_merge(MPI_Comm intercomm, int high, ompi_communicator_t *newcomp=MPI_COMM_NULL; ompi_proc_t **procs=NULL; int local_size, remote_size; - int local_rank; int first; int total_size; int rc=MPI_SUCCESS; @@ -65,7 +64,6 @@ int MPI_Intercomm_merge(MPI_Comm intercomm, int high, } local_size = ompi_comm_size ( intercomm ); - local_rank = ompi_comm_rank ( intercomm ); remote_size = ompi_comm_remote_size ( intercomm ); total_size = local_size + remote_size; procs = (ompi_proc_t **) malloc ( total_size * sizeof(ompi_proc_t *)); diff --git a/ompi/mpi/c/type_dup.c b/ompi/mpi/c/type_dup.c index 135283199a..a2ab3444a1 100644 --- a/ompi/mpi/c/type_dup.c +++ b/ompi/mpi/c/type_dup.c @@ -36,8 +36,6 @@ static const char FUNC_NAME[] = "MPI_Type_dup"; int MPI_Type_dup (MPI_Datatype type, MPI_Datatype *newtype) { - int rc; - OPAL_CR_TEST_CHECKPOINT_READY(); if( MPI_PARAM_CHECK ) { @@ -58,30 +56,30 @@ int MPI_Type_dup (MPI_Datatype type, return OMPI_SUCCESS; } - if( (rc = ompi_ddt_duplicate( type, newtype )) != MPI_SUCCESS ) { - ompi_ddt_destroy( newtype ); - OMPI_ERRHANDLER_RETURN( MPI_ERR_INTERN, MPI_COMM_WORLD, - MPI_ERR_INTERN, FUNC_NAME ); + if (OMPI_SUCCESS != ompi_ddt_duplicate( type, newtype)) { + ompi_ddt_destroy( newtype ); + OMPI_ERRHANDLER_RETURN (MPI_ERR_INTERN, MPI_COMM_WORLD, + MPI_ERR_INTERN, FUNC_NAME ); } ompi_ddt_set_args( *newtype, 0, NULL, 0, NULL, 1, &type, MPI_COMBINER_DUP ); - /* Copy all the old attributes, if there were any. This is done - here (vs. ompi_ddt_duplicate()) because MPI_TYPE_DUP is the - only MPI function that copies attributes. All other MPI - functions that take an old type and generate a newtype do not - copy attributes. Really. */ - if (NULL != type->d_keyhash) { - ompi_attr_hash_init(&(*newtype)->d_keyhash); - if (OMPI_SUCCESS != (rc = ompi_attr_copy_all(TYPE_ATTR, - type, *newtype, - type->d_keyhash, - (*newtype)->d_keyhash))) { - ompi_ddt_destroy(newtype); - OMPI_ERRHANDLER_RETURN( MPI_ERR_INTERN, MPI_COMM_WORLD, - MPI_ERR_INTERN, FUNC_NAME ); - } - } + /* Copy all the old attributes, if there were any. This is done + here (vs. ompi_ddt_duplicate()) because MPI_TYPE_DUP is the + only MPI function that copies attributes. All other MPI + functions that take an old type and generate a newtype do not + copy attributes. Really. */ + if (NULL != type->d_keyhash) { + ompi_attr_hash_init(&(*newtype)->d_keyhash); + if (OMPI_SUCCESS != ompi_attr_copy_all(TYPE_ATTR, + type, *newtype, + type->d_keyhash, + (*newtype)->d_keyhash)) { + ompi_ddt_destroy(newtype); + OMPI_ERRHANDLER_RETURN( MPI_ERR_INTERN, MPI_COMM_WORLD, + MPI_ERR_INTERN, FUNC_NAME ); + } + } return MPI_SUCCESS; } diff --git a/ompi/mpi/f77/cart_coords_f.c b/ompi/mpi/f77/cart_coords_f.c index ac45d5ed4a..ceabd9691b 100644 --- a/ompi/mpi/f77/cart_coords_f.c +++ b/ompi/mpi/f77/cart_coords_f.c @@ -58,21 +58,19 @@ OMPI_GENERATE_F77_BINDINGS (MPI_CART_COORDS, #endif void mpi_cart_coords_f(MPI_Fint *comm, MPI_Fint *rank, MPI_Fint *maxdims, - MPI_Fint *coords, MPI_Fint *ierr) + MPI_Fint *coords, MPI_Fint *ierr) { MPI_Comm c_comm; - int size; OMPI_ARRAY_NAME_DECL(coords); - - c_comm = MPI_Comm_f2c(*comm); - size = OMPI_FINT_2_INT(*maxdims); - OMPI_ARRAY_FINT_2_INT_ALLOC(coords, size); - *ierr = OMPI_INT_2_FINT(MPI_Cart_coords(c_comm, - OMPI_FINT_2_INT(*rank), - OMPI_FINT_2_INT(*maxdims), - OMPI_ARRAY_NAME_CONVERT(coords))); + c_comm = MPI_Comm_f2c(*comm); + + OMPI_ARRAY_FINT_2_INT_ALLOC(coords, OMPI_FINT_2_INT(*maxdims)); + *ierr = OMPI_INT_2_FINT(MPI_Cart_coords(c_comm, + OMPI_FINT_2_INT(*rank), + OMPI_FINT_2_INT(*maxdims), + OMPI_ARRAY_NAME_CONVERT(coords))); if (MPI_SUCCESS == OMPI_FINT_2_INT(*ierr)) { - OMPI_ARRAY_INT_2_FINT(coords, size); + OMPI_ARRAY_INT_2_FINT(coords, OMPI_FINT_2_INT(*maxdims)); } }