Skip to content

Commit

Permalink
Performance improvements in AIM step. Added >= compat specification.
Browse files Browse the repository at this point in the history
  • Loading branch information
lucass-carneiro committed Mar 19, 2021
1 parent 725a897 commit a897e9d
Show file tree
Hide file tree
Showing 4 changed files with 64 additions and 64 deletions.
90 changes: 42 additions & 48 deletions Manifest.toml
Original file line number Diff line number Diff line change
@@ -1,16 +1,10 @@
# This file is machine-generated - editing it directly is not advised

[[Adapt]]
deps = ["LinearAlgebra"]
git-tree-sha1 = "42c42f2221906892ceb765dbcb1a51deeffd86d7"
uuid = "79e6a3ab-5dfb-504d-930d-738a2a938a0e"
version = "2.3.0"

[[ArrayInterface]]
deps = ["LinearAlgebra", "Requires", "SparseArrays"]
git-tree-sha1 = "c74dd860c9223b5da03d12b393968260d8e674eb"
deps = ["IfElse", "LinearAlgebra", "Requires", "SparseArrays", "Static"]
git-tree-sha1 = "ce17bad65d0842b34a15fffc8879a9f68f08a67f"
uuid = "4fba245c-0d91-5ea0-9b3e-6abc04ee57a9"
version = "2.14.10"
version = "3.1.6"

[[Artifacts]]
deps = ["Pkg"]
Expand All @@ -22,10 +16,10 @@ version = "1.3.0"
uuid = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"

[[ChainRulesCore]]
deps = ["LinearAlgebra", "MuladdMacro", "SparseArrays"]
git-tree-sha1 = "15081c431bb25848ad9b0d172a65794f3a3e197a"
deps = ["Compat", "LinearAlgebra", "SparseArrays"]
git-tree-sha1 = "de4f08843c332d355852721adb1592bce7924da3"
uuid = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4"
version = "0.9.24"
version = "0.9.29"

[[CommonSubexpressions]]
deps = ["MacroTools", "Test"]
Expand Down Expand Up @@ -67,9 +61,9 @@ version = "1.0.2"

[[Distances]]
deps = ["LinearAlgebra", "Statistics"]
git-tree-sha1 = "e8b13ba5f166e11df2de6fc283e5db7864245df0"
git-tree-sha1 = "366715149014943abd71aa647a07a43314158b2d"
uuid = "b4f34e82-e78d-54a5-968a-f98e89d6e8f7"
version = "0.10.0"
version = "0.10.2"

[[Distributed]]
deps = ["Random", "Serialization", "Sockets"]
Expand All @@ -88,22 +82,27 @@ version = "1.1.0"

[[FiniteDiff]]
deps = ["ArrayInterface", "LinearAlgebra", "Requires", "SparseArrays", "StaticArrays"]
git-tree-sha1 = "7f7216e0eb46c20ee8ddab5c8f9a262ed72587b6"
git-tree-sha1 = "f6f80c8f934efd49a286bb5315360be66956dfc4"
uuid = "6a86dc24-6348-571c-b903-95158fe2bd41"
version = "2.7.2"
version = "2.8.0"

[[ForwardDiff]]
deps = ["CommonSubexpressions", "DiffResults", "DiffRules", "NaNMath", "Random", "SpecialFunctions", "StaticArrays"]
git-tree-sha1 = "8de2519a83c6c1c2442c2f481dd9a8364855daf4"
git-tree-sha1 = "c68fb7481b71519d313114dca639b35262ff105f"
uuid = "f6369f11-7733-5829-9624-2563aa707210"
version = "0.10.14"
version = "0.10.17"

[[GMP_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"]
git-tree-sha1 = "15abc5f976569a1c9d651aff02f7222ef305eb2a"
uuid = "781609d7-10c4-51f6-84f2-b8444358ff6d"
version = "6.1.2+6"

[[IfElse]]
git-tree-sha1 = "28e837ff3e7a6c3cdb252ce49fb412c8eb3caeef"
uuid = "615f187c-cbe4-4ef1-ba3b-2fcf58d6d173"
version = "0.1.0"

[[InteractiveUtils]]
deps = ["Markdown"]
uuid = "b77e0a4c-d291-57a0-90e8-8db25a27a240"
Expand All @@ -115,9 +114,9 @@ uuid = "d8418881-c3e1-53bb-8760-2df7ec849ed5"
version = "1.5.0"

[[JLLWrappers]]
git-tree-sha1 = "04b49c556240b62d5a799e94c63d5fc14d3c07cd"
git-tree-sha1 = "a431f5f2ca3f4feef3bd7a5e94b8b8d4f2f647a0"
uuid = "692b3bcd-3c85-4b1f-b108-f13ce0eb3210"
version = "1.1.4"
version = "1.2.0"

[[LibGit2]]
deps = ["Printf"]
Expand Down Expand Up @@ -176,16 +175,11 @@ git-tree-sha1 = "916b850daad0d46b8c71f65f719c49957e9513ed"
uuid = "78c3b35d-d492-501b-9361-3d52fe80e533"
version = "0.7.1"

[[MuladdMacro]]
git-tree-sha1 = "c6190f9a7fc5d9d5915ab29f2134421b12d24a68"
uuid = "46d2c3a1-f734-5fdb-9937-b9b9aeba4221"
version = "0.2.2"

[[NLSolversBase]]
deps = ["DiffResults", "Distributed", "FiniteDiff", "ForwardDiff"]
git-tree-sha1 = "39d6bc45e99c96e6995cbddac02877f9b61a1dd1"
git-tree-sha1 = "50608f411a1e178e0129eab4110bd56efd08816f"
uuid = "d41bc354-129a-5804-8e4c-c37616107c6c"
version = "7.7.1"
version = "7.8.0"

[[NLsolve]]
deps = ["Distances", "LineSearches", "LinearAlgebra", "NLSolversBase", "Printf", "Reexport"]
Expand All @@ -198,28 +192,22 @@ git-tree-sha1 = "bfe47e760d60b82b66b61d2d44128b62e3a369fb"
uuid = "77ba4419-2d1f-58cd-9bb1-8ffee604a2e3"
version = "0.3.5"

[[OffsetArrays]]
deps = ["Adapt"]
git-tree-sha1 = "b0cc1c42b63e30b759f4e1cf045ad8a51069d6cc"
uuid = "6fe1bfb0-de20-5000-8ca7-80f57d26f881"
version = "1.4.2"

[[OpenSpecFun_jll]]
deps = ["Artifacts", "CompilerSupportLibraries_jll", "JLLWrappers", "Libdl", "Pkg"]
git-tree-sha1 = "9db77584158d0ab52307f8c04f8e7c08ca76b5b3"
uuid = "efe28fd5-8261-553b-a9e1-b2916fc3738e"
version = "0.5.3+4"

[[OrderedCollections]]
git-tree-sha1 = "cf59cfed2e2c12e8a2ff0a4f1e9b2cd8650da6db"
git-tree-sha1 = "4fa2ba51070ec13fcc7517db714445b4ab986bdf"
uuid = "bac558e1-5e72-5ebc-8fee-abe8a469f55d"
version = "1.3.2"
version = "1.4.0"

[[Parameters]]
deps = ["OrderedCollections", "UnPack"]
git-tree-sha1 = "38b2e970043613c187bd56a995fe2e551821eb4a"
git-tree-sha1 = "2276ac65f1e236e0a6ea70baff3f62ad4c625345"
uuid = "d96e819e-fc66-5662-9728-84c9c7592b0a"
version = "0.12.1"
version = "0.12.2"

[[Pkg]]
deps = ["Dates", "LibGit2", "Libdl", "Logging", "Markdown", "Printf", "REPL", "Random", "SHA", "UUIDs"]
Expand All @@ -231,10 +219,10 @@ uuid = "3a141323-8675-5d76-9d11-e1df1406c778"
version = "1.0.0"

[[Polynomials]]
deps = ["Intervals", "LinearAlgebra", "OffsetArrays", "RecipesBase"]
git-tree-sha1 = "1c6c5b0c3713738d6b987903c529d80622c37e07"
deps = ["Intervals", "LinearAlgebra", "RecipesBase"]
git-tree-sha1 = "039e1916e84cbe204c5321cc0a21a55519532630"
uuid = "f27b6e38-b328-58d1-80ce-0feddd5e7a45"
version = "1.2.0"
version = "2.0.0"

[[Printf]]
deps = ["Unicode"]
Expand All @@ -260,15 +248,15 @@ version = "1.0.0"

[[Requires]]
deps = ["UUIDs"]
git-tree-sha1 = "cfbac6c1ed70c002ec6361e7fd334f02820d6419"
git-tree-sha1 = "4036a3bd08ac7e968e27c203d45f5fff15020621"
uuid = "ae029012-a4dd-5104-9daa-d747884805df"
version = "1.1.2"
version = "1.1.3"

[[Roots]]
deps = ["Printf"]
git-tree-sha1 = "8f743e4f4368d1d753f3806bf635899dad6b4847"
git-tree-sha1 = "369e25546984dff5df351bc056fccc30de615080"
uuid = "f2b01f46-fcfa-551c-844a-d8ac1e96c665"
version = "1.0.7"
version = "1.0.8"

[[SHA]]
uuid = "ea8e919c-243c-51af-8825-aaa63cd721ce"
Expand All @@ -289,9 +277,15 @@ uuid = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"

[[SpecialFunctions]]
deps = ["ChainRulesCore", "OpenSpecFun_jll"]
git-tree-sha1 = "75394dbe2bd346beeed750fb02baa6445487b862"
git-tree-sha1 = "5919936c0e92cff40e57d0ddf0ceb667d42e5902"
uuid = "276daf66-3868-5448-9aa4-cd146d93841b"
version = "1.2.1"
version = "1.3.0"

[[Static]]
deps = ["IfElse"]
git-tree-sha1 = "ddec5466a1d2d7e58adf9a427ba69763661aacf6"
uuid = "aedffcd0-7271-4cad-89d0-dc628f76c6d3"
version = "0.2.4"

[[StaticArrays]]
deps = ["LinearAlgebra", "Random", "Statistics"]
Expand All @@ -317,9 +311,9 @@ version = "0.6.0+1"

[[TaylorSeries]]
deps = ["InteractiveUtils", "LinearAlgebra", "Markdown", "Requires", "SparseArrays"]
git-tree-sha1 = "ae6e4153bc60dfcafe892ad0eaaa66f7a9458d1b"
git-tree-sha1 = "39523982677336d055907fe734b30b9951b2cadc"
uuid = "6aa5eb33-94cf-58f4-a9d0-e4b2c4fc25ea"
version = "0.10.9"
version = "0.10.11"

[[Test]]
deps = ["Distributed", "InteractiveUtils", "Logging", "Random"]
Expand Down
17 changes: 8 additions & 9 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "QuasinormalModes"
uuid = "7b4b3212-f72a-4ba2-afa8-103f0bfb7cd6"
authors = ["Lucas Timotheo Sanches <[email protected]>"]
version = "0.2.1"
version = "0.2.2"

[deps]
NLsolve = "2774e3e8-f4cf-5e23-947b-6d7e65073b56"
Expand All @@ -12,11 +12,10 @@ SymEngine = "123dc426-2d89-5057-bbad-38513e3affd8"
TaylorSeries = "6aa5eb33-94cf-58f4-a9d0-e4b2c4fc25ea"

[compat]
julia = "1.5"
NLsolve = "4.4.1"
PolynomialRoots = "1.0.0"
Polynomials = "1.2.0"
Roots = "1.0.7"
SymEngine = "0.8.2"
TaylorSeries = "0.10.9"

NLsolve = ">= 4.4.1"
PolynomialRoots = ">= 1.0.0"
Polynomials = ">= 2.0.0"
Roots = ">= 1.0.8"
SymEngine = ">= 0.8.2"
TaylorSeries = ">= 0.10.11"
julia = ">= 1.5"
1 change: 1 addition & 0 deletions src/core/aim_cache.jl
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ struct AIMCache{N <: Unsigned, T <: Any}
cdda::Array{T,1}
pdda::Array{T,1}
bdda::Array{T,1}

size::N
end

Expand Down
20 changes: 13 additions & 7 deletions src/core/aim_step.jl
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,23 @@ function AIMStep!(p::AIMProblem{N,T}, c::AIMCache{N,U}) where {N <: Unsigned, T
# after the iteration is done, so we store the current values to the previous array
copy!(c.pcda, c.ccda)
copy!(c.pdda, c.cdda)
# Applay the AIM formula to compute the coeficients writing the results to the

# Apply the AIM formula to compute the coeficients writing the results to the
# buffer arrays and reading data from all the other arrays.
# The use of a buffer array as temporary storage to the coefficients allow for the
# computation of the coefficients to be parallelized
Threads.@threads for i in zeroN:(get_niter(p) - oneN)
@inbounds sumc = sum(k -> c.icda[k + oneN] * c.ccda[i - k + oneN], zeroN:i)
@inbounds sumd = sum(k -> c.idda[k + oneN] * c.ccda[i - k + oneN], zeroN:i)
@simd for i in zeroN:(get_niter(p) - oneN)

c_sum = zero(T)
d_sum = zero(T)

@simd for k in zeroN:i
@inbounds c_sum += c.icda[k + oneN] * c.ccda[i - k + oneN]
@inbounds d_sum += c.idda[k + oneN] * c.ccda[i - k + oneN]
end

@inbounds c.bcda[i + oneN] = (i + oneN) * c.ccda[i + twoN] + c.cdda[i + oneN] + sumc
@inbounds c.bdda[i + oneN] = (i + oneN) * c.cdda[i + twoN] + sumd
@inbounds c.bcda[i + oneN] = (i + oneN) * c.ccda[i + twoN] + c.cdda[i + oneN] + c_sum
@inbounds c.bdda[i + oneN] = (i + oneN) * c.cdda[i + twoN] + d_sum
end

# Copy the data in the buffer arrays to the current arrays
Expand Down

2 comments on commit a897e9d

@lucass-carneiro
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator register()

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/32387

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.2.2 -m "<description of version>" a897e9da934ec65fa5507cbe6c1a263c0a1ed06d
git push origin v0.2.2

Please sign in to comment.