55#ifndef Foam_profiling_H
56#define Foam_profiling_H
109 static std::unique_ptr<profiling> singleton_;
130 std::unique_ptr<sysInfo> sysInfo_;
133 std::unique_ptr<cpuInfo> cpuInfo_;
136 std::unique_ptr<memInfo> memInfo_;
163 const bool allEnabled =
true
187 const std::string& descr
263 const
bool writeOnProc
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
IOdictionary(const IOobject &io, const dictionary *fallback=nullptr)
Construct given an IOobject and optional fallback dictionary content.
Defines the attributes of an object for which implicit objectRegistry management is supported,...
InfoProxy< IOobject > info() const noexcept
Return info proxy, for printing information to a stream.
A simple container for options an IOstream can normally have.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
A dynamically resizable PtrList with allocation management.
General CPU characteristics.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
const dictionary & parent() const noexcept
Return the parent dictionary.
Memory usage information for the current process, and the system memory that is free.
General system information useful for profiling.
Triggers for starting/stopping code profiling.
Information * endTimer()
Remove from stack of active information and update elapsed time.
static void disable() noexcept
Disallow profiling - turns the InfoSwitch off.
profilingInformation Information
static bool writeNow()
Write profiling information now.
static bool print(Ostream &os)
Print profiling information to specified output.
virtual bool writeData(Ostream &os) const
writeData member function required by regIOobject
profiling(const profiling &)=delete
No copy construct.
void operator=(const profiling &)=delete
No copy assignment.
static void unstack(const profilingInformation *info)
Remove the information from the top of the stack.
static int allowed
Flag if profiling is allowed.
static bool active() noexcept
True if profiling is allowed and is active.
friend class profilingTrigger
Information * create()
Clear all profiling and restart with new profiling.
const Time & owner() const noexcept
The owner of the profiling.
label size() const noexcept
The size of the current stack.
static profilingInformation * New(const std::string &descr)
Existing or new element on pool, add to stack.
void beginTimer(Information *info)
Add to stack of active information and begin timer datum.
static void stop(const Time &owner)
Stop profiling, cleanup pool if possible.
virtual bool writeObject(IOstreamOption, const bool writeOnProc) const
Write as uncompressed ASCII.
~profiling()
Destructor. Top-level clears the singleton.
static void initialize(const IOobject &ioObj, const Time &owner)
Singleton to initialize profiling pool, everything enabled.
OBJstream os(runTime.globalPath()/outputName)