]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Apply review comments 15516/head
authorMartin Kronbichler <martin.kronbichler@uni-a.de>
Thu, 29 Jun 2023 18:34:44 +0000 (20:34 +0200)
committerMartin Kronbichler <martin.kronbichler@uni-a.de>
Fri, 30 Jun 2023 05:57:10 +0000 (07:57 +0200)
include/deal.II/lac/la_parallel_vector.templates.h
source/base/mpi.cc

index 13e3c5a11b8198a6edd944be0287a67f899be52a..848aa0446a8f67e7fbee49c9691c2b4ea951e935 100644 (file)
@@ -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,
index 76558a606421f7166613c72f063041973fc93cc6..30736e44b3b31b215c282bbecfde47ede69a364d 100644 (file)
@@ -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;
     }
 
 

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.