Commit fe8e2525 authored by graham's avatar graham
Browse files

ENH: Improved parallel memory reporting.

parent 605c27ae
......@@ -599,6 +599,8 @@ void Foam::conformalVoronoiMesh::buildParallelInterface
Info<< nl << "Parallel interface construction" << endl;
timeCheck("Before buildParallelInterface");
// Hard coded switch, can be turned on for testing and debugging purposes -
// all vertices will be referred to all processors, use with caution for
// big cases.
......@@ -612,6 +614,8 @@ void Foam::conformalVoronoiMesh::buildParallelInterface
receivedVertices,
outputName
);
timeCheck("After buildParallelInterfaceAll");
}
if (initialEdgeReferral)
......@@ -627,6 +631,8 @@ void Foam::conformalVoronoiMesh::buildParallelInterface
receivedVertices,
outputName
);
timeCheck("After buildParallelInterfaceIntersection");
}
buildParallelInterfaceInfluence
......@@ -773,11 +779,15 @@ void Foam::conformalVoronoiMesh::buildParallelInterfaceIntersection
dE0.setSize(fI);
dE1.setSize(fI);
timeCheck("buildParallelInterfaceIntersection before intersectsProc");
// Preform intersections in both directions, as there is no sense
// associated with the Dual edge
List<List<pointIndexHit> > intersectionForward(intersectsProc(dE0, dE1));
List<List<pointIndexHit> > intersectionReverse(intersectsProc(dE1, dE0));
timeCheck("buildParallelInterfaceIntersection after intersectsProc");
fI = 0;
// Relying on the order of iteration of facets being the same as before
......@@ -947,6 +957,8 @@ void Foam::conformalVoronoiMesh::buildParallelInterfaceIntersection
}
}
timeCheck("buildParallelInterfaceIntersection before referVertices");
referVertices
(
targetProcessor,
......
......@@ -63,17 +63,51 @@ void Foam::conformalVoronoiMesh::timeCheck
if (Pstream::parRun())
{
reduce(mSize, sumOp<label>());
reduce(mPeak, sumOp<label>());
reduce(mRss, sumOp<label>());
}
labelList allMSize(Pstream::nProcs());
labelList allMPeak(Pstream::nProcs());
labelList allMRss(Pstream::nProcs());
allMSize[Pstream::myProcNo()] = mSize;
allMPeak[Pstream::myProcNo()] = mPeak;
allMRss[Pstream::myProcNo()] = mRss;
Pstream::gatherList(allMSize);
Pstream::gatherList(allMPeak);
Pstream::gatherList(allMRss);
Info<< "--- [ "
<< "mem (kB) " << tab
<< "size" << tab
<< "peak" << tab
<< "rss"
<< " ] --- " << endl;
forAll(allMSize, procI)
{
Info<< "--- [ "
<< procI << " " << tab
<< allMSize[procI] << tab
<< allMPeak[procI] << tab
<< allMRss[procI]
<< " ] --- " << endl;
}
Info<< "--- [ "
<< "sum " << tab
<< sum(allMSize) << tab
<< sum(allMPeak) << tab
<< sum(allMRss)
<< " ] --- " << endl;
Info<< "--- [ "
<< runTime_.elapsedCpuTime() << " s, "
<< "mem size " << mSize << " kB, "
<< "mem peak " << mPeak << " kB, "
<< "mem rss " << mRss << " kB"
<< " ] --- " << endl;
}
else
{
Info<< "--- [ "
<< "mem size " << mSize << " kB, "
<< "mem peak " << mPeak << " kB, "
<< "mem rss " << mRss << " kB"
<< " ] --- " << endl;
}
}
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment