diff --git a/src/functionObjects/utilities/parProfiling/parProfiling.C b/src/functionObjects/utilities/parProfiling/parProfiling.C index ade16fb0516b122c1c22f261b0153aedb4a31974..5ba3797594da95339674bada2269d10e29be5124 100644 --- a/src/functionObjects/utilities/parProfiling/parProfiling.C +++ b/src/functionObjects/utilities/parProfiling/parProfiling.C @@ -183,28 +183,19 @@ void Foam::functionObjects::parProfiling::report() const statData& allToAllStats = times[1]; scalar reduceAvg = reduceStats[2].second()/Pstream::nProcs(); - scalar reduceRelMin = - (reduceStats[0].second()-reduceAvg)/(reduceAvg + VSMALL); - scalar reduceRelMax = - (reduceStats[1].second()-reduceAvg)/(reduceAvg + VSMALL); - scalar allToAllAvg = allToAllStats[2].second()/Pstream::nProcs(); - scalar allToAllRelMin = - (allToAllStats[0].second()-allToAllAvg)/(allToAllAvg + VSMALL); - scalar allToAllRelMax = - (allToAllStats[1].second()-allToAllAvg)/(allToAllAvg + VSMALL); Info<< type() << ':' << nl << "\treduce : avg = " << reduceAvg << 's' << nl - << "\t min = " << reduceRelMin*100 - << "% (processor " << reduceStats[0].first() << ')' << nl - << "\t max = +" << reduceRelMax*100 - << "% (processor " << reduceStats[1].first() << ')' << nl + << "\t min = " << reduceStats[0].second() + << "s (processor " << reduceStats[0].first() << ')' << nl + << "\t max = " << reduceStats[1].second() + << "s (processor " << reduceStats[1].first() << ')' << nl << "\tall-all : avg = " << allToAllAvg << 's' << nl - << "\t min = " << allToAllRelMin*100 - << "% (processor " << allToAllStats[0].first() << ')' << nl - << "\t max = +" << allToAllRelMax*100 - << "% (processor " << allToAllStats[1].first() << ')' << endl; + << "\t min = " << allToAllStats[0].second() + << "s (processor " << allToAllStats[0].first() << ')' << nl + << "\t max = " << allToAllStats[1].second() + << "s (processor " << allToAllStats[1].first() << ')' << endl; } } @@ -224,7 +215,6 @@ bool Foam::functionObjects::parProfiling::write() bool Foam::functionObjects::parProfiling::end() { - report(); profilingPstream::disable(); return true; } diff --git a/src/functionObjects/utilities/parProfiling/parProfiling.H b/src/functionObjects/utilities/parProfiling/parProfiling.H index 32b055bc5479c4378518ec3ba8b56bf64d3f5bf7..1b7dbf28dbffc3562f36f05ebca3fde39085ac8c 100644 --- a/src/functionObjects/utilities/parProfiling/parProfiling.H +++ b/src/functionObjects/utilities/parProfiling/parProfiling.H @@ -30,6 +30,20 @@ Group Description Simple (simplistic) mpi-profiling. +Usage + Example of function object specification: + \verbatim + profiling + { + type parProfiling; + libs ("libutilityFunctionObjects.so"); + + // Report stats on exit only (instead of every time step) + executeControl onEnd; + writeControl none; + } + \endverbatim + SourceFiles parProfiling.C diff --git a/tutorials/incompressible/simpleFoam/windAroundBuildings/system/profiling b/tutorials/incompressible/simpleFoam/windAroundBuildings/system/profiling index b0865c6bb6653f1a0ba6736091fe2c9e60c77348..f66e2e99ed5304ac1a1b56e4df536e232a0a4a3b 100644 --- a/tutorials/incompressible/simpleFoam/windAroundBuildings/system/profiling +++ b/tutorials/incompressible/simpleFoam/windAroundBuildings/system/profiling @@ -12,8 +12,9 @@ profiling libs ("libutilityFunctionObjects.so"); - executeControl none; - writeControl writeTime; + // Report stats on exit only (instead of every time step) + executeControl onEnd; + writeControl none; }