]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Fix some unused warnings. 17548/head
authorMarc Fehling <mafehling.git@gmail.com>
Fri, 16 Aug 2024 15:33:52 +0000 (09:33 -0600)
committerMarc Fehling <mafehling.git@gmail.com>
Fri, 16 Aug 2024 15:48:10 +0000 (09:48 -0600)
source/base/mpi.cc

index 75c1f4272bbd1cfc0eeb0eca2b2da3295897d5d8..e99ba8386d1d6d3481b9b00194cb9ba0e8b44d59 100644 (file)
@@ -233,7 +233,7 @@ namespace Utilities
       auto deleter = [](MPI_Datatype *p) {
         if (p != nullptr)
           {
-            const int ierr = MPI_Type_free(p);
+            [[maybe_unused]] const int ierr = MPI_Type_free(p);
 
             AssertNothrow(ierr == MPI_SUCCESS, ExcMPI(ierr));
 
@@ -255,13 +255,10 @@ namespace Utilities
       const unsigned int myid    = Utilities::MPI::this_mpi_process(mpi_comm);
       const unsigned int n_procs = Utilities::MPI::n_mpi_processes(mpi_comm);
 
-
-
+#  ifdef DEBUG
       for (const unsigned int destination : destinations)
-        {
-          AssertIndexRange(destination, n_procs);
-        }
-
+        AssertIndexRange(destination, n_procs);
+#  endif
 
       // Have a little function that checks if destinations provided
       // to the current process are unique. The way it does this is
@@ -393,6 +390,7 @@ namespace Utilities
           const unsigned int n_procs =
             Utilities::MPI::n_mpi_processes(mpi_comm);
 
+#  ifdef DEBUG
           for (const unsigned int destination : destinations)
             {
               AssertIndexRange(destination, n_procs);
@@ -400,6 +398,7 @@ namespace Utilities
                      ExcMessage(
                        "There is no point in communicating with ourselves."));
             }
+#  endif
 
           // Calculate the number of messages to send to each process
           std::vector<unsigned int> dest_vector(n_procs);

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.