Constructs the sequence tree of CPUCrunchers with provided control flow and data flow precedence rules.
Definition at line 139 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 150 of file precedence.py.
162 timeValue -- timeValue object to set algorithm execution time 163 IOboolValue -- *BooleanValue object to set whether an algorithm has to experience IO-bound execution 164 cfgPath -- relative to $GAUDIHIVEROOT/data path to GRAPHML file with control flow dependencies 165 dfgPath -- relative to $GAUDIHIVEROOT/data path to GRAPHML file with data flow dependencies 166 showStat -- print out statistics on precedence graph 169 self.timeValue = timeValue
170 self.IOboolValue = IOboolValue
171 self.sleepFraction = sleepFraction
176 self.enableTimeline = timeline
178 self.outputLevel = outputLevel
181 self.sequencer = self._generate_sequence(topSequencer)
186 print(
"\n===== Statistics on Algorithms =====")
187 print(
"Total number of algorithm nodes: ", len(self.unique_algos) +
188 sum([self.dupl_algos[i] - 1
for i
in self.dupl_algos]))
189 print(
"Number of unique algorithms: ", len(self.unique_algos))
190 print(
" -->", len(self.dupl_algos),
191 "of them being re-used with the following distribution: ",
192 [self.dupl_algos[i]
for i
in self.dupl_algos])
195 print(
"\n===== Statistics on Sequencers =====")
196 print(
"Total number of sequencers: ", len(self.unique_sequencers) +
197 sum([self.dupl_seqs[i] - 1
for i
in self.dupl_seqs]))
198 print(
"Number of unique sequencers: ", len(self.unique_sequencers))
199 print(
" -->", len(self.dupl_seqs),
200 "of them being re-used with the following distribution: ",
201 [self.dupl_seqs[i]
for i
in self.dupl_seqs])
203 print(
"Number of OR-sequencers: ", len(self.OR_sequencers))
205 print(
"\n===== Statistics on DataObjects =====")
206 print(
"Number of unique DataObjects: ",
207 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 215 of file precedence.py.
215 def _declare_data_deps(self, algo_name, algo):
216 """ Declare data inputs and outputs for a given algorithm. """ 219 for inNode, outNode
in self.dfg.in_edges(algo_name):
221 if dataName
not in self.unique_data_objects:
222 self.unique_data_objects.append(dataName)
224 if dataName
not in algo.inpKeys:
225 algo.inpKeys.append(dataName)
228 for inNode, outNode
in self.dfg.out_edges(algo_name):
230 if dataName
not in self.unique_data_objects:
231 self.unique_data_objects.append(dataName)
233 if dataName
not in algo.outKeys:
234 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 236 of file precedence.py.
236 def _generate_sequence(self, name, seq=None):
237 """ Assemble the tree of sequencers. """ 242 for n
in self.cfg[name]:
244 algo_name = n.split(
'/')[1]
if '/' in n
else n
246 if 'type' in self.cfg.node[n]:
248 algo_type = self.cfg.node[n].
get(
'type')
252 algo_type = n.split(
'/')[0]
if '/' in n
else 'Algorithm' 254 if algo_type
in [
'GaudiSequencer',
'AthSequencer',
'ProcessPhase']:
255 if algo_name
in [
'RecoITSeq',
'RecoOTSeq',
'RecoTTSeq']:
258 if n
not in self.unique_sequencers:
259 self.unique_sequencers.append(n)
261 if n
not in self.dupl_seqs:
262 self.dupl_seqs[n] = 2
264 self.dupl_seqs[n] += 1
267 if self.cfg.node[n].
get(
'ModeOR') ==
'True':
268 self.OR_sequencers.append(n)
269 seq_daughter.ModeOR =
True 272 seq_daughter.ShortCircuit =
False 273 if seq_daughter
not in seq.Members:
274 seq.Members += [seq_daughter]
276 self._generate_sequence(n, seq_daughter)
280 if n
not in self.unique_algos:
281 self.unique_algos.append(n)
283 if n
not in self.dupl_algos:
284 self.dupl_algos[n] = 2
286 self.dupl_algos[n] += 1
288 avgRuntime, varRuntime = self.timeValue.
get(algo_name)
292 OutputLevel=self.outputLevel,
293 varRuntime=varRuntime,
294 avgRuntime=avgRuntime,
295 SleepFraction=self.sleepFraction
296 if self.IOboolValue.
get()
else 0.,
297 Timeline=self.enableTimeline)
299 self._declare_data_deps(algo_name, algo_daughter)
301 if algo_daughter
not in seq.Members:
302 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 211 of file precedence.py.
213 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: