From 52ba4499c8c7c0ab218bea58f9846887799183ab Mon Sep 17 00:00:00 2001 From: Martin Kronbichler Date: Thu, 29 Jun 2023 20:34:44 +0200 Subject: [PATCH] Apply review comments --- .../deal.II/lac/la_parallel_vector.templates.h | 3 ++- source/base/mpi.cc | 16 +++++++++------- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/include/deal.II/lac/la_parallel_vector.templates.h b/include/deal.II/lac/la_parallel_vector.templates.h index 13e3c5a11b..848aa0446a 100644 --- a/include/deal.II/lac/la_parallel_vector.templates.h +++ b/include/deal.II/lac/la_parallel_vector.templates.h @@ -1348,9 +1348,9 @@ namespace LinearAlgebra // make sure that there are not outstanding requests from updating // ghost values or compress - int flag = 1; if (update_ghost_values_requests.size() > 0) { + int flag = 1; const int ierr = MPI_Testall(update_ghost_values_requests.size(), update_ghost_values_requests.data(), &flag, @@ -1363,6 +1363,7 @@ namespace LinearAlgebra } if (compress_requests.size() > 0) { + int flag = 1; const int ierr = MPI_Testall(compress_requests.size(), compress_requests.data(), &flag, diff --git a/source/base/mpi.cc b/source/base/mpi.cc index 76558a6064..30736e44b3 100644 --- a/source/base/mpi.cc +++ b/source/base/mpi.cc @@ -149,28 +149,30 @@ namespace Utilities unsigned int n_mpi_processes(const MPI_Comm mpi_communicator) { - int n_jobs = 1; if (job_supports_mpi()) { - const int ierr = MPI_Comm_size(mpi_communicator, &n_jobs); + int n_jobs = 1; + const int ierr = MPI_Comm_size(mpi_communicator, &n_jobs); AssertThrowMPI(ierr); + return n_jobs; } - - return n_jobs; + else + return 1; } unsigned int this_mpi_process(const MPI_Comm mpi_communicator) { - int rank = 0; if (job_supports_mpi()) { + int rank = 0; const int ierr = MPI_Comm_rank(mpi_communicator, &rank); AssertThrowMPI(ierr); + return rank; } - - return rank; + else + return 0; } -- 2.39.5