ENH: Less verbose, reduced parallel output to log.

This commit is contained in:
graham
2011-03-23 11:54:44 +00:00
parent 20aad955d8
commit 363f6426a7
6 changed files with 108 additions and 49 deletions

View File

@ -514,7 +514,17 @@ void Foam::conformalVoronoiMesh::createFeaturePoints()
insertMixedFeaturePoints();
Pout<< " Inserted " << number_of_vertices() << " vertices" << endl;
label nFeatureVertices = number_of_vertices() - 8;
if (Pstream::parRun())
{
reduce(nFeatureVertices, sumOp<label>());
}
if (nFeatureVertices > 0)
{
Info<< " Inserted " << nFeatureVertices << " vertices" << endl;
}
featureVertices_.setSize(number_of_vertices());

View File

@ -2273,31 +2273,31 @@ void Foam::conformalVoronoiMesh::addPatches
}
else
{
// Warn if a patch is empty and includeEmptyPatches is
// false, unless it is the default patch.
// // Warn if a patch is empty and includeEmptyPatches is
// // false, unless it is the default patch or a processor patch
if (p != nTotalPatches - 1)
{
WarningIn
(
"void Foam::conformalVoronoiMesh::addPatches"
"("
"const label nInternalFaces,"
"faceList& faces,"
"labelList& owner,"
"wordList& patchTypes,"
"wordList& patchNames,"
"labelList& patchSizes,"
"labelList& patchStarts,"
"labelList& procNeighbours,"
"List<DynamicList<face> >& patchFaces,"
"List<DynamicList<label> >& patchOwners,"
"bool includeEmptyPatches"
") const"
)
<< "Patch " << patchNames[p]
<< " has no faces, not creating." << endl;
}
// if (p != nTotalPatches - 1 && procNeighbours[p] < 0)
// {
// WarningIn
// (
// "void Foam::conformalVoronoiMesh::addPatches"
// "("
// "const label nInternalFaces,"
// "faceList& faces,"
// "labelList& owner,"
// "wordList& patchTypes,"
// "wordList& patchNames,"
// "labelList& patchSizes,"
// "labelList& patchStarts,"
// "labelList& procNeighbours,"
// "List<DynamicList<face> >& patchFaces,"
// "List<DynamicList<label> >& patchOwners,"
// "bool includeEmptyPatches"
// ") const"
// )
// << "Patch " << patchNames[p]
// << " has no faces, not creating." << endl;
// }
}
}

View File

@ -182,10 +182,21 @@ void Foam::conformalVoronoiMesh::buildSurfaceConformation
}
}
Pout<< nl << "Initial conformation" << nl
<< " Number of vertices " << number_of_vertices() << nl
<< " Number of surface hits " << surfaceHits.size() << nl
<< " Number of edge hits " << featureEdgeHits.size()
label nVerts = number_of_vertices();
label nSurfHits = surfaceHits.size();
label nFeatEdHits = featureEdgeHits.size();
if (Pstream::parRun())
{
reduce(nVerts, sumOp<label>());
reduce(nSurfHits, sumOp<label>());
reduce(nFeatEdHits, sumOp<label>());
}
Info<< nl << "Initial conformation" << nl
<< " Number of vertices " << nVerts << nl
<< " Number of surface hits " << nSurfHits << nl
<< " Number of edge hits " << nFeatEdHits
<< endl;
insertSurfacePointPairs
@ -204,7 +215,7 @@ void Foam::conformalVoronoiMesh::buildSurfaceConformation
timeCheck("After initial conformation");
initialTotalHits = surfaceHits.size() + featureEdgeHits.size();
initialTotalHits = nSurfHits + nFeatEdHits;
}
// Build the parallel interface the initial surface conformation
@ -220,7 +231,7 @@ void Foam::conformalVoronoiMesh::buildSurfaceConformation
label hitLimit = label(iterationToIntialHitRatioLimit*initialTotalHits);
Pout<< nl << "Stopping iterations when: " << nl
Info<< nl << "Stopping iterations when: " << nl
<<" total number of hits drops below "
<< iterationToIntialHitRatioLimit << " of initial hits ("
<< hitLimit << ")" << nl
@ -321,13 +332,24 @@ void Foam::conformalVoronoiMesh::buildSurfaceConformation
}
}
label nVerts = number_of_vertices();
label nSurfHits = surfaceHits.size();
label nFeatEdHits = featureEdgeHits.size();
if (Pstream::parRun())
{
reduce(nVerts, sumOp<label>());
reduce(nSurfHits, sumOp<label>());
reduce(nFeatEdHits, sumOp<label>());
}
Info<< nl << "Conformation iteration " << iterationNo << nl
<< " Number of vertices " << number_of_vertices() << nl
<< " Number of surface hits " << surfaceHits.size() << nl
<< " Number of edge hits " << featureEdgeHits.size()
<< " Number of vertices " << nVerts << nl
<< " Number of surface hits " << nSurfHits << nl
<< " Number of edge hits " << nFeatEdHits
<< endl;
totalHits = surfaceHits.size() + featureEdgeHits.size();
totalHits = nSurfHits + nFeatEdHits;
if (totalHits > 0)
{

View File

@ -264,15 +264,28 @@ inline void Foam::conformalVoronoiMesh::insertPoints
const std::vector<Point>& points
)
{
Pout<< " " << points.size() << " points to insert..." << endl;
label nPoints = points.size();
if (Pstream::parRun())
{
reduce(nPoints, sumOp<label>());
}
Info<< " " << nPoints << " points to insert..." << endl;
label nVert = number_of_vertices();
// using the range insert (faster than inserting points one by one)
insert(points.begin(), points.end());
Pout<< " " << number_of_vertices() - startOfInternalPoints_
<< " points inserted" << endl;
label nInserted = number_of_vertices() - startOfInternalPoints_;
if (Pstream::parRun())
{
reduce(nInserted, sumOp<label>());
}
Info<< " " << nInserted << " points inserted" << endl;
for
(

View File

@ -56,12 +56,26 @@ void Foam::conformalVoronoiMesh::timeCheck
memInfo m;
Pout<< "--- [ "
<< runTime_.elapsedCpuTime() << " s, "
<< "mem size " << m.size() << " kB, "
<< "mem peak " << m.peak() << " kB, "
<< "mem rss " << m.rss() << " kB"
<< " ] --- " << endl;
if (m.valid())
{
label mSize = m.size();
label mPeak = m.peak();
label mRss = m.rss();
if (Pstream::parRun())
{
reduce(mSize, sumOp<label>());
reduce(mPeak, sumOp<label>());
reduce(mRss, sumOp<label>());
}
Info<< "--- [ "
<< runTime_.elapsedCpuTime() << " s, "
<< "mem size " << mSize << " kB, "
<< "mem peak " << mPeak << " kB, "
<< "mem rss " << mRss << " kB"
<< " ] --- " << endl;
}
}
}
@ -149,7 +163,7 @@ void Foam::conformalVoronoiMesh::writeInternalDelaunayVertices
internalDelaunayVertices
);
Pout<< nl
Info<< nl
<< "Writing " << internalDVs.name()
<< " to " << internalDVs.instance()
<< endl;
@ -231,7 +245,7 @@ void Foam::conformalVoronoiMesh::writeMesh
filterFaces
);
Pout<< nl << "Writing polyMesh to " << instance << endl;
Info<< nl << "Writing polyMesh to " << instance << endl;
writeMesh
(

View File

@ -268,10 +268,10 @@ Foam::conformationSurfaces::conformationSurfaces
bounds_ = globalBounds_;
}
Info<< "global bounds " << globalBounds_ << endl;
if (Pstream::parRun())
if (Pstream::parRun() && cvMesh_.cvMeshControls().objOutput())
{
Info<< "global bounds " << globalBounds_ << endl;
Pout<< " proc bounds " << bounds_ << endl;
OFstream str