From e037fc8a7d7f20bfad71afa9b08026cee94fd80e Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Mon, 5 Jan 2015 09:19:53 -0600 Subject: [PATCH] Simplify control flow. --- source/base/mpi.cc | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/source/base/mpi.cc b/source/base/mpi.cc index 2680c3272a..e0d65cd1a1 100644 --- a/source/base/mpi.cc +++ b/source/base/mpi.cc @@ -501,8 +501,6 @@ namespace Utilities // when running PETSc, because we initialize MPI ourselves before calling // PetscInitialize #ifdef DEAL_II_WITH_MPI - int mpi_err = 0; - int MPI_has_been_started = 0; MPI_Initialized(&MPI_has_been_started); if (Utilities::System::job_supports_mpi() == true && @@ -516,12 +514,12 @@ namespace Utilities << std::endl; } else - mpi_err = MPI_Finalize(); + { + const int mpi_err = MPI_Finalize(); + AssertThrow (mpi_err == 0, + ExcMessage ("An error occurred while calling MPI_Finalize()")); + } } - - - AssertThrow (mpi_err == 0, - ExcMessage ("An error occurred while calling MPI_Finalize()")); #endif } -- 2.39.5