Skip to content

Commit

Permalink
Merge pull request #371 from FourierFlows/ncc/julia-v1.11
Browse files Browse the repository at this point in the history
Use julia v1.11 as default in CI and Docs
  • Loading branch information
navidcy authored Oct 22, 2024
2 parents 1c412b9 + 9204a7e commit 71ec327
Show file tree
Hide file tree
Showing 7 changed files with 81 additions and 89 deletions.
4 changes: 2 additions & 2 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ steps:
- JuliaCI/julia#v1:
version: '1.10'
- JuliaCI/julia-test#v1: ~
- JuliaCI/julia-coverage#v1:
codecov: true
agents:
queue: "juliagpu"
cuda: "*"
Expand All @@ -21,6 +19,8 @@ steps:
- JuliaCI/julia#v1:
version: '1.11'
- JuliaCI/julia-test#v1: ~
- JuliaCI/julia-coverage#v1:
codecov: true
agents:
queue: "juliagpu"
cuda: "*"
Expand Down
54 changes: 54 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: CI
on:
push:
branches: [main]
tags: ["*"]
pull_request:
jobs:
test:
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
version:
- "1.10" # LTS
- "1.11"
os:
- macOS-latest
- windows-latest
arch:
- x64
- aarch64
- arm64
exclude:
# Test 32-bit only on Linux
- os: macOS-latest
arch: x64
- os: windows-latest
arch: aarch64
- os: windows-latest
arch: arm64
steps:
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v2
with:
version: ${{ matrix.version }}
arch: ${{ matrix.arch }}
- uses: julia-actions/cache@v2
- uses: julia-actions/julia-buildpkg@v1
- uses: julia-actions/julia-runtest@v1
docs:
name: Documentation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v2
with:
version: '1.11'
- uses: julia-actions/julia-buildpkg@latest
- uses: julia-actions/julia-docdeploy@latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }}
JULIA_DEBUG: Documenter
2 changes: 1 addition & 1 deletion .github/workflows/CompatHelper.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
steps:
- uses: julia-actions/setup-julia@latest
with:
version: 1.10
version: 1.11
- name: Pkg.add("CompatHelper")
run: julia -e 'using Pkg; Pkg.add("CompatHelper")'
- name: CompatHelper.main()
Expand Down
26 changes: 0 additions & 26 deletions .github/workflows/Documenter.yml

This file was deleted.

36 changes: 0 additions & 36 deletions appveyor.yml

This file was deleted.

4 changes: 2 additions & 2 deletions docs/src/installation_instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ To install the latest version of FourierFlows.jl use the Julia's built-in packag

```julia
julia> ]
(v1.10) pkg> add FourierFlows
(v1.11) pkg> add FourierFlows
```

We recommend installing FourierFlows.jl with the built-in Julia package manager, because
this installs a stable, tagged release. Later, you can update FourierFlows.jl to the
latest tagged release again via the package manager by

```julia
(v1.10) pkg> update FourierFlows
(v1.11) pkg> update FourierFlows
```

Note that some releases might induce breaking changes to certain modules. If after anything
Expand Down
44 changes: 22 additions & 22 deletions test/test_grid.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,21 @@ testnz(g, nz) = isapprox(g.nz, nz)
function testdx(dev, g::Union{OneDGrid{T}, TwoDGrid{T}, ThreeDGrid{T}}) where T
dxgrid = @. g.x[2:end] - g.x[1:end-1]
dxones = device_array(dev)(g.dx*ones(T, size(dxgrid)))

return isapprox(dxgrid, dxones)
end

function testdy(dev, g::Union{TwoDGrid{T}, ThreeDGrid{T}}) where T
dygrid = @. g.y[2:end] - g.y[1:end-1]
dyones = device_array(dev)(g.dy*ones(T, size(dygrid)))

return isapprox(dygrid, dyones)
end

function testdz(dev, g::ThreeDGrid{T}) where T
dzgrid = @. g.z[2:end] - g.z[1:end-1]
dzones = device_array(dev)(g.dz*ones(T, size(dzgrid)))

return isapprox(dzgrid, dzones)
end

Expand All @@ -38,7 +38,7 @@ function testwavenumberalignment(k, nx)
mid = Int(nx/2)
positives = k[2:mid]
negatives = flippednegatives(k, mid)

return isapprox(reshape(positives, mid-1), reshape(negatives, mid-1))
end

Expand All @@ -61,7 +61,7 @@ function testgridpoints(dev::Device, g::TwoDGrid{T}) where T
dYgrid = @. Y[:, 2:end] - Y[:, 1:end-1]
dXones = device_array(dev)(g.dx*ones(T, size(dXgrid)))
dYones = device_array(dev)(g.dy*ones(T, size(dYgrid)))

return isapprox(dXgrid, dXones) && isapprox(dYgrid, dYones)
end

Expand All @@ -73,16 +73,16 @@ function testgridpoints(dev::Device, g::ThreeDGrid{T}) where T
dXones = device_array(dev)(g.dx*ones(T, size(dXgrid)))
dYones = device_array(dev)(g.dy*ones(T, size(dYgrid)))
dZones = device_array(dev)(g.dz*ones(T, size(dZgrid)))

return isapprox(dXgrid, dXones) && isapprox(dYgrid, dYones) && isapprox(dZgrid, dZones)
end

function testdealias(grid::OneDGrid)
fh = ones(Complex{eltype(grid)}, size(grid.kr))
dealias!(fh, grid)

kmax = round(maximum(grid.kr)*2/3)

for i₁ = 1:grid.nkr
if CUDA.@allowscalar grid.kr[i₁] < kmax
fh[i₁] = 0
Expand All @@ -95,7 +95,7 @@ end
function testdealias(grid::TwoDGrid)
fh = ones(Complex{eltype(grid)}, size(grid.Krsq))
dealias!(fh, grid)

kmax = round(maximum(grid.kr)*2/3)
lmax = round(maximum(abs.(grid.l))*2/3)

Expand All @@ -107,7 +107,7 @@ function testdealias(grid::TwoDGrid)
fh[i₁, i₂] = 0
end
end

return isapprox(sum(abs.(fh)), 0)
end

Expand All @@ -134,7 +134,7 @@ end

function testnodealias(grid::OneDGrid)
fh = ones(Complex{eltype(grid)}, size(grid.kr))

return dealias!(fh, grid) === nothing
end

Expand All @@ -146,7 +146,7 @@ end

function testtypedonedgrid(dev::Device, nx, Lx; T=Float64)
grid = OneDGrid(; nx, Lx, T)

return typeof(grid.dx)==T && typeof(grid.x[1])==T && typeof(grid.Lx)==T && eltype(grid) == T
end

Expand All @@ -168,7 +168,7 @@ function testmakefilter(dev::Device, g::AbstractGrid)
G = typeof(g)
nofilter = G<:OneDGrid ? filter[@. g.kr*g.dx/π < 0.65] : ( G<:TwoDGrid ? filter[@. sqrt((g.kr*g.dx/π)^2 + (g.l*g.dy/π)^2) < 0.65] : filter[@. sqrt((g.kr*g.dx/π)^2 + (g.l*g.dy/π)^2 + (g.m*g.dz/π)^2) < 0.65] )
fullfilter = G<:OneDGrid ? filter[@. g.kr*g.dx/π > 0.999] : ( G<:TwoDGrid ? filter[@. sqrt((g.kr*g.dx/π)^2 + (g.l*g.dy/π)^2) > 0.999] : filter[@. sqrt((g.kr*g.dx/π)^2 + (g.l*g.dy/π)^2 + (g.m*g.dz/π)^2) > 0.999] )

return nofilter== zeros(dev, T, size(nofilter)) .+ 1 && isapprox(fullfilter, zeros(dev, T, size(fullfilter)), atol=1e-12)
end

Expand All @@ -190,34 +190,34 @@ function test_plan_flows_fftrfft(::GPU; T=Float64)

region_ans = VERSION >= v"1.9.0" ? (1, 2) : [1, 2]

return typeof(FourierFlows.plan_flows_fft(A(rand(Complex{T}, (4,))))) == CUDA.CUFFT.cCuFFTPlan{Complex{T},-1,false,1} &&
typeof(FourierFlows.plan_flows_fft(A(rand(Complex{T}, (4, 6))))) == CUDA.CUFFT.cCuFFTPlan{Complex{T},-1,false,2} &&
typeof(FourierFlows.plan_flows_fft(A(rand(Complex{T}, (4, 6, 8))))) == CUDA.CUFFT.cCuFFTPlan{Complex{T},-1,false,3} &&
return typeof(FourierFlows.plan_flows_fft(A(rand(Complex{T}, (4,))))) == CUDA.CUFFT.CuFFTPlan{Complex{T}, Complex{T}, -1, false, 1} &&
typeof(FourierFlows.plan_flows_fft(A(rand(Complex{T}, (4, 6))))) == CUDA.CUFFT.CuFFTPlan{Complex{T}, Complex{T}, -1, false, 2} &&
typeof(FourierFlows.plan_flows_fft(A(rand(Complex{T}, (4, 6, 8))))) == CUDA.CUFFT.CuFFTPlan{Complex{T}, Complex{T}, -1, false, 3} &&
FourierFlows.plan_flows_fft(A(rand(Complex{T}, (4, 6, 8))), [1, 2]).region == region_ans &&
typeof(FourierFlows.plan_flows_rfft(A(rand(T, (4,))))) == CUDA.CUFFT.rCuFFTPlan{T,-1,false,1} &&
typeof(FourierFlows.plan_flows_rfft(A(rand(T, (4, 6))))) == CUDA.CUFFT.rCuFFTPlan{T,-1,false,2} &&
typeof(FourierFlows.plan_flows_rfft(A(rand(T, (4, 6, 8))))) == CUDA.CUFFT.rCuFFTPlan{T,-1,false,3} &&
typeof(FourierFlows.plan_flows_rfft(A(rand(T, (4,))))) == CUDA.CUFFT.CuFFTPlan{Complex{T}, T, -1, false, 1} &&
typeof(FourierFlows.plan_flows_rfft(A(rand(T, (4, 6))))) == CUDA.CUFFT.CuFFTPlan{Complex{T}, T, -1, false, 2} &&
typeof(FourierFlows.plan_flows_rfft(A(rand(T, (4, 6, 8))))) == CUDA.CUFFT.CuFFTPlan{Complex{T}, T, -1, false, 3} &&
FourierFlows.plan_flows_rfft(A(rand(T, (4, 6, 8))), [1, 2]).region == region_ans
end

function test_aliased_fraction(dev, aliased_fraction)
nx, Lx = 16, 2π
ny, Ly = 32, 2π
nz, Lz = 34, 2π

g₁ = OneDGrid(; nx, Lx, aliased_fraction)
g₂ = TwoDGrid(; nx, Lx, ny, Ly, aliased_fraction)
g₃ = ThreeDGrid(; nx, Lx, ny, Ly, nz, Lz, aliased_fraction)

lower_end(n) = floor(Int, (1 - aliased_fraction)/2 * n) + 1
upper_end(n) = ceil(Int, (1 + aliased_fraction)/2 * n)
upper_end_r(n) = Int(n/2)+1

kralias = aliased_fraction==0 ? nothing : lower_end(nx):upper_end_r(nx)
kalias = aliased_fraction==0 ? nothing : lower_end(nx):upper_end(nx)
lalias = aliased_fraction==0 ? nothing : lower_end(ny):upper_end(ny)
malias = aliased_fraction==0 ? nothing : lower_end(nz):upper_end(nz)

return g₁.aliased_fraction == aliased_fraction &&
g₂.aliased_fraction == aliased_fraction &&
g₃.aliased_fraction == aliased_fraction &&
Expand Down

0 comments on commit 71ec327

Please sign in to comment.