rocALUTION solvers#
This document provides a category-wise listing of the solver APIs along with the information required to use them.
Member documentation for each solver class is on the rocALUTION API library page. The sections below group solvers by category and describe how to use them in practice.
Code structure#
Iterative linear solvers#
Building and solving phase#
Each iterative solver consists of a building step and a solving step. During the building step all necessary auxiliary data is allocated and the preconditioner is constructed. You can now call the solving procedure, which can be called several times.
When the initial matrix associated with the solver is on the accelerator, the solver tries to build everything on the accelerator. However, some preconditioners and solvers (such as FSAI and AMG) must be constructed on the host before being transferred to the accelerator. If the initial matrix is on the host and you want to run the solver on the accelerator, then you need to move the solver to the accelerator, matrix, right-hand side, and solution vector.
// CG solver
CG<LocalMatrix<ValueType>, LocalVector<ValueType>, ValueType> ls;
// Multi-Colored ILU preconditioner
MultiColoredILU<LocalMatrix<ValueType>, LocalVector<ValueType>, ValueType> p;
// Move matrix and vectors to the accelerator
mat.MoveToAccelerator();
rhs.MoveToAccelerator();
x.MoveToAccelerator();
// Set mat to be the operator
ls.SetOperator(mat);
// Set p as the preconditioner of ls
ls.SetPreconditioner(p);
// Build the solver and preconditioner on the accelerator
ls.Build();
// Compute the solution on the accelerator
ls.Solve(rhs, &x);
// CG solver
CG<LocalMatrix<ValueType>, LocalVector<ValueType>, ValueType> ls;
// Multi-Colored ILU preconditioner
MultiColoredILU<LocalMatrix<ValueType>, LocalVector<ValueType>, ValueType> p;
// Set mat to be the operator
ls.SetOperator(mat);
// Set p as the preconditioner of ls
ls.SetPreconditioner(p);
// Build the solver and preconditioner on the host
ls.Build();
// Move matrix and vectors to the accelerator
mat.MoveToAccelerator();
rhs.MoveToAccelerator();
x.MoveToAccelerator();
// Move linear solver to the accelerator
ls.MoveToAccelerator();
// Compute the solution on the accelerator
ls.Solve(rhs, &x);
Clear function and destructor#
See rocalution::Solver::Clear() and the rocalution::Solver class documentation on the rocALUTION API library page.
Numerical update#
Some preconditioners require two phases in the their construction: an algebraic (e.g. compute a pattern or structure) and a numerical (compute the actual values) phase. In cases, where the structure of the input matrix is a constant (e.g. Newton-like methods), it is not necessary to fully reconstruct the preconditioner. In this case, the user can apply a numerical update to the current preconditioner and pass the new operator with rocalution::Solver::ReBuildNumeric(). If the preconditioner/solver does not support the numerical update, then a full rocalution::Solver::Clear() and rocalution::Solver::Build() is performed.
Fixed-Point iteration#
Krylov subspace solvers#
Chebyshev iteration scheme#
Mixed-precision defect correction scheme#
MultiGrid solvers#
The library provides algebraic multigrid and a skeleton for geometric multigrid methods. The BaseMultigrid class itself doesn’t construct data for the method. It contains the solution procedure for V, W and K-cycles. The AMG has two different versions for Local (non-MPI) and for Global (MPI) type of computations.
Geometric multiGrid#
Algebraic multiGrid#
Unsmoothed aggregation AMG#
Smoothed aggregation AMG#
Ruge-stueben AMG#
Pairwise AMG#
Direct linear solvers#
rocalution::DirectLinearSolver, rocalution::LU, rocalution::QR, rocalution::Inversion