From ed703bec1bcfc5425598ccc197a3735e6cef19d8 Mon Sep 17 00:00:00 2001 From: Gilles Gouaillardet Date: Wed, 17 Jul 2019 09:28:43 +0900 Subject: [PATCH] fortran/mpif-h: fix [i]alltoallw bindings Fix a regression introduced in open-mpi/ompi@cdaed89d0481e8352a6c1a6cb8f71a250ea9352b Fixes CID 1451610, 1451611 and 1451612 Signed-off-by: Gilles Gouaillardet --- ompi/mpi/fortran/mpif-h/alltoallw_f.c | 4 ++-- ompi/mpi/fortran/mpif-h/ialltoallw_f.c | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/ompi/mpi/fortran/mpif-h/alltoallw_f.c b/ompi/mpi/fortran/mpif-h/alltoallw_f.c index 581eb7288e1..55b782a7928 100644 --- a/ompi/mpi/fortran/mpif-h/alltoallw_f.c +++ b/ompi/mpi/fortran/mpif-h/alltoallw_f.c @@ -75,7 +75,7 @@ void ompi_alltoallw_f(char *sendbuf, MPI_Fint *sendcounts, MPI_Fint *comm, MPI_Fint *ierr) { MPI_Comm c_comm; - MPI_Datatype *c_sendtypes, *c_recvtypes; + MPI_Datatype *c_sendtypes = NULL, *c_recvtypes; int size, c_ierr; OMPI_ARRAY_NAME_DECL(sendcounts); OMPI_ARRAY_NAME_DECL(sdispls); @@ -119,7 +119,7 @@ void ompi_alltoallw_f(char *sendbuf, MPI_Fint *sendcounts, OMPI_ARRAY_FINT_2_INT_CLEANUP(sdispls); OMPI_ARRAY_FINT_2_INT_CLEANUP(recvcounts); OMPI_ARRAY_FINT_2_INT_CLEANUP(rdispls); - if (MPI_IN_PLACE != sendbuf) { + if (NULL != c_sendtypes) { free(c_sendtypes); } free(c_recvtypes); diff --git a/ompi/mpi/fortran/mpif-h/ialltoallw_f.c b/ompi/mpi/fortran/mpif-h/ialltoallw_f.c index 2aed76900e8..75f8262bef5 100644 --- a/ompi/mpi/fortran/mpif-h/ialltoallw_f.c +++ b/ompi/mpi/fortran/mpif-h/ialltoallw_f.c @@ -75,7 +75,7 @@ void ompi_ialltoallw_f(char *sendbuf, MPI_Fint *sendcounts, MPI_Fint *comm, MPI_Fint *request, MPI_Fint *ierr) { MPI_Comm c_comm; - MPI_Datatype *c_sendtypes, *c_recvtypes; + MPI_Datatype *c_sendtypes = NULL, *c_recvtypes; MPI_Request c_request; int size, c_ierr; OMPI_ARRAY_NAME_DECL(sendcounts); @@ -101,7 +101,6 @@ void ompi_ialltoallw_f(char *sendbuf, MPI_Fint *sendcounts, for (int i=0; i