Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Don't use this anymore, as we are in the same namespace already.
[simgrid.git] / src / smpi / colls / alltoall-pair.cpp
index 8a0a76e..f0e127b 100644 (file)
@@ -40,24 +40,24 @@ int smpi_coll_tuned_alltoall_pair_rma(void *send_buff, int send_count, MPI_Datat
 
   char *send_ptr = (char *) send_buff;
 
-  rank = smpi_comm_rank(comm);
-  num_procs = smpi_comm_size(comm);
+  rank = comm->rank();
+  num_procs = comm->size();
   send_chunk = smpi_datatype_get_extent(send_type);
   recv_chunk = smpi_datatype_get_extent(recv_type);
 
-  win=smpi_mpi_win_create(recv_buff, num_procs * recv_chunk * send_count, recv_chunk, 0,
+  win=new  Win(recv_buff, num_procs * recv_chunk * send_count, recv_chunk, 0,
                  comm);
   send_chunk *= send_count;
   recv_chunk *= recv_count;
 
-  smpi_mpi_win_fence(assert, win);
+  win->fence(assert);
   for (i = 0; i < num_procs; i++) {
     dst = rank ^ i;
-    smpi_mpi_put(send_ptr + dst * send_chunk, send_count, send_type, dst,
-            rank /* send_chunk*/, send_count, send_type, win);
+    win->put(send_ptr + dst * send_chunk, send_count, send_type, dst,
+            rank /* send_chunk*/, send_count, send_type);
   }
-  smpi_mpi_win_fence(assert, win);
-  smpi_mpi_win_free(&win);
+  win->fence(assert);
+  delete win;
   return 0;
 }
 
@@ -75,8 +75,8 @@ int smpi_coll_tuned_alltoall_pair(void *send_buff, int send_count,
   char *send_ptr = (char *) send_buff;
   char *recv_ptr = (char *) recv_buff;
 
-  rank = smpi_comm_rank(comm);
-  num_procs = smpi_comm_size(comm);
+  rank = comm->rank();
+  num_procs = comm->size();
 
   if((num_procs&(num_procs-1)))
     THROWF(arg_error,0, "alltoall pair algorithm can't be used with non power of two number of processes ! ");
@@ -89,7 +89,7 @@ int smpi_coll_tuned_alltoall_pair(void *send_buff, int send_count,
 
   for (i = 0; i < num_procs; i++) {
     src = dst = rank ^ i;
-    smpi_mpi_sendrecv(send_ptr + dst * send_chunk, send_count, send_type, dst, tag,
+    Request::sendrecv(send_ptr + dst * send_chunk, send_count, send_type, dst, tag,
                 recv_ptr + src * recv_chunk, recv_count, recv_type, src, tag,
                 comm, &s);
   }