]> https://gitweb.dealii.org/ - dealii.git/commitdiff
fix MPI type and remove confusing assert 5939/head
authorTimo Heister <timo.heister@gmail.com>
Wed, 21 Feb 2018 16:41:24 +0000 (11:41 -0500)
committerTimo Heister <timo.heister@gmail.com>
Wed, 21 Feb 2018 16:41:24 +0000 (11:41 -0500)
clan-tidy correctly complains about an incorrect MPI type (signed vs
unsigned). While here, remove the assert() that doesn't make much sense:
the subdomain id is not the data to be sent, but the destination and
compilation would fail if it wasn't an int (or convertible to it).
Introduced by @bangerth in 2016.

source/distributed/tria_base.cc

index 68e59a763db52e38cd4f01673aaf548247b1e20c..c75d95a00493fdbfd64940a0b25195959fc3a30e 100644 (file)
@@ -236,24 +236,20 @@ namespace parallel
             this->number_cache.level_ghost_owners.insert(cell->level_subdomain_id());
 
 #ifdef DEBUG
-        // Check that level_ghost_owners is symmetric by sending a message
-        // to everyone
+        // Check that level_ghost_owners is symmetric by sending a message to everyone
         {
           int ierr = MPI_Barrier(this->mpi_communicator);
           AssertThrowMPI(ierr);
 
           // important: preallocate to avoid (re)allocation:
           std::vector<MPI_Request> requests (this->number_cache.level_ghost_owners.size());
-          int dummy = 0;
+          unsigned int dummy = 0;
           unsigned int req_counter = 0;
 
           for (std::set<types::subdomain_id>::iterator it = this->number_cache.level_ghost_owners.begin();
                it != this->number_cache.level_ghost_owners.end();
                ++it, ++req_counter)
             {
-              Assert (typeid(types::subdomain_id)
-                      == typeid(unsigned int),
-                      ExcNotImplemented());
               ierr = MPI_Isend(&dummy, 1, MPI_UNSIGNED,
                                *it, 9001, this->mpi_communicator,
                                &requests[req_counter]);
@@ -264,9 +260,6 @@ namespace parallel
                it != this->number_cache.level_ghost_owners.end();
                ++it)
             {
-              Assert (typeid(types::subdomain_id)
-                      == typeid(unsigned int),
-                      ExcNotImplemented());
               unsigned int dummy;
               ierr = MPI_Recv(&dummy, 1, MPI_UNSIGNED,
                               *it, 9001, this->mpi_communicator,

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.