www.mooseframework.org
MemoryUsage.h
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://www.mooseframework.org
3 //*
4 //* All rights reserved, see COPYRIGHT for full restrictions
5 //* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6 //*
7 //* Licensed under LGPL 2.1, please see LICENSE for details
8 //* https://www.gnu.org/licenses/lgpl-2.1.html
9 
10 #pragma once
11 
12 #include "GeneralPostprocessor.h"
13 #include "MemoryUsageReporter.h"
14 #include "MemoryUtils.h"
15 
20 {
21 public:
23 
25 
26  virtual void timestepSetup() override;
27 
28  virtual void initialize() override {}
29  virtual void execute() override;
30  virtual void finalize() override;
31  virtual PostprocessorValue getValue() const override;
32 
33 protected:
34  enum class MemType
35  {
39  } _mem_type;
40 
41  enum class ValueType
42  {
43  total,
44  average,
47  } _value_type;
48 
51 
54 
57 
59  const bool _report_peak_value;
60 };
MemoryUsage(const InputParameters &parameters)
Definition: MemoryUsage.C:38
enum MemoryUsage::MemType _mem_type
Real _value
memory usage metric in bytes
Definition: MemoryUsage.h:53
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
This class is here to combine the Postprocessor interface and the base class Postprocessor object alo...
MemoryUtils::MemUnits _mem_units
The unit prefix for the reported memory statistics (kilobyte, megabyte, etc).
Definition: MemoryUsage.h:50
Mix-in class for querying memory metrics used by MemoryUsage and VectorMemoryUsage.
static InputParameters validParams()
Definition: MemoryUsage.C:18
virtual void timestepSetup() override
Definition: MemoryUsage.C:51
Real PostprocessorValue
various MOOSE typedefs
Definition: MooseTypes.h:191
Output maximum, average, or total process memory usage.
Definition: MemoryUsage.h:19
virtual void execute() override
Execute method.
Definition: MemoryUsage.C:57
Real _peak_value
peak memory usage metric in bytes (of multiple samples in the current time step)
Definition: MemoryUsage.h:56
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
virtual PostprocessorValue getValue() const override
This will get called to actually grab the final value the postprocessor has calculated.
Definition: MemoryUsage.C:122
const bool _report_peak_value
report peak value for multiple samples in a time step
Definition: MemoryUsage.h:59
const InputParameters & parameters() const
Get the parameters of the object.
virtual void initialize() override
Called before execute() is ever called so that data can be cleared.
Definition: MemoryUsage.h:28
enum MemoryUsage::ValueType _value_type
virtual void finalize() override
This is called after execute() and after threadJoin()! This is probably where you want to do MPI comm...
Definition: MemoryUsage.C:86