Commit 3f43918e authored by Mark OLESEN's avatar Mark OLESEN
Browse files

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.
parent d0898b43
......@@ -109,9 +109,9 @@ OptimisationSwitches
profiling
{
active true;
cpuInfo true;
cpuInfo false;
memInfo false;
sysInfo true;
sysInfo false;
}
*/
......
......@@ -357,7 +357,7 @@ void Foam::Time::setMonitoring(const bool forceProfiling)
else if
(
profilingDict
&& profilingDict->lookupOrDefault<Switch>("active", true)
&& profilingDict->lookupOrDefault<bool>("active", true)
)
{
profiling::initialize
......
......@@ -38,7 +38,7 @@ int Foam::profiling::allowed
Foam::debug::infoSwitch("allowProfiling", 1)
);
Foam::profiling* Foam::profiling::pool_(0);
Foam::profiling* Foam::profiling::pool_(nullptr);
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
......@@ -179,7 +179,7 @@ void Foam::profiling::stop(const Time& owner)
if (pool_ && &owner == &(pool_->owner_))
{
delete pool_;
pool_ = 0;
pool_ = nullptr;
}
}
......@@ -274,18 +274,18 @@ Foam::profiling::profiling
timers_(),
sysInfo_
(
dict.lookupOrDefault<Switch>("sysInfo", true)
? new profilingSysInfo() : 0
dict.lookupOrDefault<bool>("sysInfo", false)
? new profilingSysInfo() : nullptr
),
cpuInfo_
(
dict.lookupOrDefault<Switch>("cpuInfo", true)
? new cpuInfo() : 0
dict.lookupOrDefault<bool>("cpuInfo", false)
? new cpuInfo() : nullptr
),
memInfo_
(
dict.lookupOrDefault<Switch>("memInfo", false)
? new memInfo() : 0
dict.lookupOrDefault<bool>("memInfo", false)
? new memInfo() : nullptr
)
{}
......@@ -300,7 +300,7 @@ Foam::profiling::~profiling()
if (pool_ == this)
{
pool_ = 0;
pool_ = nullptr;
profilingInformation::nextId_ = 0;
}
}
......
......@@ -128,7 +128,7 @@ private:
// Private Static Data Members
//- Only one global pool object is possible
static profiling *pool_;
static profiling* pool_;
// Private Data Members
......@@ -200,14 +200,14 @@ protected:
profilingInformation* find(const string& descr, const label parentId);
//- Add to hashed storage,
// returns pointer to newly stored element for chaining
// \return pointer to newly stored element for chaining
profilingInformation* store(profilingInformation* info);
//- Add to stack and set timer lookup (based on Id)
void push(profilingInformation* info, clockTime& timer);
//- Remove from stack and remove timer lookup (based on Id).
// Returns pointer to profiling information element
// \return pointer to profiling information element
profilingInformation* pop();
......
......@@ -150,11 +150,7 @@ Foam::Ostream& Foam::profilingInformation::write
// * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * //
Foam::Ostream& Foam::operator<<
(
Ostream& os,
const profilingInformation& info
)
Foam::Ostream& Foam::operator<<(Ostream& os, const profilingInformation& info)
{
return info.write(os);
}
......
......@@ -68,7 +68,7 @@ void Foam::profilingTrigger::stop()
profiling::unstack(ptr_);
// pointer is managed by pool storage -> thus no delete here
}
ptr_ = 0;
ptr_ = nullptr;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment