STYLE: qualify format/version/compression with IOstreamOption not IOstream
STYLE: reduce number of lookups when scanning {fa,fv}Solution
STYLE: call IOobject::writeEndDivider as static
- makes it easier to distinguish between pointers referring to pool
data versus pointers actually holding storage, avoids
manual demand-driven deletion and autoPtr.
ENH: simplify/improve Pstream profiling
- times now double (not scalar) for consistency with what cpuTime
delivers
- use bool to track suspend state
- previously introduced `getOrDefault` as a dictionary _get_ method,
now complete the transition and use it everywhere instead of
`lookupOrDefault`. This avoids mixed usage of the two methods that
are identical in behaviour, makes for shorter names, and promotes
the distinction between "lookup" access (ie, return a token stream,
locate and return an entry) and "get" access (ie, the above with
conversion to concrete types such as scalar, label etc).
- add additional control via a Foam::infoDetailLevel flag, which is
supported by a 'DetailLevel' macro. Eg,
DetailLevel << "some information" << nl
- When infoDetailLevel is zero, the stdout for all Foam::system() calls
are also redirected to stderr to prevent child output from
appearing on the parent.
- close stdin before exec in system call.
- in many cases can just use lookupOrDefault("key", bool) instead of
lookupOrDefault<bool> or lookupOrDefault<Switch> since reading a
bool from an Istream uses the Switch(Istream&) anyhow
STYLE: relocated Switch string names into file-local scope
- include amount of free system memory in profiling, which can give an
indication of when swapping is about to start
- profilingSummary utility to collect profiling from parallel
calculations. Collects profiling information from processor
directories and summarize the time spent and number of calls as (max
avg min) values.
- use InfoSwitch to disable, or via static method.
- respect the state of the argList banner when deciding to emit
initialization information. Can otherwise end up with unwanted
output rubbish on things like foamDictionary and foamListTimes.
- Include newline in beginBlock/endBlock, since this corresponds to
the standard usage. The beginBlock now takes keyType instead of word.
- Provide Ostream::writeEntry method to reduce clutter and simplify
writing of entries.
Before
======
os << indent << "name" << nl
<< indent << token::BEGIN_BLOCK << incrIndent << nl;
os.writeKeyword("key1") << val1 << token::END_STATEMENT << nl;
os.writeKeyword("key2") << val2 << token::END_STATEMENT << nl;
os << decrIndent << indent << token::END_BLOCK << nl;
After
=====
os.beginBlock("name");
os.writeEntry("key1", val1);
os.writeEntry("key2", val2);
os.endBlock();
- For completeness, support inline use of various Ostream methods.
For example,
os << beginBlock;
os.writeEntry("key1", val1);
os.writeEntry("key2", val2);
os << endBlock;
- For those who wish to write in long form, can also use endEntry inline:
os.beginBlock("name");
os.writeKeyword("key1") << val2 << endEntry;
os.writeKeyword("key2") << val2 << endEntry;
os.endBlock();
The endEntry encapsulates a semi-colon, newline combination.
- value corresponds to the max memory when the corresponding profiling
is started.
Only used when the top-level profiling has memInfo active.
- memInfo is disabled by default, since the new maxMem functionality
otherwise adds overhead with every call.
tutorial:
/lagrangian/reactingParcelFoam/verticalChannelLTS