55 #ifndef Foam_profiling_H 56 #define Foam_profiling_H 74 class profilingInformation;
75 class profilingSysInfo;
76 class profilingTrigger;
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
label size() const noexcept
The size of the current stack.
A list of keyword definitions, which are a keyword followed by a number of values (eg...
profilingInformation Information
static bool active() noexcept
True if profiling is allowed and is active.
static bool writeNow()
Write profiling information now.
Triggers for starting/stopping code profiling.
A simple container for options an IOstream can normally have.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
static void disable() noexcept
Disallow profiling - turns the InfoSwitch off.
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
static void unstack(const profilingInformation *info)
Remove the information from the top of the stack.
void beginTimer(Information *info)
Add to stack of active information and begin timer datum.
virtual bool writeData(Ostream &os) const
writeData member function required by regIOobject
void operator=(const profiling &)=delete
No copy assignment.
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects...
const dictionary & parent() const noexcept
Return the parent dictionary.
static void initialize(const IOobject &ioObj, const Time &owner)
Singleton to initialize profiling pool, everything enabled.
static int allowed
Flag if profiling is allowed.
static profilingInformation * New(const std::string &descr)
Existing or new element on pool, add to stack.
static void stop(const Time &owner)
Stop profiling, cleanup pool if possible.
InfoProxy< IOobject > info() const noexcept
Return info proxy, for printing information to a stream.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
virtual bool writeObject(IOstreamOption, const bool writeOnProc) const
Write as uncompressed ASCII.
static bool print(Ostream &os)
Print profiling information to specified output.
OBJstream os(runTime.globalPath()/outputName)
Information * endTimer()
Remove from stack of active information and update elapsed time.
A dynamically resizable PtrList with allocation management.
~profiling()
Destructor. Top-level clears the singleton.
IOobject io("surfaceFilmProperties", mesh.time().constant(), mesh, IOobject::READ_IF_PRESENT, IOobject::NO_WRITE, IOobject::NO_REGISTER)
const Time & owner() const noexcept
The owner of the profiling.
Defines the attributes of an object for which implicit objectRegistry management is supported...
profiling(const profiling &)=delete
No copy construct.
General system information useful for profiling.
Information * create()
Clear all profiling and restart with new profiling.