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

Use Julia 1.10.5 and split up OrdinaryDiffEq packages #1776

Merged
merged 1 commit into from
Sep 2, 2024
Merged

Conversation

visr
Copy link
Member

@visr visr commented Aug 29, 2024

OrdinaryDiffEq was a very large package that took a long time to precompile, because there were many solvers in there that we don't use. The developers recently split up the package. OrdinaryDiffEq is still around as the package that has all solvers, but if we want to benefit from having to load less code, we need to use the sub-packages directly. This PR does that. Most of the core stuff is now in OrdinaryDiffEqCore, and we need OrdinaryDiffEqNonlinearSolve. The solver algorithms we support now come from these five sub packages:

using OrdinaryDiffEqLowOrderRK: Euler, RK4
using OrdinaryDiffEqTsit5: Tsit5
using OrdinaryDiffEqSDIRK: ImplicitEuler, KenCarp4, TRBDF2
using OrdinaryDiffEqBDF: QNDF
using OrdinaryDiffEqRosenbrock: Rodas5, Rosenbrock23

After doing this and removing OrdinaryDiffEq you could see the packages that were split out that we no longer depend on:

(root) pkg> rm OrdinaryDiffEq
    Updating `D:\repo\ribasim\Ribasim\Project.toml`
  [1dea7af3] - OrdinaryDiffEq v6.89.0
    Updating `D:\repo\ribasim\Ribasim\Manifest.toml`
  [d4d017d3] - ExponentialUtilities v1.26.1
  [c145ed77] - GenericSchur v0.5.4
  [1dea7af3] - OrdinaryDiffEq v6.89.0
  [89bda076] - OrdinaryDiffEqAdamsBashforthMoulton v1.1.0
  [50262376] - OrdinaryDiffEqDefault v1.1.0
  [9286f039] - OrdinaryDiffEqExplicitRK v1.1.0
  [e0540318] - OrdinaryDiffEqExponentialRK v1.1.0
  [becaefa8] - OrdinaryDiffEqExtrapolation v1.1.0
  [5960d6e9] - OrdinaryDiffEqFIRK v1.1.0
  [101fe9f7] - OrdinaryDiffEqFeagin v1.1.0
  [d3585ca7] - OrdinaryDiffEqFunctionMap v1.1.0
  [d28bc4f8] - OrdinaryDiffEqHighOrderRK v1.1.0
  [9f002381] - OrdinaryDiffEqIMEXMultistep v1.1.0
  [521117fe] - OrdinaryDiffEqLinear v1.1.0
  [b0944070] - OrdinaryDiffEqLowStorageRK v1.2.0
  [c9986a66] - OrdinaryDiffEqNordsieck v1.1.0
  [5dd0a6cf] - OrdinaryDiffEqPDIRK v1.1.0
  [5b33eab2] - OrdinaryDiffEqPRK v1.1.0
  [04162be5] - OrdinaryDiffEqQPRK v1.1.0
  [af6ede74] - OrdinaryDiffEqRKN v1.1.0
  [669c94d9] - OrdinaryDiffEqSSPRK v1.2.0
  [e3e12d00] - OrdinaryDiffEqStabilizedIRK v1.1.0
  [358294b1] - OrdinaryDiffEqStabilizedRK v1.1.0
  [fa646aed] - OrdinaryDiffEqSymplecticRK v1.1.0
  [79d7bb75] - OrdinaryDiffEqVerner v1.1.0

This also updates from Julia 1.10.4 to the latest stable release, 1.10.5, and updates all our dependencies.

Comment on lines +34 to +35
LineSearches = "d3d80556-e9d4-5f37-9878-2ab0fcc64255"
LinearSolve = "7ed4a6bd-45f5-4d41-b270-4a48e9bafcae"
Copy link
Member Author

Choose a reason for hiding this comment

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

These were already core deps, but for interactive use it's nice to have all core deps in the root environment as well.

Comment on lines -109 to -118
[preferences.OrdinaryDiffEq]
PrecompileAutoSpecialize = false
PrecompileAutoSwitch = false
PrecompileDefaultSpecialize = false
PrecompileFunctionWrapperSpecialize = false
PrecompileLowStorage = false
PrecompileNoSpecialize = false
PrecompileNonStiff = false
PrecompileStiff = false

Copy link
Member Author

Choose a reason for hiding this comment

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

We'll precompile less since we load less solver packages. And for the packages we do load, maybe it's not so bad to precompile a bit so Ribasim starts faster in interactive sessions.

@@ -20,7 +20,7 @@ test-ribasim-api = "pytest --basetemp=python/ribasim_api/tests/temp --junitxml=r

[feature.dev.tasks]
# Installation
install-julia = "juliaup add 1.10.4 && juliaup override unset && juliaup override set 1.10.4"
install-julia = "juliaup add 1.10.5 && juliaup override unset && juliaup override set 1.10.5"
Copy link
Member Author

Choose a reason for hiding this comment

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

@visr
Copy link
Member Author

visr commented Aug 29, 2024

Hmm strange. IntegrationTestWindows passes but IntegrationTestLinux fails.
I assume this isn't related to this PR, more likely #1761.
One centimeter water level difference may be a bit too tight, depending on the Basin.
The 80% speedup compared to the reference is nice though! Also, more likely #1761.

So I think this is probably safe to merge. Though perhaps @Jingru923 do you think the reference timing should be updated as well? Is it the same on Windows and Linux?

22:10:55   Results values: Test Failed at /opt/teamcityagent/work/ecd2b8f9b25b1609/ribasim/core/integration_test/hws_integration_test.jl:20
22:10:55     Expression: all((q->begin
22:10:55               #= /opt/teamcityagent/work/ecd2b8f9b25b1609/ribasim/core/integration_test/hws_integration_test.jl:20 =#
22:10:55               abs(q) < 0.01
22:10:55           end), basin.level - basin_bench.level)
22:10:56   
22:10:56   Stacktrace:
22:10:56    [1] macro expansion
22:10:56      @ ~/.julia/juliaup/julia-1.10.5+0.x64.linux.gnu/share/julia/stdlib/v1.10/Test/src/Test.jl:672 [inlined]
22:10:56    [2] macro expansion
22:10:56      @ /opt/teamcityagent/work/ecd2b8f9b25b1609/ribasim/core/integration_test/hws_integration_test.jl:20 [inlined]
22:10:56    [3] macro expansion
22:10:56      @ ~/.julia/juliaup/julia-1.10.5+0.x64.linux.gnu/share/julia/stdlib/v1.10/Test/src/Test.jl:1577 [inlined]
22:10:56    [4] top-level scope
22:10:56      @ /opt/teamcityagent/work/ecd2b8f9b25b1609/ribasim/core/integration_test/hws_integration_test.jl:19
22:12:52   [ Info: Runtime is 115.53133216 and it is -80.74 % faster than benchmark

@Jingru923
Copy link
Contributor

Jingru923 commented Aug 30, 2024

@visr what do you mean by reference timing? Do you mean the benchmark?

Looking at the result, I would say that it is safe to merge, maybe some other can review code and do quality control.

Since the benchmark for Windows and Linux are the same, we can adjust the limitation to allow more than 1cm difference.

@visr
Copy link
Member Author

visr commented Aug 30, 2024

Ok! Indeed I mean the benchmark.

Copy link
Collaborator

@SouthEndMusic SouthEndMusic left a comment

Choose a reason for hiding this comment

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

Nice that we can reduce the dependencies like this! The changes all look good to me.

@Jingru923 Jingru923 merged commit 1ae6a24 into main Sep 2, 2024
30 of 31 checks passed
@Jingru923 Jingru923 deleted the update-jl branch September 2, 2024 07:35
@visr visr mentioned this pull request Sep 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants