59 class(
ksp_t),
allocatable,
target,
intent(inout) :: ksp
60 integer,
intent(in),
value :: n
61 character(len=*),
intent(in) :: solver
62 integer,
intent(in) :: max_iter
63 real(kind=
rp),
optional :: abstol
64 class(
pc_t),
optional,
intent(inout),
target :: m
66 if (
allocated(ksp))
then
70 if (trim(solver) .eq.
'cg')
then
78 else if (trim(solver) .eq.
'pipecg')
then
83 call neko_error(
'PipeCG not supported for OpenCL')
89 else if (trim(solver) .eq.
'fusedcg')
then
92 call neko_error(
'FusedCG not supported for OpenCL')
96 call neko_error(
'FusedCG only supported for CUDA/HIP')
98 else if (trim(solver) .eq.
'cacg')
then
100 else if (trim(solver) .eq.
'gmres')
then
108 else if (trim(solver) .eq.
'bicgstab')
then
111 call neko_error(
'Unknown Krylov solver '//trim(solver))
114 if (
present(abstol) .and.
present(m))
then
115 select type(kp => ksp)
117 call kp%init(n, max_iter, m = m, abs_tol = abstol)
119 call kp%init(n, max_iter, m = m, abs_tol = abstol)
121 call kp%init(n, max_iter, m = m, abs_tol = abstol)
123 call kp%init(n, max_iter, m = m, abs_tol = abstol)
125 call kp%init(n, max_iter, m = m, abs_tol = abstol)
127 call kp%init(n, max_iter, m = m, abs_tol = abstol)
129 call kp%init(n, max_iter, m = m, abs_tol = abstol)
131 call kp%init(n, max_iter, m = m, abs_tol = abstol)
133 call kp%init(n, max_iter, m = m, abs_tol = abstol)
135 call kp%init(n, max_iter, m = m, abs_tol = abstol)
137 call kp%init(n, max_iter, m = m, abs_tol = abstol)
139 call kp%init(n, max_iter, m = m, abs_tol = abstol)
141 else if (
present(abstol))
then
142 select type(kp => ksp)
144 call kp%init(n, max_iter, abs_tol = abstol)
146 call kp%init(n, max_iter, abs_tol = abstol)
148 call kp%init(n, max_iter, abs_tol = abstol)
150 call kp%init(n, max_iter, abs_tol = abstol)
152 call kp%init(n, max_iter, abs_tol = abstol)
154 call kp%init(n, max_iter, abs_tol = abstol)
156 call kp%init(n, max_iter, abs_tol = abstol)
158 call kp%init(n, max_iter, abs_tol = abstol)
160 call kp%init(n, max_iter, abs_tol = abstol)
162 call kp%init(n, max_iter, abs_tol = abstol)
164 call kp%init(n, max_iter, abs_tol = abstol)
166 call kp%init(n, max_iter, abs_tol = abstol)
168 else if (
present(m))
then
169 select type(kp => ksp)
171 call kp%init(n, max_iter, m = m)
173 call kp%init(n, max_iter, m = m)
175 call kp%init(n, max_iter, m = m)
177 call kp%init(n, max_iter, m = m)
179 call kp%init(n, max_iter, m = m)
181 call kp%init(n, max_iter, m = m)
183 call kp%init(n, max_iter, m = m)
185 call kp%init(n, max_iter, m = m)
187 call kp%init(n, max_iter, m = m)
189 call kp%init(n, max_iter, m = m)
191 call kp%init(n, max_iter, m = m)
193 call kp%init(n, max_iter, m = m)
196 select type(kp => ksp)
198 call kp%init(n, max_iter)
200 call kp%init(n, max_iter)
202 call kp%init(n, max_iter)
204 call kp%init(n, max_iter)
206 call kp%init(n, max_iter)
208 call kp%init(n, max_iter)
210 call kp%init(n, max_iter)
212 call kp%init(n, max_iter)
214 call kp%init(n, max_iter)
216 call kp%init(n, max_iter)
218 call kp%init(n, max_iter)
220 call kp%init(n, max_iter)
228 class(
ksp_t),
allocatable,
intent(inout) :: ksp
230 if (
allocated(ksp))
then
231 select type(kp => ksp)
Defines various Bi-Conjugate Gradient Stabilized methods.
Defines a communication avoiding Conjugate Gradient method.
Defines various Conjugate Gradient methods for accelerators.
Defines various Conjugate Gradient methods.
Defines various Conjugate Gradient methods.
Defines a fused Conjugate Gradient method for accelerators.
Defines various GMRES methods.
Defines various GMRES methods.
Defines various GMRES methods.
subroutine, public krylov_solver_destroy(ksp)
Destroy an interative Krylov solver.
subroutine, public krylov_solver_factory(ksp, n, solver, max_iter, abstol, M)
Initialize an iterative Krylov solver.
Implements the base abstract type for Krylov solvers plus helper types.
integer, parameter neko_bcknd_sx
integer, parameter neko_bcknd_device
integer, parameter neko_bcknd_opencl
integer, parameter, public rp
Global precision used in computations.
Defines a pipelined Conjugate Gradient methods.
Defines a pipelined Conjugate Gradient methods SX-Aurora backend.
Defines a pipelined Conjugate Gradient methods.
Standard preconditioned Bi-Conjugate Gradient Stabilized method.
S-step communication avoiding preconditioned conjugate gradient method.
Standard preconditioned conjugate gradient method.
Device based preconditioned conjugate gradient method.
Standard preconditioned conjugate gradient method (SX version)
Fused preconditioned conjugate gradient method.
Standard preconditioned generalized minimal residual method.
Standard preconditioned generalized minimal residual method.
Standard preconditioned generalized minimal residual method (SX version)
Type for storing initial and final residuals in a Krylov solver.
Base abstract type for a canonical Krylov method, solving .
Pipelined preconditioned conjugate gradient method.
Pipelined preconditioned conjugate gradient method.
Pipelined preconditioned conjugate gradient method for SX-Aurora.
Defines a canonical Krylov preconditioner.