diff options
author | Roland Haas <roland.haas@physics.gatech.edu> | 2012-09-05 00:44:46 -0400 |
---|---|---|
committer | Barry Wardell <barry.wardell@gmail.com> | 2012-09-11 18:23:36 +0100 |
commit | 75ee69144b59c74f4ebac5e356f4b7cf5d628b12 (patch) | |
tree | 761243c59520760331814a59f27163109eb3e3bf | |
parent | d355ac5937e65c26837e6c37541026328b7797ef (diff) |
Carpet: correct typos in Requirements handling
* rl was used were tl should have been used
* flesh does not allow comma inside of the (...) modifier, use ';'
instead
* use WRITE clause in AfterRoutine call
* add some more information to error message
-rw-r--r-- | Carpet/Carpet/src/Requirements.cc | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/Carpet/Carpet/src/Requirements.cc b/Carpet/Carpet/src/Requirements.cc index dab11d281..b2a79fc67 100644 --- a/Carpet/Carpet/src/Requirements.cc +++ b/Carpet/Carpet/src/Requirements.cc @@ -99,16 +99,23 @@ namespace Carpet { } else { // Not a group - should be a variable int const vi = CCTK_VarIndex(clause); + if (vi < 0) { + CCTK_VWarn(CCTK_WARN_ABORT, __LINE__, __FILE__, CCTK_THORNSTRING, + "could not obtain variable/group index for '%s' in clause '%s': %d", + clause, clause1, vi); + } assert(vi >= 0); vars.push_back(vi); } // Parse modifiers // TODO: Use CarpetLib parser for this + // TODO: add user friendly error messages + // TODO: teach the flesh about commas within the READS/WRITES block if (p) { ++p; for (;;) { - size_t const len = strcspn(p, ",)"); + size_t const len = strcspn(p, ";)"); char const c = p[len]; assert(c); p[len] = '\0'; @@ -140,10 +147,11 @@ namespace Carpet { not all_timelevels); all_timelevels = true; } else { - assert(0); + CCTK_VWarn(CCTK_WARN_ABORT, __LINE__, __FILE__, CCTK_THORNSTRING, + "Unknown modifier '%s' in clause '%s'", p, clause1); } if (c == ')') break; - assert(c==','); + assert(c==';'); p += len+1; } } @@ -263,25 +271,25 @@ namespace Carpet { { if (not interior) { if (clause.everywhere or clause.interior) { - report_error(function_data, vi, rl, m, rl, + report_error(function_data, vi, rl, m, tl, "calling function", "interior"); } } if (not boundary) { if (clause.everywhere or clause.boundary) { - report_error(function_data, vi, rl, m, rl, + report_error(function_data, vi, rl, m, tl, "calling function", "boundary"); } } if (not ghostzones) { if (clause.everywhere) { - report_error(function_data, vi, rl, m, rl, + report_error(function_data, vi, rl, m, tl, "calling function", "ghostzones"); } } if (not boundary_ghostzones) { if (clause.everywhere or clause.boundary_ghostzones) { - report_error(function_data, vi, rl, m, rl, + report_error(function_data, vi, rl, m, tl, "calling", "boundary-ghostzones"); } } @@ -874,8 +882,8 @@ namespace Carpet { { // Loop over all clauses clauses_t const& clauses = all_clauses.get_clauses(function_data); - for (vector<clause_t>::const_iterator iclause = clauses.reads.begin(); - iclause != clauses.reads.end(); + for (vector<clause_t>::const_iterator iclause = clauses.writes.begin(); + iclause != clauses.writes.end(); ++iclause) { clause_t const& clause = *iclause; |