Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Set status in any case.
authorArnaud Giersch <arnaud.giersch@iut-bm.univ-fcomte.fr>
Mon, 18 Feb 2013 20:31:42 +0000 (21:31 +0100)
committerArnaud Giersch <arnaud.giersch@iut-bm.univ-fcomte.fr>
Mon, 18 Feb 2013 20:32:21 +0000 (21:32 +0100)
src/smpi/smpi_base.c

index 823a5eb..84e314c 100644 (file)
@@ -531,13 +531,14 @@ int smpi_mpi_get_count(MPI_Status * status, MPI_Datatype datatype)
 static void finish_wait(MPI_Request * request, MPI_Status * status)
 {
   MPI_Request req = *request;
+  if(status != MPI_STATUS_IGNORE)
+    smpi_empty_status(status);
+
   if(!(req->detached && req->flags & SEND)){
     if(status != MPI_STATUS_IGNORE) {
       status->MPI_SOURCE = req->src == MPI_ANY_SOURCE ? req->real_src : req->src;
       status->MPI_TAG = req->tag == MPI_ANY_TAG ? req->real_tag : req->tag;
-      if(req->truncated)
-      status->MPI_ERROR = MPI_ERR_TRUNCATE;
-      else status->MPI_ERROR = MPI_SUCCESS ;
+      status->MPI_ERROR = req->truncated ? MPI_ERR_TRUNCATE : MPI_SUCCESS;
       // this handles the case were size in receive differs from size in send
       // FIXME: really this should just contain the count of receive-type blocks,
       // right?