|
def | __init__ (self, timeValue, BlockingBoolValue, sleepFraction, cfgPath, dfgPath, topSequencer, showStat=False, timeline=False, outputLevel=INFO, cardinality=1) |
|
def | get (self) |
|
Constructs the sequence tree of CPUCrunchers with provided control flow and data flow precedence rules.
Definition at line 172 of file precedence.py.
◆ __init__()
def GaudiHive.precedence.CruncherSequence.__init__ |
( |
|
self, |
|
|
|
timeValue, |
|
|
|
BlockingBoolValue, |
|
|
|
sleepFraction, |
|
|
|
cfgPath, |
|
|
|
dfgPath, |
|
|
|
topSequencer, |
|
|
|
showStat = False , |
|
|
|
timeline = False , |
|
|
|
outputLevel = INFO , |
|
|
|
cardinality = 1 |
|
) |
| |
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 $ENV_PROJECT_SOURCE_DIR/GaudiHive/data path to GRAPHML file with control flow dependencies
dfgPath -- relative to $ENV_PROJECT_SOURCE_DIR/GaudiHive/data path to GRAPHML file with data flow dependencies
showStat -- print out statistics on precedence graph
Definition at line 183 of file precedence.py.
198 timeValue -- timeValue object to set algorithm execution time
199 BlockingBoolValue -- *BooleanValue object to set whether an algorithm has to experience CPU-blocking execution
200 cfgPath -- relative to $ENV_PROJECT_SOURCE_DIR/GaudiHive/data path to GRAPHML file with control flow dependencies
201 dfgPath -- relative to $ENV_PROJECT_SOURCE_DIR/GaudiHive/data path to GRAPHML file with data flow dependencies
202 showStat -- print out statistics on precedence graph
205 self.cardinality = cardinality
206 self.timeValue = timeValue
207 self.BlockingBoolValue = BlockingBoolValue
208 self.sleepFraction = sleepFraction
213 self.enableTimeline = timeline
215 self.outputLevel = outputLevel
218 self.sequencer = self._generate_sequence(topSequencer)
221 print(
"\n===== Statistics on Algorithms =====")
223 "Total number of algorithm nodes: ",
224 len(self.unique_algos)
225 + sum([self.dupl_algos[i] - 1
for i
in self.dupl_algos]),
227 print(
"Number of unique algorithms: ", len(self.unique_algos))
230 len(self.dupl_algos),
231 "of them being re-used with the following distribution: ",
232 [self.dupl_algos[i]
for i
in self.dupl_algos],
236 print(
"\n===== Statistics on Sequencers =====")
238 "Total number of sequencers: ",
239 len(self.unique_sequencers)
240 + sum([self.dupl_seqs[i] - 1
for i
in self.dupl_seqs]),
242 print(
"Number of unique sequencers: ", len(self.unique_sequencers))
246 "of them being re-used with the following distribution: ",
247 [self.dupl_seqs[i]
for i
in self.dupl_seqs],
250 print(
"Number of OR-sequencers: ", len(self.OR_sequencers))
252 print(
"\n===== Statistics on DataObjects =====")
253 print(
"Number of unique DataObjects: ", len(self.unique_data_objects))
◆ _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 261 of file precedence.py.
261 def _declare_data_deps(self, algo_name, algo):
262 """Declare data inputs and outputs for a given algorithm."""
265 for inNode, outNode
in self.dfg.in_edges(algo_name):
267 if dataName
not in self.unique_data_objects:
268 self.unique_data_objects.append(dataName)
270 if dataName
not in algo.inpKeys:
271 algo.inpKeys.append(dataName)
274 for inNode, outNode
in self.dfg.out_edges(algo_name):
276 if dataName
not in self.unique_data_objects:
277 self.unique_data_objects.append(dataName)
279 if dataName
not in algo.outKeys:
280 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 282 of file precedence.py.
282 def _generate_sequence(self, name, seq=None):
283 """Assemble the tree of sequencers."""
288 for n
in self.cfg[name]:
290 algo_name = n.split(
"/")[1]
if "/" in n
else n
292 if "type" in self.cfg.nodes[n]:
294 algo_type = self.cfg.nodes[n].
get(
"type")
298 algo_type = n.split(
"/")[0]
if "/" in n
else "Algorithm"
300 if algo_type
in [
"GaudiSequencer",
"AthSequencer",
"ProcessPhase"]:
301 if algo_name
in [
"RecoITSeq",
"RecoOTSeq",
"RecoTTSeq"]:
304 if n
not in self.unique_sequencers:
305 self.unique_sequencers.append(n)
307 if n
not in self.dupl_seqs:
308 self.dupl_seqs[n] = 2
310 self.dupl_seqs[n] += 1
313 if self.cfg.nodes[n].
get(
"ModeOR") ==
"True":
314 self.OR_sequencers.append(n)
315 seq_daughter.ModeOR =
True
318 seq_daughter.ShortCircuit =
False
319 if seq_daughter
not in seq.Members:
320 seq.Members += [seq_daughter]
322 self._generate_sequence(n, seq_daughter)
326 if n
not in self.unique_algos:
327 self.unique_algos.append(n)
329 if n
not in self.dupl_algos:
330 self.dupl_algos[n] = 2
332 self.dupl_algos[n] += 1
334 avgRuntime, varRuntime = self.timeValue.
get(algo_name)
338 Cardinality=self.cardinality,
339 OutputLevel=self.outputLevel,
340 varRuntime=varRuntime,
341 avgRuntime=avgRuntime,
342 SleepFraction=self.sleepFraction
343 if self.BlockingBoolValue.
get()
345 Timeline=self.enableTimeline,
348 self._declare_data_deps(algo_name, algo_daughter)
350 if algo_daughter
not in seq.Members:
351 seq.Members += [algo_daughter]
◆ get()
def GaudiHive.precedence.CruncherSequence.get |
( |
|
self | ) |
|
◆ BlockingBoolValue
GaudiHive.precedence.CruncherSequence.BlockingBoolValue |
◆ cardinality
GaudiHive.precedence.CruncherSequence.cardinality |
◆ cfg
GaudiHive.precedence.CruncherSequence.cfg |
◆ dfg
GaudiHive.precedence.CruncherSequence.dfg |
◆ dupl_algos
GaudiHive.precedence.CruncherSequence.dupl_algos |
|
static |
◆ dupl_seqs
GaudiHive.precedence.CruncherSequence.dupl_seqs |
|
static |
◆ enableTimeline
GaudiHive.precedence.CruncherSequence.enableTimeline |
◆ OR_sequencers
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
GaudiHive.precedence.CruncherSequence.unique_algos |
|
static |
◆ unique_data_objects
GaudiHive.precedence.CruncherSequence.unique_data_objects |
|
static |
◆ unique_sequencers
GaudiHive.precedence.CruncherSequence.unique_sequencers |
|
static |
The documentation for this class was generated from the following file: