| The Gaudi Framework v29r0 (ff2e7097)

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

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 40 of file precedence.py.

## Constructor & Destructor Documentation

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 43 of file precedence.py.

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

## Member Function Documentation

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

    Get time for a given algorithm name

Definition at line 57 of file precedence.py.

57 def get(self, algoName=''):
58 """Get time for a given algorithm name"""
59
60 if algoName in self.timings:
61 time = float(self.timings[algoName])
62 else:
63 capAlgoName = algoName[0].upper() + algoName[1:len(algoName)]
64
65 if capAlgoName in self.timings:
66 time = float(self.timings[capAlgoName])
67 else:
68 time = self.defaultTime
69 print "WARNING: TimiNg for %s (or %s) not found in the provided library, using default one: %s" % (algoName, capAlgoName, time)
70
71 time = time * self.factor
72
73 return time, self.varRuntime
74
75
GaudiHive.precedence.RealTimeValue.get
def get(self, algoName='')
Definition: precedence.py:57
GaudiHive.precedence.RealTimeValue.timings
timings
Definition: precedence.py:55
GaudiHive.precedence.RealTimeValue.varRuntime
varRuntime
Definition: precedence.py:52
GaudiHive.precedence.RealTimeValue.factor
factor
Definition: precedence.py:50
GaudiHive.precedence.RealTimeValue.defaultTime
defaultTime
Definition: precedence.py:51

## Member Data Documentation

GaudiHive.precedence.RealTimeValue.defaultTime

Definition at line 51 of file precedence.py.

GaudiHive.precedence.RealTimeValue.factor

Definition at line 50 of file precedence.py.

GaudiHive.precedence.RealTimeValue.file

Definition at line 54 of file precedence.py.

GaudiHive.precedence.RealTimeValue.path

Definition at line 49 of file precedence.py.

GaudiHive.precedence.RealTimeValue.timings

Definition at line 55 of file precedence.py.

GaudiHive.precedence.RealTimeValue.varRuntime

Definition at line 52 of file precedence.py.

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

- GaudiHive/python/GaudiHive/precedence.py