Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[EXAMPLES] Added an example for the HostLoad plugin
[simgrid.git] / src / smpi / colls / allreduce-mvapich-rs.cpp
index bf8cba4..e887175 100644 (file)
@@ -49,8 +49,8 @@ int smpi_coll_tuned_allreduce_mvapich2_rs(void *sendbuf,
     is_commutative = (op==MPI_OP_NULL || op->is_commutative());
 
     /* need to allocate temporary buffer to store incoming data */
-    smpi_datatype_extent(datatype, &true_lb, &true_extent);
-    extent = smpi_datatype_get_extent(datatype);
+    datatype->extent(&true_lb, &true_extent);
+    extent = datatype->get_extent();
 
     tmp_buf_free= smpi_get_tmp_recvbuffer(count * (MAX(extent, true_extent)));
 
@@ -60,7 +60,7 @@ int smpi_coll_tuned_allreduce_mvapich2_rs(void *sendbuf,
     /* copy local data into recvbuf */
     if (sendbuf != MPI_IN_PLACE) {
         mpi_errno =
-            smpi_datatype_copy(sendbuf, count, datatype, recvbuf, count,
+            Datatype::copy(sendbuf, count, datatype, recvbuf, count,
                            datatype);
     }
 
@@ -94,7 +94,7 @@ int smpi_coll_tuned_allreduce_mvapich2_rs(void *sendbuf,
             /* do the reduction on received data. since the
                ordering is right, it doesn't matter whether
                the operation is commutative or not. */
-               if(op!=MPI_OP_NULL) op->apply( tmp_buf, recvbuf, &count, &datatype);
+               if(op!=MPI_OP_NULL) op->apply( tmp_buf, recvbuf, &count, datatype);
                 /* change the rank */
                 newrank = rank / 2;
         }
@@ -132,12 +132,12 @@ int smpi_coll_tuned_allreduce_mvapich2_rs(void *sendbuf,
 
                 if (is_commutative || (dst < rank)) {
                     /* op is commutative OR the order is already right */
-                     if(op!=MPI_OP_NULL) op->apply( tmp_buf, recvbuf, &count, &datatype);
+                     if(op!=MPI_OP_NULL) op->apply( tmp_buf, recvbuf, &count, datatype);
                 } else {
                     /* op is noncommutative and the order is not right */
-                    if(op!=MPI_OP_NULL) op->apply( recvbuf, tmp_buf, &count, &datatype);
+                    if(op!=MPI_OP_NULL) op->apply( recvbuf, tmp_buf, &count, datatype);
                     /* copy result back into recvbuf */
-                    mpi_errno = smpi_datatype_copy(tmp_buf, count, datatype,
+                    mpi_errno = Datatype::copy(tmp_buf, count, datatype,
                                                recvbuf, count, datatype);
                 }
                 mask <<= 1;
@@ -204,7 +204,7 @@ int smpi_coll_tuned_allreduce_mvapich2_rs(void *sendbuf,
 
                 if(op!=MPI_OP_NULL) op->apply( (char *) tmp_buf + disps[recv_idx] * extent,
                         (char *) recvbuf + disps[recv_idx] * extent,
-                        &recv_cnt, &datatype);
+                        &recv_cnt, datatype);
 
                 /* update send_idx for next iteration */
                 send_idx = recv_idx;