aboutsummaryrefslogtreecommitdiff
path: root/Carpet/Carpet
diff options
context:
space:
mode:
authorErik Schnetter <schnetter@gmail.com>2013-04-03 12:18:05 -0400
committerErik Schnetter <schnetter@gmail.com>2013-04-03 12:18:05 -0400
commit7fbf726821bd9e2d73b612fbddc4bb4e372db578 (patch)
tree2d08a4a5db96afd7a853da7c6bd28e5799cc55d4 /Carpet/Carpet
parentcad9235c93ae7a4dcb3f7213529c4a36f1c435ee (diff)
Carpet: Call Requirements before, not after the respective actions
Ensure requirements are met before restricting and syncing, not afterwards.
Diffstat (limited to 'Carpet/Carpet')
-rw-r--r--Carpet/Carpet/src/Comm.cc8
-rw-r--r--Carpet/Carpet/src/Cycle.cc8
-rw-r--r--Carpet/Carpet/src/Restrict.cc10
3 files changed, 13 insertions, 13 deletions
diff --git a/Carpet/Carpet/src/Comm.cc b/Carpet/Carpet/src/Comm.cc
index c38a3b4f2..922577fd2 100644
--- a/Carpet/Carpet/src/Comm.cc
+++ b/Carpet/Carpet/src/Comm.cc
@@ -136,6 +136,10 @@ namespace Carpet {
if (goodgroups.size() > 0) {
+#ifdef REQUIREMENTS_HH
+ Requirements::Sync(function_data, goodgroups, reflevel, timelevel);
+#endif
+
// prolongate boundaries
bool const local_do_prolongate = do_prolongate and not do_taper;
if (local_do_prolongate) {
@@ -165,10 +169,6 @@ namespace Carpet {
timer.stop();
}
-#ifdef REQUIREMENTS_HH
- Requirements::Sync(function_data, goodgroups, reflevel, timelevel);
-#endif
-
}
return retval;
diff --git a/Carpet/Carpet/src/Cycle.cc b/Carpet/Carpet/src/Cycle.cc
index 523bc694e..48d239276 100644
--- a/Carpet/Carpet/src/Cycle.cc
+++ b/Carpet/Carpet/src/Cycle.cc
@@ -36,6 +36,10 @@ namespace Carpet {
cctkGH->cctk_time = tt->get_time (mglevel, reflevel, timelevel);
}
+#ifdef REQUIREMENTS_HH
+ Requirements::Cycle(reflevel);
+#endif
+
int errors = 0;
for (int group=0; group<CCTK_NumGroups(); ++group) {
@@ -110,10 +114,6 @@ namespace Carpet {
Accelerator_Cycle(cctkGH);
}
-#ifdef REQUIREMENTS_HH
- Requirements::Cycle(reflevel);
-#endif
-
if (errors > 0) {
CCTK_VWarn (CCTK_WARN_ABORT, __LINE__, __FILE__, CCTK_THORNSTRING,
"Errors in %d groups detected; aborting", errors);
diff --git a/Carpet/Carpet/src/Restrict.cc b/Carpet/Carpet/src/Restrict.cc
index 628e414d5..f20a711fd 100644
--- a/Carpet/Carpet/src/Restrict.cc
+++ b/Carpet/Carpet/src/Restrict.cc
@@ -52,7 +52,11 @@ namespace Carpet {
groups.push_back (group);
}
}
-
+
+#ifdef REQUIREMENTS_HH
+ Requirements::Restrict(groups, reflevel);
+#endif
+
// Restrict
{
static Timer timer ("Restrict");
@@ -68,10 +72,6 @@ namespace Carpet {
SyncGroups (cctkGH, groups);
timer.stop();
}
-
-#ifdef REQUIREMENTS_HH
- Requirements::Restrict(groups, reflevel);
-#endif
}