Constructs the sequence tree of CPUCrunchers with provided control flow and data flow precedence rules.
Definition at line 135 of file precedence.py.
◆ __init__()
| def GaudiHive.precedence.CruncherSequence.__init__ |
( |
|
self, |
|
|
|
timeValue, |
|
|
|
IOboolValue, |
|
|
|
sleepFraction, |
|
|
|
cfgPath, |
|
|
|
dfgPath, |
|
|
|
topSequencer, |
|
|
|
showStat = False, |
|
|
|
timeline = False, |
|
|
|
outputLevel = INFO |
|
) |
| |
Keyword arguments:
timeValue -- timeValue object to set algorithm execution time
IOboolValue -- *BooleanValue object to set whether an algorithm has to experience IO-bound execution
cfgPath -- relative to $GAUDIHIVEROOT/data path to GRAPHML file with control flow dependencies
dfgPath -- relative to $GAUDIHIVEROOT/data path to GRAPHML file with data flow dependencies
showStat -- print out statistics on precedence graph
Definition at line 146 of file precedence.py.
158 timeValue -- timeValue object to set algorithm execution time 159 IOboolValue -- *BooleanValue object to set whether an algorithm has to experience IO-bound execution 160 cfgPath -- relative to $GAUDIHIVEROOT/data path to GRAPHML file with control flow dependencies 161 dfgPath -- relative to $GAUDIHIVEROOT/data path to GRAPHML file with data flow dependencies 162 showStat -- print out statistics on precedence graph 165 self.timeValue = timeValue
166 self.IOboolValue = IOboolValue
167 self.sleepFraction = sleepFraction
172 self.enableTimeline = timeline
174 self.outputLevel = outputLevel
177 self.sequencer = self._generate_sequence(topSequencer)
182 print "\n===== Statistics on Algorithms =====" 183 print "Total number of algorithm nodes: ", len(
184 self.unique_algos) + sum(
185 [self.dupl_algos[i] - 1
for i
in self.dupl_algos])
186 print "Number of unique algorithms: ", len(self.unique_algos)
189 ),
"of them being re-used with the following distribution: ", [
190 self.dupl_algos[i]
for i
in self.dupl_algos
194 print "\n===== Statistics on Sequencers =====" 195 print "Total number of sequencers: ", len(
196 self.unique_sequencers) + sum(
197 [self.dupl_seqs[i] - 1
for i
in self.dupl_seqs])
198 print "Number of unique sequencers: ", len(self.unique_sequencers)
201 ),
"of them being re-used with the following distribution: ", [
202 self.dupl_seqs[i]
for i
in self.dupl_seqs
205 print "Number of OR-sequencers: ", len(self.OR_sequencers)
207 print "\n===== Statistics on DataObjects =====" 208 print "Number of unique DataObjects: ", len(
209 self.unique_data_objects)
def _buildFilePath(filePath)
◆ _declare_data_deps()
| def GaudiHive.precedence.CruncherSequence._declare_data_deps |
( |
|
self, |
|
|
|
algo_name, |
|
|
|
algo |
|
) |
| |
|
private |
Declare data inputs and outputs for a given algorithm.
Definition at line 217 of file precedence.py.
217 def _declare_data_deps(self, algo_name, algo):
218 """ Declare data inputs and outputs for a given algorithm. """ 221 for inNode, outNode
in self.dfg.in_edges(algo_name):
223 if dataName
not in self.unique_data_objects:
224 self.unique_data_objects.append(dataName)
226 if dataName
not in algo.inpKeys:
227 algo.inpKeys.append(dataName)
230 for inNode, outNode
in self.dfg.out_edges(algo_name):
232 if dataName
not in self.unique_data_objects:
233 self.unique_data_objects.append(dataName)
235 if dataName
not in algo.outKeys:
236 algo.outKeys.append(dataName)
◆ _generate_sequence()
| def GaudiHive.precedence.CruncherSequence._generate_sequence |
( |
|
self, |
|
|
|
name, |
|
|
|
seq = None |
|
) |
| |
|
private |
Assemble the tree of sequencers.
Definition at line 238 of file precedence.py.
238 def _generate_sequence(self, name, seq=None):
239 """ Assemble the tree of sequencers. """ 244 for n
in self.cfg[name]:
246 algo_name = n.split(
'/')[1]
if '/' in n
else n
248 if self.cfg.node[n].has_key(
'type'):
250 algo_type = self.cfg.node[n].
get(
'type')
254 algo_type = n.split(
'/')[0]
if '/' in n
else 'Algorithm' 256 if algo_type
in [
'GaudiSequencer',
'AthSequencer',
'ProcessPhase']:
257 if algo_name
in [
'RecoITSeq',
'RecoOTSeq',
'RecoTTSeq']:
260 if n
not in self.unique_sequencers:
261 self.unique_sequencers.append(n)
263 if n
not in self.dupl_seqs:
264 self.dupl_seqs[n] = 2
266 self.dupl_seqs[n] += 1
269 if self.cfg.node[n].
get(
'ModeOR') ==
'True':
270 self.OR_sequencers.append(n)
271 seq_daughter.ModeOR =
True 274 seq_daughter.ShortCircuit =
False 275 if seq_daughter
not in seq.Members:
276 seq.Members += [seq_daughter]
278 self._generate_sequence(n, seq_daughter)
282 if n
not in self.unique_algos:
283 self.unique_algos.append(n)
285 if n
not in self.dupl_algos:
286 self.dupl_algos[n] = 2
288 self.dupl_algos[n] += 1
290 avgRuntime, varRuntime = self.timeValue.
get(algo_name)
294 OutputLevel=self.outputLevel,
295 varRuntime=varRuntime,
296 avgRuntime=avgRuntime,
297 SleepFraction=self.sleepFraction
298 if self.IOboolValue.
get()
else 0.,
299 Timeline=self.enableTimeline)
301 self._declare_data_deps(algo_name, algo_daughter)
303 if algo_daughter
not in seq.Members:
304 seq.Members += [algo_daughter]
A class that implements a search for prime numbers.
Sequencer for executing several algorithms, stopping when one is faulty.
auto get(const Handle &handle, const Algo &, const EventContext &) -> decltype(details::deref(handle.get()))
◆ get()
| def GaudiHive.precedence.CruncherSequence.get |
( |
|
self | ) |
|
Definition at line 213 of file precedence.py.
215 return self.sequencer
auto get(const Handle &handle, const Algo &, const EventContext &) -> decltype(details::deref(handle.get()))
◆ cfg
| GaudiHive.precedence.CruncherSequence.cfg |
◆ dfg
| GaudiHive.precedence.CruncherSequence.dfg |
◆ dupl_algos
| dictionary GaudiHive.precedence.CruncherSequence.dupl_algos = {} |
|
static |
◆ dupl_seqs
| dictionary GaudiHive.precedence.CruncherSequence.dupl_seqs = {} |
|
static |
◆ enableTimeline
| GaudiHive.precedence.CruncherSequence.enableTimeline |
◆ IOboolValue
| GaudiHive.precedence.CruncherSequence.IOboolValue |
◆ OR_sequencers
| list GaudiHive.precedence.CruncherSequence.OR_sequencers = [] |
|
static |
◆ outputLevel
| GaudiHive.precedence.CruncherSequence.outputLevel |
◆ sequencer
| GaudiHive.precedence.CruncherSequence.sequencer |
◆ sleepFraction
| GaudiHive.precedence.CruncherSequence.sleepFraction |
◆ timeValue
| GaudiHive.precedence.CruncherSequence.timeValue |
◆ unique_algos
| list GaudiHive.precedence.CruncherSequence.unique_algos = [] |
|
static |
◆ unique_data_objects
| list GaudiHive.precedence.CruncherSequence.unique_data_objects = [] |
|
static |
◆ unique_sequencers
| list GaudiHive.precedence.CruncherSequence.unique_sequencers = [] |
|
static |
The documentation for this class was generated from the following file: