mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: support '-profiling' command-line option
- this option overrides any controlDict settings as a convenient means to selecting profiling without messing with the controlDict. - provide Profiling::writeNow() to emit profiling for utilities that don't have any natural time increment mechanism to trigger it.
This commit is contained in:
@ -334,11 +334,17 @@ void Foam::Time::setControls()
|
||||
}
|
||||
|
||||
|
||||
void Foam::Time::setMonitoring()
|
||||
void Foam::Time::setMonitoring(bool forceProfiling)
|
||||
{
|
||||
// initialize profiling on request
|
||||
// skip if 'active' keyword is explicitly set to false
|
||||
const dictionary* profilingDict = controlDict_.subDictPtr("profiling");
|
||||
const dictionary* profilingDict =
|
||||
(
|
||||
forceProfiling
|
||||
? &dictionary::null
|
||||
: controlDict_.subDictPtr("profiling")
|
||||
);
|
||||
|
||||
if
|
||||
(
|
||||
profilingDict
|
||||
@ -526,7 +532,9 @@ Foam::Time::Time
|
||||
readOpt() = IOobject::MUST_READ_IF_MODIFIED;
|
||||
|
||||
setControls();
|
||||
setMonitoring();
|
||||
|
||||
// '-profiling' = force profiling, ignore controlDict entry
|
||||
setMonitoring(args.optionFound("profiling"));
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user