]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Fix a quicktest. 3677/head
authorWolfgang Bangerth <bangerth@colostate.edu>
Fri, 16 Dec 2016 05:43:56 +0000 (22:43 -0700)
committerWolfgang Bangerth <bangerth@colostate.edu>
Fri, 16 Dec 2016 05:43:56 +0000 (22:43 -0700)
The test assigned MPI return codes to a variable, but then did not do anything with this
variable. We may as well test for errors.

tests/quick_tests/mpi.cc

index 4cd4259521c5df35a535b604efbf6f725fac6a1d..350d1f8a85ec3c5201168849d16c01850abe5166 100644 (file)
@@ -1,6 +1,6 @@
 // ---------------------------------------------------------------------
 //
-// Copyright (C) 2013 - 2015 by the deal.II authors
+// Copyright (C) 2013 - 2016 by the deal.II authors
 //
 // This file is part of the deal.II library.
 //
@@ -48,6 +48,14 @@ int main(int argc, char *argv[] )
   else if (myrank==0)
     err = MPI_Recv(&value, 1, MPI_INT, 1, 1, MPI_COMM_WORLD, MPI_STATUS_IGNORE);
 
+  if (err != MPI_SUCCESS)
+    {
+      std::cerr << "MPI_Send/Recv error code = "
+                << err
+                << std::endl;
+      abort ();
+    }
+
   if (myrank==0 && value!=1)
     {
       std::cerr << "ERROR: MPI_Send/Recv did not work!" << std::endl;

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.