Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
the naive legacy (default) reduce_scatter did not work really well with different...
authorAugustin Degomme <adegomme@gmail.com>
Thu, 18 Feb 2021 00:11:32 +0000 (01:11 +0100)
committerAugustin Degomme <adegomme@gmail.com>
Thu, 18 Feb 2021 00:11:32 +0000 (01:11 +0100)
src/smpi/colls/smpi_default_selector.cpp

index febd2e3..d3c2fcb 100644 (file)
@@ -39,10 +39,18 @@ int reduce_scatter__default(const void *sendbuf, void *recvbuf, const int *recvc
   int size = comm->size();
   int count = 0;
   int* displs = new int[size];
+  int regular=1;
   for (int i = 0; i < size; i++) {
+    if(recvcounts[i]!=recvcounts[0]){
+      regular=0;
+      continue;
+    }
     displs[i] = count;
     count += recvcounts[i];
   }
+  if(not regular)
+    return reduce_scatter__ompi(sendbuf, recvbuf, recvcounts, datatype, op, comm);
+
   unsigned char* tmpbuf = smpi_get_tmp_sendbuffer(count * datatype->get_extent());
 
   int ret = reduce__default(sendbuf, tmpbuf, count, datatype, op, 0, comm);