16 if (not
data.isMasterSlot()) {
17 return StatusCode::SUCCESS;
21 bool isMultiSlot =
false;
23 const uint32_t slot =
tc->getDetail<uint32_t>(
"slot");
24 if (slot !=
data.onlineSlot()){
31 ATH_MSG_DEBUG(
"Saving data from multiple slots to master slot was not enabled - ThreadOccupancy Monitoring won't be executed");
32 return StatusCode::SUCCESS;
36 const uint32_t threadID =
tc->getDetail<uint32_t>(
"thread");
38 std::stringstream threadIDStr;
39 threadIDStr <<
"Thread_" << std::setfill(
'0') << std::setw(5) << threadID;
48 return StatusCode::SUCCESS;
53 uint64_t lowTimestamp = std::numeric_limits<uint64_t>::max();
54 uint64_t highTimestamp = 0;
55 for (
const auto& nameCounterPair :
m_counters) {
57 lowTimestamp = std::min(lowTimestamp, ptr->getLowTimestamp());
58 highTimestamp = std::max(highTimestamp, ptr->getHighTimestamp());
62 ptr->setAllThreadsTimestamps(lowTimestamp, highTimestamp);
65 return StatusCode::SUCCESS;
70 return std::make_unique<CounterThread>(name,
this);
#define ATH_CHECK
Evaluate an expression and check for errors.
char data[hepevt_bytes_allocation_ATLAS]
Caches and propagates event data to be used by monitoring algorithms.
Concrete implimentation of Counter to monitor all algorithms executing on a single thread.
CounterBase * getCounter(const std::string &name)
Retrieve counter by name.
MonitorBase()=delete
Forbid default constructor.
std::unordered_map< std::string, std::unique_ptr< CounterBase > > m_counters
Storage of Monitor's collection of Counters.
MonitorThreadOccupancy()=delete
Forbid default constructor.
StatusCode postProcess(float weight)
Get the global start and stop timestamps over all threads and sync these to the individual threads.
virtual std::unique_ptr< CounterBase > newCounter(const std::string &name) override
Concrete counter instantiation.
std::unordered_map< uint32_t, std::string > m_threadToCounterMap
Map thread's hash ID to a counting numeral embedded in a string.
virtual StatusCode newEvent(const CostData &data, const float weight=1.) override
Concrete dispatch method.
size_t m_threadCounter
Count how many unique thread ID we have seen.
Container which represents a time range and holds a collection of Monitors which monitor this range.
TrigComposite_v1 TrigComposite
Declare the latest version of the class.