From: Timo Heister Date: Wed, 21 Feb 2018 16:41:24 +0000 (-0500) Subject: fix MPI type and remove confusing assert X-Git-Tag: v9.0.0-rc1~404^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F5939%2Fhead;p=dealii.git fix MPI type and remove confusing assert 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. --- diff --git a/source/distributed/tria_base.cc b/source/distributed/tria_base.cc index 68e59a763d..c75d95a004 100644 --- a/source/distributed/tria_base.cc +++ b/source/distributed/tria_base.cc @@ -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 requests (this->number_cache.level_ghost_owners.size()); - int dummy = 0; + unsigned int dummy = 0; unsigned int req_counter = 0; for (std::set::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,