Skip to content

Commit 8281e78

Browse files
Remove the HeptadiagonalSolver (#4386)
* remove everything * remove IterativeSolvers * remove the tests * precompiles * remove constructors * remove more stuff * upload * restore targets * fix tests * fix project toml * remove the "acronym" * fix tests
1 parent 21ad375 commit 8281e78

26 files changed

+11
-1673
lines changed

.buildkite/pipeline.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ steps:
7171
- "👻 abstract_operations"
7272
- "🕊 poisson_solvers_1"
7373
- "🦖 poisson_solvers_2"
74-
- "🌷 matrix_poisson_solvers"
7574
- "🦤 general_solvers"
7675
- "🎣 turbulence_closures"
7776
- "🦀 time_stepping_1"

Project.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ GPUArrays = "0c68f7d7-f131-5f86-a1c3-88cf8149b2d7"
1515
GPUArraysCore = "46192b85-c4d5-4398-a991-12ede77f4527"
1616
Glob = "c27321d9-0574-5035-807b-f59d2c89b15c"
1717
InteractiveUtils = "b77e0a4c-d291-57a0-90e8-8db25a27a240"
18-
IterativeSolvers = "42fd0dbc-a981-5370-80f2-aaf504508153"
1918
JLD2 = "033835bb-8acc-5ee8-8aae-3f567f8a3819"
2019
KernelAbstractions = "63c18a36-062a-441e-b654-da1e3ab1ce7c"
2120
Krylov = "ba0b0d4f-ebba-5204-a429-3ac8c609bfb7"
@@ -75,7 +74,6 @@ GPUArrays = "10.3, 11.2.2"
7574
GPUArraysCore = "0.2"
7675
Glob = "1.3"
7776
InteractiveUtils = "1.9"
78-
IterativeSolvers = "0.9"
7977
JLD2 = "0.4, 0.5, 0.6"
8078
KernelAbstractions = "0.9.21"
8179
Krylov = "0.10.0"

benchmark/benchmark_implicit_surface_solvers.jl

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,6 @@ for N in 10:10:250
6767

6868
implicit_free_surface_solvers = (:FastFourierTransform,
6969
:PreconditionedConjugateGradient,
70-
:HeptadiagonalIterativeSolver,
71-
:HeptadiagonalIterativeSolver_withMGpreconditioner,
7270
:PreconditionedConjugateGradient_withFFTpreconditioner,
7371
)
7472

@@ -87,8 +85,6 @@ for N in 10:10:250
8785
if implicit_free_surface_solver == :PreconditionedConjugateGradient_withFFTpreconditioner
8886
fft_preconditioner = FFTImplicitFreeSurfaceSolver(grid)
8987
free_surface = ImplicitFreeSurface(solver_method=:PreconditionedConjugateGradient, preconditioner=fft_preconditioner, reltol=sqrt(eps(eltype(grid))), abstol=0)
90-
elseif implicit_free_surface_solver == :HeptadiagonalIterativeSolver
91-
free_surface = ImplicitFreeSurface(solver_method=implicit_free_surface_solver, tolerance=sqrt(eps(eltype(grid))))
9288
else
9389
free_surface = ImplicitFreeSurface(solver_method=implicit_free_surface_solver, reltol=sqrt(eps(eltype(grid))), abstol=0)
9490
end

benchmark/benchmark_spai_preconditioner.jl

Lines changed: 0 additions & 50 deletions
This file was deleted.

ext/OceananigansAMDGPUExt.jl

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -67,15 +67,6 @@ end
6767

6868
@inline AC.unsafe_free!(a::ROCArray) = AMDGPU.unsafe_free!(a)
6969

70-
@inline AC.constructors(::AC.GPU{ROCBackend}, A::SparseMatrixCSC) = (ROCArray(A.colptr), ROCArray(A.rowval), ROCArray(A.nzval), (A.m, A.n))
71-
@inline AC.constructors(::AC.CPU, A::ROCSparseMatrixCSC) = (A.dims[1], A.dims[2], Int64.(Array(A.colPtr)), Int64.(Array(A.rowVal)), Array(A.nzVal))
72-
@inline AC.constructors(::AC.GPU{ROCBackend}, A::ROCSparseMatrixCSC) = (A.colPtr, A.rowVal, A.nzVal, A.dims)
73-
74-
@inline AC.arch_sparse_matrix(::AC.GPU{ROCBackend}, constr::Tuple) = ROCSparseMatrixCSC(constr...)
75-
@inline AC.arch_sparse_matrix(::AC.CPU, A::ROCSparseMatrixCSC) = SparseMatrixCSC(AC.constructors(AC.CPU(), A)...)
76-
@inline AC.arch_sparse_matrix(::AC.GPU{ROCBackend}, A::SparseMatrixCSC) = ROCSparseMatrixCSC(AC.constructors(AC.GPU(), A)...)
77-
@inline AC.arch_sparse_matrix(::AC.GPU{ROCBackend}, A::ROCSparseMatrixCSC) = A
78-
7970
@inline convert_to_device(::ROCGPU, args) = AMDGPU.rocconvert(args)
8071
@inline convert_to_device(::ROCGPU, args::Tuple) = map(AMDGPU.rocconvert, args)
8172

ext/OceananigansCUDAExt.jl

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -89,15 +89,6 @@ end
8989

9090
@inline AC.unsafe_free!(a::CuArray) = CUDA.unsafe_free!(a)
9191

92-
@inline AC.constructors(::AC.GPU{CUDABackend}, A::SparseMatrixCSC) = (CuArray(A.colptr), CuArray(A.rowval), CuArray(A.nzval), (A.m, A.n))
93-
@inline AC.constructors(::AC.CPU, A::CuSparseMatrixCSC) = (A.dims[1], A.dims[2], Int64.(Array(A.colPtr)), Int64.(Array(A.rowVal)), Array(A.nzVal))
94-
@inline AC.constructors(::AC.GPU{CUDABackend}, A::CuSparseMatrixCSC) = (A.colPtr, A.rowVal, A.nzVal, A.dims)
95-
96-
@inline AC.arch_sparse_matrix(::AC.GPU{CUDABackend}, constr::Tuple) = CuSparseMatrixCSC(constr...)
97-
@inline AC.arch_sparse_matrix(::AC.CPU, A::CuSparseMatrixCSC) = SparseMatrixCSC(AC.constructors(AC.CPU(), A)...)
98-
@inline AC.arch_sparse_matrix(::AC.GPU{CUDABackend}, A::SparseMatrixCSC) = CuSparseMatrixCSC(AC.constructors(AC.GPU(), A)...)
99-
@inline AC.arch_sparse_matrix(::AC.GPU{CUDABackend}, A::CuSparseMatrixCSC) = A
100-
10192
@inline AC.convert_to_device(::CUDAGPU, args) = CUDA.cudaconvert(args)
10293
@inline AC.convert_to_device(::CUDAGPU, args::Tuple) = map(CUDA.cudaconvert, args)
10394

src/Architectures.jl

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@ export AbstractArchitecture, AbstractSerialArchitecture
44
export CPU, GPU, ReactantState
55
export device, device!, ndevices, synchronize, architecture, unified_array, device_copy_to!
66
export array_type, on_architecture
7-
export constructors, unpack_constructors, copy_unpack_constructors
8-
export arch_sparse_matrix, child_architecture
7+
export child_architecture
98

109
using Adapt
1110
using OffsetArrays
@@ -117,18 +116,4 @@ unified_array(::GPU, a) = a
117116
@inline convert_to_device(arch, args) = args
118117
@inline convert_to_device(::CPU, args) = args
119118

120-
# Utils for sparse matrix manipulation
121-
@inline constructors(::CPU, A::SparseMatrixCSC) = (A.m, A.n, A.colptr, A.rowval, A.nzval)
122-
@inline constructors(::CPU, m::Number, n::Number, constr::Tuple) = (m, n, constr...)
123-
@inline constructors(::GPU, m::Number, n::Number, constr::Tuple) = (constr..., (m, n))
124-
125-
@inline unpack_constructors(::CPU, constr::Tuple) = (constr[3], constr[4], constr[5])
126-
@inline unpack_constructors(::GPU, constr::Tuple) = (constr[1], constr[2], constr[3])
127-
128-
@inline copy_unpack_constructors(::CPU, constr::Tuple) = deepcopy((constr[3], constr[4], constr[5]))
129-
@inline copy_unpack_constructors(::GPU, constr::Tuple) = deepcopy((constr[1], constr[2], constr[3]))
130-
131-
@inline arch_sparse_matrix(::CPU, constr::Tuple) = SparseMatrixCSC(constr...)
132-
@inline arch_sparse_matrix(::CPU, A::SparseMatrixCSC) = A
133-
134119
end # module

src/Models/HydrostaticFreeSurfaceModels/HydrostaticFreeSurfaceModels.jl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ include("implicit_free_surface_utils.jl")
6464
include("compute_vertically_integrated_variables.jl")
6565
include("fft_based_implicit_free_surface_solver.jl")
6666
include("pcg_implicit_free_surface_solver.jl")
67-
include("matrix_implicit_free_surface_solver.jl")
6867
include("implicit_free_surface.jl")
6968
include("hydrostatic_free_surface_field_tuples.jl")
7069

src/Models/HydrostaticFreeSurfaceModels/implicit_free_surface.jl

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,10 @@ surface can be obtained using the [`FFTBasedPoissonSolver`](@ref).
6868
6969
`solver_method` can be either of:
7070
* `:FastFourierTransform` for [`FFTBasedPoissonSolver`](@ref)
71-
* `:HeptadiagonalIterativeSolver` for [`HeptadiagonalIterativeSolver`](@ref)
7271
* `:PreconditionedConjugateGradient` for [`ConjugateGradientSolver`](@ref)
7372
7473
By default, if the grid has regular spacing in the horizontal directions then the `:FastFourierTransform` is chosen,
75-
otherwise the `:HeptadiagonalIterativeSolver`.
74+
otherwise the `:PreconditionedConjugateGradient`.
7675
"""
7776
ImplicitFreeSurface(; solver_method=:Default, gravitational_acceleration=g_Earth, solver_settings...) =
7877
ImplicitFreeSurface(nothing, gravitational_acceleration, nothing, nothing, solver_method, solver_settings)
@@ -115,7 +114,7 @@ build_implicit_step_solver(::Val{:Default}, grid::XYRegularRG, settings, gravita
115114
build_implicit_step_solver(Val(:FastFourierTransform), grid, settings, gravitational_acceleration)
116115

117116
build_implicit_step_solver(::Val{:Default}, grid, settings, gravitational_acceleration) =
118-
build_implicit_step_solver(Val(:HeptadiagonalIterativeSolver), grid, settings, gravitational_acceleration)
117+
build_implicit_step_solver(Val(:PreconditionedConjugateGradient), grid, settings, gravitational_acceleration)
119118

120119
@inline explicit_barotropic_pressure_x_gradient(i, j, k, grid, ::ImplicitFreeSurface) = 0
121120
@inline explicit_barotropic_pressure_y_gradient(i, j, k, grid, ::ImplicitFreeSurface) = 0

src/Models/HydrostaticFreeSurfaceModels/matrix_implicit_free_surface_solver.jl

Lines changed: 0 additions & 137 deletions
This file was deleted.

0 commit comments

Comments
 (0)