The Gaudi Framework  v36r11 (bdb84f5f)
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 340 of file PrecedenceRulesGraph.h.

Constructor & Destructor Documentation

◆ Duration()

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

Definition at line 341 of file PrecedenceRulesGraph.h.

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

Member Function Documentation

◆ operator()() [1/3]

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

Definition at line 352 of file PrecedenceRulesGraph.h.

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

◆ operator()() [2/3]

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

Definition at line 372 of file PrecedenceRulesGraph.h.

372 { return ""; }

◆ operator()() [3/3]

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

Definition at line 370 of file PrecedenceRulesGraph.h.

370 { return ""; }

Member Data Documentation

◆ m_slot

const EventSlot& precedence::Duration::m_slot

Definition at line 374 of file PrecedenceRulesGraph.h.

◆ m_timelineSvc

SmartIF<ITimelineSvc> precedence::Duration::m_timelineSvc

Definition at line 375 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
precedence::Duration::m_timelineSvc
SmartIF< ITimelineSvc > m_timelineSvc
Definition: PrecedenceRulesGraph.h:375
MSG::WARNING
@ WARNING
Definition: IMessageSvc.h:25
precedence::Duration::m_slot
const EventSlot & m_slot
Definition: PrecedenceRulesGraph.h:374
TimelineEvent::event
size_t event
Definition: ITimelineSvc.h:29
TimelineEvent::slot
size_t slot
Definition: ITimelineSvc.h:28
TimelineEvent
Definition: ITimelineSvc.h:23
Gaudi::svcLocator
GAUDI_API ISvcLocator * svcLocator()
plotSpeedupsPyRoot.time
def time
Definition: plotSpeedupsPyRoot.py:175
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:97
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:203
MsgStream
Definition: MsgStream.h:34
ProduceConsume.props
props
Definition: ProduceConsume.py:84
TimelineEvent::algorithm
std::string algorithm
Definition: ITimelineSvc.h:31
AsyncIncidents.msgSvc
msgSvc
Definition: AsyncIncidents.py:34
TimelineEvent::end
time_point end
Definition: ITimelineSvc.h:34
EventContext::evt
ContextEvt_t evt() const
Definition: EventContext.h:50