aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoland Haas <roland.haas@physics.gatech.edu>2012-09-05 00:44:46 -0400
committerRoland Haas <roland.haas@physics.gatech.edu>2012-09-05 00:44:46 -0400
commit68c0c103c458ec6a174e013d9cf962e51900fc11 (patch)
tree888b555f61bf7373beb35f2196ac11ee26ba9e86
parent8a324d3f9b5230b44694b6ab1c7038132c37addc (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.cc26
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;