]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Add some missing error code asserts. 2965/head
authorDavid Wells <wellsd2@rpi.edu>
Sun, 14 Aug 2016 22:56:24 +0000 (18:56 -0400)
committerDavid Wells <wellsd2@rpi.edu>
Sun, 14 Aug 2016 23:13:45 +0000 (19:13 -0400)
These were caught by cppcheck.

source/base/mpi.cc
source/lac/petsc_matrix_free.cc
source/lac/petsc_parallel_vector.cc

index e78b50806fe33cec094ab3fac7bb40f8ad674234..5d7b0982774947d4cfedc5b2dd55c5992500e6f2 100644 (file)
@@ -247,6 +247,7 @@ namespace Utilities
       AssertThrow(ierr == MPI_SUCCESS, ExcInternalError());
 
       ierr = MPI_Type_commit(&type);
+      AssertThrow(ierr == MPI_SUCCESS, ExcInternalError());
       ierr = MPI_Allreduce (&in, &result, 1, type, op, mpi_communicator);
       AssertThrow(ierr == MPI_SUCCESS, ExcInternalError());
 
index 40e4034839dbccb7e204b44455a87b512c67e665..3a3e35d68fff10043ce18e91ba5e358dcd9ce827 100644 (file)
@@ -192,6 +192,7 @@ namespace PETScWrappers
     // dealii::PETScWrappers::*::Vector:
     const char  *vec_type;
     int ierr = VecGetType (src, &vec_type);
+    AssertThrow (ierr == 0, ExcPETScError(ierr));
 
     PetscInt  local_size;
     ierr = VecGetLocalSize (src, &local_size);
index 6e1892c4d4f29d2f0a76a7f5963581aecd021ad8..0f146f59c1e4b7509cf6d23b7a0cc969c5d6ee84 100644 (file)
@@ -322,6 +322,7 @@ namespace PETScWrappers
         PetscInt begin, end;
 
         ierr = VecGetOwnershipRange (vector, &begin, &end);
+        AssertThrow (ierr == 0, ExcPETScError(ierr));
 
         Assert(local_size==(size_type)(end-begin), ExcInternalError());
 

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.