99import Dagger
1010import Dagger: EagerThunk, Chunk, Processor
1111import Dagger. TimespanLogging: Timespan
12- import Graphs: SimpleDiGraph, add_edge!, add_vertex!, inneighbors, outneighbors, vertices, is_directed, edges, nv
12+ import Graphs: SimpleDiGraph, add_edge!, add_vertex!, inneighbors, outneighbors, vertices, is_directed, edges, nv, src, dst
1313
1414function pretty_time (t; digits= 3 )
1515 r (t) = round (t; digits)
@@ -23,6 +23,23 @@ function pretty_time(t; digits=3)
2323 " $(r (t)) ns"
2424 end
2525end
26+
27+ """
28+ Dagger.render_logs(logs::Dict, ::Val{:graphviz}; disconnected=false,
29+ color_by=:fn, layout_engine="dot",
30+ times::Bool=true, times_digits::Integer=3)
31+
32+ Render a graph of the task dependencies and data dependencies in `logs` using GraphViz.
33+
34+ Requires the following events enabled in `enable_logging!`: `taskdeps`, `tasknames`, `taskargs`, `taskargmoves`
35+
36+ Options:
37+ - `disconnected`: If `true`, render disconnected vertices (tasks or arguments without upstream/downstream dependencies)
38+ - `color_by`: How to color tasks; if `:fn`, then color by unique function name, if `:proc`, then color by unique processor
39+ - `layout_engine`: The layout engine to use for GraphViz
40+ - `times`: If `true`, annotate each task with its start and finish times
41+ - `times_digits`: Number of digits to display in the time annotations
42+ """
2643function Dagger. render_logs (logs:: Dict , :: Val{:graphviz} ; disconnected= false ,
2744 color_by= :fn , layout_engine= " dot" ,
2845 times:: Bool = true , times_digits:: Integer = 3 )
0 commit comments