Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Change file mode (remove execute bit).
[simgrid.git] / src / smpi / colls / allreduce-rab-reduce-scatter.c
old mode 100755 (executable)
new mode 100644 (file)
index 29b3866..5650ef2
@@ -1,4 +1,4 @@
-#include "colls.h"
+#include "colls_private.h"
 #ifndef REDUCE_STUFF
 #define REDUCE_STUFF
 /*****************************************************************************
@@ -341,15 +341,15 @@ int smpi_coll_tuned_allreduce_rab_reduce_scatter(void *sbuff, void *rbuff,
   MPI_Status status;
   void *tmp_buf = NULL;
   MPI_User_function *func = get_op_func(op);
-  MPI_Comm_size(comm, &nprocs);
-  MPI_Comm_rank(comm, &rank);
+  nprocs = smpi_comm_size(comm);
+  rank = smpi_comm_rank(comm);
 
-  MPI_Type_extent(dtype, &extent);
+  extent = smpi_datatype_get_extent(dtype);
   tmp_buf = (void *) xbt_malloc(count * extent);
 
   MPIR_Localcopy(sbuff, count, dtype, rbuff, count, dtype);
 
-  MPI_Type_size(dtype, &type_size);
+  type_size = smpi_datatype_size(dtype);
 
   // find nearest power-of-two less than or equal to comm_size
   pof2 = 1;
@@ -405,8 +405,8 @@ int smpi_coll_tuned_allreduce_rab_reduce_scatter(void *sbuff, void *rbuff,
     // reduce-scatter, calculate the count that each process receives
     // and the displacement within the buffer 
 
-    cnts = (int *) malloc(pof2 * sizeof(int));
-    disps = (int *) malloc(pof2 * sizeof(int));
+    cnts = (int *) xbt_malloc(pof2 * sizeof(int));
+    disps = (int *) xbt_malloc(pof2 * sizeof(int));
 
     for (i = 0; i < (pof2 - 1); i++)
       cnts[i] = count / pof2;