The Gaudi Framework  master (37c0b60a)
precedence::Duration Struct Reference

#include </builds/gaudi/Gaudi/GaudiHive/src/PRGraph/PrecedenceRulesGraph.h>

Collaboration diagram for precedence::Duration:

Public Member Functions

 Duration (const EventSlot &slot, SmartIF< ISvcLocator > &svcLocator)
 
std::string operator() (const AlgoProps &props) const
 
std::string operator() (const DecisionHubProps &) const
 
std::string operator() (const DataProps &) const
 

Public Attributes

const EventSlotm_slot
 
SmartIF< ITimelineSvcm_timelineSvc
 

Detailed Description

Definition at line 335 of file PrecedenceRulesGraph.h.

Constructor & Destructor Documentation

◆ Duration()

precedence::Duration::Duration ( const EventSlot slot,
SmartIF< ISvcLocator > &  svcLocator 
)
inline

Definition at line 336 of file PrecedenceRulesGraph.h.

336  : m_slot( slot ) {
338  MsgStream log{ msgSvc, "Duration.Getter" };
339 
340  // Figure if we can discover the algorithm timings
341  m_timelineSvc = svcLocator->service<ITimelineSvc>( "TimelineSvc", false );
342  if ( !m_timelineSvc.isValid() )
343  log << MSG::WARNING << "Failed to locate the TimelineSvc: no way to add "
344  << "algorithm's runtimes to the TTT dumps" << endmsg;
345  }

Member Function Documentation

◆ operator()() [1/3]

std::string precedence::Duration::operator() ( const AlgoProps props) const
inline

Definition at line 347 of file PrecedenceRulesGraph.h.

347  {
348 
350 
351  if ( m_timelineSvc.isValid() ) {
352 
353  TimelineEvent te;
354  te.algorithm = props.m_name;
355  te.slot = m_slot.eventContext->slot();
356  te.event = m_slot.eventContext->evt();
357 
358  m_timelineSvc->getTimelineEvent( te );
359  time = std::to_string( std::chrono::duration_cast<std::chrono::nanoseconds>( te.end - te.start ).count() );
360  }
361 
362  return time;
363  }

◆ operator()() [2/3]

std::string precedence::Duration::operator() ( const DataProps ) const
inline

Definition at line 367 of file PrecedenceRulesGraph.h.

367 { return ""; }

◆ operator()() [3/3]

std::string precedence::Duration::operator() ( const DecisionHubProps ) const
inline

Definition at line 365 of file PrecedenceRulesGraph.h.

365 { return ""; }

Member Data Documentation

◆ m_slot

const EventSlot& precedence::Duration::m_slot

Definition at line 369 of file PrecedenceRulesGraph.h.

◆ m_timelineSvc

SmartIF<ITimelineSvc> precedence::Duration::m_timelineSvc

Definition at line 370 of file PrecedenceRulesGraph.h.


The documentation for this struct was generated from the following file:
EventSlot::eventContext
std::unique_ptr< EventContext > eventContext
Cache for the eventContext.
Definition: EventSlot.h:83
std::string
STL class.
Gaudi.Configuration.log
log
Definition: Configuration.py:28
TimelineEvent::start
time_point start
Definition: ITimelineSvc.h:33
check_ParticleID.props
props
Definition: check_ParticleID.py:21
precedence::Duration::m_timelineSvc
SmartIF< ITimelineSvc > m_timelineSvc
Definition: PrecedenceRulesGraph.h:370
MSG::WARNING
@ WARNING
Definition: IMessageSvc.h:25
precedence::Duration::m_slot
const EventSlot & m_slot
Definition: PrecedenceRulesGraph.h:369
TimelineEvent::event
size_t event
Definition: ITimelineSvc.h:29
AvalancheSchedulerErrorTest.msgSvc
msgSvc
Definition: AvalancheSchedulerErrorTest.py:80
TimelineEvent::slot
size_t slot
Definition: ITimelineSvc.h:28
TimelineEvent
Definition: ITimelineSvc.h:23
Gaudi::svcLocator
GAUDI_API ISvcLocator * svcLocator()
SmartIF::isValid
bool isValid() const
Allow for check if smart pointer is valid.
Definition: SmartIF.h:72
ITimelineSvc
Definition: ITimelineSvc.h:37
EventContext::slot
ContextID_t slot() const
Definition: EventContext.h:51
ISvcLocator::service
StatusCode service(const Gaudi::Utils::TypeNameString &name, T *&svc, bool createIf=true)
Templated method to access a service by name.
Definition: ISvcLocator.h:98
std::to_string
T to_string(T... args)
SmartIF< IMessageSvc >
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:202
MsgStream
Definition: MsgStream.h:33
plotSpeedupsPyRoot.time
time
Definition: plotSpeedupsPyRoot.py:180
TimelineEvent::algorithm
std::string algorithm
Definition: ITimelineSvc.h:31
TimelineEvent::end
time_point end
Definition: ITimelineSvc.h:34
EventContext::evt
ContextEvt_t evt() const
Definition: EventContext.h:50