www.mooseframework.org
PerfGraphInterface.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 "Moose.h"
13 #include "PerfGuard.h"
14 #include "InputParameters.h"
15 
16 #ifndef MOOSE_NO_PERF_GRAPH
17 #define TIME_SECTION(id) PerfGuard time_guard(_perf_graph, id);
18 #else
19 #define TIME_SECTION(id)
20 #endif
21 
22 // Forward declarations
23 class PerfGraphInterface;
24 
25 template <>
27 
32 {
33 public:
37  PerfGraphInterface(const MooseObject * moose_object);
38 
42  PerfGraphInterface(const MooseObject * moose_object, const std::string prefix);
43 
47  PerfGraphInterface(PerfGraph & perf_graph, const std::string prefix = "");
48 
49  virtual ~PerfGraphInterface() = default;
50 
51 protected:
59  PerfID registerTimedSection(const std::string & section_name, const unsigned int level);
60 
63 
66 
68  std::string _prefix;
69 };
70 
PerfID registerTimedSection(const std::string &section_name, const unsigned int level)
Call to register a named section for timing.
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
PerfGraph & _perf_graph
The performance graph to add to.
unsigned int PerfID
Definition: MooseTypes.h:163
Every object that can be built by the factory should be derived from this class.
Definition: MooseObject.h:42
virtual ~PerfGraphInterface()=default
Interface for objects that needs transient capabilities.
InputParameters validParams< PerfGraphInterface >()
std::string _prefix
A prefix to use for all sections.
const InputParameters * _pg_params
Params.
PerfGraphInterface(const MooseObject *moose_object)
For objects that are MooseObjects with a default prefix of type()
The PerfGraph will hold the master list of all registered performance segments and the head PerfNode...
Definition: PerfGraph.h:34