CONFIG: cpu/sys information in profiling now OFF by default (issue #526)

- since the cpu/sys information is invariant, it doesn't make much
  sense to emit by default at every time-step.
This commit is contained in:
Mark Olesen
2017-07-14 16:41:15 +02:00
parent 7380f53efb
commit b287d1bddd
6 changed files with 17 additions and 21 deletions

View File

@ -109,9 +109,9 @@ OptimisationSwitches
profiling profiling
{ {
active true; active true;
cpuInfo true; cpuInfo false;
memInfo false; memInfo false;
sysInfo true; sysInfo false;
} }
*/ */

View File

@ -357,7 +357,7 @@ void Foam::Time::setMonitoring(const bool forceProfiling)
else if else if
( (
profilingDict profilingDict
&& profilingDict->lookupOrDefault<Switch>("active", true) && profilingDict->lookupOrDefault<bool>("active", true)
) )
{ {
profiling::initialize profiling::initialize

View File

@ -38,7 +38,7 @@ int Foam::profiling::allowed
Foam::debug::infoSwitch("allowProfiling", 1) Foam::debug::infoSwitch("allowProfiling", 1)
); );
Foam::profiling* Foam::profiling::pool_(0); Foam::profiling* Foam::profiling::pool_(nullptr);
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // // * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
@ -179,7 +179,7 @@ void Foam::profiling::stop(const Time& owner)
if (pool_ && &owner == &(pool_->owner_)) if (pool_ && &owner == &(pool_->owner_))
{ {
delete pool_; delete pool_;
pool_ = 0; pool_ = nullptr;
} }
} }
@ -274,18 +274,18 @@ Foam::profiling::profiling
timers_(), timers_(),
sysInfo_ sysInfo_
( (
dict.lookupOrDefault<Switch>("sysInfo", true) dict.lookupOrDefault<bool>("sysInfo", false)
? new profilingSysInfo() : 0 ? new profilingSysInfo() : nullptr
), ),
cpuInfo_ cpuInfo_
( (
dict.lookupOrDefault<Switch>("cpuInfo", true) dict.lookupOrDefault<bool>("cpuInfo", false)
? new cpuInfo() : 0 ? new cpuInfo() : nullptr
), ),
memInfo_ memInfo_
( (
dict.lookupOrDefault<Switch>("memInfo", false) dict.lookupOrDefault<bool>("memInfo", false)
? new memInfo() : 0 ? new memInfo() : nullptr
) )
{} {}
@ -300,7 +300,7 @@ Foam::profiling::~profiling()
if (pool_ == this) if (pool_ == this)
{ {
pool_ = 0; pool_ = nullptr;
profilingInformation::nextId_ = 0; profilingInformation::nextId_ = 0;
} }
} }

View File

@ -128,7 +128,7 @@ private:
// Private Static Data Members // Private Static Data Members
//- Only one global pool object is possible //- Only one global pool object is possible
static profiling *pool_; static profiling* pool_;
// Private Data Members // Private Data Members
@ -200,14 +200,14 @@ protected:
profilingInformation* find(const string& descr, const label parentId); profilingInformation* find(const string& descr, const label parentId);
//- Add to hashed storage, //- Add to hashed storage,
// returns pointer to newly stored element for chaining // \return pointer to newly stored element for chaining
profilingInformation* store(profilingInformation* info); profilingInformation* store(profilingInformation* info);
//- Add to stack and set timer lookup (based on Id) //- Add to stack and set timer lookup (based on Id)
void push(profilingInformation* info, clockTime& timer); void push(profilingInformation* info, clockTime& timer);
//- Remove from stack and remove timer lookup (based on Id). //- Remove from stack and remove timer lookup (based on Id).
// Returns pointer to profiling information element // \return pointer to profiling information element
profilingInformation* pop(); profilingInformation* pop();

View File

@ -150,11 +150,7 @@ Foam::Ostream& Foam::profilingInformation::write
// * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * //
Foam::Ostream& Foam::operator<< Foam::Ostream& Foam::operator<<(Ostream& os, const profilingInformation& info)
(
Ostream& os,
const profilingInformation& info
)
{ {
return info.write(os); return info.write(os);
} }

View File

@ -68,7 +68,7 @@ void Foam::profilingTrigger::stop()
profiling::unstack(ptr_); profiling::unstack(ptr_);
// pointer is managed by pool storage -> thus no delete here // pointer is managed by pool storage -> thus no delete here
} }
ptr_ = 0; ptr_ = nullptr;
} }