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, |
|
|
|
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 160 of file precedence.py.
172 timeValue -- timeValue object to set algorithm execution time 173 IOboolValue -- *BooleanValue object to set whether an algorithm has to experience IO-bound 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.IOboolValue = IOboolValue
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 =====")
197 print(
"Total number of algorithm nodes: ", len(self.unique_algos) +
198 sum([self.dupl_algos[i] - 1
for i
in self.dupl_algos]))
199 print(
"Number of unique algorithms: ", len(self.unique_algos))
200 print(
" -->", len(self.dupl_algos),
201 "of them being re-used with the following distribution: ",
202 [self.dupl_algos[i]
for i
in self.dupl_algos])
205 print(
"\n===== Statistics on Sequencers =====")
206 print(
"Total number of sequencers: ", len(self.unique_sequencers) +
207 sum([self.dupl_seqs[i] - 1
for i
in self.dupl_seqs]))
208 print(
"Number of unique sequencers: ", len(self.unique_sequencers))
209 print(
" -->", len(self.dupl_seqs),
210 "of them being re-used with the following distribution: ",
211 [self.dupl_seqs[i]
for i
in self.dupl_seqs])
213 print(
"Number of OR-sequencers: ", len(self.OR_sequencers))
215 print(
"\n===== Statistics on DataObjects =====")
216 print(
"Number of unique DataObjects: ",
217 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 225 of file precedence.py.
225 def _declare_data_deps(self, algo_name, algo):
226 """ Declare data inputs and outputs for a given algorithm. """ 229 for inNode, outNode
in self.dfg.in_edges(algo_name):
231 if dataName
not in self.unique_data_objects:
232 self.unique_data_objects.append(dataName)
234 if dataName
not in algo.inpKeys:
235 algo.inpKeys.append(dataName)
238 for inNode, outNode
in self.dfg.out_edges(algo_name):
240 if dataName
not in self.unique_data_objects:
241 self.unique_data_objects.append(dataName)
243 if dataName
not in algo.outKeys:
244 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 246 of file precedence.py.
246 def _generate_sequence(self, name, seq=None):
247 """ Assemble the tree of sequencers. """ 252 for n
in self.cfg[name]:
254 algo_name = n.split(
'/')[1]
if '/' in n
else n
256 if 'type' in self.cfg.node[n]:
258 algo_type = self.cfg.node[n].
get(
'type')
262 algo_type = n.split(
'/')[0]
if '/' in n
else 'Algorithm' 264 if algo_type
in [
'GaudiSequencer',
'AthSequencer',
'ProcessPhase']:
265 if algo_name
in [
'RecoITSeq',
'RecoOTSeq',
'RecoTTSeq']:
268 if n
not in self.unique_sequencers:
269 self.unique_sequencers.append(n)
271 if n
not in self.dupl_seqs:
272 self.dupl_seqs[n] = 2
274 self.dupl_seqs[n] += 1
277 if self.cfg.node[n].
get(
'ModeOR') ==
'True':
278 self.OR_sequencers.append(n)
279 seq_daughter.ModeOR =
True 282 seq_daughter.ShortCircuit =
False 283 if seq_daughter
not in seq.Members:
284 seq.Members += [seq_daughter]
286 self._generate_sequence(n, seq_daughter)
290 if n
not in self.unique_algos:
291 self.unique_algos.append(n)
293 if n
not in self.dupl_algos:
294 self.dupl_algos[n] = 2
296 self.dupl_algos[n] += 1
298 avgRuntime, varRuntime = self.timeValue.
get(algo_name)
302 OutputLevel=self.outputLevel,
303 varRuntime=varRuntime,
304 avgRuntime=avgRuntime,
305 SleepFraction=self.sleepFraction
306 if self.IOboolValue.
get()
else 0.,
307 Timeline=self.enableTimeline)
309 self._declare_data_deps(algo_name, algo_daughter)
311 if algo_daughter
not in seq.Members:
312 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 221 of file precedence.py.
223 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: