BUG: disturbing warning about multiple initialization of profiling

- For example, decomposePar use multiple simultaneous Times.
  So permit multiple initialization without a warning. (issue #157)
This commit is contained in:
Mark Olesen
2016-06-23 14:18:17 +02:00
parent 08be9fcb5d
commit eb3ba2479a

View File

@ -94,12 +94,7 @@ void Foam::profiling::initialize
const Time& owner const Time& owner
) )
{ {
if (pool_) if (!pool_)
{
WarningInFunction
<< "Already initialized" << endl;
}
else
{ {
pool_ = new profiling(ioObj, owner); pool_ = new profiling(ioObj, owner);
@ -111,6 +106,9 @@ void Foam::profiling::initialize
pool_->push(info, pool_->clockTime_); pool_->push(info, pool_->clockTime_);
Info<< "profiling initialized" << nl; Info<< "profiling initialized" << nl;
} }
// silently ignore multiple initialization
// eg, decomposePar use multiple simultaneous Times
} }
@ -121,12 +119,7 @@ void Foam::profiling::initialize
const Time& owner const Time& owner
) )
{ {
if (pool_) if (!pool_)
{
WarningInFunction
<< "Already initialized" << endl;
}
else
{ {
pool_ = new profiling(dict, ioObj, owner); pool_ = new profiling(dict, ioObj, owner);
@ -138,6 +131,9 @@ void Foam::profiling::initialize
pool_->push(info, pool_->clockTime_); pool_->push(info, pool_->clockTime_);
Info<< "profiling initialized" << nl; Info<< "profiling initialized" << nl;
} }
// silently ignore multiple initialization
// eg, decomposePar use multiple simultaneous Times
} }