-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Basic runner script using new
run_events
function (#29)
* Removed `parse_graphs` from scheduling code * Removed unnecessary `enumerate` * Added function for running events from a graph * Added basic runner script * Moved runner script to `bin` * Updated README New information for runner script * Move main call into if statement Co-authored-by: Mateusz Jakub Fila <[email protected]> * Make arguments non-positional Co-authored-by: Mateusz Jakub Fila <[email protected]> * add logging with LocalEventLog and :graphviz_simple --------- Co-authored-by: Mateusz Jakub Fila <[email protected]> Co-authored-by: Mateusz Jakub Fila <[email protected]>
- Loading branch information
1 parent
2f9bb77
commit f72b4c7
Showing
5 changed files
with
92 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,7 @@ authors = ["SmalRat <[email protected]>", | |
version = "0.1.0" | ||
|
||
[deps] | ||
ArgParse = "c7e460c6-2fb9-53a9-8c5b-16f535851c63" | ||
BenchmarkTools = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf" | ||
Cairo = "159f3aea-2a34-519c-b102-8c37f9878175" | ||
Colors = "5ae59095-9a9b-59fe-a467-6f913c188581" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
#!/usr/bin/env julia | ||
|
||
using Distributed | ||
using Dagger | ||
using ArgParse | ||
using FrameworkDemo | ||
|
||
function parse_args() | ||
s = ArgParseSettings() | ||
|
||
@add_arg_table! s begin | ||
"data-flow" | ||
help = "Input data-flow graph as a GraphML file" | ||
arg_type = String | ||
required = true | ||
|
||
"--event-count" | ||
help = "Number of events to be processed" | ||
arg_type = Int | ||
default = 1 | ||
|
||
"--max-concurrent" | ||
help = "Number of slots for graphs to be scheduled concurrently" | ||
arg_type = Int | ||
default = 3 | ||
|
||
"--dot-trace" | ||
help = "Output graphviz dot file for execution logs graph" | ||
arg_type = String | ||
end | ||
|
||
return ArgParse.parse_args(s) | ||
end | ||
|
||
function main() | ||
args = parse_args() | ||
|
||
event_count = args["event-count"] | ||
max_concurrent = args["max-concurrent"] | ||
|
||
if !isnothing(args["dot-trace"]) | ||
@info "Enabled logging" | ||
FrameworkDemo.configure_LocalEventLog() | ||
end | ||
|
||
graph = FrameworkDemo.parse_graphml(args["data-flow"]) | ||
FrameworkDemo.run_events(graph, event_count, max_concurrent) | ||
|
||
if !isnothing(args["dot-trace"]) | ||
logs = Dagger.fetch_logs!() | ||
open(args["dot-trace"], "w") do io | ||
FrameworkDemo.ModGraphVizSimple.show_logs(io, logs, :graphviz_simple) | ||
@info "Written logs dot graph to $(args["dot-trace"])" | ||
end | ||
end | ||
end | ||
|
||
|
||
if abspath(PROGRAM_FILE) == @__FILE__ | ||
main() | ||
rmprocs!(Dagger.Sch.eager_context(), workers()) | ||
rmprocs(workers()) | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters