Skip to content

Commit

Permalink
Merge pull request #948 from JuliaControl/nopoly
Browse files Browse the repository at this point in the history
remove use of `Polyester.@batch` due to segfault
  • Loading branch information
baggepinnen authored Jan 10, 2025
2 parents 40a14eb + 49f93ac commit 9f0bcff
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 10 deletions.
12 changes: 5 additions & 7 deletions lib/ControlSystemsBase/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
MacroTools = "1914dd2f-81c6-5fcd-8719-6d5c9610ff09"
MatrixEquations = "99c1a7ee-ab34-5fd5-8076-27c950a045f4"
MatrixPencils = "48965c70-4690-11ea-1f13-43a2532b2fa8"
Polyester = "f517fe37-dbe3-4b94-8317-1923a5111588"
Polynomials = "f27b6e38-b328-58d1-80ce-0feddd5e7a45"
PrecompileTools = "aea7be01-6a6a-4083-8856-8a6e6704d82a"
Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7"
Expand All @@ -37,20 +36,19 @@ ForwardDiff = "0.10"
ImplicitDifferentiation = "0.4.2"
IterTools = "1.0"
LaTeXStrings = "1.0"
LinearAlgebra = "<0.0.1, 1"
MacroTools = "0.5"
MatrixEquations = "1, 2.1"
MatrixPencils = "1.6"
Polyester = "0.6, 0.7"
Polynomials = "3.0, 4.0"
PrecompileTools = "1"
RecipesBase = "1"
StaticArraysCore = "1"
julia = "1.6"
LinearAlgebra = "<0.0.1, 1"
Printf = "<0.0.1, 1"
Random = "<0.0.1, 1"
UUIDs = "<0.0.1, 1"
RecipesBase = "1"
SparseArrays = "<0.0.1, 1"
StaticArraysCore = "1"
UUIDs = "<0.0.1, 1"
julia = "1.6"

[extras]
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
Expand Down
2 changes: 1 addition & 1 deletion lib/ControlSystemsBase/src/ControlSystemsBase.jl
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ import MatrixPencils
using MacroTools
using MatrixEquations
using UUIDs # to load Plots in gangoffourplot
using StaticArraysCore, Polyester
using StaticArraysCore

abstract type AbstractSystem end

Expand Down
2 changes: 1 addition & 1 deletion lib/ControlSystemsBase/src/types/staticsystems.jl
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ end
te = sys.timeevol

let R=R, A=A, B=B, C=C, D=D, te=te
@inbounds Polyester.@batch for i in eachindex(w_vec)
@inbounds Threads.@threads :static for i in eachindex(w_vec)
Ri = @views R[:,:,i]
copyto!(Ri,D) # start with the D-matrix
isinf(w_vec[i]) && continue
Expand Down
3 changes: 2 additions & 1 deletion lib/ControlSystemsBase/test/test_staticsystems.jl
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,8 @@ syss = StaticStateSpace(ssrand(1,1,5,proper=false))
sys = ss(syss)

freqresp_nohess!(R, syss, w) # precompile
@test @allocated(freqresp_nohess!(R, syss, w)) == 0
# @test @allocated(freqresp_nohess!(R, syss, w)) == 0 # This used to hold with Polyester.@batch, but Polyester sometimes segfaulted when used with ForwardDiff
@test @allocated(freqresp_nohess!(R, syss, w)) < 20000

@test freqresp_nohess!(R, syss, w) freqresp(ss(syss), w)

Expand Down

0 comments on commit 9f0bcff

Please sign in to comment.