The Gaudi Framework  v33r1 (b1225454)
getCriticalPath Namespace Reference

Functions

def get_critical_path (path_to_trace_file)
 
def main ()
 

Variables

string __author__ = "Illya Shapoval"
 (c) Copyright 1998-2019 CERN for the benefit of the LHCb and ATLAS collaborations # # This software is distributed under the terms of the Apache version 2 licence, # copied verbatim in the file "LICENSE". More...
 

Function Documentation

◆ get_critical_path()

def getCriticalPath.get_critical_path (   path_to_trace_file)
Find critical path, print algorithms on it and its length.

Definition at line 21 of file getCriticalPath.py.

21 def get_critical_path(path_to_trace_file):
22  """Find critical path, print algorithms on it and its length."""
23 
24  assert float(
25  nx.__version__
26  ) >= 2.0, "This script requires Networkx version 2.0 or higher"
27 
28  trace = nx.read_graphml(path_to_trace_file)
29 
30  for inNode, outNode, edge_attrs in trace.in_edges(data=True):
31  edge_attrs['Runtime'] = nx.get_node_attributes(trace,
32  'Runtime')[outNode]
33 
34  cpath = nx.algorithms.dag.dag_longest_path(trace, weight='Runtime')
35 
36  print "Algorithms on the critical path (%i): " % len(cpath)
37 
38  print " {:<40} Runtime (ns)".format("Name")
39  print " -----------------------------------------------------"
40  for node_id in cpath:
41  print " {:<40}: {}".format(trace.node[node_id].get('Name'),
42  trace.node[node_id].get('Runtime'))
43 
44  print "\nTotal critical path time: ", nx.algorithms.dag.dag_longest_path_length(
45  trace, weight='Runtime'), "ns"
46 
47 
def get_critical_path(path_to_trace_file)
GAUDI_API std::string format(const char *,...)
MsgStream format utility "a la sprintf(...)".
Definition: MsgStream.cpp:119
auto get(const Handle &handle, const Algo &, const EventContext &) -> decltype(details::deref(handle.get()))

◆ main()

def getCriticalPath.main ( )

Definition at line 48 of file getCriticalPath.py.

48 def main():
49 
50  parser = argparse.ArgumentParser(
51  description=
52  "Determine critical path for a precedence trace generated by the Avalanche Scheduler."
53  )
54  parser.add_argument(
55  "path_to_trace_file",
56  help="Path to GRAPHML precedence trace file.",
57  type=str)
58  args = parser.parse_args()
59 
60  get_critical_path(args.path_to_trace_file)
61 
62 
def get_critical_path(path_to_trace_file)

Variable Documentation

◆ __author__

string getCriticalPath.__author__ = "Illya Shapoval"
private

(c) Copyright 1998-2019 CERN for the benefit of the LHCb and ATLAS collaborations # # This software is distributed under the terms of the Apache version 2 licence, # copied verbatim in the file "LICENSE".

# # In applying this licence, CERN does not waive the privileges and immunities # granted to it by virtue of its status as an Intergovernmental Organization # or submit itself to any jurisdiction. #

Definition at line 14 of file getCriticalPath.py.