Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix scheduling algorithms without runtime property #26

Merged
merged 1 commit into from
Jul 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion src/scheduling.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,20 @@ struct MockupAlgorithm
runtime::Float64
input_length::UInt
MockupAlgorithm(graph::MetaDiGraph, vertex_id::Int) = begin
runtime = get_prop(graph, vertex_id, :runtime_average_s)
name = get_prop(graph, vertex_id, :node_id)
if has_prop(graph, vertex_id, :runtime_average_s)
runtime = get_prop(graph, vertex_id, :runtime_average_s)
else
runtime = alg_default_runtime_s
@warn "Runtime not provided for $name algorithm. Using default value $runtime"
end
inputs = length(inneighbors(graph, vertex_id))
new(name, runtime, inputs)
end
end

alg_default_runtime_s::Float64 = 0

function (alg::MockupAlgorithm)(args...)
println("Executing $(alg.name)")

Expand Down