From cd9250250720ecf5fb2dad444ace66ffaeda21b4 Mon Sep 17 00:00:00 2001 From: Hendrik Ranocha Date: Wed, 15 Mar 2023 13:14:05 +0100 Subject: [PATCH] follow SciMLBase update destats -> stats (#1372) * follow SciMLBase update destats -> stats * update compat bounds of OrdinaryDiffEq.jl for destats -> stats * set required Julia version to v1.8 and update CI * fix tests of performance specializations --- .github/workflows/Documenter.yml | 2 +- .github/workflows/benchmark.yml | 2 +- .github/workflows/ci.yml | 10 +++++----- NEWS.md | 2 ++ Project.toml | 4 ++-- README.md | 2 +- docs/Project.toml | 2 +- docs/src/development.md | 6 +++--- docs/src/index.md | 2 +- src/callbacks_step/alive.jl | 12 ++++++------ src/callbacks_step/amr.jl | 6 +++--- src/callbacks_step/analysis.jl | 8 ++++---- src/callbacks_step/save_restart.jl | 6 +++--- src/callbacks_step/save_solution.jl | 10 +++++----- src/callbacks_step/time_series.jl | 10 +++++----- src/callbacks_step/visualization.jl | 8 ++++---- src/time_integration/methods_2N.jl | 4 ++-- src/time_integration/methods_3Sstar.jl | 4 ++-- test/Project.toml | 2 +- test/test_performance_specializations.jl | 16 ++++++++-------- 20 files changed, 60 insertions(+), 58 deletions(-) diff --git a/.github/workflows/Documenter.yml b/.github/workflows/Documenter.yml index c7c1f0c07b1..5d9632b1653 100644 --- a/.github/workflows/Documenter.yml +++ b/.github/workflows/Documenter.yml @@ -36,7 +36,7 @@ jobs: - uses: actions/checkout@v3 - uses: julia-actions/setup-julia@v1 with: - version: '1.7' + version: '1.8' show-versioninfo: true - uses: julia-actions/julia-buildpkg@v1 env: diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index edf54c8ca74..01a6c99e843 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -11,7 +11,7 @@ jobs: os: - ubuntu-latest version: - - '1.7' + - '1.8' arch: - x64 steps: diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6a1c3db3d45..8956c32ee06 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -52,7 +52,7 @@ jobs: fail-fast: false matrix: version: - - '1.7' + - '1.8' # - 'nightly' os: - ubuntu-latest @@ -77,19 +77,19 @@ jobs: - mpi - threaded include: - - version: '1.7' + - version: '1.8' os: macOS-latest arch: x64 trixi_test: mpi - - version: '1.7' + - version: '1.8' os: macOS-latest arch: x64 trixi_test: threaded - - version: '1.7' + - version: '1.8' os: windows-latest arch: x64 trixi_test: mpi - - version: '1.7' + - version: '1.8' os: windows-latest arch: x64 trixi_test: threaded diff --git a/NEWS.md b/NEWS.md index f988a77a098..26f0b91771c 100644 --- a/NEWS.md +++ b/NEWS.md @@ -12,6 +12,8 @@ for human readability. #### Changed +- The required Julia version is updated to v1.8 in Trixi.jl v0.5.13. + #### Deprecated #### Removed diff --git a/Project.toml b/Project.toml index c2dfd9e7757..b40df8d6d64 100644 --- a/Project.toml +++ b/Project.toml @@ -58,7 +58,7 @@ Polyester = "0.3.4, 0.5, 0.6, 0.7" RecipesBase = "1.1" Reexport = "1.0" Requires = "1.1" -SciMLBase = "1.65" +SciMLBase = "1.90" Setfield = "0.8, 1" StartUpDG = "0.15" Static = "0.3, 0.4, 0.5, 0.6, 0.7, 0.8" @@ -71,4 +71,4 @@ Triangulate = "2.0" TriplotBase = "0.1" TriplotRecipes = "0.1" UnPack = "1.0" -julia = "1.7" +julia = "1.8" diff --git a/README.md b/README.md index f0e27f97faa..f4bac6cc564 100644 --- a/README.md +++ b/README.md @@ -64,7 +64,7 @@ installation and postprocessing procedures. Its features include: ## Installation If you have not yet installed Julia, please [follow the instructions for your operating system](https://julialang.org/downloads/platform/). Trixi works -with Julia v1.7. +with Julia v1.8. ### For users Trixi and its related tools are registered Julia packages. Hence, you diff --git a/docs/Project.toml b/docs/Project.toml index 371129a0867..9fc974d6f38 100644 --- a/docs/Project.toml +++ b/docs/Project.toml @@ -19,6 +19,6 @@ HOHQMesh = "0.1, 0.2" LaTeXStrings = "1.2" Literate = "2.9" Measurements = "2.5" -OrdinaryDiffEq = "5.65, 6" +OrdinaryDiffEq = "6.49.1" Plots = "1.9" Trixi2Vtk = "0.3" diff --git a/docs/src/development.md b/docs/src/development.md index ac9fbb65067..45e7b5bd76a 100644 --- a/docs/src/development.md +++ b/docs/src/development.md @@ -18,7 +18,7 @@ package, which tracks changed files and re-loads them automatically. Therefore, it is *highly recommended* to first install Revise with the following command in Julia: To enter the package REPL mode, press `]` in the standard Julia REPL mode. Then, execute ```julia-repl -(@v1.7) pkg> add Revise +(@v1.8) pkg> add Revise ``` Now you are able to run Trixi from the REPL, change Trixi code between runs, **and** enjoy the advantages of the compilation cache! Before you start using @@ -28,7 +28,7 @@ Another recommended package for working from the REPL is [OhMyREPL.jl](https://github.com/KristofferC/OhMyREPL.jl). It can be installed by running ```julia-repl -(@v1.7) pkg> add OhMyREPL +(@v1.8) pkg> add OhMyREPL ``` and adds syntax highlighting, bracket highlighting, and other helpful improvements for using Julia interactively. To automatically use OhMyREPL when @@ -332,5 +332,5 @@ in Trixi2Vtk. To use a locally modified Trixi clone instead of a Trixi release, one can tell Pkg to use the local source code of Trixi instead of a registered version by running ```julia-repl -(@v1.7) pkg> develop path/to/Trixi.jl +(@v1.8) pkg> develop path/to/Trixi.jl ``` diff --git a/docs/src/index.md b/docs/src/index.md index 03e0c29af3f..7d621271c3c 100644 --- a/docs/src/index.md +++ b/docs/src/index.md @@ -58,7 +58,7 @@ installation and postprocessing procedures. Its features include: ## Installation If you have not yet installed Julia, please [follow the instructions for your operating system](https://julialang.org/downloads/platform/). Trixi works -with Julia v1.7. +with Julia v1.8. ### For users Trixi and its related tools are registered Julia packages. Hence, you diff --git a/src/callbacks_step/alive.jl b/src/callbacks_step/alive.jl index 179abb37cda..17686343207 100644 --- a/src/callbacks_step/alive.jl +++ b/src/callbacks_step/alive.jl @@ -67,14 +67,14 @@ function (alive_callback::AliveCallback)(u, t, integrator) @unpack alive_interval, analysis_interval = alive_callback # With error-based step size control, some steps can be rejected. Thus, - # `integrator.iter >= integrator.destats.naccept` + # `integrator.iter >= integrator.stats.naccept` # (total #steps) (#accepted steps) # We need to check the number of accepted steps since callbacks are not # activated after a rejected step. return alive_interval > 0 && ( - (integrator.destats.naccept % alive_interval == 0 && - !(integrator.destats.naccept == 0 && integrator.iter > 0) && - (analysis_interval == 0 || integrator.destats.naccept % analysis_interval != 0)) || + (integrator.stats.naccept % alive_interval == 0 && + !(integrator.stats.naccept == 0 && integrator.iter > 0) && + (analysis_interval == 0 || integrator.stats.naccept % analysis_interval != 0)) || isfinished(integrator)) end @@ -86,13 +86,13 @@ function (alive_callback::AliveCallback)(integrator) if isfinished(integrator) && mpi_isroot() println("─"^100) println("Trixi simulation finished. Final time: ", integrator.t, - " Time steps: ", integrator.destats.naccept, " (accepted), ", integrator.iter, " (total)") + " Time steps: ", integrator.stats.naccept, " (accepted), ", integrator.iter, " (total)") println("─"^100) println() elseif mpi_isroot() runtime_absolute = 1.0e-9 * (time_ns() - alive_callback.start_time) @printf("#timesteps: %6d │ Δt: %.4e │ sim. time: %.4e │ run time: %.4e s\n", - integrator.destats.naccept, integrator.dt, integrator.t, runtime_absolute) + integrator.stats.naccept, integrator.dt, integrator.t, runtime_absolute) end # avoid re-evaluating possible FSAL stages diff --git a/src/callbacks_step/amr.jl b/src/callbacks_step/amr.jl index 8c9e8d7881a..08f89182785 100644 --- a/src/callbacks_step/amr.jl +++ b/src/callbacks_step/amr.jl @@ -38,13 +38,13 @@ function AMRCallback(semi, controller, adaptor; # AMR every `interval` time steps, but not after the final step # With error-based step size control, some steps can be rejected. Thus, - # `integrator.iter >= integrator.destats.naccept` + # `integrator.iter >= integrator.stats.naccept` # (total #steps) (#accepted steps) # We need to check the number of accepted steps since callbacks are not # activated after a rejected step. if interval > 0 - condition = (u, t, integrator) -> ( (integrator.destats.naccept % interval == 0) && - !(integrator.destats.naccept == 0 && integrator.iter > 0) && + condition = (u, t, integrator) -> ( (integrator.stats.naccept % interval == 0) && + !(integrator.stats.naccept == 0 && integrator.iter > 0) && !isfinished(integrator) ) else # disable the AMR callback except possibly for initial refinement during initialization condition = (u, t, integrator) -> false diff --git a/src/callbacks_step/analysis.jl b/src/callbacks_step/analysis.jl index 46a6b6c3fbe..614378a6f86 100644 --- a/src/callbacks_step/analysis.jl +++ b/src/callbacks_step/analysis.jl @@ -98,12 +98,12 @@ function AnalysisCallback(mesh, equations::AbstractEquations, solver, cache; kwargs...) # Decide when the callback is activated. # With error-based step size control, some steps can be rejected. Thus, - # `integrator.iter >= integrator.destats.naccept` + # `integrator.iter >= integrator.stats.naccept` # (total #steps) (#accepted steps) # We need to check the number of accepted steps since callbacks are not # activated after a rejected step. - condition = (u, t, integrator) -> interval > 0 && ( (integrator.destats.naccept % interval == 0 && - !(integrator.destats.naccept == 0 && integrator.iter > 0)) || + condition = (u, t, integrator) -> interval > 0 && ( (integrator.stats.naccept % interval == 0 && + !(integrator.stats.naccept == 0 && integrator.iter > 0)) || isfinished(integrator)) analyzer = SolutionAnalyzer(solver; kwargs...) @@ -202,7 +202,7 @@ function (analysis_callback::AnalysisCallback)(integrator) semi = integrator.p mesh, equations, solver, cache = mesh_equations_solver_cache(semi) @unpack dt, t = integrator - iter = integrator.destats.naccept + iter = integrator.stats.naccept # Record performance measurements and compute performance index (PID) runtime_since_last_analysis = 1.0e-9 * (time_ns() - analysis_callback.start_time_last_analysis) diff --git a/src/callbacks_step/save_restart.jl b/src/callbacks_step/save_restart.jl index 33ce0910ba9..4597c3ce920 100644 --- a/src/callbacks_step/save_restart.jl +++ b/src/callbacks_step/save_restart.jl @@ -80,12 +80,12 @@ function (restart_callback::SaveRestartCallback)(u, t, integrator) @unpack interval, save_final_restart = restart_callback # With error-based step size control, some steps can be rejected. Thus, - # `integrator.iter >= integrator.destats.naccept` + # `integrator.iter >= integrator.stats.naccept` # (total #steps) (#accepted steps) # We need to check the number of accepted steps since callbacks are not # activated after a rejected step. return interval > 0 && ( - ((integrator.destats.naccept % interval == 0) && !(integrator.destats.naccept == 0 && integrator.iter > 0)) || + ((integrator.stats.naccept % interval == 0) && !(integrator.stats.naccept == 0 && integrator.iter > 0)) || (save_final_restart && isfinished(integrator))) end @@ -94,7 +94,7 @@ end function (restart_callback::SaveRestartCallback)(integrator) u_ode = integrator.u @unpack t, dt = integrator - iter = integrator.destats.naccept + iter = integrator.stats.naccept semi = integrator.p mesh, _, _, _ = mesh_equations_solver_cache(semi) diff --git a/src/callbacks_step/save_solution.jl b/src/callbacks_step/save_solution.jl index 1efa2146ca3..d7877ae95a8 100644 --- a/src/callbacks_step/save_solution.jl +++ b/src/callbacks_step/save_solution.jl @@ -95,12 +95,12 @@ function (solution_callback::SaveSolutionCallback)(u, t, integrator) @unpack interval, save_final_solution = solution_callback # With error-based step size control, some steps can be rejected. Thus, - # `integrator.iter >= integrator.destats.naccept` + # `integrator.iter >= integrator.stats.naccept` # (total #steps) (#accepted steps) # We need to check the number of accepted steps since callbacks are not # activated after a rejected step. return interval > 0 && ( - ((integrator.destats.naccept % interval == 0) && !(integrator.destats.naccept == 0 && integrator.iter > 0)) || + ((integrator.stats.naccept % interval == 0) && !(integrator.stats.naccept == 0 && integrator.iter > 0)) || (save_final_solution && isfinished(integrator))) end @@ -109,7 +109,7 @@ end function (solution_callback::SaveSolutionCallback)(integrator) u_ode = integrator.u @unpack t, dt = integrator - iter = integrator.destats.naccept + iter = integrator.stats.naccept semi = integrator.p mesh, _, _, _ = mesh_equations_solver_cache(semi) @@ -125,10 +125,10 @@ function (solution_callback::SaveSolutionCallback)(integrator) callbacks = integrator.opts.callback if callbacks isa CallbackSet for cb in callbacks.continuous_callbacks - get_element_variables!(element_variables, u_ode, semi, cb; t=integrator.t, iter=integrator.destats.naccept) + get_element_variables!(element_variables, u_ode, semi, cb; t=integrator.t, iter=integrator.stats.naccept) end for cb in callbacks.discrete_callbacks - get_element_variables!(element_variables, u_ode, semi, cb; t=integrator.t, iter=integrator.destats.naccept) + get_element_variables!(element_variables, u_ode, semi, cb; t=integrator.t, iter=integrator.stats.naccept) end end end diff --git a/src/callbacks_step/time_series.jl b/src/callbacks_step/time_series.jl index 9bce17eadd0..e89128a16f8 100644 --- a/src/callbacks_step/time_series.jl +++ b/src/callbacks_step/time_series.jl @@ -103,12 +103,12 @@ function TimeSeriesCallback(mesh, equations, solver, cache, point_coordinates; # Invoke callback every `interval` time steps or after final step (for storing the data on disk) if interval > 0 # With error-based step size control, some steps can be rejected. Thus, - # `integrator.iter >= integrator.destats.naccept` + # `integrator.iter >= integrator.stats.naccept` # (total #steps) (#accepted steps) # We need to check the number of accepted steps since callbacks are not # activated after a rejected step. - condition = (u, t, integrator) -> ( (integrator.destats.naccept % interval == 0 && - !(integrator.destats.naccept == 0 && integrator.iter > 0)) || + condition = (u, t, integrator) -> ( (integrator.stats.naccept % interval == 0 && + !(integrator.stats.naccept == 0 && integrator.iter > 0)) || isfinished(integrator)) else # disable the callback for interval == 0 condition = (u, t, integrator) -> false @@ -173,11 +173,11 @@ function (time_series_callback::TimeSeriesCallback)(integrator) # Create record if in correct interval (needs to be checked since the callback is also called # after the final step for storing the data on disk, indepdendent of the current interval) - if integrator.destats.naccept % interval == 0 + if integrator.stats.naccept % interval == 0 @trixi_timeit timer() "time series" begin # Store time and step push!(time_series_callback.time, integrator.t) - push!(time_series_callback.step, integrator.destats.naccept) + push!(time_series_callback.step, integrator.stats.naccept) # Unpack data u_ode = integrator.u diff --git a/src/callbacks_step/visualization.jl b/src/callbacks_step/visualization.jl index 5db0b932751..6eb04608368 100644 --- a/src/callbacks_step/visualization.jl +++ b/src/callbacks_step/visualization.jl @@ -126,12 +126,12 @@ function (visualization_callback::VisualizationCallback)(u, t, integrator) @unpack interval = visualization_callback # With error-based step size control, some steps can be rejected. Thus, - # `integrator.iter >= integrator.destats.naccept` + # `integrator.iter >= integrator.stats.naccept` # (total #steps) (#accepted steps) # We need to check the number of accepted steps since callbacks are not # activated after a rejected step. - return interval > 0 && ( (integrator.destats.naccept % interval == 0 && - !(integrator.destats.naccept == 0 && integrator.iter > 0)) || + return interval > 0 && ( (integrator.stats.naccept % interval == 0 && + !(integrator.stats.naccept == 0 && integrator.iter > 0)) || isfinished(integrator)) end @@ -153,7 +153,7 @@ function (visualization_callback::VisualizationCallback)(integrator) # Create plot plot_creator(plot_data, variable_names; show_mesh=show_mesh, plot_arguments=plot_arguments, - time=integrator.t, timestep=integrator.destats.naccept) + time=integrator.t, timestep=integrator.stats.naccept) # avoid re-evaluating possible FSAL stages u_modified!(integrator, false) diff --git a/src/time_integration/methods_2N.jl b/src/time_integration/methods_2N.jl index 47a83fddf2a..64773e031b8 100644 --- a/src/time_integration/methods_2N.jl +++ b/src/time_integration/methods_2N.jl @@ -92,9 +92,9 @@ mutable struct SimpleIntegrator2N{RealT<:Real, uType, Params, Sol, F, Alg, Simpl finalstep::Bool # added for convenience end -# Forward integrator.destats.naccept to integrator.iter (see GitHub PR#771) +# Forward integrator.stats.naccept to integrator.iter (see GitHub PR#771) function Base.getproperty(integrator::SimpleIntegrator2N, field::Symbol) - if field === :destats + if field === :stats return (naccept = getfield(integrator, :iter),) end # general fallback diff --git a/src/time_integration/methods_3Sstar.jl b/src/time_integration/methods_3Sstar.jl index 416d6dca9c9..4ff723216b5 100644 --- a/src/time_integration/methods_3Sstar.jl +++ b/src/time_integration/methods_3Sstar.jl @@ -122,9 +122,9 @@ mutable struct SimpleIntegrator3Sstar{RealT<:Real, uType, Params, Sol, F, Alg, S finalstep::Bool # added for convenience end -# Forward integrator.destats.naccept to integrator.iter (see GitHub PR#771) +# Forward integrator.stats.naccept to integrator.iter (see GitHub PR#771) function Base.getproperty(integrator::SimpleIntegrator3Sstar, field::Symbol) - if field === :destats + if field === :stats return (naccept = getfield(integrator, :iter),) end # general fallback diff --git a/test/Project.toml b/test/Project.toml index 5754ba25b50..35cc57fb67c 100644 --- a/test/Project.toml +++ b/test/Project.toml @@ -17,5 +17,5 @@ CairoMakie = "0.6, 0.7, 0.8, 0.9, 0.10" Flux = "0.13 - 0.13.12" # TODO: Return to "0.13" once https://github.com/FluxML/Flux.jl/issues/2204 is resolved ForwardDiff = "0.10" MPI = "0.20" -OrdinaryDiffEq = "5.65, 6" +OrdinaryDiffEq = "6.49.1" Plots = "1.16" diff --git a/test/test_performance_specializations.jl b/test/test_performance_specializations.jl index 56880b1c0f5..9702d080c38 100644 --- a/test/test_performance_specializations.jl +++ b/test/test_performance_specializations.jl @@ -32,7 +32,7 @@ isdir(outdir) && rm(outdir, recursive=true) du, u, 1, semi.mesh, nonconservative_terms, semi.equations, semi.solver.volume_integral.volume_flux, semi.solver, semi.cache, true) - du_specialized = du[:, :, :, :, 1] + du_specialized = du[:, :, :, 1] # Call the plain version - note the argument type `Function` of # `semi.solver.volume_integral.volume_flux` @@ -44,7 +44,7 @@ isdir(outdir) && rm(outdir, recursive=true) du, u, 1, semi.mesh, nonconservative_terms, semi.equations, semi.solver.volume_integral.volume_flux, semi.solver, semi.cache, true) - du_baseline = du[:, :, :, :, 1] + du_baseline = du[:, :, :, 1] @test du_specialized ≈ du_baseline end @@ -71,7 +71,7 @@ isdir(outdir) && rm(outdir, recursive=true) du, u, 1, semi.mesh, nonconservative_terms, semi.equations, semi.solver.volume_integral.volume_flux, semi.solver, semi.cache, true) - du_specialized = du[:, :, :, :, 1] + du_specialized = du[:, :, :, 1] # Call the plain version - note the argument type `Function` of # `semi.solver.volume_integral.volume_flux` @@ -83,7 +83,7 @@ isdir(outdir) && rm(outdir, recursive=true) du, u, 1, semi.mesh, nonconservative_terms, semi.equations, semi.solver.volume_integral.volume_flux, semi.solver, semi.cache, true) - du_baseline = du[:, :, :, :, 1] + du_baseline = du[:, :, :, 1] @test du_specialized ≈ du_baseline end @@ -110,7 +110,7 @@ isdir(outdir) && rm(outdir, recursive=true) du, u, 1, semi.mesh, nonconservative_terms, semi.equations, semi.solver.volume_integral.volume_flux, semi.solver, semi.cache, true) - du_specialized = du[:, :, :, :, 1] + du_specialized = du[:, :, :, 1] # Call the plain version - note the argument type `Function` of # `semi.solver.volume_integral.volume_flux` @@ -122,7 +122,7 @@ isdir(outdir) && rm(outdir, recursive=true) du, u, 1, semi.mesh, nonconservative_terms, semi.equations, semi.solver.volume_integral.volume_flux, semi.solver, semi.cache, true) - du_baseline = du[:, :, :, :, 1] + du_baseline = du[:, :, :, 1] @test du_specialized ≈ du_baseline end @@ -149,7 +149,7 @@ isdir(outdir) && rm(outdir, recursive=true) du, u, 1, semi.mesh, nonconservative_terms, semi.equations, semi.solver.volume_integral.volume_flux, semi.solver, semi.cache, true) - du_specialized = du[:, :, :, :, 1] + du_specialized = du[:, :, :, 1] # Call the plain version - note the argument type `Function` of # `semi.solver.volume_integral.volume_flux` @@ -161,7 +161,7 @@ isdir(outdir) && rm(outdir, recursive=true) du, u, 1, semi.mesh, nonconservative_terms, semi.equations, semi.solver.volume_integral.volume_flux, semi.solver, semi.cache, true) - du_baseline = du[:, :, :, :, 1] + du_baseline = du[:, :, :, 1] @test du_specialized ≈ du_baseline end