From 9e88a8a21ee761c85a33ea77783ddde12d5245a4 Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Wed, 12 Jul 2017 15:48:25 +0200 Subject: [PATCH] ENH: enable profiling output for postProcess and -postProcess (closes #526) - added an explicit print, but only report profiling to the log file from master process. We don't wish to overwrite any profiling that was conducted during the simulation. Besides which, we don't have a proper Time object for handling the write nicely either. --- .../utilities/postProcessing/postProcess/postProcess.C | 5 +++++ etc/config.sh/bashcompletion | 2 +- .../db/functionObjects/functionObjectList/postProcess.H | 3 +++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/applications/utilities/postProcessing/postProcess/postProcess.C b/applications/utilities/postProcessing/postProcess/postProcess.C index d0c998aeb2..3f7f51dd2d 100644 --- a/applications/utilities/postProcessing/postProcess/postProcess.C +++ b/applications/utilities/postProcessing/postProcess/postProcess.C @@ -32,6 +32,7 @@ Description \*---------------------------------------------------------------------------*/ #include "argList.H" +#include "profiling.H" #include "timeSelector.H" #include "ReadFields.H" #include "volFields.H" @@ -132,6 +133,7 @@ void executeFunctionObjects int main(int argc, char *argv[]) { Foam::timeSelector::addOptions(); + #include "addProfilingOption.H" #include "addRegionOption.H" #include "addFunctionObjectOptions.H" @@ -202,6 +204,9 @@ int main(int argc, char *argv[]) functionsPtr(), timei == timeDirs.size()-1 ); + + // Report to output (avoid overwriting values from simulation) + profiling::print(Info); } catch (IOerror& err) { diff --git a/etc/config.sh/bashcompletion b/etc/config.sh/bashcompletion index c2589be81f..b2e723b793 100644 --- a/etc/config.sh/bashcompletion +++ b/etc/config.sh/bashcompletion @@ -4931,7 +4931,7 @@ _of_postProcess() local cur="${COMP_WORDS[COMP_CWORD]}" local prev="${COMP_WORDS[COMP_CWORD-1]}" - local opts="-constant -latestTime -list -newTimes -noFunctionObjects -noZero -parallel -srcDoc -doc -help " + local opts="-constant -latestTime -list -newTimes -noFunctionObjects -noZero -parallel -profiling -srcDoc -doc -help " local optsWithArgs="-case -decomposeParDict -dict -field -fields -func -funcs -region -roots -time " case ${prev} in diff --git a/src/OpenFOAM/db/functionObjects/functionObjectList/postProcess.H b/src/OpenFOAM/db/functionObjects/functionObjectList/postProcess.H index 06f7aa3f4e..f3c065bafc 100644 --- a/src/OpenFOAM/db/functionObjects/functionObjectList/postProcess.H +++ b/src/OpenFOAM/db/functionObjects/functionObjectList/postProcess.H @@ -143,6 +143,9 @@ if (argList::postProcess(argc, argv)) { functionsPtr->end(); } + + // Report to output (avoid overwriting values from simulation) + profiling::print(Info); } catch (IOerror& err) {