ENH: support default profiling settings from etc/controlDict (issue #441)

- patch from Bernhard Gschaider
This commit is contained in:
Mark Olesen
2017-04-19 01:20:51 +02:00
parent befb49af10
commit 27776b09b0
2 changed files with 14 additions and 0 deletions

View File

@ -78,6 +78,15 @@ OptimisationSwitches
stopAtWriteNowSignal -1;
}
/* Can specify fallback profiling settings
profiling
{
active true;
cpuInfo true;
memInfo false;
sysInfo true;
}
*/
DebugSwitches
{

View File

@ -324,6 +324,11 @@ void Foam::Time::setControls()
void Foam::Time::setMonitoring(const bool forceProfiling)
{
const dictionary* profilingDict = controlDict_.subDictPtr("profiling");
if (!profilingDict)
{
// ... or from etc/controlDict
profilingDict = debug::controlDict().subDictPtr("profiling");
}
// initialize profiling on request
// otherwise rely on profiling entry within controlDict