Linear Solver
Overview
As mentioned before, a linear solver is required to compute the Newton step in
dx .= jacobian(x)\f(x)Our package supports the following linear solvers:
- KLU (CPU),
cuDSS(NVIDIA GPU),Krylov.jlwithdqgmresandbicgstab(CPU, NVIDIA GPU, AMD GPU),- Any custom linear solver provided by the user.
Preconditioning
Using only an iterative solver leads to divergence and bad performance due to ill-conditioning of the Jacobian. This is a known phenomenon in power systems. That's why this package comes with a block Jacobi preconditioner that is tailored towards GPUs and is proven to work well with power flow problems.
The block-Jacobi preconditioner used in ExaPF has been added to KrylovPreconditioners.jl
Using Metis.jl, the sparse Jacobian is reordered to expose a dense block-diagonal structure, on which a block-Jacobi preconditioner becomes relevant and efficient.

Subsequently, each diagonal block is treated as dense and inverted to form the block-Jacobi preconditioner P.

Compared to incomplete Cholesky and incomplete LU this preconditioner is easily portable to the GPU if the number of blocks is high enough. ExaPF.jl uses the batch BLAS / LAPACK calls from cuBLAS / cuSOLVER or rocBLAS / rocSOLVER to invert the single blocks.
CUDA.@sync pivot, info = CUDA.CUBLAS.getrf_batched!(blocks, true)
CUDA.@sync pivot, info, p.cuJs = CUDA.CUBLAS.getri_batched(blocks, pivot)