[mvapich-discuss] Segmentation fault in MPI_Reduce using MPI_IN_PLACE and root != 0

Akshay Venkatesh akshay at cse.ohio-state.edu
Mon Jun 29 11:45:21 EDT 2015


Good to know the patch included worked Markus. Thanks for verifying.

diff --git a/src/mpi/coll/reduce_osu.c b/src/mpi/coll/reduce_osu.c
index b5d2f1f..50cb018 100644
--- a/src/mpi/coll/reduce_osu.c
+++ b/src/mpi/coll/reduce_osu.c
@@ -1346,8 +1346,20 @@ int MPIR_Reduce_two_level_helper_MV2(const void
*sendbuf,
                      }
                  }
             } else {
-                in_buf  = (void *)sendbuf;
-                out_buf = NULL;
+               if (my_rank != root) {
+                   in_buf  = (void *)sendbuf;
+                   out_buf = NULL;
+               }
+               else {
+                   if (sendbuf !=  MPI_IN_PLACE) {
+                       in_buf  = (void *)sendbuf;
+                       out_buf = (void *)recvbuf;
+                   }
+                   else {
+                       in_buf  = (void *)recvbuf;
+                       out_buf = (void *)recvbuf;
+                   }
+               }
             }

            if (count * (MPIR_MAX(extent, true_extent)) <
SHMEM_COLL_BLOCK_SIZE) {


On Mon, Jun 29, 2015 at 11:13 AM, Markus Geimer <mg1102 at web.de> wrote:

> Akshay,
>
> > Sorry for the delay in getting back. There were a couple of corner cases
> > not handled for non-zero roots that needed fixing. It works for us on
> > stampede with your reproducer. Can you try the following patch and let
> > us know if the patch fixes the problems you faced? (the patch is also
> > attached)
>
> Good news!  The patch you provided indeed fixes the issue for both
> my simplified test case as well as the original problem encountered
> with my application. Thanks for fixing it!
>
> Markus
>



-- 
- Akshay
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.cse.ohio-state.edu/pipermail/mvapich-discuss/attachments/20150629/d64eca58/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: reduce-inplace-fix.patch
Type: text/x-patch
Size: 995 bytes
Desc: not available
URL: <http://mailman.cse.ohio-state.edu/pipermail/mvapich-discuss/attachments/20150629/d64eca58/attachment.bin>


More information about the mvapich-discuss mailing list