Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
First works on the datatypes. Still missing a lot.
[simgrid.git] / src / smpi / colls / reduce-flat-tree.cpp
index a12009c..b4c3635 100644 (file)
@@ -27,7 +27,7 @@ smpi_coll_tuned_reduce_flat_tree(void *sbuf, void *rbuf, int count,
   extent = smpi_datatype_get_extent(dtype);
 
   if (rank != root) {
-    smpi_mpi_send(sbuf, count, dtype, root, tag, comm);
+    Request::send(sbuf, count, dtype, root, tag, comm);
     return 0;
   }
 
@@ -40,10 +40,10 @@ smpi_coll_tuned_reduce_flat_tree(void *sbuf, void *rbuf, int count,
 
   /* Initialize the receive buffer. */
   if (rank == (size - 1))
-    smpi_mpi_sendrecv(sbuf, count, dtype, rank, tag,
+    Request::sendrecv(sbuf, count, dtype, rank, tag,
                  rbuf, count, dtype, rank, tag, comm, &status);
   else
-    smpi_mpi_recv(rbuf, count, dtype, size - 1, tag, comm, &status);
+    Request::recv(rbuf, count, dtype, size - 1, tag, comm, &status);
 
   /* Loop receiving and calling reduction function (C or Fortran). */
 
@@ -51,12 +51,12 @@ smpi_coll_tuned_reduce_flat_tree(void *sbuf, void *rbuf, int count,
     if (rank == i)
       inbuf = static_cast<char*>(sbuf);
     else {
-      smpi_mpi_recv(origin, count, dtype, i, tag, comm, &status);
+      Request::recv(origin, count, dtype, i, tag, comm, &status);
       inbuf = origin;
     }
 
     /* Call reduction function. */
-    smpi_op_apply(op, inbuf, rbuf, &count, &dtype);
+    if(op!=MPI_OP_NULL) op->apply( inbuf, rbuf, &count, dtype);
 
   }