From: Wolfgang Bangerth Date: Mon, 5 Jan 2015 15:19:53 +0000 (-0600) Subject: Simplify control flow. X-Git-Tag: v8.3.0-rc1~563^2~1 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e037fc8a7d7f20bfad71afa9b08026cee94fd80e;p=dealii.git Simplify control flow. --- 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 }