ATLAS Offline Software
|
Concrete implementation of Monitor to monitor utilisation of individual threads in a MT job. More...
#include <MonitorThreadOccupancy.h>
Public Member Functions | |
MonitorThreadOccupancy ()=delete | |
Forbid default constructor. More... | |
MonitorThreadOccupancy (const std::string &name, const MonitoredRange *parent) | |
Construct monitor. More... | |
virtual | ~MonitorThreadOccupancy ()=default |
Default destructor. More... | |
MonitorThreadOccupancy & | operator= (const MonitorThreadOccupancy &)=delete |
Forbid assignment. More... | |
MonitorThreadOccupancy (const MonitorThreadOccupancy &)=delete | |
Forbid copy. More... | |
virtual StatusCode | newEvent (const CostData &data, const float weight=1.) override |
Concrete dispatch method. More... | |
virtual std::unique_ptr< CounterBase > | newCounter (const std::string &name) override |
Concrete counter instantiation. More... | |
StatusCode | postProcess (float weight) |
Get the global start and stop timestamps over all threads and sync these to the individual threads. More... | |
const std::string & | getName () const |
Getter for Monitor's name. More... | |
const MonitoredRange * | getParent () const |
Return cached non-owning const ptr to this Monitor's parent Range. More... | |
TH1 * | bookGetPointer (TH1 *hist, const std::string &tDir="") const |
Appends Monitor name (to histogram path) and forwards histogram book request to parent Range. More... | |
bool | counterExists (const std::string &name) const |
Check if a counter of a given name exists. More... | |
CounterBase * | getCounter (const std::string &name) |
Retrieve counter by name. More... | |
virtual StatusCode | endEvent (float weight=1.) |
Called by the framework. More... | |
MsgStream & | msg () |
Logging. More... | |
MsgStream & | msg (const MSG::Level lvl) |
Logging on a given level. More... | |
bool | msgLvl (const MSG::Level lvl) |
Returns if requested level is same or higher than logging level. More... | |
Public Attributes | |
std::unordered_map< uint32_t, std::string > | m_threadToCounterMap |
Map thread's hash ID to a counting numeral embedded in a string. More... | |
size_t | m_threadCounter |
Count how many unique thread ID we have seen. More... | |
Protected Attributes | |
std::unordered_map< std::string, std::unique_ptr< CounterBase > > | m_counters |
Storage of Monitor's collection of Counters. More... | |
MsgStream | m_msgStream |
Logging member. More... | |
Private Attributes | |
const std::string | m_name |
Monitor's name. More... | |
const MonitoredRange * | m_parent |
Monitor's parent Range. More... | |
Concrete implementation of Monitor to monitor utilisation of individual threads in a MT job.
Definition at line 14 of file MonitorThreadOccupancy.h.
|
delete |
Forbid default constructor.
MonitorThreadOccupancy::MonitorThreadOccupancy | ( | const std::string & | name, |
const MonitoredRange * | parent | ||
) |
Construct monitor.
[in] | name | Monitor's name |
[in] | parent | Monitor's parent Range, cached non-owning pointer. |
Definition at line 8 of file MonitorThreadOccupancy.cxx.
|
virtualdefault |
Default destructor.
|
delete |
Forbid copy.
|
inherited |
Appends Monitor name (to histogram path) and forwards histogram book request to parent Range.
[in] | hist | Bare pointer to histogram. Ownership transferred to THistSvc. |
[in] | tDir | Histogram name & directory. |
Definition at line 37 of file Trigger/TrigCost/TrigCostAnalysis/src/MonitorBase.cxx.
|
inherited |
Check if a counter of a given name exists.
[in] | name | Name of Counter. |
Definition at line 47 of file Trigger/TrigCost/TrigCostAnalysis/src/MonitorBase.cxx.
|
virtualinherited |
Called by the framework.
Causes per-Event Variables to fill their histograms with their accumulated data.
Definition at line 29 of file Trigger/TrigCost/TrigCostAnalysis/src/MonitorBase.cxx.
|
inherited |
Retrieve counter by name.
If no such counter exists, a new one will be instanced and returned.
[in] | name | Name of Counter. |
Definition at line 52 of file Trigger/TrigCost/TrigCostAnalysis/src/MonitorBase.cxx.
|
inherited |
Getter for Monitor's name.
Definition at line 19 of file Trigger/TrigCost/TrigCostAnalysis/src/MonitorBase.cxx.
|
inherited |
Return cached non-owning const ptr to this Monitor's parent Range.
Definition at line 24 of file Trigger/TrigCost/TrigCostAnalysis/src/MonitorBase.cxx.
|
inherited |
Logging.
Definition at line 64 of file Trigger/TrigCost/TrigCostAnalysis/src/MonitorBase.cxx.
|
inherited |
Logging on a given level.
[in] | lvl | Verbosity level |
Definition at line 68 of file Trigger/TrigCost/TrigCostAnalysis/src/MonitorBase.cxx.
|
inherited |
Returns if requested level is same or higher than logging level.
[in] | lvl | Verbosity level |
Definition at line 72 of file Trigger/TrigCost/TrigCostAnalysis/src/MonitorBase.cxx.
|
overridevirtual |
Concrete counter instantiation.
Mints named counter of CounterThread type.
[in] | name | Name of Counter to mint. |
Implements MonitorBase.
Definition at line 69 of file MonitorThreadOccupancy.cxx.
|
overridevirtual |
Concrete dispatch method.
Iterate over all Algorithms in event data and dispatch to owned Counters
[in] | data | Access to event data |
[in] | weight | Global event weight |
Implements MonitorBase.
Definition at line 14 of file MonitorThreadOccupancy.cxx.
|
delete |
Forbid assignment.
StatusCode MonitorThreadOccupancy::postProcess | ( | float | weight | ) |
Get the global start and stop timestamps over all threads and sync these to the individual threads.
Definition at line 52 of file MonitorThreadOccupancy.cxx.
|
protectedinherited |
Storage of Monitor's collection of Counters.
Keyed by name.
Definition at line 138 of file Trigger/TrigCost/TrigCostAnalysis/src/MonitorBase.h.
|
protectedinherited |
Logging member.
Definition at line 140 of file Trigger/TrigCost/TrigCostAnalysis/src/MonitorBase.h.
|
privateinherited |
Monitor's name.
Definition at line 144 of file Trigger/TrigCost/TrigCostAnalysis/src/MonitorBase.h.
|
privateinherited |
Monitor's parent Range.
Cached non-owning const ptr.
Definition at line 145 of file Trigger/TrigCost/TrigCostAnalysis/src/MonitorBase.h.
size_t MonitorThreadOccupancy::m_threadCounter |
Count how many unique thread ID we have seen.
Definition at line 63 of file MonitorThreadOccupancy.h.
std::unordered_map<uint32_t, std::string> MonitorThreadOccupancy::m_threadToCounterMap |
Map thread's hash ID to a counting numeral embedded in a string.
Definition at line 62 of file MonitorThreadOccupancy.h.