GridapTrilinos.jl
GridapTrilinos provides a Gridap.Algebra.LinearSolver implementation backed by Trilinos. The Julia package can be installed and loaded without Trilinos; calls that need the optional C++ backend report how to build it.
Public API
GridapTrilinos.TrilinosSolve — Type
TrilinosSolve(parameter_file::AbstractString)Create a Gridap linear solver backed by Trilinos, using the XML parameter file at parameter_file.
TrilinosSolve implements Gridap.Algebra.LinearSolver. Numerical setup builds a distributed Tpetra matrix and caches the Trilinos solver state so repeated solve! calls can reuse it. The latest solve metadata is available as solver.log after a solve completes.
The package can be loaded without the optional C++ shared library. In that mode constructing TrilinosSolve still succeeds, but setup or solve calls that need Trilinos throw an error explaining how to build the backend.
GridapTrilinos.SolverResult — Type
SolverResultResult object returned by the Trilinos backend after a solve has completed.
Access values with the public properties name, num_iters, residual, solve_time, verbose, and depth, or with the matching accessor functions. A solver's latest result is available as solver.log after Gridap.Algebra.solve! has run.
GridapTrilinos.name — Function
name(result::SolverResult)Return the Trilinos linear solver and preconditioner name reported for a completed solve.
GridapTrilinos.num_iters — Function
num_iters(result::SolverResult)Return the iteration count reported by Trilinos for a completed solve.
GridapTrilinos.residual — Function
residual(result::SolverResult)Return the achieved residual tolerance reported by Trilinos for a completed solve.
GridapTrilinos.solve_time — Function
solve_time(result::SolverResult)Return the elapsed Trilinos solve time in seconds.
GridapTrilinos.verbose — Function
verbose(result::SolverResult)Return the backend verbosity value stored in a SolverResult.
GridapTrilinos.depth — Function
depth(result::SolverResult)Return the backend depth value stored in a SolverResult.
Backend
Build the optional backend after configuring MPI.jl to use the same system MPI as Trilinos. For a registered package installation:
export TRILINOS_ROOT=/path/to/TrilinosInstall
julia -e 'using Pkg; Pkg.build("GridapTrilinos")'For a source checkout with the repository environment activated, use:
export TRILINOS_ROOT=/path/to/TrilinosInstall
julia --project=. -e 'using Pkg; Pkg.build("GridapTrilinos")'The shared library is generated in Julia scratch space:
DEPOT_PATH[1]/scratchspaces/<GridapTrilinos uuid>/trilinos-backend/usr/lib/GridapTrilinos.soBecause the backend is outside the versioned package source directory, it is not lost when Julia replaces the package source tree during an update.