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-binomial.cpp
index d9255a8..53a802d 100644 (file)
@@ -28,7 +28,7 @@ int smpi_coll_tuned_reduce_binomial(void *sendbuf, void *recvbuf, int count,
   extent = smpi_datatype_get_extent(datatype);
 
   tmp_buf = (void *) smpi_get_tmp_sendbuffer(count * extent);
-  int is_commutative = smpi_op_is_commute(op);
+  int is_commutative =  (op==MPI_OP_NULL || op->is_commutative());
   mask = 1;
   
   int lroot;
@@ -59,18 +59,18 @@ int smpi_coll_tuned_reduce_binomial(void *sendbuf, void *recvbuf, int count,
       source = (relrank | mask);
       if (source < comm_size) {
         source = (source + lroot) % comm_size;
-        smpi_mpi_recv(tmp_buf, count, datatype, source, tag, comm, &status);
+        Request::recv(tmp_buf, count, datatype, source, tag, comm, &status);
         
         if (is_commutative) {
-          smpi_op_apply(op, tmp_buf, recvbuf, &count, &datatype);
+          if(op!=MPI_OP_NULL) op->apply( tmp_buf, recvbuf, &count, datatype);
         } else {
-          smpi_op_apply(op, recvbuf, tmp_buf, &count, &datatype);
+          if(op!=MPI_OP_NULL) op->apply( recvbuf, tmp_buf, &count, datatype);
           smpi_datatype_copy(tmp_buf, count, datatype,recvbuf, count, datatype);
         }
       }
     } else {
       dst = ((relrank & (~mask)) + lroot) % comm_size;
-      smpi_mpi_send(recvbuf, count, datatype, dst, tag, comm);
+      Request::send(recvbuf, count, datatype, dst, tag, comm);
       break;
     }
     mask <<= 1;
@@ -78,9 +78,9 @@ int smpi_coll_tuned_reduce_binomial(void *sendbuf, void *recvbuf, int count,
 
   if (!is_commutative && (root != 0)){
     if (rank == 0){
-      smpi_mpi_send(recvbuf, count, datatype, root,tag, comm);
+      Request::send(recvbuf, count, datatype, root,tag, comm);
     }else if (rank == root){
-      smpi_mpi_recv(recvbuf, count, datatype, 0, tag, comm, &status);
+      Request::recv(recvbuf, count, datatype, 0, tag, comm, &status);
     }
   }