Commit d0b84daa authored by mark's avatar mark
Browse files

BUG: profiling dictionary could be binary/compressed (fixed #157)

BUG: memInfo not activated by -profiling option (fixed #157)
parent a7ef6c2e
......@@ -336,16 +336,28 @@ void Foam::Time::setControls()
void Foam::Time::setMonitoring(bool forceProfiling)
{
// initialize profiling on request
// skip if 'active' keyword is explicitly set to false
const dictionary* profilingDict =
(
forceProfiling
? &dictionary::null
: controlDict_.subDictPtr("profiling")
);
const dictionary* profilingDict = controlDict_.subDictPtr("profiling");
if
// initialize profiling on request
// otherwise rely on profiling entry within controlDict
// and skip if 'active' keyword is explicitly set to false
if (forceProfiling)
{
profiling::initialize
(
IOobject
(
"profiling",
timeName(),
"uniform",
*this,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
*this
);
}
else if
(
profilingDict
&& profilingDict->lookupOrDefault<Switch>("active", true)
......
......@@ -438,6 +438,22 @@ bool Foam::profiling::writeData(Ostream& os) const
}
bool Foam::profiling::writeObject
(
IOstream::streamFormat,
IOstream::versionNumber ver,
IOstream::compressionType
) const
{
return regIOobject::writeObject
(
IOstream::ASCII,
ver,
IOstream::UNCOMPRESSED
);
}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::profiling::Information* Foam::profiling::store(Information *info)
......
......@@ -207,6 +207,14 @@ public:
//- writeData member function required by regIOobject
virtual bool writeData(Ostream&) const;
//- Write as uncompressed ASCII, using given format
virtual bool writeObject
(
IOstream::streamFormat ignoreAlwaysASCII,
IOstream::versionNumber ver,
IOstream::compressionType ignoreAlwaysUncompressed
) const;
};
......
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