| The Gaudi Framework v32r1 (f65d50dc)

Public Member Functions | Public Attributes | List of all members
GaudiHive.precedence.RealTimeValue Class Reference
Inheritance diagram for GaudiHive.precedence.RealTimeValue:
[legend]
Collaboration diagram for GaudiHive.precedence.RealTimeValue:
[legend]

## Public Member Functions
def | __init__ (self, path, defaultTime, factor=1)
def | get (self, algoName='')

## Public Attributes
| path
| factor
| defaultTime
| varRuntime
| file
| timings

## Detailed Description

    A class to manage real algorithm timing

Definition at line 41 of file precedence.py.

## Constructor & Destructor Documentation

## ◆ __init__()

def GaudiHive.precedence.RealTimeValue.__init__ | ( |  | self,
|  |  | path,
|  |  | defaultTime,
|  |  | factor = `1`
| ) |  |

    defaultTime -- run time, assigned to an algorithm if no time is found in provided timing library
           (and it will also be scaled by the 'factor' argument)

Definition at line 44 of file precedence.py.

44 def __init__(self, path, defaultTime, factor=1):
45 """
46 defaultTime -- run time, assigned to an algorithm if no time is found in provided timing library
47 (and it will also be scaled by the 'factor' argument)
48 """
49
50 self.path = os.path.realpath(_buildFilePath(path))
51 self.factor = factor
52 self.defaultTime = defaultTime # typically 0.05s
53 self.varRuntime = 0
54
55 self.file = open(self.path)
56 self.timings = json.load(self.file)
57
GaudiHive.precedence._buildFilePath
def _buildFilePath(filePath)
Definition: precedence.py:12

## Member Function Documentation

## ◆ get()

def GaudiHive.precedence.RealTimeValue.get | ( |  | self,
|  |  | algoName = `''`
| ) |  |

    Get time for a given algorithm name

Definition at line 58 of file precedence.py.

58 def get(self, algoName=''):
59 """Get time for a given algorithm name"""
60
61 if algoName in self.timings:
62 time = float(self.timings[algoName])
63 else:
64 capAlgoName = algoName[0].upper() + algoName[1:len(algoName)]
65
66 if capAlgoName in self.timings:
67 time = float(self.timings[capAlgoName])
68 else:
69 time = self.defaultTime
70 print "WARNING: TimiNg for %s (or %s) not found in the provided library, using default one: %s" % (
71 algoName, capAlgoName, time)
72
73 time = time * self.factor
74
75 return time, self.varRuntime
76
77
Gaudi::Functional::details::get
auto get(const Handle &handle, const Algo &, const EventContext &) -> decltype(details::deref(handle.get()))
Definition: FunctionalDetails.h:332

## Member Data Documentation

## ◆ defaultTime

GaudiHive.precedence.RealTimeValue.defaultTime

Definition at line 52 of file precedence.py.

## ◆ factor

GaudiHive.precedence.RealTimeValue.factor

Definition at line 51 of file precedence.py.

## ◆ file

GaudiHive.precedence.RealTimeValue.file

Definition at line 55 of file precedence.py.

## ◆ path

GaudiHive.precedence.RealTimeValue.path

Definition at line 50 of file precedence.py.

## ◆ timings

GaudiHive.precedence.RealTimeValue.timings

Definition at line 56 of file precedence.py.

## ◆ varRuntime

GaudiHive.precedence.RealTimeValue.varRuntime

Definition at line 53 of file precedence.py.

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

- GaudiHive/python/GaudiHive/precedence.py