23 params.
addParam<
bool>(
"report_peak_value",
25 "If the vectorpostprocessor is executed more than once " 26 "during a time step, report the aggregated peak " 30 "The unit prefix used to report memory usage, default: Mebibytes");
38 _col_hardware_id(declareVector(
"hardware_id")),
39 _col_total_ram(declareVector(
"total_ram")),
40 _col_physical_mem(declareVector(
"physical_mem")),
41 _col_virtual_mem(declareVector(
"virtual_mem")),
42 _col_page_faults(declareVector(
"page_faults")),
43 _col_node_utilization(declareVector(
"node_utilization")),
44 _report_peak_value(getParam<bool>(
"report_peak_value")),
45 _peak_physical_mem(0.0),
46 _peak_virtual_mem(0.0)
58 for (std::size_t i = 0; i <
_nrank; ++i)
117 for (std::size_t i = 0; i <
_nrank; ++i)
120 for (std::size_t i = 0; i <
_nrank; ++i)
126 for (std::size_t i = 0; i <
_nrank; ++i)
virtual void timestepSetup() override
Gets called at the beginning of the timestep before this object is asked to do its job...
VectorPostprocessorValue & _col_physical_mem
physical memory usage per rank
VectorPostprocessorValue & _col_hardware_id
hardware id for the physical node the rank is located at
VectorMemoryUsage(const InputParameters ¶meters)
MemoryUtils::MemUnits _mem_units
The unit prefix for the reported memory statistics (kilobyte, megabyte, etc).
registerMooseObject("MooseApp", VectorMemoryUsage)
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
void gather(const unsigned int root_id, const T &send_data, std::vector< T, A > &recv) const
This class is here to combine the VectorPostprocessor interface and the base class VectorPostprocesso...
const Parallel::Communicator & _communicator
static InputParameters validParams()
MooseEnum getMemUnitsEnum()
get the moose enum for the mem_unit_prefix parameter
std::vector< unsigned long long > _hardware_memory_total
total RAM for each hardware ID (node) (valid on rank zero only)
VectorPostprocessorValue & _col_page_faults
hard page faults per rank (Linux only), i.e. swap frequency
auto max(const L &left, const R &right)
const bool _report_peak_value
peak values
Mix-in class for querying memory metrics used by MemoryUsage and VectorMemoryUsage.
Generate a table of various memory metrics indexed by MPI rank.
static InputParameters validParams()
VectorPostprocessorValue & _col_virtual_mem
virtual memory usage per rank
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type It sho...
processor_id_type _nrank
number of ranks in the object's communicator
FEProblemBase & _fe_problem
Reference to the FEProblemBase for this user object.
virtual void finalize() override
Finalize.
VectorPostprocessorValue & _col_total_ram
total RAM available on the physical node the rank is located at
processor_id_type _my_rank
this objects rank
bool checkingUOAuxState() const
Return a flag to indicate whether we are executing user objects and auxliary kernels for state check ...
std::size_t convertBytes(std::size_t bytes, MemUnits unit)
convert bytes to selected unit prefix
const std::vector< unsigned int > & _hardware_id
hardware IDs for each MPI rank (valid on rank zero only)
VectorPostprocessorValue & _col_node_utilization
RAM utilization of the physical node (i.e. what fraction of the total RAM is the simulation using) ...
virtual void execute() override
Execute method.