Merge branch 'release-4-6'
[alexxy/gromacs.git] / src / gromacs / gmxlib / thread_mpi / gather.c
index a43f2db53db039b68cedfe22f1d61bbd89124d38..54e91bf69b64430ad336ed53cd82d0eba9b529c8 100644 (file)
@@ -145,8 +145,12 @@ int tMPI_Gather(void* sendbuf, int sendcount, tMPI_Datatype sendtype,
         }
 
         /* first set up the data just to root. */
-        tMPI_Post_multi(cev, myrank, 0, TMPI_GATHER_TAG, sendtype,
-                        sendcount*sendtype->size, sendbuf, 1, synct, root);
+        ret = tMPI_Post_multi(cev, myrank, 0, TMPI_GATHER_TAG, sendtype,
+                              sendcount*sendtype->size, sendbuf, 1, synct, root);
+        if (ret != TMPI_SUCCESS)
+        {
+            return ret;
+        }
         /* and wait until root is done copying */
         tMPI_Wait_for_others(cev, myrank);
     }
@@ -247,8 +251,12 @@ int tMPI_Gatherv(void* sendbuf, int sendcount, tMPI_Datatype sendtype,
         }
 
         /* first set up the data just to root. */
-        tMPI_Post_multi(cev, myrank, 0, TMPI_GATHERV_TAG, sendtype,
-                        sendcount*sendtype->size, sendbuf, 1, synct, root);
+        ret = tMPI_Post_multi(cev, myrank, 0, TMPI_GATHERV_TAG, sendtype,
+                              sendcount*sendtype->size, sendbuf, 1, synct, root);
+        if (ret != TMPI_SUCCESS)
+        {
+            return ret;
+        }
         /* and wait until root is done copying */
         tMPI_Wait_for_others(cev, myrank);
     }