Skip to content

Commit 3d914c1

Browse files
committed
tests: mpi-fix for GTest
each MPI task should return the same test result; otherwise it might happen that the test passed on rank 0 but one of the minor ranks finally wins the race on returning from main
1 parent f2b7050 commit 3d914c1

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

tests/examples/advection_diffusion/test_mpi_advection_diffusion.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ int main(int argc, char** argv)
5151
if (rank == 0) {
5252
result = RUN_ALL_TESTS();
5353
}
54+
MPI_Bcast(&result, 1, MPI_INT, 0, MPI_COMM_WORLD);
5455
MPI_Finalize();
5556
return result;
5657
}

0 commit comments

Comments
 (0)