]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Improve assert message in DictionaryPayLoad 12937/head
authorPeter Munch <peterrmuench@gmail.com>
Fri, 12 Nov 2021 08:14:40 +0000 (09:14 +0100)
committerPeter Munch <peterrmuench@gmail.com>
Sat, 13 Nov 2021 18:36:22 +0000 (19:36 +0100)
include/deal.II/base/mpi_compute_index_owner_internal.h

index 45682a7489a1c1d1981bd3d3ca7ce9bdadb21105..2a5496d9bd154dcdc8c67ada6f15db32cc9ec2f0 100644 (file)
@@ -64,7 +64,9 @@ namespace Utilities
             , actually_owning_ranks(actually_owning_ranks)
             , local_range(local_range)
             , actually_owning_rank_list(actually_owning_rank_list)
-          {}
+          {
+            Assert(local_range.first < local_range.second, ExcInternalError());
+          }
 
           /**
            * Implementation of
@@ -114,15 +116,19 @@ namespace Utilities
                 for (types::global_dof_index i = interval.first;
                      i < interval.second;
                      i++)
-                  Assert(actually_owning_ranks[i - local_range.first] ==
-                           numbers::invalid_unsigned_int,
-                         ExcInternalError());
-                Assert(interval.first >= local_range.first &&
-                         interval.first < local_range.second,
-                       ExcInternalError());
-                Assert(interval.second > local_range.first &&
-                         interval.second <= local_range.second,
-                       ExcInternalError());
+                  Assert(
+                    actually_owning_ranks[i - local_range.first] ==
+                      numbers::invalid_unsigned_int,
+                    ExcMessage(
+                      "Multiple processes seem to own the same global index. "
+                      "A possible reason is that the sets of locally owned "
+                      "indices are not distinct."));
+                Assert(interval.first < interval.second, ExcInternalError());
+                Assert(
+                  local_range.first <= interval.first &&
+                    interval.second <= local_range.second,
+                  ExcMessage(
+                    "The specified interval is not handled by the current process."));
 #endif
                 std::fill(actually_owning_ranks.data() + interval.first -
                             local_range.first,

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.