aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoland Haas <roland.haas@physics.gatech.edu>2012-08-01 09:13:42 -0700
committerRoland Haas <roland.haas@physics.gatech.edu>2012-08-01 09:13:42 -0700
commit4ae061131c1da2a4a944a1139117cec0c4eac02e (patch)
treeb350232fb5ca700672a379527a78261f42c24970
parentdd757d86966ecc9716bf13d837c909476f630934 (diff)
CarpetIOHDF5: only warn once about reading extra files
once per variable, refinement level and time level that is. So still about ~3000 warnings in a typical simulation.
-rw-r--r--Carpet/CarpetIOHDF5/src/Input.cc15
1 files changed, 11 insertions, 4 deletions
diff --git a/Carpet/CarpetIOHDF5/src/Input.cc b/Carpet/CarpetIOHDF5/src/Input.cc
index f14146dd6..2214f74ff 100644
--- a/Carpet/CarpetIOHDF5/src/Input.cc
+++ b/Carpet/CarpetIOHDF5/src/Input.cc
@@ -406,11 +406,13 @@ int Recover (cGH* cctkGH, const char *basefilename, int called_from)
// create a bbox set for each active timelevel of all variables
// to mark how much has been read already
const int numvars = CCTK_NumVars ();
+ vector<vector<bool> > warned_about_multiple_files(numvars);
vector<vector<bool> > read_completely(numvars);
vector<vector<vector<ibset> > > bboxes_read (numvars);
for (unsigned int vindex = 0; vindex < bboxes_read.size(); vindex++) {
const int timelevels = CCTK_ActiveTimeLevelsVI (cctkGH, vindex);
read_completely[vindex].resize (timelevels, false);
+ warned_about_multiple_files[vindex].resize (timelevels, false);
bboxes_read[vindex].resize (timelevels);
for (int tl = 0; tl < timelevels; tl++) {
bboxes_read[vindex][tl].resize (maps);
@@ -635,12 +637,17 @@ int Recover (cGH* cctkGH, const char *basefilename, int called_from)
for (unsigned int tl = 0; tl < read_completely[vindex].size(); tl++) {
all_done &= read_completely[vindex][tl];
- if (not read_completely[vindex][tl]) {
+ if (not read_completely[vindex][tl] and not warned_about_multiple_files[vindex][tl]) {
+ static bool warned_once_already = false;
+ const int warnlevel = warned_once_already ? CCTK_WARN_DEBUG : CCTK_WARN_COMPLAIN;
char * const fullname = CCTK_FullName (vindex);
- CCTK_VWarn (1, __LINE__, __FILE__, CCTK_THORNSTRING,
- "Variable %s on rl %d and tl %d not read completely. Will have to look for it in other files",
- fullname, reflevel, tl);
+ CCTK_VWarn (warnlevel, __LINE__, __FILE__, CCTK_THORNSTRING,
+ "Variable %s on rl %d and tl %d not read completely. Will have to look for it in other files.%s",
+ fullname, reflevel, tl,
+ warned_once_already ? "" : " Further warnings will be level 4.");
free (fullname);
+ warned_about_multiple_files[vindex][tl] = true;
+ warned_once_already = true;
}
}
}