[mvapich-discuss] Strange error with MPI_REDUCE

amith rajith mamidala mamidala at cse.ohio-state.edu
Thu Dec 20 12:45:25 EST 2007


Hi Christian,

If you are using MVAPICH1, I am attaching a minor patch related to freeing
of memory with MPI_REDUCE. Can you apply this one too?


Thanks,
Amith.

On Mon, 17 Dec 2007, amith rajith mamidala wrote:

> Hi Christian,
>
> I am attaching the patch for MVAPICH2 (0.9.8) along with this mail. Can
> you please try this out?
>
> Thanks,
> Amith.
>
> On Wed, 12 Dec 2007, amith rajith mamidala wrote:
>
> > Hi Christian,
> >
> > Thanks for trying out the patch.
> > I will post a patch to MVAPICH2 in the next few days.
> >
> > Thanks,
> > Amith.
> >
> > On Tue, 11 Dec 2007, Christian Boehme wrote:
> >
> > > Hi Amith,
> > > > Can you also try the patch I am attaching with this mail and let us know
> > > > how it works?
> > > >
> > >
> > > Now that the patch seems to work, would it be possible to get a similar
> > > patch for MVAPICH2 (version 0.9.8)? Many thanks
> > >
> > > Christian Boehme
> > >
> >
> >
>
-------------- next part --------------
Index: intra_fns_new.c
===================================================================
--- intra_fns_new.c	(revision 1714)
+++ intra_fns_new.c	(working copy)
@@ -5194,12 +5194,14 @@
                     mpi_errno = MPI_Sendrecv(tmpbuf, count, datatype->self, rank,
                             MPIR_REDUCE_TAG, recvbuf, count, datatype->self, rank, 
                             MPIR_REDUCE_TAG, comm_ptr->self, &status);
+                    FREE((char *)tmpbuf+lb); 
                 }
                 else{
                     mpi_errno = MPI_Sendrecv(sendbuf, count, datatype->self, rank,
                             MPIR_REDUCE_TAG, recvbuf, count, datatype->self, rank, 
                             MPIR_REDUCE_TAG, comm_ptr->self, &status);
                 }
+                FREE((char *)tmpbuf1+lb); 
                 return MPI_SUCCESS;
             }
 
@@ -5216,6 +5218,8 @@
             mpi_errno = MPI_Sendrecv(tmpbuf1, count, datatype->self, rank,
                     MPIR_REDUCE_TAG, recvbuf, count, datatype->self, rank, 
                     MPIR_REDUCE_TAG, comm_ptr->self, &status);
+            FREE((char *)tmpbuf1+lb); 
+            FREE((char *)tmpbuf+lb); 
             return MPI_SUCCESS;
 
         }
@@ -5246,6 +5250,9 @@
         if ((local_rank == 0)&&(local_size > 1)){
             FREE((char *)tmpbuf+lb); 
         }
+        if (local_rank == 0){
+            FREE((char *)tmpbuf1+lb); 
+        }
 
     }
     else{


More information about the mvapich-discuss mailing list