diff options
author | Erik Schnetter <schnetter@gmail.com> | 2013-04-04 14:31:08 -0400 |
---|---|---|
committer | Erik Schnetter <schnetter@gmail.com> | 2013-04-04 14:31:08 -0400 |
commit | 390abfb6b3a7b7bdde2bb7a671580403279ca6d2 (patch) | |
tree | 7d4b4ff79ee332c986cb4855a4f7d47479499007 /Carpet/Requirements | |
parent | 7b51f697d3a18ce75c8e00ee275a1f43e8a8b785 (diff) |
Requirements: Output iteration number in warnings and error messages
Diffstat (limited to 'Carpet/Requirements')
-rw-r--r-- | Carpet/Requirements/src/all_state.cc | 24 | ||||
-rw-r--r-- | Carpet/Requirements/src/gridpoint.cc | 27 | ||||
-rw-r--r-- | Carpet/Requirements/src/gridpoint.hh | 6 |
3 files changed, 31 insertions, 26 deletions
diff --git a/Carpet/Requirements/src/all_state.cc b/Carpet/Requirements/src/all_state.cc index a7e00d759..892fd4725 100644 --- a/Carpet/Requirements/src/all_state.cc +++ b/Carpet/Requirements/src/all_state.cc @@ -397,7 +397,7 @@ namespace Requirements { clause.active_on_timelevel(tl - timelevel_offset)) { gridpoint_t const& gp = tls.AT(tl); - gp.check_state(clause, function_data, vi, rl, m, tl); + gp.check_state(clause, function_data, vi, iteration, rl, m, tl); } } @@ -539,7 +539,8 @@ namespace Requirements { // Synchronising requires a valid interior if (not gp.interior()) { gp.report_error - (function_data, vi, rl, m, tl, "synchronising", "interior"); + (function_data, vi, iteration, rl, m, tl, + "synchronising", "interior"); } // Synchronising (i.e. prolongating) requires valid data @@ -553,11 +554,11 @@ namespace Requirements { int const ctimelevels = int(ctls.size()); for (int ctl=0; ctl<ctimelevels; ++ctl) { gridpoint_t const& cgp = ctls.AT(ctl); - if (not (cgp.interior() and cgp.boundary() and cgp.ghostzones() and - cgp.boundary_ghostzones())) + if (not (cgp.interior() and cgp.boundary() and + cgp.ghostzones() and cgp.boundary_ghostzones())) { cgp.report_error - (function_data, vi, crl, m, ctl, + (function_data, vi, iteration, crl, m, ctl, "prolongating", "everywhere"); } } @@ -568,13 +569,13 @@ namespace Requirements { if (gp.boundary() ) { if (gp.ghostzones() and gp.boundary_ghostzones()) { gp.report_warning - (function_data, vi, rl, m, tl, + (function_data, vi, iteration, rl, m, tl, "synchronising", "ghostzones+boundary_ghostzones"); } } else { if (gp.ghostzones()) { gp.report_warning - (function_data, vi, rl, m, tl, + (function_data, vi, iteration, rl, m, tl, "synchronising", "ghostzones"); } } @@ -641,7 +642,7 @@ namespace Requirements { // afterwards) if (not gp.interior()) { gp.report_error - (NULL, vi, rl, m, tl, "restricting", "interior"); + (NULL, vi, iteration, rl, m, tl, "restricting", "interior"); } // Restricting requires valid data on the current time @@ -653,11 +654,12 @@ namespace Requirements { timelevels_t const& ftls = fms.AT(m); int const ftl = 0; gridpoint_t const& fgp = ftls.AT(ftl); - if (not (fgp.interior() and fgp.boundary() and fgp.ghostzones() and - fgp.boundary_ghostzones())) + if (not (fgp.interior() and fgp.boundary() and + fgp.ghostzones() and fgp.boundary_ghostzones())) { fgp.report_error - (NULL, vi, frl, m, ftl, "restricting", "everywhere"); + (NULL, vi, iteration, frl, m, ftl, + "restricting", "everywhere"); } } diff --git a/Carpet/Requirements/src/gridpoint.cc b/Carpet/Requirements/src/gridpoint.cc index 3b5354d00..eb5b06fab 100644 --- a/Carpet/Requirements/src/gridpoint.cc +++ b/Carpet/Requirements/src/gridpoint.cc @@ -44,30 +44,31 @@ namespace Requirements { void gridpoint_t::check_state(clause_t const& clause, cFunctionData const* const function_data, int const vi, + int const it, int const rl, int const m, int const tl) const { if (not i_interior) { if (clause.everywhere or clause.interior) { - report_error(function_data, vi, rl, m, tl, + report_error(function_data, vi, it, rl, m, tl, "calling function", "interior"); } } if (not i_boundary) { if (clause.everywhere or clause.boundary) { - report_error(function_data, vi, rl, m, tl, + report_error(function_data, vi, it, rl, m, tl, "calling function", "boundary"); } } if (not i_ghostzones) { if (clause.everywhere) { - report_error(function_data, vi, rl, m, tl, + report_error(function_data, vi, it, rl, m, tl, "calling function", "ghostzones"); } } if (not i_boundary_ghostzones) { if (clause.everywhere or clause.boundary_ghostzones) { - report_error(function_data, vi, rl, m, tl, + report_error(function_data, vi, it, rl, m, tl, "calling", "boundary-ghostzones"); } } @@ -75,6 +76,7 @@ namespace Requirements { void gridpoint_t::report_error(cFunctionData const* const function_data, int const vi, + int const it, int const rl, int const m, int const tl, char const* const what, char const* const where) const @@ -87,19 +89,19 @@ namespace Requirements { CCTK_VWarn(CCTK_WARN_ALERT, __LINE__, __FILE__, CCTK_THORNSTRING, "Schedule READS clause not satisfied: " "Function %s::%s in %s: " - "Variable %s reflevel=%d map=%d timelevel=%d: " + "Variable %s iteration=%d reflevel=%d map=%d timelevel=%d: " "%s not valid for %s. %s", function_data->thorn, function_data->routine, function_data->where, - fullname, rl, m, tl, + fullname, it, rl, m, tl, where, what, state.str().c_str()); } else { // The error is not related to a scheduled function CCTK_VWarn(CCTK_WARN_ALERT, __LINE__, __FILE__, CCTK_THORNSTRING, "Schedule READS clause not satisfied: " - "Variable %s reflevel=%d map=%d timelevel=%d: " + "Variable %s iteration=%d reflevel=%d map=%d timelevel=%d: " "%s not valid for %s. %s", - fullname, rl, m, tl, + fullname, it, rl, m, tl, where, what, state.str().c_str()); } free(fullname); @@ -108,6 +110,7 @@ namespace Requirements { void gridpoint_t::report_warning(cFunctionData const* const function_data, int const vi, + int const it, int const rl, int const m, int const tl, char const* const what, char const* const where) const @@ -120,19 +123,19 @@ namespace Requirements { CCTK_VWarn(CCTK_WARN_ALERT, __LINE__, __FILE__, CCTK_THORNSTRING, "Schedule WRITES clause is superfluous: " "Function %s::%s in %s: " - "Variable %s reflevel=%d map=%d timelevel=%d: " + "Variable %s iteration=%d reflevel=%d map=%d timelevel=%d: " "%s already valid for %s. %s", function_data->thorn, function_data->routine, function_data->where, - fullname, rl, m, tl, + fullname, it, rl, m, tl, where, what, state.str().c_str()); } else { // The error is not related to a scheduled function CCTK_VWarn(CCTK_WARN_ALERT, __LINE__, __FILE__, CCTK_THORNSTRING, "Schedule WRITES clause already satisfied: " - "Variable %s reflevel=%d map=%d timelevel=%d: " + "Variable %s iteration=%d reflevel=%d map=%d timelevel=%d: " "%s already valid for %s. %s", - fullname, rl, m, tl, + fullname, it, rl, m, tl, where, what, state.str().c_str()); } free(fullname); diff --git a/Carpet/Requirements/src/gridpoint.hh b/Carpet/Requirements/src/gridpoint.hh index 0975f690d..ead8a7338 100644 --- a/Carpet/Requirements/src/gridpoint.hh +++ b/Carpet/Requirements/src/gridpoint.hh @@ -54,12 +54,12 @@ namespace Requirements { void check_state(clause_t const& clause, cFunctionData const* function_data, - int vi, int rl, int m, int tl) const; + int vi, int it, int rl, int m, int tl) const; void report_error(cFunctionData const* function_data, - int vi, int rl, int m, int tl, + int vi, int it, int rl, int m, int tl, char const* what, char const* where) const; void report_warning(cFunctionData const* function_data, - int vi, int rl, int m, int tl, + int vi, int it, int rl, int m, int tl, char const* what, char const* where) const; void update_state(clause_t const& clause, const location_t &loc); |