From 1672e75a823d0a4ee7547d598c27cfe6dcecc277 Mon Sep 17 00:00:00 2001 From: "Navid C. Constantinou" Date: Wed, 9 Oct 2024 08:18:39 +1100 Subject: [PATCH 1/5] julia v1.11 as default --- .buildkite/pipeline.yml | 4 ++-- .github/workflows/CompatHelper.yml | 2 +- .github/workflows/Documenter.yml | 2 +- Project.toml | 6 +++--- docs/src/installation_instructions.md | 4 ++-- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index d5466ad9..4f89f401 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -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: "*" @@ -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: "*" diff --git a/.github/workflows/CompatHelper.yml b/.github/workflows/CompatHelper.yml index 887837ea..299d6d4a 100644 --- a/.github/workflows/CompatHelper.yml +++ b/.github/workflows/CompatHelper.yml @@ -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() diff --git a/.github/workflows/Documenter.yml b/.github/workflows/Documenter.yml index 9748275a..2b36cce4 100644 --- a/.github/workflows/Documenter.yml +++ b/.github/workflows/Documenter.yml @@ -14,7 +14,7 @@ jobs: - uses: actions/checkout@v4 - uses: julia-actions/setup-julia@latest with: - version: '1.10' + version: '1.11' - name: Install dependencies run: julia --project=docs/ -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()' - name: Build and deploy diff --git a/Project.toml b/Project.toml index 2c36732a..7374a765 100644 --- a/Project.toml +++ b/Project.toml @@ -25,10 +25,10 @@ DocStringExtensions = "0.8, 0.9" FFTW = "1" Interpolations = "0.12, 0.13, 0.14, 0.15" JLD2 = "0.1, 0.2, 0.3, 0.4" -LinearAlgebra = "1.10" -Random = "1.10" +LinearAlgebra = "1.10, 1.11" +Random = "1.10, 1.11" Reexport = "0.2, 1" -Statistics = "1.10" +Statistics = "1.10, 1.11" julia = "1.10" [extras] diff --git a/docs/src/installation_instructions.md b/docs/src/installation_instructions.md index 8b8571e2..45d00a0c 100644 --- a/docs/src/installation_instructions.md +++ b/docs/src/installation_instructions.md @@ -5,7 +5,7 @@ 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 @@ -13,7 +13,7 @@ this installs a stable, tagged release. Later, you can update FourierFlows.jl to 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 From 253164a7abf9db0e124ee4f4d60f2c26be4762ac Mon Sep 17 00:00:00 2001 From: "Navid C. Constantinou" Date: Wed, 9 Oct 2024 08:20:31 +1100 Subject: [PATCH 2/5] remove unnecessary compats --- Project.toml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Project.toml b/Project.toml index 7374a765..2c36732a 100644 --- a/Project.toml +++ b/Project.toml @@ -25,10 +25,10 @@ DocStringExtensions = "0.8, 0.9" FFTW = "1" Interpolations = "0.12, 0.13, 0.14, 0.15" JLD2 = "0.1, 0.2, 0.3, 0.4" -LinearAlgebra = "1.10, 1.11" -Random = "1.10, 1.11" +LinearAlgebra = "1.10" +Random = "1.10" Reexport = "0.2, 1" -Statistics = "1.10, 1.11" +Statistics = "1.10" julia = "1.10" [extras] From 451311c03336328d1dcf6c8ac77a0fc7e83d93ab Mon Sep 17 00:00:00 2001 From: "Navid C. Constantinou" Date: Tue, 22 Oct 2024 15:00:46 +1100 Subject: [PATCH 3/5] use gh actions for CI+docs; drop appveyor --- .github/workflows/CI.yml | 54 ++++++++++++++++++++++++++++++++ .github/workflows/Documenter.yml | 26 --------------- appveyor.yml | 36 --------------------- 3 files changed, 54 insertions(+), 62 deletions(-) create mode 100644 .github/workflows/CI.yml delete mode 100644 .github/workflows/Documenter.yml delete mode 100644 appveyor.yml diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml new file mode 100644 index 00000000..587cf11a --- /dev/null +++ b/.github/workflows/CI.yml @@ -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 diff --git a/.github/workflows/Documenter.yml b/.github/workflows/Documenter.yml deleted file mode 100644 index 2b36cce4..00000000 --- a/.github/workflows/Documenter.yml +++ /dev/null @@ -1,26 +0,0 @@ -name: Documentation - -on: - push: - branches: - - main - tags: '*' - pull_request: - -jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: julia-actions/setup-julia@latest - with: - version: '1.11' - - name: Install dependencies - run: julia --project=docs/ -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()' - - name: Build and deploy - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # If authenticating with GitHub Actions token - DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }} # If authenticating with SSH deploy key - run: julia --project=docs/ docs/make.jl --code-coverage=user - - uses: julia-actions/julia-processcoverage@v1 - - uses: codecov/codecov-action@v1 diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index 0ddbcf12..00000000 --- a/appveyor.yml +++ /dev/null @@ -1,36 +0,0 @@ -environment: - matrix: - - julia_version: 1.10 - - julia_version: 1.11 - - julia_version: nightly - -platform: - # - x86 # 32-bit - - x64 # 64-bit - -# Uncomment the following lines to allow failures on nightly julia -# (tests will run but not make your overall status red) -matrix: - allow_failures: - - julia_version: nightly - -branches: - only: - - main - -notifications: - - provider: Email - on_build_success: false - on_build_failure: false - on_build_status_changed: false - -install: - - ps: iex ((new-object net.webclient).DownloadString("https://raw.githubusercontent.com/JuliaCI/Appveyor.jl/version-1/bin/install.ps1")) - -build_script: - - echo "%JL_BUILD_SCRIPT%" - - C:\julia\bin\julia -e "%JL_BUILD_SCRIPT%" - -test_script: - - echo "%JL_TEST_SCRIPT%" - - C:\julia\bin\julia -e "%JL_TEST_SCRIPT%" From 02306d9ac2d83ebc3276d4e0226ca84d7b672e15 Mon Sep 17 00:00:00 2001 From: "Navid C. Constantinou" Date: Tue, 22 Oct 2024 15:41:52 +1100 Subject: [PATCH 4/5] update test_plan_flows_fftrfft for GPU --- test/test_grid.jl | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/test/test_grid.jl b/test/test_grid.jl index c0aaa63d..3b908e3c 100644 --- a/test/test_grid.jl +++ b/test/test_grid.jl @@ -190,13 +190,13 @@ 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 From 9204a7ea8d2c1ea7e2e4207499da7ee7e4452575 Mon Sep 17 00:00:00 2001 From: "Navid C. Constantinou" Date: Tue, 22 Oct 2024 15:43:13 +1100 Subject: [PATCH 5/5] remove stray spaces --- test/test_grid.jl | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/test/test_grid.jl b/test/test_grid.jl index 3b908e3c..d64d59aa 100644 --- a/test/test_grid.jl +++ b/test/test_grid.jl @@ -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 @@ -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 @@ -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 @@ -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 @@ -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) @@ -107,7 +107,7 @@ function testdealias(grid::TwoDGrid) fh[i₁, i₂] = 0 end end - + return isapprox(sum(abs.(fh)), 0) end @@ -134,7 +134,7 @@ end function testnodealias(grid::OneDGrid) fh = ones(Complex{eltype(grid)}, size(grid.kr)) - + return dealias!(fh, grid) === nothing end @@ -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 @@ -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 @@ -204,7 +204,7 @@ 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) @@ -212,12 +212,12 @@ function test_aliased_fraction(dev, 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 &&