Input File Structure¶
hypredrive uses YAML to specify parameters and settings. The YAML content can be
provided either as a file on disk (driver usage) or as an in-memory string
passed directly to HYPREDRV_InputArgsParse from application code. The structure
of the YAML is the same in both cases.
In general, the various keywords are optional and, if not explicitly defined by the
user, default values are used for them. Some keywords such as linear_system are
mandatory for driver use and are marked with required or possibly required,
depending on the value of other keywords.
Note
The YAML parser in hypredrive is case-insensitive, meaning that it works regardless of the presence of lower-case, upper-case, or a mixture of both when defining keys and values.
CLI Overrides (-a/--args)¶
When running the hypredrive driver, it is often convenient to keep a base YAML file
and override a few parameters from the command line.
The driver supports this via the -a / --args flag, followed by key/value pairs in
the form:
--path:to:key <value>
The path:to:key is interpreted as a YAML path where : separates nested blocks.
Overrides are applied after reading the YAML file, so the command line takes precedence
over the file.
Examples (based on examples/ex1.yml):
# Keep solver as PCG, but change max_iter
mpirun -np 1 ./hypredrive-cli examples/ex1.yml -q -a --solver:pcg:max_iter 50
# Switch solver type and set a nested option
mpirun -np 1 ./hypredrive-cli examples/ex1.yml -q -a --solver gmres --solver:gmres:max_iter 30
Note
Overrides must be provided as key/value pairs after
-a.Key/value pairs may introduce settings not present in the base YAML file.
Keys and values must be separated by a space, for example
--solver:pcg:max_iter 50.Values containing spaces or YAML syntax such as
[1, 2]should be quoted for your shell.
General Settings¶
The general section contains global settings that apply to the entire execution of
hypredrive. This section is optional.
warmup- If set to yes, hypredrive will perform a warmup execution to ensure more accurate timing measurements. If no, no warmup is performed. The default value for this parameter is no.statistics- Controls the verbosity of statistics reporting. Accepts integer values or boolean strings (yes/no, on/off, true/false). The default value is 1 (or yes). Available levels:0(or no/off/false) - No statistics reporting.1(or yes/on/true) - Display the basic statistics summary table with execution times, residual norms, and iteration counts for each solve entry.2- Display the basic statistics summary table plus an aggregate summary table showing min, max, average, standard deviation, and total values for build, setup, and solve times, as well as iteration counts. The aggregate table is only shown when there are multiple entries (e.g., when usingnum_repetitions > 1).
use_millisec- Show timings on the statistics summary table in milliseconds. The default value is no, which uses seconds instead.print_config_params- Print the parsed YAML tree to stdout on rank 0 after input parsing. Values:yes/no. Default:yesin driver mode andnoin library mode.num_repetitions- Specifies the number of times the operation should be repeated. Useful for benchmarking and profiling. The default value for this parameter is 1.dev_pool_size- Initial size of the umpire’s device memory pool. This parameter is neglected when hypre is not configured with umpire support. The default value for this parameter is 8 GB.uvm_pool_size- Initial size of the umpire’s unified virtual memory pool. This parameter is neglected when hypre is not configured with umpire support. The default value for this parameter is 8 GB.host_pool_size- Initial size of the umpire’s host memory pool. This parameter is neglected when hypre is not configured with umpire support. The default value for this parameter is 8 GB.pinned_pool_size- Initial size of the umpire’s host memory pool. This parameter is neglected when hypre is not configured with umpire support. The default value for this parameter is 512 MB.exec_policy- Determines whether computations are performed on thehost(CPU) ordevice(GPU). When hypre is built without GPU support the only valid value ishost; otherwise the default isdevice.use_vendor_spgemm- Use vendor-optimized sparse matrix-matrix multiplication (SpGEMM) kernels when available. Values:yes/no. Default:yeson GPU-enabled builds andnootherwise.use_vendor_spmv- Use vendor-optimized sparse matrix-vector multiplication (SpMV) kernels when available. Values:yes/no. Default:yeson GPU-enabled builds andnootherwise.
An example code block for the general section is given below:
general:
warmup: no
statistics: yes
use_millisec: no
print_config_params: yes
num_repetitions: 1
dev_pool_size: 8.0
uvm_pool_size: 8.0
host_pool_size: 8.0
pinned_pool_size: 0.5
exec_policy: device
use_vendor_spgemm: yes
use_vendor_spmv: yes
Linear System¶
The linear_system section describes the linear system that hypredrive will solve. This
section is required.
type- The format of the linear system matrix. Available options areijandmtx. The default value for this parameter isij.matrix_filename- (Required) The filename of the linear system matrix. This parameter does not have a default value.precmat_filename- The filename of the linear system matrix used for computing the preconditioner, which, by default, is set to the original linear system matrix. In the C API,HYPREDRV_LinearSystemSetPrecMatrix(h, mat)overrides this file-based path whenmatis non-NULL.rhs_filename- (Possibly required) The filename of the linear system right hand side vector. This parameter does not have a default value and it is required when therhs_modeis set tofile.x0_filename- (Possibly required) The filename of the initial guess for the linear system left hand side vector. This parameter does not have a default value and it is required when theinit_guess_modeis set tofile. In the C API,HYPREDRV_LinearSystemSetInitialGuess(h, vec)overrides this file/default path whenvecis non-NULL.xref_filename- (Optional) The filename of the reference solution vector used by tagged residual/error reporting. In the C API,HYPREDRV_LinearSystemSetReferenceSolution(h, vec)overrides file/default behavior whenvecis non-NULL.
Degrees of Freedom Map¶
dofmap_filename- (Possibly required) The filename of the degrees of freedom maping array (dofmap) for the linear system. This parameter does not have a default value and it is required when themgrpreconditioner is used.init_guess_mode- Choice of initial guess vector. Available options are:zeros: generates a vector of zeros.ones: generates a vector of ones.random: generates a vector of random numbers between 0 and 1.file: vector is read from file.
The default value for this parameter is
file.Note
In the library API, passing
NULLtoHYPREDRV_LinearSystemSetInitialGuess/HYPREDRV_LinearSystemSetReferenceSolution/HYPREDRV_LinearSystemSetPrecMatrixpreserves the file/default behavior described in this section.rhs_mode- Determines how the right-hand side vector is provided. Available options are the same as forinit_guess_mode.dirname- (Possibly required) Name of the top-level directory storing the linear system data. This option helps remove possible redundancies when informing filenames for the linear system data. This parameter does not have a default value.sequence_filename- (Optional) Path to a lossless-compressed sequence container produced byhypredrive-lsseq. When set, matrix/RHS/(optional) dofmap are read from the container instead ofdirname/*_filename/*_basenamefields. The number of systems is inferred from the container metadata.matrix_basename- (Possibly required) Common prefix used for the filenames of linear system matrices. It can be used to solve multiple matrices stored in a shared directory. This parameter does not have a default value.precmat_basename- (Possibly required) Common prefix used for the filenames of linear system matrices employed in the computation of the preconditioner. If not specified, the matrices used for preconditioning purposes are set to the original linear system matrices formed with matrix_basename.rhs_basename- (Possibly required) Common prefix used for the filenames of linear system right hand sides. It can be used to solve multiple RHS stored in a shared directory. This parameter does not have a default value.dofmap_basename- (Possibly required) Common prefix used for the filenames of dofmap arrays. This parameter does not have a default value.timestep_filename- (Optional) File that maps timesteps to linear-system ids for preconditioner reuse-by-timestep. When usingsequence_filename, this can be omitted if timestep metadata is embedded in the compressed container.init_suffix- (Possibly required) Suffix number of the first linear system of a sequence of systems to be solved. Cannot be used together withset_suffix.last_suffix- (Possibly required) Suffix number of the last linear system of a sequence of systems to be solved. Cannot be used together withset_suffix.set_suffix- (Optional) A list of suffix numbers for each linear system in the sequence (e.g.set_suffix: [0, 2, 5]). Use this when the sequence of systems does not use consecutive suffixes. Cannot be used together withinit_suffixorlast_suffix; ifset_suffixis set, the number of systems is the length of the list.digits_suffix- (Optional) Number of digits used to build complete filenames when using thebasenameordirnameoptions. This parameter has a default value of 5.
An example code block for the linear_system section is given below:
linear_system:
type: ij
x0_filename: IJ.out.x0
rhs_filename: IJ.out.b
matrix_filename: IJ.out.A
precmat_filename: IJ.out.A
dofmap_filename: dofmap
rhs_mode: file
init_guess_mode: file
Compressed sequence containers¶
The hypredrive-lsseq utility can convert a directory-based sequence into a
single lossless container. The output filename extension identifies the low-level
backend (for example .zst.bin or .zlib.bin).
Example packing command:
# Minimal form: auto-detect suffix range + filenames from the first ls_XXXXX directory
hypredrive-lsseq \
--dirname data/poromech2k/np1 \
--output poromech2k_np1_lsseq
# Explicit form (overrides auto-detection)
hypredrive-lsseq \
--dirname data/poromech2k/np1/ls \
--matrix-filename IJ.out.A \
--rhs-filename IJ.out.b \
--dofmap-filename dofmap.out \
--init-suffix 0 \
--last-suffix 24 \
--algo zstd \
--output poromech2k_np1_lsseq
Inspect metadata from an existing packed sequence:
hypredrive-lsseq metadata \
--input poromech2k_np1_lsseq.zst.bin
Unpack back to directory layout:
hypredrive-lsseq unpack \
--input poromech2k_np1_lsseq.zst.bin \
--output-dir poromech2k_np1_unpacked
Example use in YAML:
linear_system:
sequence_filename: poromech2k_np1_lsseq.zst.bin
rhs_mode: file
When sequence_filename is present, hypredrive reads matrix/RHS/(optional) dofmap from
the container. If timestep metadata is embedded in the container, preconditioner reuse by
timestep can use it when timestep_filename is omitted.
Packed sequence files use batched compression per part (one compressed blob per part for values, RHS, and dofmap across all systems), which yields good compression ratios. They embed a mandatory small manifest block (uncompressed) with provenance/debug information (resolved suffix range, input paths, codec, build metadata). This does not affect runtime reconstruction, but is useful when inspecting packed artifacts. See Utilities for the internal container structure.
Solver¶
The solver section is mandatory and it specifies the Krylov solver configuration. The
available options for the Krylov solver type are:
pcg- preconditioned conjugate gradient.bicgstab- bi-conjugate gradient stabilized.gmres- generalized minimal residual.fgmres- flexible generalized minimal residual.
The solver type must be entered as a key in a new indentation level under solver.
Scaling¶
The scaling subsection under solver enables optional diagonal scaling of the linear system before preconditioner setup and Krylov solve. When enabled, the system is transformed as \(B = M A M\), \(c = M b\), solved as \(B y = c\), and the solution is recovered as \(x = M y\).
Available keywords:
enabled- Turn on/off scaling. Available values areyesorno. Default value isno.type- Scaling strategy. Available values are:rhs_l2- Scalar scaling based on the L2 norm of the RHS vector \(b\). Computes \(s = 1/\sqrt{\|b\|_2}\) and applies uniform scaling \(M = s I\).dofmap_mag- Vector scaling computed using Hypre’s tagged scaling API. Requires a dofmap to be provided (see Degrees of Freedom Map). UsesHYPRE_ParCSRMatrixComputeScalingTaggedwith scaling type 1 to compute per-DOF-type scaling weights based on matrix magnitude.dofmap_custom- Vector scaling using user-provided custom scaling values. Requires a dofmap to be provided (see Degrees of Freedom Map). The number of custom values must match the number of unique DOF types in the dofmap. Each DOF type is scaled by the corresponding value in thecustom_valuesarray.
custom_values- (Required fordofmap_custom) Array of scaling values, one per unique DOF type in the dofmap. Must be provided as a YAML sequence. The number of entries must match the number of unique tags in the dofmap (e.g., if dofmap has tags 0, 1, 2, thencustom_valuesmust have 3 entries).
Note
Scaling requires hypre >= 3.0.0. If scaling is enabled on an older build, YAML parsing succeeds but scaling is silently disabled at runtime.
Example configuration with RHS L2 scaling:
solver:
pcg:
max_iter: 100
relative_tol: 1.0e-6
scaling:
enabled: yes
type: rhs_l2
Example configuration with dofmap_mag scaling:
solver:
gmres:
max_iter: 300
relative_tol: 1.0e-6
scaling:
enabled: yes
type: dofmap_mag
linear_system:
dofmap_filename: dofmap.dat
Example configuration with dofmap_custom scaling:
solver:
gmres:
max_iter: 300
relative_tol: 1.0e-6
scaling:
enabled: yes
type: dofmap_custom
custom_values:
- 1.0e5
- 1.0e8
- 1.0e4
linear_system:
dofmap_filename: dofmap.dat
PCG¶
The available keywords to further configure the preconditioned conjugate gradient solver
(pcg) are all optional and given below:
max_iter- Maximum number of iterations. Available values are any positive integer.two_norm- Turn on/off L2 norm for the residual. Available values areyesorno. Default value isyes.rel_change- Turn on/off an additional convergence criteria that checks for a relative change in the solution vector. Available values areyesorno. Default value isno.print_level- Verbosity level for the iterative solver. 1 turns on convergence history reporting. Default value is 0.relative_tol- Relative tolerance based on the norm of the residual vector and used for determining convergence of the iterative solver. Available values are any positive floating point number. Default value is1.0e-6.absolute_tol- Absolute tolerance used for determining convergence of the iterative solver. Available values are any positive floating point number. Default value is0.0, meaning that the absolute tolerance-based convergence criteria is inactive.residual_tol- Tolerance used for determining convergence of the iterative solver and based on the norm of the difference between subsequent residual vectors. Available values are any positive floating point number. Default value is0.0, meaning that the residual tolerance-based convergence criteria is inactive.conv_fac_tol- Tolerance used for determining convergence of the iterative solver and based on the convergence factor ratio of subsequent iterations. Available values are any positive floating point number. Default value is0.0, meaning that the convergence factor tolerance-based convergence criteria is inactive.
The code block representing the default parameter values for the solver:pcg section is
given below:
solver:
pcg:
max_iter: 100
two_norm: yes
rel_change: no
print_level: 1
relative_tol: 1.0e-6
absolute_tol: 0.0
residual_tol: 0.0
conv_fac_tol: 0.0
BiCGSTAB¶
The available keywords to further configure the bi-conjugate gradient stabilized solver
(bicgstab) are all optional and given below:
min_iter- Minimum number of iterations. Available values are any positive integer.max_iter,print_level,relative_tol,absolute_tol,residual_tol, andconv_fac_tol- See PCG for a description of these variables.
The code block representing the default parameter values for the solver:bicgstab section is
given below:
solver:
bicgstab:
min_iter: 0
max_iter: 100
print_level: 1
relative_tol: 1.0e-6
absolute_tol: 0.0
residual_tol: 0.0
conv_fac_tol: 0.0
GMRES¶
The available keywords to further configure the generalized minimal residual solver
(gmres) are all optional and given below:
skip_real_res_check- Skip calculation of the real residual when evaluating convergence. Available values are yes and no. Default value is no.krylov_dim- Dimension of the krylov space. Available values are any positive integer. Default value is 30.min_iter,max_iter,print_level,rel_change,relative_tol,absolute_tol, andconv_fac_tol- See PCG for a description of these variables.
The code block representing the default parameter values for the solver:gmres section is
given below:
solver:
gmres:
min_iter: 0
max_iter: 300
skip_real_res_check: no
krylov_dim: 30
rel_change: no
print_level: 1
relative_tol: 1.0e-6
absolute_tol: 0.0
conv_fac_tol: 0.0
FGMRES¶
The available keywords to further configure the flexible generalized minimal residual
solver (fgmres) are all optional and given below:
min_iter,max_iter,krylov_dim,print_level,relative_tol,absolute_tol- See GMRES for a description of these variables.
The code block representing the default parameter values for the solver:fgmres section is
given below:
solver:
fgmres:
min_iter: 0
max_iter: 300
krylov_dim: 30
print_level: 1
relative_tol: 1.0e-6
absolute_tol: 0.0
Preconditioner¶
The preconditioner section is mandatory and it specifies the preconditioner
configuration. Available options for the preconditioner type are:
amg- algebraic multigrid (BoomerAMG).ilu: incomplete LU factorization.fsai: factorized sparse approximate inverse.mgr: multigrid reduction.
The preconditioner type must be entered as a key in a new indentation level under
preconditioner.
Preconditioner presets¶
Presets are named default configurations that select a preconditioner and apply a small set of tuned settings. They are useful when you want a reasonable default without enumerating all options.
preconditioner:
preset: elasticity-2D
Available presets:
poisson: BoomerAMG defaults (same aspreconditioner: amgwith defaults).elasticity-2D: BoomerAMG defaults withcoarsening.num_functions = 2andcoarsening.strong_th = 0.8.elasticity-3D: BoomerAMG defaults withcoarsening.num_functions = 3andcoarsening.strong_th = 0.8.
Preset names are case-insensitive.
Applications can also register additional preset names at runtime with
HYPREDRV_PreconPresetRegister() before parsing or selecting inputs.
AMG¶
The algebraic multigrid (BoomerAMG) preconditioner can be further configured by the following optional keywords:
max_iter- number of times the preconditioner is applied when it is called. Available values are any positive integer. Default value is 1.tolerance- convergence tolerance of AMG when applied multiple times. Available values are any positive floating point number. Default value is 0.0.print_level- Verbosity level for the preconditioner. Default value is 00- no printout.1- print setup statistics.2- print solve statistics.
interpolation- subsection detailing interpolation options:prolongation_type- choose the prolongation operator. For detailed information, see HYPRE_BoomerAMGSetInterpType. Available options are:mod_classicalleast_squaresdirect_sep_weightsmultipassmultipass_sep_weightsextended+i(default)extended+i_cstandardstandard_sep_weightsblk_classicalblk_classical_diagf_ff_f1extendeddirect_sep_weightsmm_extendedmm_extended+imm_extended+eblk_directone_point
restriction_type- choose the restriction operator. For detailed information, see HYPRE_BoomerAMGSetRestriction. Available options are:p_transpose(default)air_1air_2neumann_air_0neumann_air_1neumann_air_2air_1.5
trunc_factor- truncation factor for computing interpolation. Available values are any non-negative floating point number. Default value is 0.0.max_nnz_row- maximum number of elements per row for interpolation. Available values are any non-negative integer. Default value is 4.
coarsening- subsection detailing coarsening options:type- choose the coarsening method. For detailed information, see HYPRE_BoomerAMGSetCoarsenType. Available options are:cljprsrs3falgoutpmishmis(default)
strong_th- strength threshold used for computing the strength of connection matrix. Available values are any non-negative floating point number. Default value is 0.25.seq_amg_th- maximum size for agglomeration or redundant coarse grid solve. Smaller system are then solved with a sequential AMG. Available values are any non-negative integer. Default value is 0.max_coarse_size- maximum size of the coarsest grid. Available values are any non-negative integer. Default value is 64.min_coarse_size- minimum size of the coarsest grid. Available values are any non-negative integer. Default value is 0.max_levels- maximum number of levels in the multigrid hierarchy. Available values are any non-negative integer. Default value is 25.num_functions- size of the system of PDEs, when using the systems version. Available values are any positive integer. Default value is 1.filter_functions- turn on/off filtering based on inter-variable couplings for systems of equations. For more information, see HYPRE_BoomerAMGSetFilterFunctions. Default value is off.rap2- whether or not to use two matrix products to compute coarse level matrices. Available values are any non-negative integer. Default value is 0.mod_rap2- whether or not to use two matrix products with modularized kernels for computing coarse level matrices. Available values are any non-negative integer. Default value is 0 for CPU runs or 1 for GPU runs.keep_transpose- whether or not to save local interpolation transposes for more efficient matvecs during the solve phase. Available values are any non-negative integer. Default value is 0 for CPU runs or 1 for GPU runs.max_row_sum- parameter that modifies the definition of strength for diagonal dominant portions of the matrix. Available values are any non-negative floating point number. Default value is 0.9.
aggressive- subsection detailing aggressive coarsening options:prolongation_type- choose the prolongation type used in levels with aggressive coarsening turned on. For detailed information, see HYPRE_ParCSRHybridSetAggInterpType. Available options are:2_stage_extended+i2_stage_standard2_stage_extendedmultipass(default)mm_extendedmm_extended+imm_extended+e
num_levels- number of levels with aggressive coarsening turned on. Available values are any positive integer. Default value is 0.num_paths- degree of aggressive coarsening. Available values are any positive integer. Default value is 1.trunc_factor- truncation factor for computing interpolation in aggressive coarsening levels. Available values are any non-negative floating point number. Default value is 0.0.max_nnz_row- maximum number of elements per row for computing interpolation in aggressive caorsening levels. Available values are any non-negative integer. Default value is 4.P12_trunc_factor- truncation factor for matrices P1 and P2 which are used to build 2-stage interpolation. Available values are any non-negative floating point number. Default value is 0.0.P12_max_elements- maximum number of elements per row for matrices P1 and P2 which are used to build 2-stage interpolation. Available values are any non-negative integer. Default value is 0, meaning there is no maximum number of elements per row.
relaxation- subsection detailing relaxation options:down_type- relaxation method used in the pre-smoothing stage. For detailed information, see HYPRE_BoomerAMGSetRelaxType. Available options are:jacobi_non_mv: legacy Jacobi implementation.forward-hgs: forward hybrid Gauss-Seidel.chaotic-hgs: chaotic hybrid Gauss-Seidel.hsgs: hybrid symmetric Gauss-Seidel.jacobi: Jacobi (based on SpMVs).l1-hsgs: L1-scaled hybrid symmetric Gauss-Seidel.2gs-it1: single iteration two stage Gauss-Seidel.2gs-it2: double iteration two stage Gauss-Seidel.forward-hl1gs: forward hybrid L1-scaled Gauss-Seidel (default).cg: conjugate gradient.chebyshev: chebyshev polinomial.l1-jacobi: L1-scaled Jacobi.l1sym-hgs: L1-scaled symmetric hybrid Gauss-Seidel (with convergent L1 factor).
up_type- relaxation method used in the post-smoothing stage. For detailed information, see HYPRE_BoomerAMGSetRelaxType. Available options are:jacobi_non_mv: legacy Jacobi implementation.backward-hgs: backward hybrid Gauss-Seidel.chaotic-hgs: chaotic hybrid Gauss-Seidel.hsgs: hybrid symmetric Gauss-Seidel.jacobi: Jacobi (based on SpMVs).l1-hsgs: L1-scaled hybrid symmetric Gauss-Seidel.2gs-it1: single iteration two stage Gauss-Seidel.2gs-it2: double iteration two stage Gauss-Seidel.backward-hl1gs: backward hybrid L1-scaled Gauss-Seidel (default).cg: conjugate gradient.chebyshev: chebyshev polinomial.l1-jacobi: L1-scaled Jacobi.l1sym-hgs: L1-scaled symmetric hybrid Gauss-Seidel (with convergent L1 factor).
coarse_type- relaxation method used in the coarsest levels. For detailed information, see HYPRE_BoomerAMGSetRelaxType. Available options are:jacobi_non_mv: legacy Jacobi implementation.hsgs: hybrid symmetric Gauss-Seidel.jacobi: Jacobi (based on SpMVs).l1-hsgs: L1-scaled hybrid symmetric Gauss-Seidel.ge: hypre’s gaussian elimination.2gs-it1: single iteration two stage Gauss-Seidel.2gs-it2: double iteration two stage Gauss-Seidel.cg: conjugate gradient.chebyshev: chebyshev polinomial.l1-jacobi: L1-scaled Jacobi.l1sym-hgs: L1-scaled symmetric hybrid Gauss-Seidel (with convergent L1 factor).lu_piv: LU factorization with pivoting.lu_inv: explicit LU inverse.
down_sweeps- number of pre-smoothing sweeps. Available values are any integer greater or equal than -1, which turns off the selection of sweeps at the specific cycle. Default value is -1.up_sweeps- number of post-smoothing sweeps. Available values are any integer greater or equal than -1, which turns off the selection of sweeps at the specific cycle. Default value is -1.coarse_sweeps- number of smoothing sweeps in the coarsest level. Available values are any integer greater or equal than -1, which turns off the selection of sweeps at the specific cycle. Default value is -1.num_sweeps- number of pre and post-smoothing sweeps. Available values are any non-negative integer. Default value is 1.order- order in which the points are relaxed. For available options, see HYPRE_BoomerAMGSetRelaxOrder. Default value is 0.weight- relaxation weight for smoothed Jacobi and hybrid SOR. For available options, see HYPRE_BoomerAMGSetRelaxWt. Default value is 1.0.outer_weight- outer relaxation weight for hybrid SOR and SSOR. For available options, see HYPRE_BoomerAMGSetOuterWt. Default value is 1.0.
relaxation- subsection detailing complex smoother options:type- complex smoother type. For detailed information, see HYPRE_BoomerAMGSetSmoothType. Available options are:fsai: factorized sparse approximate inverse.ilu: incomplete LU factorization.schwarz: Additive/Multiplicative overlapping Schwarz.pilut: incomplete LU factorization via PILUT.parasails: sparse approximate inverse via Parasails.euclid: incomplete LU factorization via Euclid.
num_levels- number of levels starting from the finest one where complex smoothers are used. Available values are any non-negative integer. Default value is 0.num_sweeps- number of pre and post-smoothing sweeps used for the complex smoother. Available values are any non-negative integer. Default value is 1.
The default parameter values for the preconditioner:amg section are represented in the
code block below:
preconditioner:
amg:
tolerance: 0.0
max_iter: 1
print_level: 0
interpolation:
prolongation_type: extended+i
restriction_type: p_transpose
trunc_factor: 0.0
max_nnz_row: 4
coarsening:
type: hmis # pmis for GPU runs
strong_th: 0.25
seq_amg_th: 0
max_coarse_size: 64
min_coarse_size: 0
max_levels: 25
num_functions: 1
filter_functions: off
rap2: off
mod_rap2: off # on for GPU runs
keep_transpose: off # on for GPU runs
max_row_sum: 0.9
aggressive:
num_levels: 0
num_paths: 1
prolongation_type: multipass
trunc_factor: 0
max_nnz_row: 0
P12_trunc_factor: 0.0
P12_max_elements: 0
relaxation:
down_type: forward-hl1gs
up_type: backward-hl1gs
coarse_type: ge
down_sweeps: -1
up_sweeps: -1
coarse_sweeps: -1
num_sweeps: 1
order: 0
weight: 1.0
outer_weight: 1.0
smoother:
type: ilu
num_levels: 0
num_sweeps: 1
ILU¶
The incomplete LU factorization (ILU) preconditioner can be further configured by the following optional keywords:
max_iter,tolerance, andprint_level- See AMG for a description of these variables.type- ILU type. For available options, see HYPRE_ILUSetType. Default value is 0 (Block-Jacobi ILU0).fill_level- level of fill when using ILUK. Available values are any non-negative integer. Default value is 0.reordering- reordering method. For available options, see HYPRE_ILUSetLocalReordering. Default value is 0 (no reordering).tri_solve- whether or not to turn on direct triangular solves in the preconditioner’s application phase. Default value is 1.lower_jac_iters- Number of iterations for solving the lower triangular system during the preconditioner’s application phase. Available values are any positive integer. Default value is 5. This option has effect only whentri_solveis set to zero.lower_jac_iters- Number of iterations for solving the upper triangular system during the preconditioner’s application phase. Available values are any positive integer. Default value is 5. This option has effect only whentri_solveis set to zero.max_row_nnz- Maximum number if nonzeros per row when using ILUT. Available values are any positive integer. Default value is 200.schur_max_iter- Maximum number of the Schur system solve. Available values are any positive integer. Default value is 5. This option has effect only whentypeis greater or equal than 10.droptol- Dropping tolerance for computing the triangular factors when using ILUT. Available values are any non-negative floating point numbers. Default value is 1.0e-2.nsh_droptol- Dropping tolerance for computing the triangular factors when using NSH. Available values are any non-negative floating point numbers. Default value is 1.0e-2.
The default parameter values for the preconditioner:ilu section are represented in the
code block below:
preconditioner:
ilu:
tolerance: 0.0
max_iter: 1
print_level: 0
type: 0
fill_level: 0
reordering: 0
tri_solve: 1
lower_jac_iters: 5
upper_jac_iters: 5
max_row_nnz: 200
schur_max_iter: 3
droptol: 1.0e-2
nsh_droptol: 1.0e-2
FSAI¶
The factorized sparse approximate inverse (FSAI) preconditioner can be further configured by the following optional keywords:
max_iter,tolerance, andprint_level- See AMG for a description of these variables.type- algorithm type used for building FSAI. For available options, see HYPRE_FSAISetAlgoType. Default value is 1 (Adaptive) for CPUs and 3 (Static) for GPUs.ls_type- solver type for the local linear systems in FSAI. For available options, see HYPRE_FSAISetLocalSolveType. Default value is 0 (Gauss-Jordan).max_steps- maximum number of steps for computing the sparsity pattern of G. Available values are any positive integer. Default value is 5.max_step_size- step size for computing the sparsity pattern of G. Available values are any positive integer. Default value is 3.max_nnz_row- maximum number of nonzeros per row for computing the sparsity pattern of G. Available values are any positive integer. Default value is 15.num_levels- number of levels for computing the candidate pattern matrix. Available values are any positive integer. Default value is 1.eig_max_iters- number of iterations for estimating the largest eigenvalue of G. Available values are any positive integer. Default value is 5.threshold- Dropping tolerance for building the canditate pattern matrix. Available values are any non-negative floating point numbers. Default value is 1.0e-3.kap_tolerance- Kaporin reduction factor. Available values are any non-negative floating point numbers. Default value is 1.0e-3.
The default parameter values for the preconditioner:fsai section are represented in
the code block below:
preconditioner:
fsai:
tolerance: 0.0
max_iter: 1
print_level: 0
algo_type: 1
ls_type: 0
max_steps: 5
max_step_size: 3
max_nnz_row: 15
num_levels: 1
eig_max_iters: 5
threshold: 1.0e-3
kap_tolerance: 1.0e-3
MGR¶
The multigrid reduction (MGR) preconditioner can be further configured by the following optional keywords:
max_iterandtolerance- See AMG for a description of these variables.print_level- verbosity level for the preconditioner. For available options, see HYPRE_MGRSetPrintLevel. Default value is 0 (no printout).coarse_th- threshold for dropping small entries on the coarse grid. Available values are any non-negative floating point numbers. Default value is 0.0, which means no dropping.level- special keyword for defining specific parameters for each MGR level. Each level is identified by its numeric ID starting from 0 (finest) and placed in increasing order on the next indentation level of the YAML input.f_dofs- (Mandatory) Array containing the identifiers of F (fine) degrees of freedom to be treated in the current level. Available values are any integer numbers from 0 to n_dofs - 1, where n_dofs represent the unique number of degrees of freedom identifiers.f_relaxation- relaxation method targeting F points. For available options, see HYPRE_MGRSetLevelFRelaxType. Default value is 0 (Jacobi). Usenoneto deactivate F-relaxation.g_relaxation- global relaxation method targeting F and C points. For available options, see HYPRE_MGRSetGlobalSmoothType. Default value is 2 (Jacobi). Usenoneto deactivate global relaxation.f_relaxationandg_relaxationalso accept a nested Krylov solver block with an optional nested preconditioner. Supported Krylov solvers arepcg,gmres,fgmres, andbicgstab. Supported nested preconditioners areamg,ilu, andfsai. Nestedpreconditioner: mgris not supported.Example:
f_relaxation: gmres: max_iter: 2 preconditioner: amg: max_iter: 1 coarsening: num_levels: 1
f_relaxationalso supports a nestedmgrblock (MGR-inside-MGR). When using nested MGR (requires Hypre>= 3.1.0with develop number>= 5), the nestedf_dofslabels are not re-labeled: nested levels continue to use the same DOF labels as the parent MGR dofmap (restricted to the parent level’s F-block).Example:
level: 0: f_dofs: [0, 2] f_relaxation: mgr mgr: level: 0: f_dofs: [2] # refers to the same parent label 2 (no relabeling) coarsest_level: amg:
restriction_type- algorithm for computing the restriction operator. For available options, see HYPRE_MGRSetRestrictType. Default value is 0 (Injection).prolongation_type- algorithm for computing the prolongation operator. For available options, see HYPRE_MGRSetInterpType. Default value is 0 (Injection).coarse_level_type- algorithm for computing the coarse level matrices. For available options, see HYPRE_MGRSetCoarseGridMethod. Default value is 0 (Galerkin).
coarsest_level- special keyword for defining specific parameters for MGR’s coarsest level.coarsest_levelalso supports the same nested Krylov solver block described above.
The default parameter values for the preconditioner:mgr section are represented in the
code block below:
preconditioner:
mgr:
tolerance: 0.0
max_iter: 1
print_level: 0
coarse_th: 0.0
level:
0:
f_dofs: [1, 2] # Example usage where DOFs 1 and 2 are treated in MGR's 1st level
f_relaxation: single
sweeps: 1
g_relaxation: none
restriction_type: injection
prolongation_type: jacobi
coarse_level_type: rap
1:
f_dofs: [0] # Example usage where DOF 0 is treated in MGR's 2nd level
f_relaxation: none
g_relaxation:
ilu: # ILU parameters can be specified with a new indentation level
restriction_type: injection
prolongation_type: jacobi
coarse_level_type: rap
coarsest_level:
amg: # AMG parameters can be specified with a new indentation level
Warning
Nested Krylov-in-MGR requires the vendored Hypre build in the hypre/ folder. Make
sure to build Hypre with hypre/build-hypre.sh before building HypreDrive.
Preconditioner reuse¶
When solving a sequence of linear systems (e.g. multiple right-hand sides or time steps), you can reuse the same preconditioner across several systems to avoid repeated setup cost. The preconditioner is rebuilt only at chosen linear-system indices; for the rest, the previous factorization is applied as-is.
A reuse subsection under preconditioner configures this behavior:
``enabled`` – Turn reuse logic on or off. Values:
yes/no. Default:no.``frequency`` – Nonnegative integer. Rebuild when
(linear_system_index) mod (frequency + 1) == 0. So0= rebuild every system,1= rebuild every other, etc.``linear_system_ids`` – Explicit list of 0-based linear-system indices at which to rebuild (e.g.
[0, 5, 10]). Alias:linear_solver_ids. Cannot be combined withfrequencyorper_timestep.``per_timestep`` – If
yes,frequencyis applied per timestep: rebuild at the first system of each timestep, then every(frequency+1)-th system within that timestep. Requireslinear_system.timestep_filenameto point to a timestep file. Values:yes/no. Cannot be combined withlinear_system_ids.
The timestep file (used only when per_timestep: yes) must list how linear systems map
to timesteps. First line: total number of timesteps. Each following line: timestep_id
ls_start, where ls_start is the 0-based index of the first linear system for that
timestep.
Example: frequency-based reuse (rebuild every 3rd system):
preconditioner:
amg: {}
reuse:
enabled: yes
frequency: 2
Example: explicit list of systems at which to rebuild:
preconditioner:
amg: {}
reuse:
enabled: yes
linear_system_ids: [0, 10, 20, 30]
Example: reuse per timestep (rebuild at the first system of each timestep; requires
linear_system.timestep_filename):
linear_system:
timestep_filename: timesteps.txt
preconditioner:
amg: {}
reuse:
enabled: yes
per_timestep: yes
frequency: 0
MGR cannot be fully defined by the ``mgr`` keyword only. Instead, it is also necessary
to specify which types of degrees of freedom are treated as F points in each MGR level,
i.e., the last level where a degree of freedom of a given type is present. This is done
via the ``f_dofs`` keyword. For a minimal MGR configuration input example, see
:ref:`Example3`.