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

New IMEXAlgorithm is not type stable #172

Open
dennisYatunin opened this issue Mar 3, 2023 · 0 comments
Open

New IMEXAlgorithm is not type stable #172

dennisYatunin opened this issue Mar 3, 2023 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@dennisYatunin
Copy link
Member

The coefficient arrays a_exp, b_exp, c_exp, a_imp, b_imp, and c_imp in the IMEXTableau are all guaranteed to have the same element type FT, but this is not necessarily the same element type that the problem prob uses (for specifying, e.g., u0 and tspan). In the tableaus specified in imex_tableaus.jl and explicit_tableaus.jl, the coefficient element type happens to always be Float64. So, when values are multiplied by the tableau coefficients in imex_ark.jl and imex_ssprk.jl, the resulting element type may end up being Float64, even if the state vector's element type is Float32. This problem was not caught earlier because we're not running any of our test problems with Float32.

The easiest way to fix this would be to

  • distinguish the IMEXTableau method specified here from the IMEXTableau methods specified for the individual AlgorithmNames later in that file
  • pass the problem's element type FT to the first IMEXTableau method (or whatever it ends up being renamed to)
  • replace the promote calls here with a promotion to the problem's element type FT
  • do the same process for ExplicitAlgorithm
  • modify the test suite so that everything is tested with both Float64 and Float32
@dennisYatunin dennisYatunin added the bug Something isn't working label Mar 3, 2023
@dennisYatunin dennisYatunin self-assigned this Mar 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant