33submodule(
krylov) krylov_fctry
58 character(len=20) :: KSP_KNOWN_TYPES(9) = [character(len=20) :: &
79 module subroutine krylov_solver_factory(object, n, type_name, &
80 max_iter, abstol, m, monitor)
81 class(ksp_t),
allocatable,
intent(inout) :: object
82 integer,
intent(in),
value :: n
83 character(len=*),
intent(in) :: type_name
84 integer,
intent(in) :: max_iter
85 real(kind=
rp),
optional :: abstol
86 class(pc_t),
optional,
intent(in),
target :: M
87 logical,
optional,
intent(in) :: monitor
89 call krylov_solver_allocator(object, type_name)
91 call object%init(n, max_iter, m = m, abs_tol = abstol, monitor = monitor)
93 end subroutine krylov_solver_factory
98 module subroutine krylov_solver_allocator(object, type_name)
99 class(ksp_t),
allocatable,
intent(inout) :: object
100 character(len=*),
intent(in) :: type_name
103 if (
allocated(object))
then
108 select case (trim(type_name))
115 allocate(
cg_t::object)
130 call neko_error(
'PipeCG not supported for OpenCL/Metal')
140 call neko_error(
'FusedCG not supported for OpenCL/Metal')
144 call neko_error(
'FusedCG only supported for CUDA/HIP')
147 case (
'fused_coupled_cg')
150 call neko_error(
'Coupled FusedCG not supported for OpenCL/Metal')
154 call neko_error(
'Coupled FusedCG only supported for CUDA/HIP')
180 do i = 1, krylov_registry_size
181 if (trim(type_name) .eq. trim(krylov_registry(i)%type_name))
then
182 call krylov_registry(i)%allocator(object)
190 end subroutine krylov_solver_allocator
197 module subroutine register_krylov(type_name, allocator)
198 character(len=*),
intent(in) :: type_name
199 procedure(krylov_allocate),
pointer,
intent(in) :: allocator
200 type(krylov_allocator_entry),
allocatable :: temp(:)
203 do i = 1,
size(ksp_known_types)
204 if (trim(type_name) .eq. trim(ksp_known_types(i)))
then
210 do i = 1, krylov_registry_size
211 if (trim(type_name) .eq. trim(krylov_registry(i)%type_name))
then
217 if (krylov_registry_size .eq. 0)
then
218 allocate(krylov_registry(1))
220 allocate(temp(krylov_registry_size + 1))
221 temp(1:krylov_registry_size) = krylov_registry
222 call move_alloc(temp, krylov_registry)
225 krylov_registry_size = krylov_registry_size + 1
226 krylov_registry(krylov_registry_size)%type_name = type_name
227 krylov_registry(krylov_registry_size)%allocator => allocator
228 end subroutine register_krylov
230end submodule krylov_fctry
Defines various Bi-Conjugate Gradient Stabilized methods.
Defines a communication avoiding Conjugate Gradient method.
Defines a coupled Conjugate Gradient methods for accelerators.
Defines a coupled Conjugate Gradient methods.
Defines various Conjugate Gradient methods for accelerators.
Defines various Conjugate Gradient methods.
Defines various Conjugate Gradient methods.
Chebyshev preconditioner.
Chebyshev preconditioner.
Defines a fused Conjugate Gradient method for accelerators.
Defines a fused Conjugate Gradient method for accelerators.
Defines various GMRES methods.
Defines various GMRES methods.
Defines various GMRES methods.
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 neko_bcknd_metal
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.
subroutine, public neko_type_registration_error(base_type, wrong_type, known)
subroutine, public neko_type_error(base_type, wrong_type, known_types)
Reports an error allocating a type for a particular base pointer class.
Standard preconditioned Bi-Conjugate Gradient Stabilized method.
S-step communication avoiding preconditioned conjugate gradient method.
Standard preconditioned conjugate gradient method.
Coupled preconditioned conjugate gradient method.
Device based coupled preconditioned conjugate gradient method.
Device based preconditioned conjugate gradient method.
Standard preconditioned conjugate gradient method (SX version)
Defines a Chebyshev preconditioner.
Defines a Chebyshev preconditioner.
Fused preconditioned conjugate gradient method.
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)
Pipelined preconditioned conjugate gradient method.
Pipelined preconditioned conjugate gradient method.
Pipelined preconditioned conjugate gradient method for SX-Aurora.
Defines a canonical Krylov preconditioner.