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"))
registerMooseObject("MooseApp", MemoryUsage)
void gatherSum(T &value)
Gather the parallel sum of the variable passed in.
void gatherMax(T &value)
Gather the parallel max of the variable passed in.
MemoryUsage(const InputParameters ¶meters)
enum MemoryUsage::MemType _mem_type
bool getMemoryStats(Stats &stats)
get all memory stats for the current process stats The Stats object to fill with the data ...
std::size_t _physical_memory
std::size_t _virtual_memory
Real _value
memory usage metric in bytes
This class is here to combine the Postprocessor interface and the base class Postprocessor object alo...
MooseEnum getMemUnitsEnum()
get the moose enum for the mem_unit_prefix parameter
MemoryUtils::MemUnits _mem_units
The unit prefix for the reported memory statistics (kilobyte, megabyte, etc).
static InputParameters validParams()
FEProblemBase & _fe_problem
Reference to the FEProblemBase for this user object.
Mix-in class for querying memory metrics used by MemoryUsage and VectorMemoryUsage.
processor_id_type n_processors() const
static InputParameters validParams()
virtual void timestepSetup() override
void gatherMin(T &value)
Gather the parallel min of the variable passed in.
Real PostprocessorValue
various MOOSE typedefs
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type It sho...
Output maximum, average, or total process memory usage.
virtual void execute() override
Execute method.
Real _peak_value
peak memory usage metric in bytes (of multiple samples in the current time step)
void mooseError(Args &&... args) const
Emits an error prefixed with object name and type and optionally a file path to the top-level block p...
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
bool checkingUOAuxState() const
Return a flag to indicate whether we are executing user objects and auxliary kernels for state check ...
enum MemoryUsage::ValueType _value_type
std::size_t convertBytes(std::size_t bytes, MemUnits unit)
convert bytes to selected unit prefix
virtual void finalize() override
This is called after execute() and after threadJoin()! This is probably where you want to do MPI comm...