22 MooseEnum mem_type(
"physical_memory virtual_memory page_faults",
"physical_memory");
24 MooseEnum value_type(
"total average max_process min_process",
"total");
26 "value_type", value_type,
"Aggregation method to apply to the requested memory metric.");
29 params.
addParam<
bool>(
"report_peak_value",
31 "If the postprocessor is executed more than once "
32 "during a time step, report the aggregated peak "
45 _report_peak_value(getParam<bool>(
"report_peak_value"))
95 case ValueType::total:
99 case ValueType::average:
104 case ValueType::max_process:
108 case ValueType::min_process:
registerMooseObject("MooseApp", MemoryUsage)
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application.
Real PostprocessorValue
various MOOSE typedefs
bool checkingUOAuxState() const
Return a flag to indicate whether we are executing user objects and auxliary kernels for state check ...
This class is here to combine the Postprocessor interface and the base class Postprocessor object alo...
static InputParameters validParams()
Mix-in class for querying memory metrics used by MemoryUsage and VectorMemoryUsage.
Output maximum, average, or total process memory usage.
enum MemoryUsage::ValueType _value_type
Real _peak_value
peak memory usage metric in bytes (of multiple samples in the current time step)
MemoryUsage(const InputParameters ¶meters)
static InputParameters validParams()
virtual void execute() override
Execute method.
MemoryUtils::MemUnits _mem_units
The unit prefix for the reported memory statistics (kilobyte, megabyte, etc).
virtual void timestepSetup() override
Gets called at the beginning of the timestep before this object is asked to do its job.
virtual PostprocessorValue getValue() const override
This will get called to actually grab the final value the postprocessor has calculated.
const bool _report_peak_value
report peak value for multiple samples in a time step
enum MemoryUsage::MemType _mem_type
Real _value
memory usage metric in bytes
virtual void finalize() override
This is called after execute() and after threadJoin()! This is probably where you want to do MPI comm...
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type It sho...
void gatherSum(T &value)
Gather the parallel sum of the variable passed in.
void gatherMin(T &value)
Gather the parallel min of the variable passed in.
void gatherMax(T &value)
Gather the parallel max of the variable passed in.
FEProblemBase & _fe_problem
Reference to the FEProblemBase for this user object.
processor_id_type n_processors() const
std::size_t convertBytes(std::size_t bytes, MemUnits unit)
convert bytes to selected unit prefix
bool getMemoryStats(Stats &stats)
get all memory stats for the current process stats The Stats object to fill with the data
MooseEnum getMemUnitsEnum()
get the moose enum for the mem_unit_prefix parameter
std::size_t _virtual_memory
std::size_t _physical_memory