]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Simplify an assertion. 4624/head
authorWolfgang Bangerth <bangerth@colostate.edu>
Wed, 19 Jul 2017 00:36:08 +0000 (18:36 -0600)
committerWolfgang Bangerth <bangerth@colostate.edu>
Wed, 19 Jul 2017 00:36:08 +0000 (18:36 -0600)
source/dofs/dof_handler_policy.cc

index 936fc332eb929b80a6bf9d23c3159e4cf045c625..637ea607a2d0d561acbf1f6f4013db285a79e933 100644 (file)
@@ -3426,21 +3426,14 @@ namespace internal
             }
 
 
-#ifdef DEBUG
-          {
-            // check that all messages got sent and received
-            unsigned int sum_send=0;
-            unsigned int sum_recv=0;
-            unsigned int sent=needs_to_get_cells.size();
-            unsigned int recv=senders.size();
 
-            int ierr = MPI_Allreduce(&sent, &sum_send, 1, MPI_UNSIGNED, MPI_SUM, triangulation->get_communicator());
-            AssertThrowMPI(ierr);
-            ierr = MPI_Allreduce(&recv, &sum_recv, 1, MPI_UNSIGNED, MPI_SUM, triangulation->get_communicator());
-            AssertThrowMPI(ierr);
-            Assert(sum_send==sum_recv, ExcInternalError());
-          }
-#endif
+          // check that all messages got sent and received
+          Assert (Utilities::MPI::sum (needs_to_get_cells.size(),
+                                       triangulation->get_communicator())
+                  ==
+                  Utilities::MPI::sum (senders.size(),
+                                       triangulation->get_communicator()),
+                  ExcInternalError());
 
           // have a barrier so that sends between two calls to this
           // function are not mixed up.

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.