From 7d8f40404763bf787b43628e53938828f7b67404 Mon Sep 17 00:00:00 2001 From: David Wells Date: Sun, 14 Aug 2016 18:56:24 -0400 Subject: [PATCH] Add some missing error code asserts. These were caught by cppcheck. --- source/base/mpi.cc | 1 + source/lac/petsc_matrix_free.cc | 1 + source/lac/petsc_parallel_vector.cc | 1 + 3 files changed, 3 insertions(+) diff --git a/source/base/mpi.cc b/source/base/mpi.cc index e78b50806f..5d7b098277 100644 --- a/source/base/mpi.cc +++ b/source/base/mpi.cc @@ -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()); diff --git a/source/lac/petsc_matrix_free.cc b/source/lac/petsc_matrix_free.cc index 40e4034839..3a3e35d68f 100644 --- a/source/lac/petsc_matrix_free.cc +++ b/source/lac/petsc_matrix_free.cc @@ -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); diff --git a/source/lac/petsc_parallel_vector.cc b/source/lac/petsc_parallel_vector.cc index 6e1892c4d4..0f146f59c1 100644 --- a/source/lac/petsc_parallel_vector.cc +++ b/source/lac/petsc_parallel_vector.cc @@ -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()); -- 2.39.5