From 97dcbabd30ed75494eb62f2686db2ae13a7525c9 Mon Sep 17 00:00:00 2001 From: Marc Fehling Date: Fri, 16 Aug 2024 09:33:52 -0600 Subject: [PATCH] Fix some unused warnings. --- source/base/mpi.cc | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/source/base/mpi.cc b/source/base/mpi.cc index 75c1f4272b..e99ba8386d 100644 --- a/source/base/mpi.cc +++ b/source/base/mpi.cc @@ -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 dest_vector(n_procs); -- 2.39.5