Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Ensure we don't post a too big receive here, because this could lead to problems...
[simgrid.git] / src / smpi / smpi_base.c
index 88e9307..8bb78e1 100644 (file)
@@ -320,6 +320,7 @@ void smpi_mpi_start(MPI_Request request)
   if(request->flags & PREPARED)request->flags &= ~PREPARED;
   if(request->flags & RECV) {
     print_request("New recv", request);
+    //FIXME: if receive is posted with a large size, but send is smaller, mailboxes may not match !
     if (request->size < sg_cfg_get_int("smpi/async_small_thres"))
       mailbox = smpi_process_mailbox_small();
     else
@@ -345,7 +346,7 @@ void smpi_mpi_start(MPI_Request request)
     #ifdef HAVE_TRACING
       int rank = smpi_process_index();
       if (TRACE_smpi_view_internals()) {
-        TRACE_smpi_send(rank, rank, receiver);
+        TRACE_smpi_send(rank, rank, receiver,request->size);
       }
     #endif
 /*    if(receiver == MPI_UNDEFINED) {*/
@@ -676,6 +677,8 @@ int smpi_mpi_testall(int count, MPI_Request requests[],
     if(requests[i]!= MPI_REQUEST_NULL){
       if (smpi_mpi_test(&requests[i], pstat)!=1){
         flag=0;
+      }else{
+          requests[i]=MPI_REQUEST_NULL;
       }
     }else{
       smpi_empty_status(pstat);
@@ -752,7 +755,7 @@ void smpi_mpi_wait(MPI_Request * request, MPI_Status * status)
     simcall_comm_wait((*request)->action, -1.0);
   }
   finish_wait(request, status);
-
+  request=MPI_REQUEST_NULL;
   // FIXME for a detached send, finish_wait is not called:
 }
 
@@ -881,7 +884,7 @@ int smpi_mpi_testsome(int incount, MPI_Request requests[], int *indices,
   for(i = 0; i < incount; i++) {
     if((requests[i] != MPI_REQUEST_NULL)) {
       if(smpi_mpi_test(&requests[i], pstat)) {
-         indices[count] = i;
+         indices[i] = 1;
          count++;
          if(status != MPI_STATUSES_IGNORE) {
            status[i] = *pstat;