Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
welcome simgrid::smpi::Request
[simgrid.git] / src / smpi / colls / bcast-SMP-binomial.cpp
index 6053e49c7a02c1ea8ad88673632eff3155ae94c0..57c0b4cfa18f7977fc44a12f8d38d15ea7c5bb1b 100644 (file)
@@ -16,15 +16,15 @@ int smpi_coll_tuned_bcast_SMP_binomial(void *buf, int count,
   MPI_Status status;
   int tag = COLL_TAG_BCAST;
 
-  size = smpi_comm_size(comm);
-  rank = smpi_comm_rank(comm);
+  size = comm->size();
+  rank = comm->rank();
 
-  if(smpi_comm_get_leaders_comm(comm)==MPI_COMM_NULL){
-    smpi_comm_init_smp(comm);
+  if(comm->get_leaders_comm()==MPI_COMM_NULL){
+    comm->init_smp();
   }
   int num_core=1;
-  if (smpi_comm_is_uniform(comm)){
-    num_core = smpi_comm_size(smpi_comm_get_intra_comm(comm));
+  if (comm->is_uniform()){
+    num_core = comm->get_intra_comm()->size();
   }else{
     //implementation buggy in this case
     return smpi_coll_tuned_bcast_mpich( buf , count, datatype,
@@ -43,9 +43,9 @@ int smpi_coll_tuned_bcast_SMP_binomial(void *buf, int count,
   // if root is not zero send to rank zero first
   if (root != 0) {
     if (rank == root)
-      smpi_mpi_send(buf, count, datatype, 0, tag, comm);
+      Request::send(buf, count, datatype, 0, tag, comm);
     else if (rank == 0)
-      smpi_mpi_recv(buf, count, datatype, root, tag, comm, &status);
+      Request::recv(buf, count, datatype, root, tag, comm, &status);
   }
   //FIRST STEP node 0 send to every root-of-each-SMP with binomial tree
 
@@ -57,7 +57,7 @@ int smpi_coll_tuned_bcast_SMP_binomial(void *buf, int count,
       if (inter_rank & mask) {
         from_inter = (inter_rank - mask) * num_core;
         //printf("Node %d recv from node %d when mask is %d\n", rank, from_inter, mask);
-        smpi_mpi_recv(buf, count, datatype, from_inter, tag, comm, &status);
+        Request::recv(buf, count, datatype, from_inter, tag, comm, &status);
         break;
       }
       mask <<= 1;
@@ -71,7 +71,7 @@ int smpi_coll_tuned_bcast_SMP_binomial(void *buf, int count,
         to_inter = (inter_rank + mask) * num_core;
         if (to_inter < size) {
           //printf("Node %d send to node %d when mask is %d\n", rank, to_inter, mask);
-          smpi_mpi_send(buf, count, datatype, to_inter, tag, comm);
+          Request::send(buf, count, datatype, to_inter, tag, comm);
         }
       }
       mask >>= 1;
@@ -85,7 +85,7 @@ int smpi_coll_tuned_bcast_SMP_binomial(void *buf, int count,
     if (intra_rank & mask) {
       from_intra = base + (intra_rank - mask);
       //printf("Node %d recv from node %d when mask is %d\n", rank, from_inter, mask);
-      smpi_mpi_recv(buf, count, datatype, from_intra, tag, comm, &status);
+      Request::recv(buf, count, datatype, from_intra, tag, comm, &status);
       break;
     }
     mask <<= 1;
@@ -100,7 +100,7 @@ int smpi_coll_tuned_bcast_SMP_binomial(void *buf, int count,
       to_intra = base + (intra_rank + mask);
       if (to_intra < size) {
         //printf("Node %d send to node %d when mask is %d\n", rank, to_inter, mask);
-        smpi_mpi_send(buf, count, datatype, to_intra, tag, comm);
+        Request::send(buf, count, datatype, to_intra, tag, comm);
       }
     }
     mask >>= 1;