| The Gaudi Framework v32r1 (f65d50dc)

Public Member Functions | Public Attributes | List of all members
precedence::Duration Struct Reference

`#include <src/PRGraph/PrecedenceRulesGraph.h>`

Collaboration diagram for precedence::Duration:
[legend]

## 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 EventSlot & | m_slot
SmartIF< ITimelineSvc > | m_timelineSvc

## Detailed Description

Definition at line 328 of file PrecedenceRulesGraph.h.

## Constructor & Destructor Documentation

## ◆ Duration()

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

Definition at line 329 of file PrecedenceRulesGraph.h.

329 : m_slot( slot ) {
330 SmartIF<IMessageSvc> msgSvc{svcLocator};
331 MsgStream log{msgSvc, "Duration.Getter"};
332
333 // Figure if we can discover the algorithm timings
334 m_timelineSvc = svcLocator->service<ITimelineSvc>( "TimelineSvc", false );
335 if ( !m_timelineSvc.isValid() )
336 log << MSG::WARNING << "Failed to locate the TimelineSvc: no way to add "
337 << "algorithm's runtimes to the TTT dumps" << endmsg;
338 }
MsgStream
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
SmartIF< IMessageSvc >
SmartIF::isValid
bool isValid() const
Allow for check if smart pointer is valid.
Definition: SmartIF.h:62
AvalancheSchedulerErrorTest.msgSvc
msgSvc
Definition: AvalancheSchedulerErrorTest.py:67
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:76
precedence::Duration::m_timelineSvc
SmartIF< ITimelineSvc > m_timelineSvc
Definition: PrecedenceRulesGraph.h:363
Gaudi::svcLocator
GAUDI_API ISvcLocator * svcLocator()
precedence::Duration::m_slot
const EventSlot & m_slot
Definition: PrecedenceRulesGraph.h:362
ITimelineSvc
Definition: ITimelineSvc.h:27
MSG::WARNING
Definition: IMessageSvc.h:15
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:192
Gaudi.Configuration.log
log
Definition: Configuration.py:13

## Member Function Documentation

## ◆ operator()() [1/3]

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

Definition at line 340 of file PrecedenceRulesGraph.h.

340 {
341
342 std::string time;
343
344 if ( m_timelineSvc.isValid() ) {
345
346 TimelineEvent te;
347 te.algorithm = props.m_name;
348 te.slot = m_slot.eventContext->slot();
349 te.event = m_slot.eventContext->evt();
350
351 m_timelineSvc->getTimelineEvent( te );
352 time = std::to_string( std::chrono::duration_cast<std::chrono::nanoseconds>( te.end - te.start ).count() );
353 }
354
355 return time;
356 }
plotSpeedupsPyRoot.time
def time
Definition: plotSpeedupsPyRoot.py:152
EventContext::slot
ContextID_t slot() const
Definition: EventContext.h:41
EventContext::evt
ContextEvt_t evt() const
Definition: EventContext.h:40
std::to_string
T to_string(T... args)
SmartIF::isValid
bool isValid() const
Allow for check if smart pointer is valid.
Definition: SmartIF.h:62
ITimelineSvc::getTimelineEvent
virtual bool getTimelineEvent(TimelineEvent &) const =0
TimelineEvent::algorithm
std::string algorithm
Definition: ITimelineSvc.h:21
TimelineEvent
Definition: ITimelineSvc.h:13
std::string
STL class.
TimelineEvent::end
time_point end
Definition: ITimelineSvc.h:24
precedence::Duration::m_timelineSvc
SmartIF< ITimelineSvc > m_timelineSvc
Definition: PrecedenceRulesGraph.h:363
precedence::Duration::m_slot
const EventSlot & m_slot
Definition: PrecedenceRulesGraph.h:362
TimelineEvent::start
time_point start
Definition: ITimelineSvc.h:23
TimelineEvent::event
size_t event
Definition: ITimelineSvc.h:19
TimelineEvent::slot
size_t slot
Definition: ITimelineSvc.h:18
EventSlot::eventContext
std::unique_ptr< EventContext > eventContext
Cache for the eventContext.
Definition: EventSlot.h:73

## ◆ operator()() [2/3]

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

Definition at line 358 of file PrecedenceRulesGraph.h.

358 { return ""; }

## ◆ operator()() [3/3]

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

Definition at line 360 of file PrecedenceRulesGraph.h.

360 { return ""; }

## Member Data Documentation

## ◆ m_slot

const EventSlot& precedence::Duration::m_slot

Definition at line 362 of file PrecedenceRulesGraph.h.

## ◆ m_timelineSvc

SmartIF<ITimelineSvc> precedence::Duration::m_timelineSvc

Definition at line 363 of file PrecedenceRulesGraph.h.

The documentation for this struct was generated from the following file:

- GaudiHive/src/PRGraph/PrecedenceRulesGraph.h