Constructs the sequence tree of CPUCrunchers with provided control flow and data flow precedence rules.
Definition at line 149 of file precedence.py.
◆ __init__()
| def GaudiHive.precedence.CruncherSequence.__init__ |
( |
|
self, |
|
|
|
timeValue, |
|
|
|
BlockingBoolValue, |
|
|
|
sleepFraction, |
|
|
|
cfgPath, |
|
|
|
dfgPath, |
|
|
|
topSequencer, |
|
|
|
showStat = False, |
|
|
|
timeline = False, |
|
|
|
outputLevel = INFO |
|
) |
| |
Keyword arguments:
timeValue -- timeValue object to set algorithm execution time
BlockingBoolValue -- *BooleanValue object to set whether an algorithm has to experience CPU-blocking 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 160 of file precedence.py.
172 timeValue -- timeValue object to set algorithm execution time 173 BlockingBoolValue -- *BooleanValue object to set whether an algorithm has to experience CPU-blocking execution 174 cfgPath -- relative to $GAUDIHIVEROOT/data path to GRAPHML file with control flow dependencies 175 dfgPath -- relative to $GAUDIHIVEROOT/data path to GRAPHML file with data flow dependencies 176 showStat -- print out statistics on precedence graph 179 self.timeValue = timeValue
180 self.BlockingBoolValue = BlockingBoolValue
181 self.sleepFraction = sleepFraction
186 self.enableTimeline = timeline
188 self.outputLevel = outputLevel
191 self.sequencer = self._generate_sequence(topSequencer)
196 print(
"\n===== Statistics on Algorithms =====")
198 "Total number of algorithm nodes: ",
199 len(self.unique_algos) + sum(
200 [self.dupl_algos[i] - 1
for i
in self.dupl_algos]))
201 print(
"Number of unique algorithms: ", len(self.unique_algos))
202 print(
" -->", len(self.dupl_algos),
203 "of them being re-used with the following distribution: ",
204 [self.dupl_algos[i]
for i
in self.dupl_algos])
207 print(
"\n===== Statistics on Sequencers =====")
209 "Total number of sequencers: ",
210 len(self.unique_sequencers) + sum(
211 [self.dupl_seqs[i] - 1
for i
in self.dupl_seqs]))
212 print(
"Number of unique sequencers: ", len(self.unique_sequencers))
213 print(
" -->", len(self.dupl_seqs),
214 "of them being re-used with the following distribution: ",
215 [self.dupl_seqs[i]
for i
in self.dupl_seqs])
217 print(
"Number of OR-sequencers: ", len(self.OR_sequencers))
219 print(
"\n===== Statistics on DataObjects =====")
220 print(
"Number of unique DataObjects: ",
221 len(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 229 of file precedence.py.
229 def _declare_data_deps(self, algo_name, algo):
230 """ Declare data inputs and outputs for a given algorithm. """ 233 for inNode, outNode
in self.dfg.in_edges(algo_name):
235 if dataName
not in self.unique_data_objects:
236 self.unique_data_objects.append(dataName)
238 if dataName
not in algo.inpKeys:
239 algo.inpKeys.append(dataName)
242 for inNode, outNode
in self.dfg.out_edges(algo_name):
244 if dataName
not in self.unique_data_objects:
245 self.unique_data_objects.append(dataName)
247 if dataName
not in algo.outKeys:
248 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 250 of file precedence.py.
250 def _generate_sequence(self, name, seq=None):
251 """ Assemble the tree of sequencers. """ 256 for n
in self.cfg[name]:
258 algo_name = n.split(
'/')[1]
if '/' in n
else n
260 if 'type' in self.cfg.node[n]:
262 algo_type = self.cfg.node[n].
get(
'type')
266 algo_type = n.split(
'/')[0]
if '/' in n
else 'Algorithm' 268 if algo_type
in [
'GaudiSequencer',
'AthSequencer',
'ProcessPhase']:
269 if algo_name
in [
'RecoITSeq',
'RecoOTSeq',
'RecoTTSeq']:
272 if n
not in self.unique_sequencers:
273 self.unique_sequencers.append(n)
275 if n
not in self.dupl_seqs:
276 self.dupl_seqs[n] = 2
278 self.dupl_seqs[n] += 1
281 if self.cfg.node[n].
get(
'ModeOR') ==
'True':
282 self.OR_sequencers.append(n)
283 seq_daughter.ModeOR =
True 286 seq_daughter.ShortCircuit =
False 287 if seq_daughter
not in seq.Members:
288 seq.Members += [seq_daughter]
290 self._generate_sequence(n, seq_daughter)
294 if n
not in self.unique_algos:
295 self.unique_algos.append(n)
297 if n
not in self.dupl_algos:
298 self.dupl_algos[n] = 2
300 self.dupl_algos[n] += 1
302 avgRuntime, varRuntime = self.timeValue.
get(algo_name)
306 OutputLevel=self.outputLevel,
307 varRuntime=varRuntime,
308 avgRuntime=avgRuntime,
309 SleepFraction=self.sleepFraction
310 if self.BlockingBoolValue.
get()
else 0.,
311 Timeline=self.enableTimeline)
313 self._declare_data_deps(algo_name, algo_daughter)
315 if algo_daughter
not in seq.Members:
316 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 225 of file precedence.py.
227 return self.sequencer
auto get(const Handle &handle, const Algo &, const EventContext &) -> decltype(details::deref(handle.get()))
◆ BlockingBoolValue
| GaudiHive.precedence.CruncherSequence.BlockingBoolValue |
◆ 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 |
◆ 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: