Skip to content

Commit

Permalink
fix scheduling algorithms without runtime property (#26)
Browse files Browse the repository at this point in the history
  • Loading branch information
m-fila authored Jul 16, 2024
1 parent 382a6d3 commit 7934198
Showing 1 changed file with 8 additions and 1 deletion.
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

0 comments on commit 7934198

Please sign in to comment.