aboutsummaryrefslogtreecommitdiff
path: root/Carpet/CarpetIOScalar
diff options
context:
space:
mode:
authorRoland Haas <roland.haas@physics.gatech.edu>2012-05-10 16:49:18 -0700
committerBarry Wardell <barry.wardell@gmail.com>2012-09-11 18:23:21 +0100
commitbd4b8d171051335103d50e29ed0a660bb9631c48 (patch)
tree307e83c503e320ccd9eb9f4bd1c5cf0c2d70d723 /Carpet/CarpetIOScalar
parent6ad367dbba2d0b4eb54a23bbd9e43c19c181f9ba (diff)
CarpetIOScalar: correct column labels
when both one_file_per_group and all_reductions_in_one_file are active
Diffstat (limited to 'Carpet/CarpetIOScalar')
-rw-r--r--Carpet/CarpetIOScalar/src/ioscalar.cc20
1 files changed, 10 insertions, 10 deletions
diff --git a/Carpet/CarpetIOScalar/src/ioscalar.cc b/Carpet/CarpetIOScalar/src/ioscalar.cc
index 9854c9602..6dbb9eaae 100644
--- a/Carpet/CarpetIOScalar/src/ioscalar.cc
+++ b/Carpet/CarpetIOScalar/src/ioscalar.cc
@@ -412,17 +412,17 @@ namespace CarpetIOScalar {
= one_file_per_group ? CCTK_FirstVarIndexI(group) : n;
int const numvars
= one_file_per_group ? CCTK_NumVarsInGroupI(group) : 1;
- for (int n=firstvar; n<firstvar+numvars; ++n) {
- if (all_reductions_in_one_file) {
- for (list<info>::const_iterator jreduction = reductions.begin();
- jreduction != reductions.end();
- ++jreduction)
- {
- file << " " << col << ":" << CCTK_VarName(n) << "(" << jreduction->reduction << ")";
- col += CarpetSimpleMPIDatatypeLength (vartype);
- }
- } else {
+ list<info>::const_iterator first_reduction
+ = all_reductions_in_one_file ? reductions.begin() : ireduction;
+ list<info>::const_iterator end_reduction
+ = all_reductions_in_one_file ? reductions.end() : ++list<info>::const_iterator(ireduction);
+ for (list<info>::const_iterator jreduction = first_reduction;
+ jreduction != end_reduction;
+ ++jreduction)
+ {
+ for (int n=firstvar; n<firstvar+numvars; ++n) {
file << " " << col << ":" << CCTK_VarName(n);
+ if (all_reductions_in_one_file) file << "(" << jreduction->reduction << ")";
col += CarpetSimpleMPIDatatypeLength (vartype);
}
}