11#ifndef ATHENASERVICES_TIMEOUTALG_H
12#define ATHENASERVICES_TIMEOUTALG_H
18#include "GaudiKernel/IIncidentListener.h"
35class TimeoutAlg :
public extends<AthReentrantAlgorithm, IIncidentListener>,
40 using base_class::base_class;
43 virtual StatusCode
execute (
const EventContext& ctx)
const override;
44 virtual StatusCode
stop()
override;
45 virtual void handle(
const Incident& inc)
override;
48 using clock_t = std::chrono::steady_clock;
59 this,
"Timeout", 0,
"Timeout in nanoseconds (0 means disabled)"
62 this,
"MaxCheckInterval", 10*1e9,
"Maximum time (ns) between timeout checks"
65 this,
"DumpSchedulerState",
false,
"Print scheduler state on timeout"
68 this,
"AbortJob",
false,
"Abort job on timeout"
Maintain a set of objects, one per slot.
Define macros for attributes used to control the static checker.
Class to modify timeout flag.
Maintain a set of objects, one per slot.
Algorithm to monitor event timeouts.
std::promise< void > m_stop_thread
Signal to stop watchdog thread.
void handleTimeout(EventContext::ContextID_t slot)
Handle timeout.
Gaudi::Property< bool > m_dumpState
virtual void handle(const Incident &inc) override
std::mutex m_handleMutex
Mutex for handleTimeout.
virtual StatusCode stop() override
Gaudi::Property< bool > m_abort
std::atomic< bool > m_stopped
Has watchdog thread already been stopped? (to avoid setting future twice)
Gaudi::Property< unsigned long long > m_timeoutProp
void timeoutThread()
Watchdog thread.
virtual StatusCode execute(const EventContext &ctx) const override
std::chrono::nanoseconds m_timeout
Timeout property as duration.
std::chrono::steady_clock clock_t
SG::SlotSpecificObj< clock_t::time_point > m_eventStartTime ATLAS_THREAD_SAFE
Start time of each event per slot.
Gaudi::Property< unsigned long long > m_checkInterval
virtual StatusCode initialize() override
Algorithm to monitor event timeouts.