Go to the documentation of this file.
54 static const word profilingFileName(
"profiling");
57 static const word blockNameProfiling(
"profiling");
63 {
"profiling", {
"calls",
"totalTime",
"childTime",
"maxMem" } },
64 {
"memInfo", {
"size",
"free" } },
70 int main(
int argc,
char *argv[])
74 "Collect profiling information from processor directories and"
75 " summarize time spent and number of calls as (max avg min) values."
111 <<
"No processor* directories found"
120 databases[0].times(),
124 if (timeDirs.empty())
127 <<
"No times selected" <<
nl <<
endl;
159 profiles[proci].clear();
160 databases[proci].setTime(timeDirs[timei], timei);
165 databases[proci].time(),
170 const IOobject* ioptr = objects.findObject(profilingFileName);
176 profiles[proci] =
dict;
195 Info<<
"found " << nDict <<
"/" << nProcs
196 <<
" profiling files" <<
nl <<
endl;
219 "summarized (max avg min) values from "
230 const entry& mainEntry = mainIter();
237 !processing.found(level1Name)
239 || mainEntry.
dict().empty()
245 const wordList& tags = processing[level1Name];
262 const bool hasDictEntries
272 level2Names = {level1Name};
279 for (
const word& level2Name : level2Names)
283 for (
const word& tag : tags)
285 stats(tag).reserve(nProcs);
294 if (inDictPtr && hasDictEntries)
297 inDictPtr = inDictPtr->
findDict(level2Name);
307 for (
const word& tag : tags)
316 stats(tag).append(val);
321 if (nEntry != nProcs)
331 outputDict.
add(level2Name, level1Dict.
subDict(level2Name));
332 outDictPtr = outputDict.
findDict(level2Name);
337 summary.
add(level1Name, level1Dict,
true);
338 outDictPtr = &outputDict;
359 for (
const word& tag : tags)
363 if (lst.size() == nProcs)
366 const scalar avg =
sum(lst) / nProcs;
368 if (lst.first() != lst.last())
375 lst.last(), avg, lst.first()
387 mkDir(summary.path());
391 summary.writeHeader(
os);
392 summary.writeData(
os);
393 summary.writeEndDivider(
os);
A keyword and a list of tokens is an 'entry'.
dictionary * findDict(const word &keyword, enum keyType::option matchOpt=keyType::REGEX)
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
Defines the attributes of an object for which implicit objectRegistry management is supported,...
Functions used by OpenFOAM that are specific to POSIX compliant operating systems and need to be repl...
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
A class for handling words, derived from Foam::string.
A class for handling file names.
const fileName & caseName() const noexcept
virtual bool isDict() const noexcept
static word timeName(const scalar t, const int precision=precision_)
auto key(const Type &t) -> typename std::enable_if< std::is_enum< Type >::value, typename std::underlying_type< Type >::type >::type
static void addNote(const string ¬e)
instantList select(const instantList ×) const
const keyType & keyword() const noexcept
const fileOperation & fileHandler()
Ostream & endl(Ostream &os)
entry * set(entry *entryPtr)
static word controlDictName
word outputName("finiteArea-edges.obj")
static void noFunctionObjects(bool addWithOption=false)
virtual label nProcs(const fileName &dir, const fileName &local="") const
const dictionary & subDict(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
OBJstream os(runTime.globalPath()/outputName)
virtual const dictionary & dict() const =0
List of IOobjects with searching and retrieving facilities.
errorManipArg< error, int > exit(error &err, const int errNo=1)
Output to file stream, using an OSstream.
bool isDict(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
#define FatalErrorInFunction
forAllConstIters(mixture.phases(), phase)
static void addOptions(const bool constant=true, const bool withZero=false)
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
virtual void setTime(const Time &t)
dimensioned< Type > sum(const DimensionedField< Type, GeoMesh > &df)
word name(const expressions::valueTypeCode typeCode)
entry * add(entry *entryPtr, bool mergeEntry=false)
Foam::argList args(argc, argv)
bool mkDir(const fileName &pathName, mode_t mode=0777)
wordList sortedToc() const
#define WarningInFunction
bool removeEnd(const std::string &text)
const fileName & rootPath() const noexcept
bool readIfPresent(const word &keyword, T &val, enum keyType::option matchOpt=keyType::REGEX) const