Skip to content

Commit 50eec5f

Browse files
authored
Merge pull request #311 from LLNL/bugfix/cerrs_to_couts
Changed cerrs to couts in Distributed source files
2 parents 6210f6d + 06a7e14 commit 50eec5f

9 files changed

+27
-27
lines changed

src/Distributed/NestedGridRedistributeNodes.cc

+2-2
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ redistributeNodes(DataBase<Dimension>& dataBase,
110110

111111
// Output the initial load distribution statistics.
112112
const string initialLoadStats = this->gatherDomainDistributionStatistics(work);
113-
if (procID == 0) cerr << "NestedGridRedistributeNodes::redistributeNodes initial load balancing:" << endl
113+
if (procID == 0) cout << "NestedGridRedistributeNodes::redistributeNodes initial load balancing:" << endl
114114
<< initialLoadStats << endl << endl;
115115

116116
// Compute the total work, and the target work per processor.
@@ -240,7 +240,7 @@ redistributeNodes(DataBase<Dimension>& dataBase,
240240

241241
// Output the final load distribution statistics.
242242
const string finalLoadStats = this->gatherDomainDistributionStatistics(work);
243-
if (procID == 0) cerr << "NestedGridRedistributeNodes::redistributeNodes final load balancing:" << endl
243+
if (procID == 0) cout << "NestedGridRedistributeNodes::redistributeNodes final load balancing:" << endl
244244
<< finalLoadStats << endl << endl;
245245
MPI_Barrier(Communicator::communicator());
246246

src/Distributed/ParmetisRedistributeNodes.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -669,7 +669,7 @@ printConnectivityStatistics(const map<int, vector<pair<int, double> > >& neighbo
669669

670670
CHECK(navgNeighbor > 0);
671671
avgNeighbor /= navgNeighbor;
672-
cerr << "ParmetisRedistributeNodes:: min connections = "
672+
cout << "ParmetisRedistributeNodes:: min connections = "
673673
<< minNeighbor << endl
674674
<< " max connections = "
675675
<< maxNeighbor << endl

src/Distributed/RedistributeNodes.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -736,7 +736,7 @@ workPerNode(const DataBase<Dimension>& dataBase,
736736
// Output some statistics.
737737
const Scalar minWeight = result.min();
738738
const Scalar maxWeight = result.max();
739-
if (Process::getRank() == 0) cerr << "RedistributeNodes::workPerNode: min/max work : "
739+
if (Process::getRank() == 0) cout << "RedistributeNodes::workPerNode: min/max work : "
740740
<< minWeight << " "
741741
<< maxWeight << endl;
742742

src/Distributed/SortAndDivideRedistributeNodes1d.cc

+2-2
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ redistributeNodes(DataBase<Dim<1> >& dataBase,
114114

115115
// Output the initial load distribution statistics.
116116
const string initialLoadStats = this->gatherDomainDistributionStatistics(work);
117-
if (procID == 0) cerr << "SortAndDivideRedistributeNodes::redistributeNodes initial load balancing:" << endl
117+
if (procID == 0) cout << "SortAndDivideRedistributeNodes::redistributeNodes initial load balancing:" << endl
118118
<< initialLoadStats << endl << endl;
119119

120120
// Compute the total work, and the target work per processor.
@@ -183,7 +183,7 @@ redistributeNodes(DataBase<Dim<1> >& dataBase,
183183

184184
// Output the final load distribution statistics.
185185
const string finalLoadStats = this->gatherDomainDistributionStatistics(work);
186-
if (procID == 0) cerr << "SortAndDivideRedistributeNodes::redistributeNodes final load balancing:" << endl
186+
if (procID == 0) cout << "SortAndDivideRedistributeNodes::redistributeNodes final load balancing:" << endl
187187
<< finalLoadStats << endl << endl;
188188
MPI_Barrier(Communicator::communicator());
189189

src/Distributed/SortAndDivideRedistributeNodes2d.cc

+4-4
Original file line numberDiff line numberDiff line change
@@ -125,14 +125,14 @@ redistributeNodes(DataBase<Dim<2> >& dataBase,
125125
// Output the initial load distribution statistics.
126126
const string initialLoadStats = this->gatherDomainDistributionStatistics(work);
127127
if (procID == 0) {
128-
cerr << "SortAndDivideRedistributeNodes::redistributeNodes initial load balancing:" << endl
128+
cout << "SortAndDivideRedistributeNodes::redistributeNodes initial load balancing:" << endl
129129
<< initialLoadStats << endl
130130
<< " Domain distribution shape tensor: " << shapeTensor.eigenValues << endl
131131
<< " Number of domains per work chunk: ";
132132
for (vector<int>::const_iterator itr = domainsPerStep.begin();
133133
itr != domainsPerStep.end();
134-
++itr) cerr << " " << *itr;
135-
cerr << endl;
134+
++itr) cout << " " << *itr;
135+
cout << endl;
136136
}
137137

138138
// Compute the total work, and the target work per processor.
@@ -232,7 +232,7 @@ redistributeNodes(DataBase<Dim<2> >& dataBase,
232232

233233
// Output the final load distribution statistics.
234234
const string finalLoadStats = this->gatherDomainDistributionStatistics(work);
235-
if (procID == 0) cerr << "SortAndDivideRedistributeNodes::redistributeNodes final load balancing:" << endl
235+
if (procID == 0) cout << "SortAndDivideRedistributeNodes::redistributeNodes final load balancing:" << endl
236236
<< finalLoadStats << endl << endl;
237237
MPI_Barrier(Communicator::communicator());
238238

src/Distributed/SortAndDivideRedistributeNodes3d.cc

+5-5
Original file line numberDiff line numberDiff line change
@@ -123,11 +123,11 @@ redistributeNodes(DataBase<Dim<3> >& dataBase,
123123
// Output the initial load distribution statistics.
124124
const string initialLoadStats = this->gatherDomainDistributionStatistics(work);
125125
if (procID == 0) {
126-
cerr << "SortAndDivideRedistributeNodes::redistributeNodes initial load balancing:" << endl
126+
cout << "SortAndDivideRedistributeNodes::redistributeNodes initial load balancing:" << endl
127127
<< initialLoadStats << endl
128128
<< " Domain distribution shape tensor: " << shapeTensor.eigenValues << endl;
129129
for (int i = 0; i != Dimension::nDim; ++i) {
130-
cerr << " " << shapeTensor.eigenVectors.getColumn(i) << endl;
130+
cout << " " << shapeTensor.eigenVectors.getColumn(i) << endl;
131131
}
132132
}
133133

@@ -205,7 +205,7 @@ redistributeNodes(DataBase<Dim<3> >& dataBase,
205205
// Iterator over the number of z domains we'll be assigning.
206206
for (int iz = 0; iz != numZChunks; ++iz) {
207207

208-
if (procID == 0) cerr << "Assigning domain " << assignDomainID
208+
if (procID == 0) cout << "Assigning domain " << assignDomainID
209209
<< " of " << numProcs << "...";
210210

211211
// Peel off nodes from the front of the unassigned nodes, until the desired work
@@ -231,7 +231,7 @@ redistributeNodes(DataBase<Dim<3> >& dataBase,
231231

232232
// Increment the domain we're assigning to.
233233
++assignDomainID;
234-
if (procID == 0) cerr << "Done." << endl;
234+
if (procID == 0) cout << "Done." << endl;
235235

236236
}
237237

@@ -272,7 +272,7 @@ redistributeNodes(DataBase<Dim<3> >& dataBase,
272272

273273
// Output the final load distribution statistics.
274274
const string finalLoadStats = this->gatherDomainDistributionStatistics(work);
275-
if (procID == 0) cerr << "SortAndDivideRedistributeNodes::redistributeNodes final load balancing:" << endl
275+
if (procID == 0) cout << "SortAndDivideRedistributeNodes::redistributeNodes final load balancing:" << endl
276276
<< finalLoadStats << endl << endl;
277277
MPI_Barrier(Communicator::communicator());
278278

src/Distributed/SpaceFillingCurveRedistributeNodes.cc

+6-6
Original file line numberDiff line numberDiff line change
@@ -157,27 +157,27 @@ redistributeNodes(DataBase<Dimension>& dataBase,
157157

158158
// Compute the target work per domain.
159159
const Scalar targetWork = workField.sumElements()/numProcs;
160-
if (procID == 0) cerr << "SpaceFillingCurveRedistributeNodes: Target work per process " << targetWork << endl;
160+
if (procID == 0) cout << "SpaceFillingCurveRedistributeNodes: Target work per process " << targetWork << endl;
161161

162162
// Compute the Key indices for each point on this processor.
163-
if (procID == 0) cerr << "SpaceFillingCurveRedistributeNodes: Hashing indices" << endl;
163+
if (procID == 0) cout << "SpaceFillingCurveRedistributeNodes: Hashing indices" << endl;
164164
FieldList<Dimension, Key> indices = computeHashedIndices(dataBase);
165165

166166
// Find the range of hashed indices.
167167
const Key indexMin = indices.min();
168168
const Key indexMax = indices.max();
169169
CHECK(indexMax < indexMax + indexMax);
170-
if (procID == 0) cerr << "SpaceFillingCurveRedistributeNodes: Index min/max : " << indexMin << " " << indexMax << endl;
170+
if (procID == 0) cout << "SpaceFillingCurveRedistributeNodes: Index min/max : " << indexMin << " " << indexMax << endl;
171171

172172
// Build the array of (hashed index, DomainNode) pairs.
173173
// Note this comes back locally sorted.
174-
if (procID == 0) cerr << "SpaceFillingCurveRedistributeNodes: sorting indices" << endl;
174+
if (procID == 0) cout << "SpaceFillingCurveRedistributeNodes: sorting indices" << endl;
175175
vector<pair<Key, DomainNode<Dimension> > > sortedIndices = buildIndex2IDPairs(indices,
176176
nodeDistribution);
177177
const int numLocalNodes = nodeDistribution.size();
178178

179179
// Build our set of unique indices and their count.
180-
if (procID == 0) cerr << "SpaceFillingCurveRedistributeNodes: Counting uniques and such" << endl;
180+
if (procID == 0) cout << "SpaceFillingCurveRedistributeNodes: Counting uniques and such" << endl;
181181
vector<Key> uniqueIndices;
182182
vector<int> count;
183183
vector<Scalar> work;
@@ -209,7 +209,7 @@ redistributeNodes(DataBase<Dimension>& dataBase,
209209
CHECK(work.size() == uniqueIndices.size());
210210
}
211211
maxCount = allReduce(maxCount, SPHERAL_OP_MAX);
212-
if (procID == 0) cerr << "SpaceFillingCurveRedistributeNodes: max redundancy is " << maxCount << endl;
212+
if (procID == 0) cout << "SpaceFillingCurveRedistributeNodes: max redundancy is " << maxCount << endl;
213213

214214
// // DEBUG
215215
// {

src/Distributed/VoronoiRedistributeNodes.cc

+4-4
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,7 @@ redistributeNodes(DataBase<Dimension>& dataBase,
404404

405405
// Define the the length scale we use to determine when the generator positions have converged.
406406
const double tol = (xmax - xmin).minElement() * mTolerance;
407-
if (procID == 0) cerr << "VoronoiRedistributeNodes: Found bounding box of " << xmin << " " << xmax << endl
407+
if (procID == 0) cout << "VoronoiRedistributeNodes: Found bounding box of " << xmin << " " << xmax << endl
408408
<< " yielding generator convergence tolerance of " << tol << endl;
409409

410410
// Determine the average work per generator.
@@ -531,7 +531,7 @@ redistributeNodes(DataBase<Dimension>& dataBase,
531531
CHECK(newGeneratorsInParents.size() == newParentCells.size());
532532
generatorsInParents = newGeneratorsInParents;
533533
parentCells = newParentCells;
534-
if (procID == 0) cerr << " Generation " << level << " : "
534+
if (procID == 0) cout << " Generation " << level << " : "
535535
<< numRemainingGenerators << " generators remaining in "
536536
<< generatorsInParents.size() << " cells."
537537
<< endl;
@@ -540,7 +540,7 @@ redistributeNodes(DataBase<Dimension>& dataBase,
540540

541541
// // Are there still remaining degeneracies in the generator positions?
542542
// if (numRemainingGenerators > 0) {
543-
// if (procID == 0) cerr << " --> Breaking up " << numRemainingGenerators
543+
// if (procID == 0) cout << " --> Breaking up " << numRemainingGenerators
544544
// << " degeneracies in intial generator positions."
545545
// << endl;
546546
// for (vector<vector<size_t> >::const_iterator cellItr = generatorsInParents.begin();
@@ -648,7 +648,7 @@ redistributeNodes(DataBase<Dimension>& dataBase,
648648
workRatio = maxWork*safeInv(minWork);
649649

650650
// Report this iterations statistics.
651-
if (procID == 0) cerr << "VoronoiRedistributeNodes: Lloyds iteration " << iteration << endl
651+
if (procID == 0) cout << "VoronoiRedistributeNodes: Lloyds iteration " << iteration << endl
652652
<< " max change: " << maxDeltaGenerator << endl
653653
<< " work ratio change: " << workRatio << " " << oldWorkRatio << " " << abs(workRatio*safeInv(oldWorkRatio) - 1.0) << endl
654654
<< " [min, max, avg] work [" << minWork << ", " << maxWork << ", " << avgWork << "]" << endl

src/Utilities/iterateIdealH.cc

+2-2
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ iterateIdealH(DataBase<Dimension>& dataBase,
218218

219219
// Output the statitics.
220220
if (Process::getRank() == 0 && maxIterations > 1)
221-
cerr << "iterateIdealH: (iteration, deltaH) = ("
221+
cout << "iterateIdealH: (iteration, deltaH) = ("
222222
<< itr << ", "
223223
<< maxDeltaH << ")"
224224
<< endl;
@@ -275,7 +275,7 @@ iterateIdealH(DataBase<Dimension>& dataBase,
275275
// Report the final timing.
276276
const auto t1 = clock();
277277
if (Process::getRank() == 0 && maxIterations > 1)
278-
cerr << "iterateIdealH: required a total of "
278+
cout << "iterateIdealH: required a total of "
279279
<< (t1 - t0)/CLOCKS_PER_SEC
280280
<< " seconds."
281281
<< endl;

0 commit comments

Comments
 (0)