struct
#include <src/vt/utils/memory/memory_usage.h>
MemoryUsage An optional VT component that records memory usage for tracing and general profiling.
The memory usage component is backed by a list of memory reporters that can be selected from depending on the platform and accuracy needed.
Base classes
-
template<typename T>struct vt::runtime::component::Component<MemoryUsage>
Component
class for a generic VT runtime module, CRTP'ed over the component's actual type
Constructors, destructors, conversion operators
- MemoryUsage()
- Construct a memory usage component.
Public functions
- void initialize() override
- Empty default overridden initialize method.
- auto name() -> std::string override
- Get the name of the component.
- auto getAverageUsage() -> std::size_t
- Get mean current usage in bytes over all working reporters.
- auto getFirstUsage() -> std::size_t
- Get current usage from first working reporter.
- auto getFirstReporter() -> std::string
- Get the first working reporter name.
-
auto getUsageAll(bool pretty = true,
MemoryUnitEnum unit = MemoryUnitEnum::
Megabytes) -> std::string - Get string of (optionally pretty-printed) usage from all reporters.
- auto hasWorkingReporter() const -> bool
- Check if there exists a working reporter.
- auto getWorkingReporters() -> std::vector<std::string>
- Get list of working reporters.
- auto convertBytesFromString(std::string const& in) -> std::size_t
- Convert bytes to string.
-
template<typename SerializerT>void serialize(SerializerT& s)
Function documentation
std::size_t vt:: util:: memory:: MemoryUsage:: getAverageUsage()
Get mean current usage in bytes over all working reporters.
Returns | average usage in bytes |
---|
std::size_t vt:: util:: memory:: MemoryUsage:: getFirstUsage()
Get current usage from first working reporter.
Returns | usage in bytes |
---|
std::string vt:: util:: memory:: MemoryUsage:: getFirstReporter()
Get the first working reporter name.
Returns | the name |
---|
std::string vt:: util:: memory:: MemoryUsage:: getUsageAll(bool pretty = true,
MemoryUnitEnum unit = MemoryUnitEnum:: Megabytes)
Get string of (optionally pretty-printed) usage from all reporters.
Parameters | |
---|---|
pretty in | whether to pretty-print |
unit in | unit requested for usage |
Returns | string output of usage |
bool vt:: util:: memory:: MemoryUsage:: hasWorkingReporter() const
Check if there exists a working reporter.
Returns | whether there is a working reporter |
---|
std::vector<std::string> vt:: util:: memory:: MemoryUsage:: getWorkingReporters()
Get list of working reporters.
Returns | working reporters |
---|
std::size_t vt:: util:: memory:: MemoryUsage:: convertBytesFromString(std::string const& in)
Convert bytes to string.
Parameters | |
---|---|
in in | string with bytes |
Returns | number of bytes |