/* selector with default/naive Simgrid algorithms. These should not be trusted for performance evaluations */
-/* Copyright (c) 2009-2019. The SimGrid Team. All rights reserved. */
+/* Copyright (c) 2009-2021. The SimGrid Team. All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
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;
+ break;
+ }
displs[i] = count;
count += recvcounts[i];
}
+ if(not regular){
+ delete[] displs;
+ return reduce_scatter__mpich(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);