aboutsummaryrefslogtreecommitdiff
path: root/Carpet/CarpetLib/src/dh.cc
diff options
context:
space:
mode:
authorErik Schnetter <schnetter@cct.lsu.edu>2008-05-20 15:21:25 -0500
committerErik Schnetter <schnetter@cct.lsu.edu>2008-05-20 15:21:25 -0500
commit0cda1e7edaaecd1e4e06bb991433ba666704e388 (patch)
tree7037d1d7438c70c9fb364fbd0ab3e78c7bc12abc /Carpet/CarpetLib/src/dh.cc
parenta65814adf370180602132a7174e4f925c86d876e (diff)
CarpetLib: Correct regridding communication schedule
Handle correctly the case where the multi-patch processor decomposition changes during regridding.
Diffstat (limited to 'Carpet/CarpetLib/src/dh.cc')
-rw-r--r--Carpet/CarpetLib/src/dh.cc26
1 files changed, 18 insertions, 8 deletions
diff --git a/Carpet/CarpetLib/src/dh.cc b/Carpet/CarpetLib/src/dh.cc
index cfdcecd0c..fa990a2b0 100644
--- a/Carpet/CarpetLib/src/dh.cc
+++ b/Carpet/CarpetLib/src/dh.cc
@@ -89,6 +89,20 @@ dh::on_this_proc (int const rl, int const c, int const cc) const
return on_this_proc (rl, c) or on_this_proc (rl, cc);
}
+inline
+int
+dh::this_oldproc (int const rl, int const c) const
+{
+ return h.old_processor (rl, c);
+}
+
+inline
+bool
+dh::on_this_oldproc (int const rl, int const c) const
+{
+ return this_oldproc (rl, c) == dist::rank();
+}
+
bool there_was_an_error = false;
@@ -850,11 +864,9 @@ regrid ()
// Synchronisation:
- if (int (fast_oldboxes.size()) > ml and
- int (fast_oldboxes.AT(ml).size()) > rl)
- {
+ if (int (oldboxes.size()) > ml and int (oldboxes.AT(ml).size()) > rl) {
- int const oldcomponents = fast_oldboxes.AT(ml).AT(rl).size();
+ int const oldcomponents = oldboxes.AT(ml).AT(rl).size();
// Synchronisation copies from the same level of the old
// grid structure. It should fill as many active points as
@@ -871,7 +883,7 @@ regrid ()
{
ibbox const & recv = * ri;
ibbox const & send = recv;
- if (on_this_proc (rl, c, cc)) {
+ if (on_this_proc (rl, c) or on_this_oldproc (rl, cc)) {
int const p = dist::rank();
fast_level.AT(p).fast_old2new_sync_sendrecv.push_back
(sendrecv_pseudoregion_t (send, cc, recv, c));
@@ -944,9 +956,7 @@ regrid ()
} // if rl > 0
- if (int (fast_oldboxes.size()) > ml and
- int (fast_oldboxes.AT(ml).size()) > 0)
- {
+ if (int (oldboxes.size()) > ml and int (oldboxes.AT(ml).size()) > 0) {
// All points must now have been received, either through
// synchronisation or through prolongation
ASSERT_c (needrecv.empty(),