From 7fbf726821bd9e2d73b612fbddc4bb4e372db578 Mon Sep 17 00:00:00 2001 From: Erik Schnetter Date: Wed, 3 Apr 2013 12:18:05 -0400 Subject: Carpet: Call Requirements before, not after the respective actions Ensure requirements are met before restricting and syncing, not afterwards. --- Carpet/Carpet/src/Comm.cc | 8 ++++---- Carpet/Carpet/src/Cycle.cc | 8 ++++---- Carpet/Carpet/src/Restrict.cc | 10 +++++----- 3 files changed, 13 insertions(+), 13 deletions(-) (limited to 'Carpet/Carpet') 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 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 } -- cgit v1.2.3