Merge branch 'release-4-6'
[alexxy/gromacs.git] / src / gromacs / gmxlib / thread_mpi / bcast.c
index bd8acd3a67c1ca6d3ef00f72162c90f715cba192..75ae9c08c6d05f10cec75c94db78753f58a4d6f2 100644 (file)
@@ -87,8 +87,13 @@ int tMPI_Bcast(void* buffer, int count, tMPI_Datatype datatype, int root,
     if (myrank == root)
     {
         /* first set up the data */
-        tMPI_Post_multi(cev, myrank, 0, TMPI_BCAST_TAG, datatype,
-                        count*datatype->size, buffer, comm->grp.N-1, synct, -1);
+        ret = tMPI_Post_multi(cev, myrank, 0, TMPI_BCAST_TAG, datatype,
+                              count*datatype->size, buffer, comm->grp.N-1,
+                              synct, -1);
+        if (ret != TMPI_SUCCESS)
+        {
+            return ret;
+        }
         /* and wait until everybody is done copying */
         tMPI_Wait_for_others(cev, myrank);
     }