The Gaudi Framework  v32r2 (46d42edc)
getCriticalPath Namespace Reference

Functions

def get_critical_path (path_to_trace_file)
 
def main ()
 

Variables

string __author__ = "Illya Shapoval"
 

Detailed Description

Determine critical path for a given precedence trace.

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 11 of file getCriticalPath.py.

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

◆ main()

def getCriticalPath.main ( )

Definition at line 38 of file getCriticalPath.py.

38 def main():
39 
40  parser = argparse.ArgumentParser(
41  description=
42  "Determine critical path for a precedence trace generated by the Avalanche Scheduler."
43  )
44  parser.add_argument(
45  "path_to_trace_file",
46  help="Path to GRAPHML precedence trace file.",
47  type=str)
48  args = parser.parse_args()
49 
50  get_critical_path(args.path_to_trace_file)
51 
52 
def get_critical_path(path_to_trace_file)

Variable Documentation

◆ __author__

string getCriticalPath.__author__ = "Illya Shapoval"
private

Definition at line 4 of file getCriticalPath.py.