From 7fb741d53da8848e8f9466018af2e52d241b09aa Mon Sep 17 00:00:00 2001
From: Axel Kohlmeyer <akohlmey@gmail.com>
Date: Fri, 17 Mar 2017 11:35:59 -0400
Subject: [PATCH] Revert "In irregular.cpp use simpler and slightly faster
 MPI_Reduce_scatter_block()"

This reverts commit 8e75616c144d7d75b7163e0f79668b7429de2126.
---
 src/irregular.cpp | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/irregular.cpp b/src/irregular.cpp
index fe08e04be8..d0210244fb 100644
--- a/src/irregular.cpp
+++ b/src/irregular.cpp
@@ -297,9 +297,11 @@ int Irregular::create_atom(int n, int *sizes, int *proclist, int sortflag)
 
   // setup for collective comm
   // work1 = 1 for procs I send a message to, not including self
+  // work2 = 1 for all procs, used for ReduceScatter
 
   for (i = 0; i < nprocs; i++) {
     work1[i] = 0;
+    work2[i] = 1;
   }
   for (i = 0; i < n; i++) work1[proclist[i]] = 1;
   work1[me] = 0;
@@ -316,7 +318,7 @@ int Irregular::create_atom(int n, int *sizes, int *proclist, int sortflag)
   MPI_Allreduce(work1,work2,nprocs,MPI_INT,MPI_SUM,world);
   nrecv_proc = work2[me];
 #else
-  MPI_Reduce_scatter_block(work1,&nrecv_proc,1,MPI_INT,MPI_SUM,world);
+  MPI_Reduce_scatter(work1,&nrecv_proc,work2,MPI_INT,MPI_SUM,world);
 #endif
 #endif
 
@@ -543,9 +545,11 @@ int Irregular::create_data(int n, int *proclist, int sortflag)
 
   // setup for collective comm
   // work1 = 1 for procs I send a message to, not including self
+  // work2 = 1 for all procs, used for ReduceScatter
 
   for (i = 0; i < nprocs; i++) {
     work1[i] = 0;
+    work2[i] = 1;
   }
   for (i = 0; i < n; i++) work1[proclist[i]] = 1;
   work1[me] = 0;
@@ -562,7 +566,7 @@ int Irregular::create_data(int n, int *proclist, int sortflag)
   MPI_Allreduce(work1,work2,nprocs,MPI_INT,MPI_SUM,world);
   nrecv_proc = work2[me];
 #else
-  MPI_Reduce_scatter_block(work1,&nrecv_proc,1,MPI_INT,MPI_SUM,world);
+  MPI_Reduce_scatter(work1,&nrecv_proc,work2,MPI_INT,MPI_SUM,world);
 #endif
 #endif
 
-- 
GitLab