33submodule(
krylov) krylov_fctry
61 character(len=20) :: KSP_KNOWN_TYPES(10) = [character(len=20) :: &
83 module subroutine krylov_solver_factory_components(object, n, type_name, &
84 max_iter, abstol, m, monitor)
85 class(ksp_t),
allocatable,
intent(inout) :: object
86 integer,
intent(in),
value :: n
87 character(len=*),
intent(in) :: type_name
88 integer,
intent(in) :: max_iter
89 real(kind=
rp),
optional :: abstol
90 class(pc_t),
optional,
intent(in),
target :: M
91 logical,
optional,
intent(in) :: monitor
93 call krylov_solver_allocator(object, type_name)
95 call object%init(n, max_iter, m = m, abs_tol = abstol, monitor = monitor)
97 end subroutine krylov_solver_factory_components
105 module subroutine krylov_solver_factory_json(object, n, json, m)
106 class(ksp_t),
allocatable,
intent(inout) :: object
107 integer,
intent(in),
value :: n
108 type(json_file),
intent(inout) :: json
109 class(pc_t),
optional,
intent(in),
target :: M
110 character(len=:),
allocatable :: type_name
112 call json_get(json,
'type', type_name)
113 call krylov_solver_allocator(object, type_name)
115 call object%init_from_json(n, json, m = m)
117 end subroutine krylov_solver_factory_json
122 module subroutine krylov_solver_allocator(object, type_name)
123 class(ksp_t),
allocatable,
intent(inout) :: object
124 character(len=*),
intent(in) :: type_name
127 if (
allocated(object))
then
132 select case (trim(type_name))
139 allocate(
cg_t::object)
154 call neko_error(
'PipeCG not supported for OpenCL/Metal')
164 call neko_error(
'FusedCG not supported for OpenCL/Metal')
168 call neko_error(
'FusedCG only supported for CUDA/HIP')
171 case (
'fused_coupled_cg')
174 call neko_error(
'Coupled FusedCG not supported for OpenCL/Metal')
178 call neko_error(
'Coupled FusedCG only supported for CUDA/HIP')
207 case (
'coupled_bicgstab')
209 call neko_error(
'Coupled BiCGStab is not supported on devices')
215 do i = 1, krylov_registry_size
216 if (trim(type_name) .eq. trim(krylov_registry(i)%type_name))
then
217 call krylov_registry(i)%allocator(object)
225 end subroutine krylov_solver_allocator
232 module subroutine register_krylov(type_name, allocator)
233 character(len=*),
intent(in) :: type_name
234 procedure(krylov_allocate),
pointer,
intent(in) :: allocator
235 type(krylov_allocator_entry),
allocatable :: temp(:)
238 do i = 1,
size(ksp_known_types)
239 if (trim(type_name) .eq. trim(ksp_known_types(i)))
then
245 do i = 1, krylov_registry_size
246 if (trim(type_name) .eq. trim(krylov_registry(i)%type_name))
then
252 if (krylov_registry_size .eq. 0)
then
253 allocate(krylov_registry(1))
255 allocate(temp(krylov_registry_size + 1))
256 temp(1:krylov_registry_size) = krylov_registry
257 call move_alloc(temp, krylov_registry)
260 krylov_registry_size = krylov_registry_size + 1
261 krylov_registry(krylov_registry_size)%type_name = type_name
262 krylov_registry(krylov_registry_size)%allocator => allocator
263 end subroutine register_krylov
265end submodule krylov_fctry
Retrieves a parameter by name or throws an error.
Provides a coupled CPU implementation of the BiCGStab method.
Provides a device implementation of the BiCGStab method.
Provides a CPU implementation of the BiCGStab method.
Defines a communication avoiding Conjugate Gradient method.
Defines a coupled Conjugate Gradient methods for accelerators.
Defines a coupled Conjugate Gradient method.
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.
Utilities for retrieving parameters from the case files.
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.
CPU implementation of the right-preconditioned BiCGStab method.
Coupled right-preconditioned CPU BiCGStab method.
Device implementation of the right-preconditioned BiCGStab method.
S-step communication avoiding preconditioned conjugate gradient method.
CPU implementation of the preconditioned conjugate gradient method.
CPU implementation of the 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.
CPU implementation of the preconditioned standard GMRES 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.