Commit 5840007e authored by Dominic Kempf's avatar Dominic Kempf Committed by Steffen Müthing

[bugfix] Fix previous bugfix about too small overlapping grids

I thought with a logic and reduce operation I could reuse the
send buffer as recv buffer, but it produces false positives.
We now use a separate recv buffer.

(cherry picked from commit bc6d007e)
Signed-off-by: Steffen Müthing's avatarSteffen Müthing <muething@dune-project.org>
parent 0ac968cd
......@@ -765,8 +765,9 @@ namespace Dune {
bool toosmall = (s_interior[i] <= overlap) && // interior is very small
(periodic[i] || (s_interior[i] != s[i])); // there is an overlap in that direction
// communicate the result to all those processes to have all processors error out if one process failed.
MPI_Allreduce(&toosmall, &toosmall, 1, MPI_INT, MPI_LOR, comm);
if (toosmall)
bool global;
MPI_Allreduce(&toosmall, &global, 1, MPI_INT, MPI_LOR, comm);
if (global)
DUNE_THROW(Dune::GridError,"YaspGrid is too small to be overlapping");
}
......@@ -832,8 +833,9 @@ namespace Dune {
bool toosmall = (s_interior[i] <= overlap) && // interior is very small
(periodic[i] || (s_interior[i] != s[i])); // there is an overlap in that direction
// communicate the result to all those processes to have all processors error out if one process failed.
MPI_Allreduce(&toosmall, &toosmall, 1, MPI_INT, MPI_LOR, comm);
if (toosmall)
bool global;
MPI_Allreduce(&toosmall, &global, 1, MPI_INT, MPI_LOR, comm);
if (global)
DUNE_THROW(Dune::GridError,"YaspGrid is too small to be overlapping");
}
......@@ -907,8 +909,9 @@ namespace Dune {
bool toosmall = (s_interior[i] <= overlap) && // interior is very small
(periodic[i] || (s_interior[i] != _coarseSize[i])); // there is an overlap in that direction
// communicate the result to all those processes to have all processors error out if one process failed.
MPI_Allreduce(&toosmall, &toosmall, 1, MPI_INT, MPI_LOR, comm);
if (toosmall)
bool global;
MPI_Allreduce(&toosmall, &global, 1, MPI_INT, MPI_LOR, comm);
if (global)
DUNE_THROW(Dune::GridError,"YaspGrid is too small to be overlapping");
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment