Skip to content

Commit

Permalink
fix type instabilities (#59)
Browse files Browse the repository at this point in the history
* change global variable mockup alg default time a constant

* make BoundAlgorithm a parametric type

* fix type instability in DataFlowGraph
  • Loading branch information
m-fila authored Oct 29, 2024
1 parent 3ad7183 commit 241b353
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/mockup.jl
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ struct MockupAlgorithm <: AbstractAlgorithm
end
end

mockup_alg_default_runtime_s::Float64 = 0
const mockup_alg_default_runtime_s = 0

function (alg::MockupAlgorithm)(args...; event_number::Int,
coefficients::Union{Vector{Float64}, Missing})
Expand Down
6 changes: 3 additions & 3 deletions src/scheduling.jl
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ function get_name(alg::AbstractAlgorithm)
error("Subtypes of AbstractAlgorithm must implement get_name")
end

struct BoundAlgorithm
alg::AbstractAlgorithm
struct BoundAlgorithm{T <: AbstractAlgorithm}
alg::T
event_number::Int
end

Expand All @@ -28,7 +28,7 @@ function get_name(alg::BoundAlgorithm)
end

struct DataFlowGraph
graph::MetaDiGraph
graph::MetaDiGraph{Int, Float64}
algorithm_indices::Vector{Int}
function DataFlowGraph(graph::MetaDiGraph)
alg_vertices = MetaGraphs.filter_vertices(graph, :type, "Algorithm")
Expand Down

0 comments on commit 241b353

Please sign in to comment.