15 #ifndef MOOSE_NO_PERF_GRAPH 16 #define TIME_SECTION1(id) \ 17 mooseAssert(!Threads::in_threads, "PerfGraph timing cannot be used within threaded sections"); \ 18 PerfGuard time_guard(this->_pg_moose_app.perfGraph(), id); 19 #define CHECK_TIME_SECTION(id, section_name) \ 20 mooseAssert(moose::internal::getPerfGraphRegistry().sectionInfo(id)._name == \ 21 timedSectionName(section_name), \ 22 "PerfGraph section '" + timedSectionName(section_name) + \ 23 "' is already registered with name '" + \ 24 moose::internal::getPerfGraphRegistry().sectionInfo(id)._name + "'"); 26 #define TIME_SECTION1(id) 27 #define CHECK_TIME_SECTION(id, section_name) 30 #define TIME_SECTION2(section_name, level) \ 31 const PerfID __perf_id = this->registerTimedSection(section_name, level); \ 32 CHECK_TIME_SECTION(__perf_id, section_name); \ 33 TIME_SECTION1(__perf_id); 35 #define TIME_SECTION3(section_name, level, live_message) \ 36 const PerfID __perf_id = this->registerTimedSection(section_name, level, live_message); \ 37 CHECK_TIME_SECTION(__perf_id, section_name); \ 38 TIME_SECTION1(__perf_id); 40 #define TIME_SECTION4(section_name, level, live_message, print_dots) \ 41 const PerfID __perf_id = \ 42 this->registerTimedSection(section_name, level, live_message, print_dots); \ 43 CHECK_TIME_SECTION(__perf_id, section_name); \ 44 TIME_SECTION1(__perf_id); 47 #define GET_MACRO(_1, _2, _3, _4, NAME, ...) NAME 48 #define TIME_SECTION(...) \ 49 GET_MACRO(__VA_ARGS__, TIME_SECTION4, TIME_SECTION3, TIME_SECTION2, TIME_SECTION1, )(__VA_ARGS__) 112 const unsigned int level,
113 const std::string & live_message,
114 const bool print_dots =
true)
const;
Base class for MOOSE-based applications.
Every object that can be built by the factory should be derived from this class.
virtual ~PerfGraphInterface()=default
std::string timedSectionName(const std::string §ion_name) const
Interface for objects interacting with the PerfGraph.
const std::string _prefix
A prefix to use for all sections.
PerfID registerTimedSection(const std::string §ion_name, const unsigned int level) const
Call to register a named section for timing.
static InputParameters validParams()
PerfGraph & perfGraph()
Get the PerfGraph.
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...
MooseApp & _pg_moose_app
The MooseApp that owns the PerfGraph.