Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
do not call smpi_bench_* from SMPI_MPI_Allreduce since it calls SMPI_MPI_* function...
[simgrid.git] / src / smpi / smpi_mpi.c
index 3d60c4d..9cf5d01 100644 (file)
@@ -206,20 +206,32 @@ smpi_mpi_request_t rrequest;
          rank = smpi_mpi_comm_rank(comm);
 
          /* send */
-         retval = smpi_create_request(sendbuf, sendcount, sendtype, 
+         /* -------------*/
+           retval = smpi_create_request(sendbuf, sendcount, sendtype, 
                                rank,dest,sendtag, 
                                comm, &srequest);
+         printf("[%d] isend request src=%d -> dst=%d (retval=%d)\n",rank,rank,dest,retval);
          smpi_mpi_isend(srequest);
+        
+         
+         //retval = MPI_Isend( sendbuf, sendcount, sendtype, dest, sendtag, MPI_COMM_WORLD, &srequest);
 
 
          /* recv */
          retval = smpi_create_request(recvbuf, recvcount, recvtype, 
-                               source,rank,recvtag, 
+                               source, rank,recvtag, 
                                comm, &rrequest);
+         printf("[%d] irecv request src=%d -> dst=%d (retval=%d)\n",rank,source,rank,retval);
          smpi_mpi_irecv(rrequest);
 
+         //retval = MPI_Irecv( recvbuf, recvcount, recvtype, source, recvtag, MPI_COMM_WORLD, &rrequest);
+
+
          smpi_mpi_wait(srequest, MPI_STATUS_IGNORE);
+         printf("[%d] isend request src=%d dst=%d tag=%d COMPLETED (retval=%d) \n",rank,rank,dest,sendtag,retval);
+
          smpi_mpi_wait(rrequest, MPI_STATUS_IGNORE);
+         printf("[%d] irecv request src=%d -> dst=%d tag=%d COMPLETED (retval=%d)\n",rank,source,rank,recvtag,retval);
 
          return(retval);
 }
@@ -426,14 +438,16 @@ int SMPI_MPI_Allreduce( void *sendbuf, void *recvbuf, int count, MPI_Datatype da
   int retval = MPI_SUCCESS;
   int root=1;  // arbitrary choice
 
-  smpi_bench_end();
+  //smpi_bench_end(); //FIXME: restaure after calling smpi_mpi_reduce instead
 
+  DEBUG0("Reduce");
   retval = SMPI_MPI_Reduce( sendbuf, recvbuf, count, datatype, op, root, comm);
   if (MPI_SUCCESS != retval)
            return(retval);
 
+  DEBUG0("Reduce done, time to bcast");
   retval = SMPI_MPI_Bcast( sendbuf, count, datatype, root, comm);
-  smpi_bench_begin();
+//  smpi_bench_begin();
   return( retval );
 }