The Gaudi Framework  master (e199b415)
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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 336 of file PrecedenceRulesGraph.h.

Constructor & Destructor Documentation

◆ Duration()

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

Definition at line 337 of file PrecedenceRulesGraph.h.

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

Member Function Documentation

◆ operator()() [1/3]

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

Definition at line 348 of file PrecedenceRulesGraph.h.

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

◆ operator()() [2/3]

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

Definition at line 368 of file PrecedenceRulesGraph.h.

368 { return ""; }

◆ operator()() [3/3]

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

Definition at line 366 of file PrecedenceRulesGraph.h.

366 { return ""; }

Member Data Documentation

◆ m_slot

const EventSlot& precedence::Duration::m_slot

Definition at line 370 of file PrecedenceRulesGraph.h.

◆ m_timelineSvc

SmartIF<ITimelineSvc> precedence::Duration::m_timelineSvc

Definition at line 371 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: TimelineEvent.h:26
check_ParticleID.props
props
Definition: check_ParticleID.py:21
precedence::Duration::m_timelineSvc
SmartIF< ITimelineSvc > m_timelineSvc
Definition: PrecedenceRulesGraph.h:371
MSG::WARNING
@ WARNING
Definition: IMessageSvc.h:25
precedence::Duration::m_slot
const EventSlot & m_slot
Definition: PrecedenceRulesGraph.h:370
TimelineEvent::event
size_t event
Definition: TimelineEvent.h:22
AvalancheSchedulerErrorTest.msgSvc
msgSvc
Definition: AvalancheSchedulerErrorTest.py:80
TimelineEvent::slot
size_t slot
Definition: TimelineEvent.h:21
TimelineEvent
Definition: TimelineEvent.h:16
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:21
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: TimelineEvent.h:24
TimelineEvent::end
time_point end
Definition: TimelineEvent.h:27
EventContext::evt
ContextEvt_t evt() const
Definition: EventContext.h:50