]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Add a couple of assertions. 13230/head
authorWolfgang Bangerth <bangerth@colostate.edu>
Thu, 13 Jan 2022 03:49:32 +0000 (20:49 -0700)
committerWolfgang Bangerth <bangerth@colostate.edu>
Thu, 13 Jan 2022 14:38:18 +0000 (07:38 -0700)
include/deal.II/base/mpi_consensus_algorithms.h
include/deal.II/base/mpi_consensus_algorithms.templates.h

index 307de41771944416ac90f8b608e7c1112815fb36..814bc1610e5286036ce5b7b72599eef18c1c3ed6 100644 (file)
@@ -407,10 +407,12 @@ namespace Utilities
        *   i.e. when this process can stop waiting for requests, no IBarrier is
        *   needed.
        *
-       * @note The function
-       *   Utilities::MPI::compute_point_to_point_communication_pattern() is
-       *   used to determine the source processes, which implements a
-       *   PEX-algorithm from @cite hoefler2010scalable.
+       * @note Under the hood, this function uses
+       *   Utilities::MPI::compute_point_to_point_communication_pattern()
+       *   to determine the source processes, which itself is based on the
+       *   NBX-algorithm from @cite hoefler2010scalable that is implemented
+       *   in the ConsensusAlgorithms::NBX class (a sister class to the
+       *   current one).
        *
        * @tparam T1 The type of the elements of the vector to be sent.
        * @tparam T2 The type of the elements of the vector to be received.
@@ -504,6 +506,8 @@ namespace Utilities
         clean_up_and_end_communication();
       };
 
+
+
       /**
        * A serial fall back for the above classes to allow programming
        * independently of whether MPI is used or not.
index e9053505fbfe141a7b9df6ac5619652f8e9a610e..78f97ba518380ecf959d357d238ea41efb443087 100644 (file)
@@ -169,6 +169,8 @@ namespace Utilities
           for (unsigned int index = 0; index < n_targets; ++index)
             {
               const unsigned int rank = targets[index];
+              AssertIndexRange(rank,
+                               Utilities::MPI::n_mpi_processes(this->comm));
 
               auto &send_buffer = send_buffers[index];
               this->process.create_request(rank, send_buffer);
@@ -513,6 +515,7 @@ namespace Utilities
         for (unsigned int i = 0; i < n_targets; ++i)
           {
             const unsigned int rank = targets[i];
+            AssertIndexRange(rank, Utilities::MPI::n_mpi_processes(this->comm));
 
             // pack data which should be sent
             auto &send_buffer = send_buffers[i];

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.