Skip to content

Commit 7c537a3

Browse files
authored
Drop support for Julia 1.9 (trixi-framework#703)
* Drop support for Julia 1.9 * Explicitly test Julia versions since 1.10 * Increase compat for PointNeighbors.jl * Downgrade CairoMakie Why did this work before!? * Run Windows and macOS tests on versions min and 1 * Fix job names * Actually run jobs on the specified operating systems * Display Julia version * Synchronize with PointNeighbors.jl CI * Bump version number * Require hot-fixed version of PointNeighbors.jl * Update solution_saving.jl * Fix example tests * Fix properly * Fix validation * Make validation tests pass on macOS ARM * Update tolerances for macOS-ARM
1 parent e80d820 commit 7c537a3

File tree

9 files changed

+61
-81
lines changed

9 files changed

+61
-81
lines changed

.github/workflows/ci.yml

Lines changed: 24 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -27,40 +27,35 @@ on:
2727
- 'docs/**'
2828
workflow_dispatch:
2929

30-
# Cancel redundant CI tests automatically
30+
# Skip intermediate builds: always.
31+
# Cancel intermediate builds: only if it is a pull request build.
3132
concurrency:
3233
group: ${{ github.workflow }}-${{ github.ref }}
33-
cancel-in-progress: true
34+
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
3435

3536
jobs:
3637
build:
37-
name: Run Tests (Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }})
38-
runs-on: ubuntu-latest
38+
name: Run Tests (Julia ${{ matrix.version }} - ${{ matrix.os }})
39+
runs-on: ${{ matrix.os }}
3940
strategy:
41+
# Don't cancel all running jobs when one job fails
4042
fail-fast: false
4143
matrix:
42-
version:
43-
- '1.9'
44-
- '1.10'
45-
- '1'
46-
os:
47-
- ubuntu-latest
48-
arch:
49-
- x64
50-
include:
51-
# Also run tests on Windows and macOS-ARM, but only with the latest Julia version and 1.10
52-
- version: '1.10'
53-
os: windows-latest
54-
arch: x64
55-
- version: '1.10'
56-
os: macos-14
57-
arch: arm64
58-
- version: '1'
59-
os: windows-latest
60-
arch: x64
61-
- version: '1'
62-
os: macos-14
63-
arch: arm64
44+
version:
45+
- '1.10'
46+
- '1'
47+
os:
48+
- ubuntu-latest
49+
include:
50+
# Also run tests on Windows and macOS-ARM, but only with the latest Julia release and minimum supported version
51+
- version: 'min'
52+
os: windows-latest
53+
- version: 'min'
54+
os: macos-14
55+
- version: '1'
56+
os: windows-latest
57+
- version: '1'
58+
os: macos-14
6459

6560
steps:
6661
- name: Check out project
@@ -71,6 +66,9 @@ jobs:
7166
with:
7267
version: ${{ matrix.version }}
7368

69+
- name: Display Julia version
70+
run: julia -e 'using InteractiveUtils; versioninfo(verbose=true)'
71+
7472
- uses: julia-actions/cache@v2
7573

7674
- name: Build package

Project.toml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "TrixiParticles"
22
uuid = "66699cd8-9c01-4e9d-a059-b96c86d16b3a"
33
authors = ["erik.faulhaber <[email protected]>"]
4-
version = "0.2.4"
4+
version = "0.2.5-dev"
55

66
[deps]
77
Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e"
@@ -32,19 +32,19 @@ TrixiBase = "9a0f1c46-06d5-4909-a5a3-ce25d3fa3284"
3232
WriteVTK = "64499a7a-5c06-52f2-abe2-ccb03c286192"
3333

3434
[compat]
35-
Adapt = "3, 4"
35+
Adapt = "4"
3636
CSV = "0.10"
3737
DataFrames = "1.6"
3838
DelimitedFiles = "1"
39-
DiffEqCallbacks = "2, 3, 4"
39+
DiffEqCallbacks = "4"
4040
FastPow = "0.1"
4141
FileIO = "1"
4242
ForwardDiff = "0.10"
43-
GPUArraysCore = "0.1, 0.2"
43+
GPUArraysCore = "0.2"
4444
JSON = "0.21"
4545
KernelAbstractions = "0.9"
4646
MuladdMacro = "0.2"
47-
PointNeighbors = "0.4.2"
47+
PointNeighbors = "0.4.7"
4848
Polyester = "0.7.10"
4949
RecipesBase = "1"
5050
Reexport = "1"
@@ -54,4 +54,4 @@ StrideArrays = "0.1"
5454
TimerOutputs = "0.5.25"
5555
TrixiBase = "0.1.3"
5656
WriteVTK = "1"
57-
julia = "1.9"
57+
julia = "1.10"

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ TrixiParticles.jl focuses on the following use cases:
2121
- Development of new particle-based methods and models.
2222
- Easy setup of accessible simulations for educational purposes, including student projects, coursework, and thesis work.
2323

24-
It offers intuitive configuration, robust pre- and post-processing, and vendor-agnostic GPU-support based on the Julia package [KernelAbstractions.jl](https://github.com/JuliaGPU/KernelAbstractions.jl).
24+
It offers intuitive configuration, robust pre- and post-processing, and vendor-agnostic GPU-support based on the Julia package [KernelAbstractions.jl](https://github.com/JuliaGPU/KernelAbstractions.jl).
2525

2626
[![YouTube](https://github.com/user-attachments/assets/dc2be627-a799-4bfd-9226-2077f737c4b0)](https://www.youtube.com/watch?v=V7FWl4YumcA&t=4667s)
2727

@@ -66,7 +66,7 @@ We provide several example simulation setups in the `examples` folder (which can
6666
## Installation
6767
If you have not yet installed Julia, please [follow the instructions for your
6868
operating system](https://julialang.org/downloads/platform/). TrixiParticles.jl works
69-
with Julia v1.9 and newer. We recommend using the latest stable release of Julia.
69+
with Julia v1.10 and newer. We recommend using the latest stable release of Julia.
7070

7171
### For users
7272
TrixiParticles.jl is a registered Julia package.

docs/Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@ Documenter = "1"
1313
DocumenterCitations = "1"
1414
OrdinaryDiffEq = "6"
1515
Plots = "1"
16-
PointNeighbors = "0.4"
16+
PointNeighbors = "0.4.7"
1717
TrixiBase = "0.1"

docs/src/install.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
## Setting up Julia
44
If you have not yet installed Julia, please [follow the instructions on the
55
official website](https://julialang.org/downloads/). TrixiParticles.jl works
6-
with Julia v1.9 and newer. We recommend using the latest stable release of Julia.
6+
with Julia v1.10 and newer. We recommend using the latest stable release of Julia.
77

88
## For users
99
TrixiParticles.jl is a registered Julia package.

src/callbacks/solution_saving.jl

Lines changed: 9 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,7 @@ function SolutionSavingCallback(; interval::Integer=0, dt=0.0,
106106
-1, Ref("UnknownVersion"))
107107

108108
if length(save_times) > 0
109-
# See the large comment below for an explanation why we use `finalize` here.
110-
# When support for Julia 1.9 is dropped, the `finalize` argument can be removed.
111-
return PresetTimeCallback(save_times, solution_callback, finalize=solution_callback)
109+
return PresetTimeCallback(save_times, solution_callback)
112110
elseif dt > 0
113111
# Add a `tstop` every `dt`, and save the final solution
114112
return PeriodicCallback(solution_callback, dt,
@@ -198,41 +196,22 @@ end
198196
# When `interval` is used, this is
199197
# `DiscreteCallback{<:SolutionSavingCallback,
200198
# <:SolutionSavingCallback,
201-
# typeof(TrixiParticles.initialize_save_cb!),
202-
# typeof(SciMLBase.FINALIZE_DEFAULT)}`.
199+
# typeof(TrixiParticles.initialize_save_cb!)}`.
203200
#
204201
# When `dt` is used, this is
205202
# `DiscreteCallback{DiffEqCallbacks.var"#99#103"{...},
206203
# DiffEqCallbacks.PeriodicCallbackAffect{<:SolutionSavingCallback},
207-
# DiffEqCallbacks.var"#100#104"{...}
208-
# typeof(SciMLBase.FINALIZE_DEFAULT)}`.
204+
# DiffEqCallbacks.var"#100#104"{...}}`.
209205
#
210206
# When `save_times` is used, this is
211207
# `DiscreteCallback{DiffEqCallbacks.var"#115#117"{...},
212208
# <:SolutionSavingCallback,
213-
# DiffEqCallbacks.var"#116#118"{...},
214-
# typeof(SciMLBase.FINALIZE_DEFAULT)}}`.
209+
# DiffEqCallbacks.var"#116#118"{...}}`.
215210
#
216211
# So we can unambiguously dispatch on
217212
# - `DiscreteCallback{<:SolutionSavingCallback, <:SolutionSavingCallback}`,
218213
# - `DiscreteCallback{<:Any, <:PeriodicCallbackAffect{<:SolutionSavingCallback}}`,
219214
# - `DiscreteCallback{<:Any, <:SolutionSavingCallback}`.
220-
#
221-
# WORKAROUND FOR JULIA 1.9:
222-
# When `save_times` is used, the `affect!` is also wrapped in an anonymous function:
223-
# `DiscreteCallback{DiffEqCallbacks.var"#110#113"{...},
224-
# DiffEqCallbacks.var"#111#114"{<:SolutionSavingCallback},
225-
# DiffEqCallbacks.var"#116#118"{...},
226-
# typeof(SciMLBase.FINALIZE_DEFAULT)}}`.
227-
#
228-
# To dispatch here, we set `finalize` to the callback itself, so that the fourth parameter
229-
# becomes `<:SolutionSavingCallback`. This is only used in Julia 1.9. 1.10 and later uses
230-
# a newer version of DiffEqCallbacks.jl that does not have this issue.
231-
#
232-
# To use the callback as `finalize`, we have to define the following function.
233-
# `finalize` is set to `FINALIZE_DEFAULT` by default in the `PresetTimeCallback`,
234-
# which is a function that just returns `nothing`.
235-
# We define the `SolutionSavingCallback` to do the same when called with these arguments.
236215
function (finalize::SolutionSavingCallback)(c, u, t, integrator)
237216
return nothing
238217
end
@@ -256,17 +235,12 @@ function Base.show(io::IO,
256235
print(io, "SolutionSavingCallback(dt=", solution_saving.interval, ")")
257236
end
258237

259-
# With `save_times`, also working in Julia 1.9.
260-
# When support for Julia 1.9 is dropped, this can be changed to
261-
# `DiscreteCallback{<:Any, <:SolutionSavingCallback}`, and the `finalize` argument
262-
# in the constructor of `SolutionSavingCallback` can be removed.
238+
# With `save_times`
263239
function Base.show(io::IO,
264-
cb::DiscreteCallback{<:Any, <:Any, <:Any, <:SolutionSavingCallback})
240+
cb::DiscreteCallback{<:Any, <:SolutionSavingCallback})
265241
@nospecialize cb # reduce precompilation time
266242

267-
# This has to be changed to `cb.affect!` when support for Julia 1.9 is dropped
268-
# and finalize is removed from the constructor of `SolutionSavingCallback`.
269-
solution_saving = cb.finalize
243+
solution_saving = cb.affect!
270244
print(io, "SolutionSavingCallback(save_times=", solution_saving.save_times, ")")
271245
end
272246

@@ -323,15 +297,13 @@ end
323297

324298
# With `save_times`. See comments above.
325299
function Base.show(io::IO, ::MIME"text/plain",
326-
cb::DiscreteCallback{<:Any, <:Any, <:Any, <:SolutionSavingCallback})
300+
cb::DiscreteCallback{<:Any, <:SolutionSavingCallback})
327301
@nospecialize cb # reduce precompilation time
328302

329303
if get(io, :compact, false)
330304
show(io, cb)
331305
else
332-
# This has to be changed to `cb.affect!` when support for Julia 1.9 is dropped
333-
# and finalize is removed from the constructor of `SolutionSavingCallback`.
334-
solution_saving = cb.finalize
306+
solution_saving = cb.affect!
335307
cq = collect(solution_saving.custom_quantities)
336308

337309
setup = [

test/Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
1616

1717
[compat]
1818
CSV = "0.10"
19-
CairoMakie = "0.13"
19+
CairoMakie = "0.12"
2020
DataFrames = "1.6"
2121
GLM = "1.9"
2222
Glob = "1.3"

test/count_allocations.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ struct NoUpdateNeighborhoodSearch{NHS}
55
nhs::NHS
66
end
77

8+
@inline Base.ndims(nhs::NoUpdateNeighborhoodSearch) = ndims(nhs.nhs)
9+
810
# Copy a `Semidiscretization`, but wrap the neighborhood searches with
911
# `NoUpdateNeighborhoodSearch`.
1012
function copy_semi_with_no_update_nhs(semi)

test/validation/validation.jl

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -47,18 +47,26 @@
4747
@test sol.retcode == ReturnCode.Success
4848
@test count_rhs_allocations(sol, semi) == 0
4949

50-
if VERSION == v"1.10"
50+
if Sys.ARCH === :aarch64
51+
# MacOS ARM produces slightly different pressure values than x86.
52+
# Note that pressure values are in the order of 1e5.
53+
@test isapprox(error_edac_P1, 0, atol=8e-10)
54+
@test isapprox(error_edac_P2, 0, atol=7e-12)
55+
@test isapprox(error_wcsph_P1, 0, atol=18.0)
56+
@test isapprox(error_wcsph_P2, 0, atol=0.004)
57+
elseif VERSION == v"1.10"
58+
# Reference values are computed with 1.10
5159
@test isapprox(error_edac_P1, 0, atol=eps())
5260
@test isapprox(error_edac_P2, 0, atol=eps())
5361
@test isapprox(error_wcsph_P1, 0, atol=eps())
5462
@test isapprox(error_wcsph_P2, 0, atol=eps())
5563
else
56-
# 1.9 causes a large difference in the solution
57-
# TODO 1.11 requires a performance hotfix which will likely change these results again
58-
@test isapprox(error_edac_P1, 0, atol=4e-9)
59-
@test isapprox(error_edac_P2, 0, atol=3e-11)
60-
@test isapprox(error_wcsph_P1, 0, atol=26.3)
61-
@test isapprox(error_wcsph_P2, 0, atol=8.2e-3)
64+
# 1.11 produces slightly different pressure values than 1.10.
65+
# Note that pressure values are in the order of 1e5.
66+
@test isapprox(error_edac_P1, 0, atol=eps())
67+
@test isapprox(error_edac_P2, 0, atol=eps())
68+
@test isapprox(error_wcsph_P1, 0, atol=0.07)
69+
@test isapprox(error_wcsph_P2, 0, atol=8e-6)
6270
end
6371

6472
# Ignore method redefinitions from duplicate `include("../validation_util.jl")`

0 commit comments

Comments
 (0)