Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
protect (hopefully) collective communication algorithms from abuse.
[simgrid.git] / src / smpi / colls / allreduce-rab1.c
index ae72f74..e863339 100644 (file)
@@ -8,7 +8,7 @@ int smpi_coll_tuned_allreduce_rab1(void *sbuff, void *rbuff,
 {
   MPI_Status status;
   MPI_Aint extent;
-  int tag = 4321, rank, nprocs, send_size, newcnt, share;
+  int tag = COLL_TAG_ALLREDUCE, rank, nprocs, send_size, newcnt, share;
   int pof2 = 1, mask, send_idx, recv_idx, dst, send_cnt, recv_cnt;
 
   void *recv, *tmp_buf;
@@ -16,6 +16,9 @@ int smpi_coll_tuned_allreduce_rab1(void *sbuff, void *rbuff,
   rank = smpi_comm_rank(comm);
   nprocs = smpi_comm_size(comm);
 
+  if((nprocs&(nprocs-1)))
+    THROWF(arg_error,0, "allreduce rab1 algorithm can't be used with non power of two number of processes ! ");
+
   extent = smpi_datatype_get_extent(dtype);
 
   pof2 = 1;