Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
avoid looping forever on iprobe
[simgrid.git] / src / smpi / colls / allreduce-rdb.c
index fec95bc..bb9c82e 100644 (file)
@@ -1,4 +1,4 @@
-#include "colls.h"
+#include "colls_private.h"
 //#include <star-reduction.c>
 
 int smpi_coll_tuned_allreduce_rdb(void *sbuff, void *rbuff, int count,
@@ -22,12 +22,8 @@ int smpi_coll_tuned_allreduce_rdb(void *sbuff, void *rbuff, int count,
   nprocs=smpi_comm_size(comm);
   rank=smpi_comm_rank(comm);
 
-  smpi_datatype_extent(dtype,&lb, &extent);
-  tmp_buf = (void *) malloc(count * extent);
-  if (!tmp_buf) {
-    printf("Could not allocate memory for tmp_buf\n");
-    return 1;
-  }
+  smpi_datatype_extent(dtype, &lb, &extent);
+  tmp_buf = (void *) xbt_malloc(count * extent);
 
   smpi_mpi_sendrecv(sbuff, count, dtype, rank, 500,
                rbuff, count, dtype, rank, 500, comm, &status);
@@ -126,5 +122,5 @@ int smpi_coll_tuned_allreduce_rdb(void *sbuff, void *rbuff, int count,
   }
 
   free(tmp_buf);
-  return 0;
+  return MPI_SUCCESS;
 }