Solvers Made Easy (to use and use together) Thyra, Stratimikos, Handles and More... - PowerPoint PPT Presentation

1 / 36
About This Presentation
Title:

Solvers Made Easy (to use and use together) Thyra, Stratimikos, Handles and More...

Description:

Sandia is a multiprogram laboratory operated by Sandia Corporation, a ... Do a 'grep r What I want to find' .' in your local Trilinos/packages dir. Outline ... – PowerPoint PPT presentation

Number of Views:78
Avg rating:3.0/5.0
Slides: 37
Provided by: trilino
Category:

less

Transcript and Presenter's Notes

Title: Solvers Made Easy (to use and use together) Thyra, Stratimikos, Handles and More...


1
Solvers Made Easy (to use and use
together)Thyra, Stratimikos, Handles and More...
  • Roscoe A. Bartlett
  • Department of Optimization Uncertainty
    Estimation
  • Sandia National Laboratories
  • Trilinos Users Group Meeting, November 7th, 2006

Sandia is a multiprogram laboratory operated by
Sandia Corporation, a Lockheed Martin
Company,for the United States Department of
Energy under contract DE-AC04-94AL85000.
2
Outline
  • Overview of Thyra
  • Why should anyone care about Thyra
  • Stratimikos (unified access to linear solvers
    algebraic preconditioners)
  • Wrapping it up

3
Outline
  • Overview of Thyra
  • Why should anyone care about Thyra
  • Stratimikos (unified access to linear solvers
    algebraic preconditioners)
  • Wrapping it up

4
Categories of Abstract Problems and Abstract
Algorithms
Trilinos Packages
  • Linear Problems
  • Linear equations
  • Eigen problems
  • Preconditioners

Belos
Anasazi
Meros
  • Nonlinear Problems
  • Nonlinear equations
  • Stability analysis

NOX
LOCA
  • Transient Nonlinear Problems
  • DAEs/ODEs

Rythmos
  • Optimization Problems
  • Unconstrained
  • Constrained

MOOCHO Aristos
5
Introducing Abstract Numerical Algorithms
What is an abstract numerical algorithm (ANA)?
An ANA is a numerical algorithm that can be
expressed abstractly solely in terms of vectors,
vector spaces, linear operators, and other
abstractions built on top of these without
general direct data access or any general
assumptions about data locality
  • Key Points
  • ANAs can be very mathematically sophisticated!
  • ANAs can be extremely reusable!
  • Flexibility needed to achieve high performance!

Example Linear Conjugate Gradients
Types of operations
Types of objects
Linear Conjugate Gradient Algorithm
6
Trilinos Strategic Goals
  • Scalable Solvers As problem size and processor
    counts increase, the cost of the solver will
    remain a nearly fixed percentage of the total
    solution time.  
  • Hardened Solvers Never fail unless problem
    essentially unsolvable, in which case we diagnose
    and inform the user why the problem fails and
    provide a reliable measure of error.
  • Full Vertical Coverage Provide leading edge
    capabilities from basic linear algebra to
    transient and optimization solvers.
  • Grand Universal Interoperability All Trilinos
    packages will be interoperable, so that any
    combination of solver packages that makes sense
    algorithmically will be possible within
    Trilinos. 
  • Universal Solver RAS Trilinos will be
  • Reliable Leading edge hardened, scalable
    solutions for each of these applications
  • Available Integrated into every major
    application at Sandia
  • Serviceable Easy to maintain and upgrade within
    the application environment.

Thyra is being developed to address this issue
Courtesy of Mike Heroux, Trilinos Project Leader
7
Interoperability is Especially Important to
Optimization
Numerous interactions exist between layered
abstract numerical algorithms (ANAs) in a
transient optimization problem
Nonlinear Optimizer MOOCHO, ???
  • What is needed to solve problem?
  • Standard interfaces to break O(N2) 1-to-1
    couplings
  • Operators/vectors
  • Linear Solvers
  • Nonlinear solvers
  • Transient solvers
  • etc.

Transient Solver Rythmos, CVODES, IDAS, ???
Iterative Linear Solver AztecOO, Amesos, Belos,
???
Nonlinear Solver NOX, PETSc, ???
Operators and Vectors Epetra, Tpetra, PETSc, ???
Thyra is being developed to address
interoperability of ANAs
Application Charon, Aria, ???
  • Key Points
  • Higher level algorithms, like optimization,
    require a lot of interoperability
  • Interoperability and layering must be easy or
    these configurations will not be achieved in
    practice

8
Examples of ANA Interoperability and Layering
Rythmos
Time Stepper
Implicit Backward Euler method
Newtons method (e.g. NOX)
Nonlinear equations
Operator and Preconditioner applications
Preconditioned GMRES
Linear equations
Matrix-free or Matrix?
Preconditioners can be defined in many different
ways
9
Fundamental Thyra ANA Operator/Vector Interfaces
  • A Few Quick Facts about Thyra Interfaces
  • All interfaces are expressed as abstract C base
    classes (i.e. object-oriented)
  • All interfaces are templated on a Scalar data
    (i.e. generic)
  • The Key to success!
  • Reduction/Transformation Operators
  • Supports all needed element-wise vector
    operations
  • Data/parallel independence
  • Optimal performance

R. A. Bartlett, B. G. van Bloemen Waanders and M.
A. Heroux. Vector Reduction/Transformation
Operators, ACM TOMS, March 2004
10
Preconditioners and Preconditioner Factories
PreconditionerFactoryBase Creates and
initializes PrecondtionerBase objects
ltltcreategtgt
prec
PreconditionerFactoryBase
createPrec() PreconditionerBase initializePrec(
in fwdOpSrc, inout prec )
PreconditionerBase
getLeftPrecOp() LinearOpBase getRightPrecOp()
LinearOpBase getUnspecifiedPrecOp() LinearOpBase
Create preconditioner prec with preconditioner
operators PL and/or PR such that PLA, or APR, or
PLAPR is easier to solve than unpreconditioned
A.
  • Allows unlimited creation/reuse of preconditioner
    objects
  • Supports reuse of factorization structures
  • Adapters currently available for Ifpack and ML
  • New Stratimikos package provides a singe
    parameter-driver wrapper for all of these

11
Linear Operator With Solve and Factories
LinearOpWithSolveBase Combines a linear
operator and a linear solver
LinearOpBase
LinearOpWithSolveBase
solve( in B, inout X, )
  • Appropriate for both direct and iterative solvers
  • Supports multiple simultaneous solutions as
    multi-vectors
  • Allows targeting of different solution criteria
    to different RHSs
  • Supports a default solve

LinearOpWithSolveFactoryBase Uses LinearOpBase
objects to initialize LOWSB objects
LinearOpWithSolveFactoryBase
createOp() LinearOpWithSolveBase initializeOp(
in fwdOpSrc, inout Op ) initializePreconditionedOp
( in fwdOpSrc, in prec, inout Op)
ltltcreategtgt
LinearOpWithSolveBase
  • Allows unlimited creation/reuse of
    LinearOpWithSolveBase objects
  • Supports reuse of factorizations/preconditioners
  • Supports client-created external preconditioners
    (which are ignored by direct solvers)
  • Appropriate for both direct and iterative solvers
  • Concrete adaptors for Amesos, AztecOO, and Belos
    (not released) are available
  • New Stratimikos package provides a single
    parameter-driven wrapper to all of these!

12
Introducing Stratimikos
  • Stratimikos created Greek words "stratigiki
    (strategy) and "grammikos (linear)
  • Defines class ThyraDefaultRealLinearSolverBuilde
    r
  • Provides common access to
  • Linear Solvers Amesos, AztecOO, Belos (dev
    only),
  • Preconditioners Ifpack, ML,
  • Reads in options through a parameter list (read
    from XML?)
  • Accepts any linear system objects that provide
  • Epetra_Operator / Epetra_RowMatrix view of the
    matrix
  • SPMD vector views for the RHS and LHS (e.g.
    Epetra_MultiVector objects)
  • Provides uniform access to linear solver options
    that can be leveraged across multiple
    applications and algorithms

Stay tuned for more detailed Stratimikos example
to come later
13
Client Support Software for Developing ANAs
  • C wrapper functions for prewritten RTOpT
    subclasses
  • e.g. norm_1(x), assign(y,x),
    scale(alpha,y),
  • Composite objects
  • Product vectors, multi-vectors and vector spaces
  • e.g. x v1 v2 v3 vn
  • Decorator and composite subclasses for building
    implicitly composed linear operators
  • Zero operator e.g.
    M 0
  • Identity operator e.g.
    M I
  • Implicit scaled adjoint/transpose e.g. M
    alphaadjoint(A)
  • Additive linear operators e.g. M
    A B C D
  • Multiplicative linear operators e.g. M
    A B C D
  • Block linear linear operators e.g. M
    A, B C, D
  • Handle classes with operator overloading
  • e.g. y alphatrans(A)x
    gammaBz betay

14
Math Notation vs. C Handle Code Example,
Linear CG
Math Notation for CG
C Handles Implementing CG
// Initialization VectorltScalargt r b -
Ax for( int iter 0 iter lt maxNumIters
iter ) Scalar rho inner(r,r) Scalar
beta (iter!0 ? rho/rho_old one)
if(iter!0) p r betap else copyInto(r,p)
q Ap Scalar gamma inner(p,q) Scalar
alpha rho/gamma x Scalar(alpha)p r
Scalar(-alpha)q // Check convergence
rho_old rho
  • Matlab-like notation for linear algebra!
  • Template meta-program methods used to reduce
    operator-overloading overhead and avoid creation
    of temps.
  • Works with any linear operator and vector
    implementation (e.g. Epetra, PETSc, etc.)
  • Works in any computing configuration, i.e.
    serial, SPMD, client/server etc.!
  • Works with any Scalar type (i.e. float, double,
    complexltdoublegt, extended precision, etc.) that
    has a traits class
  • Still some more work to be done Better
    elimination of some temporaries, support for
    multi-vectors

See silliestCgSolve() and Meros for other
examples
15
History Behind Thyra
???
Hilbert Class Library (HCL) Symes et. al.
1995? Rice University Vector spaces, vectors, and
operators
AbstractLinAlgPack (in rSQP) Bartlett,
2001 Sandia National Labs RTOp
Sundance HCL Long et. al., 2000 Sandia National
Labs Smart pointers, Handles
Trilinos Solver Framework (TSF) Long et. al.
2001 Sandia National Labs Renaming of Sundance HCL
TSFCore Bartlett et. al., 2003 Sandia National
Labs ANA Operator/Vector Interfaces
Thyra Thyra developers et. al., 2005 Sandia
National Labs Renaming of TSFCore Operator/Vector
clases, LinearOpWithSolve, ModelEvaluator
16
Finding Your Way Around Thyra
  • Browse Thyra Doxygen documenation
  • Go to the website http//software.sandia.gov/trili
    nos,
  • Click on Thyra (on the right side)
  • Click on Release 7.0 or Development (on the
    left side)
  • Browse the different doxygen documentation
    collections separately
  • You will see Thyra in small chunks!
  • - It is hard to find things you dont know where
    they exist!
  • Or, click on Browse all of Thyra as a single
    doxygen collection and click on single doxygen
    collection
  • You will find everything in Thyra!
  • - You will find everything in Thyra! This will
    not search outside of Thyra pacakge!
  • Click Other Software Related to Thyra and click
    links to other collection
  • Use the Search For box in a Doxygen
    documentation collection (on software!)
  • Within any doxygen collection html page, at the
    fill in Search For box and hit Enter
  • You will search only that doxygen documentation
    collection!
  • - You will search only that doxygen
    documentation collection!
  • Use the Google Search option on the main website
  • Go to the website http//software.sandia.gov/trili
    nos,
  • Click on Search (on the left side)
  • Click Google Search ( Search all packges, -
    Will search dev and all releases!)

17
Outline
  • Overview of Thyra
  • Why should anyone care about Thyra
  • Stratimikos (unified access to linear solvers
    algebraic preconditioners)
  • Wrapping it up

18
Why Should Anyone Care about Thyra?
We will look at answering this question and
provide insights by asking some more questions
  • Do you just want different solvers to work
    together without a lot of work on your part?
  • Do you need to access a solver that accepts input
    through Thyra?
  • Do you want to implement large-scale numerical
    algorithms?
  • Are you responsible for making sure that many
    different solvers all work together in a seamless
    and automatic way?

19
Do you want different solvers to work together?
Do you just want different solvers to work
together without a lot of work on your part?
If your answer is yes then You should care about
Thyra since it makes this possible like has never
been achieved before for as many different types
of numerical algorithms and software!
  • What you need to know about Thyra?
  • Almost nothing! (perhaps not even the name Thyra)
  • What you do not need to know about Thyra?
  • Almost everything about Thyra!

20
Do you want different solvers to work together?
In the long term, most users will form
connections between different solvers by
selecting options from in a parameter list!
Example Time Stepper gt Nonlinear Solver
gt Linear Solver gt Preconditioner
ltParameterListgt ltParameter nameTime
Stepper typestring valueRythmosImplicitBDF
Stepper/gt ltParameterList nameRythmosSUNDIAL
Sgt lt/ParameterListgt ltParameterList
nameRythmosImplicitBDFSteppergt
ltParameter nameNonlinear Solver typestring
valueNOX/gt ltParameterList
nameTimeStepNewtonNonlinearSolvergt
lt/ParameterListgt ltParameterList nameNOXgt
ltParameter nameLinear Solver typestring
valueStratimikos/gt ltParameterList
nameStratimikosgt ltParameter
name"Linear Solver Type" type"string"
valueBelos"/gt ltParameterList
name"Linear Solver Types"gt
ltParameterList nameAmesosgt lt/ParameterListgt
ltParameterList nameAztecOOgt
lt/ParameterListgt ltParameterList
nameBelosgt lt/ParameterListgt
lt/ParameterListgt ltParameter
name"Preconditioner Type" type"string"
value"ML"/gt ltParameterList
name"Preconditioner Types"gt
ltParameterList name"Ifpack"gt lt/ParameterListgt
ltParameterList name"ML"gt
lt/ParameterListgt ltParameterList
nameMeros"gt lt/ParameterListgt
lt/ParameterListgt lt/ParameterListgt
lt/ParameterListgt lt/ParameterListgt lt/ParameterLis
tgt
Lin. Solver
Time Stepper
Nonlinear Solver
Linear Solver
Precond.
End users may not even see the name Thyra!
21
Do you need to access a solver that accepts Thyra
objects?
Do you need to be able to access a numerical
solver that only accepts objects through Thyra
(e.g. Stratimikos)?
If your answer is yes then You have no choice
but to care about Thyra since that is the only
way to access the solver capability!
  • What you need to know about Thyra?
  • How to wrap your objects as Thyra objects
  • Support already provided for your objects (e.g.
    Epetra, Tpetra, etc.)? gt Easy!
  • Support not already provided?
    gt
    Harder!
  • What you do not need to know about Thyra?
  • How interoperability works
  • What utilities there are for developing
    algorithms (e.g. implicit ops, handles etc.)

Stay tuned for more detailed Stratimikos example
to come later
22
Do you want to write large-scale numerical
algorithms?
Are you interested in doing algorithmic research
and writing numerical algorithms that lend
themselves to the ANA approach and
  • maintain a concise mathematical
    description/notation?
  • will run in parallel out of the box?
  • are completely independent of computer platform
    details or MPI?
  • are interoperable with other numerical
    algorithms?
  • provides a straightforward path to a production
    capability?
  • have access to a wide range of large-scale
    production problems?

If your answer is yes then You should care about
Thyra since it makes it relatively easy (but
perhaps not by MATLAB standards) to achieve these
goals and get efficient and maintainable code
that will stand up over time.
  • What you need to know about Thyra?
  • Client support software for developing ANAs
    (e.g. implicit ops, handles etc.)
  • What you do not need to know about Thyra?
  • How interoperability works
  • How to define concrete Thyra objects

23
Are you responsible for ensuring different
solvers work together?
Are you responsible for making sure that
different solver packages all work together in a
seamless and automatic way in many different
configurations?
If your answer is yes then you should care about
Thyra since it makes this possible like no other
middleware has ever done before with the range of
algorithms that can and have been addressed using
Thyra.
  • What you need to know about Thyra?
  • How interoperability works
  • How to define concrete Thyra objects
  • What you do not need to know about Thyra?
  • Client support software for developing ANAs
    (e.g. implicit ops, handles etc.)

24
Why Should Anyone Care about Thyra?
  • Do you just want solver A, solver B, solver C
    etc. to work together without a lot of work on
    your part?
  • Do you need to access a solver that accepts input
    through Thyra?
  • Do you want to implement large-scale numerical
    algorithms?
  • Are you responsible for making sure that solver
    A, solver B, solver C etc. all work together in a
    seamless and automatic way?

Note Very few people (perhaps just me and a few
other people) will answer yes to all four of
these question! Take-home message What you need
to know about Thyra depends on how you interact
with Thyra (if at all)!
25
Outline
  • Overview of Thyra
  • Why should anyone care about Thyra
  • Stratimikos (unified access to linear solvers
    algebraic preconditioners)
  • Wrapping it up

26
Accessing a Solver through Thyra? Stratimikos
Example
  • simple_stratimikos_example.cpp
  • Demonstrates how to solve single-RHS linear
    systems expressed as Epetra objects
  • Typical steps for using a solver that accepts
    Thyra objects
  • Setup the environment for the program
  • gt Read in command-line options
  • Create the input objects using your data
    structures (independent of Thyra)
  • gt Read in linear system objects in terms of
    Epetra objects
  • Wrap your objects as Thyra objects (The glue)
  • gt Use Epetra-to-Thyra wrapper functions
  • Call the solver through Thyra interfaces
    (Thyra-specific)
  • gt Create the LinearOpWithSolveFactoryBase
    objects and solve
  • Post process the solution (if needed) using your
    objects (independent of Thyra)
  • gt Post process solution and check in terms of
    Epetra objects (Not Thyra!!!)

27
A) Setup the environment for the program
// // A) Program setup code //
// // Read options from command-line //
stdstring matrixFile
"" ThyraDefaultRealLinearSolverBuil
der linearSolverBuilder CommandLineProcessor
clp(false) // Don't throw exceptions //
Set up command-line options for the linear solver
that will be used! linearSolverBuilder.setupCL
P(clp) clp.setOption( "matrix-file",
matrixFile ,"Defines the
matrix and perhaps the RHS and LHS for a linear
system to be solved." )
CommandLineProcessorEParseCommandLineReturn
parse_return clp.parse(argc,argv) if(
parse_return ! CommandLineProcessorPARSE_SUCCES
SFUL ) return parse_return
See the file simple_stratimikos_example.cpp for
more details
28
B) Create the input objects using your data
structures
// // B) Epetra-specific code that sets
up the linear system to be solved // //
While the below code reads in the Epetra objects
from a file, you can // setup the Epetra
objects any way you would like. Note that this
next // set of code as nothing to do with
Thyra at all, and it should not. // out
ltlt "\nReading linear system in Epetra format from
the file \'"ltltmatrixFileltlt"\' ...\n" ifdef
HAVE_MPI Epetra_MpiComm comm(MPI_COMM_WORLD)
else Epetra_SerialComm comm endif
RefCountPtrltEpetra_CrsMatrixgt epetra_A
RefCountPtrltEpetra_Vectorgt epetra_x, epetra_b
EpetraExtreadEpetraLinearSystem( matrixFile,
comm, epetra_A, NULL, epetra_x, epetra_b )
if(!epetra_b.get()) out ltlt "\nThe RHS
b was not read in so generate a new random vector
...\n" epetra_b rcp(new
Epetra_Vector(epetra_A-gtOperatorRangeMap()))
epetra_b-gtRandom()
if(!epetra_x.get()) out ltlt "\nThe LHS x
was not read in so generate a new zero vector
...\n" epetra_x rcp(new
Epetra_Vector(epetra_A-gtOperatorDomainMap()))
epetra_x-gtPutScalar(0.0) // Initial guess is
critical!
Create the Epetra objects any way that you would
like
29
C) Wrap your objects as Thyra objects (The glue)
// // C) The "Glue" code that takes
Epetra objects and wraps them as Thyra //
objects // // This next set of code wraps
the Epetra objects that define the linear //
system to be solved as Thyra objects so that they
can be passed to the // linear solver.
// // Create RCPs that will be used to hold
the Thyra wrappers RefCountPtrltconst
ThyraLinearOpBaseltdoublegt gt A
RefCountPtrltThyraVectorBaseltdoublegt gt
x RefCountPtrltconst ThyraVectorBaseltdouble
gt gt b // Create the Thyra wrappers
if(1) // Create an RCP directly to the
EpetraLinearOp so that we can access the //
right range and domains spaces to use to create
the wrappers for the // vector objects.
RefCountPtrltconst ThyraEpetraLinearOpgt
_A Thyracreate_LinearOp(epetra_A) //
Create Thyra wrappers for the vector objects that
will automatically // update the Epetra
objects. b Thyracreate_Vector(epetra_b,_
A-gtspmdRange()) x Thyracreate_Vector(ep
etra_x,_A-gtspmdDomain()) // Set the RCP to
the base linear operator interface A _A

Epetra-to-Thyra wrapper functions are found in
Thyra_EpetraThyraWrappers.hpp
Turning Epetra objects into Thyra objects is easy!
30
D) Call the solver through Thyra interfaces
// // D) Thyra-specific code for solving
the linear system // // Note that this
code has no mention of any concrete
implementation and // therefore can be used
in any use case. // // Reading in the
solver parameters from the parameters file and/or
from // the command line. This was setup by
the command-line options // set by the
setupCLP(...) function above.
linearSolverBuilder.readParameters(out.get())
// Create a linear solver factory given
information read from the // parameter list.
RefCountPtrltThyraLinearOpWithSolveFactoryBase
ltdoublegt gt lowsFactory linearSolverBuilder
.createLinearSolveStrategy("") // Setup
output stream and the verbosity level
lowsFactory-gtsetOStream(out)
lowsFactory-gtsetVerbLevel(TeuchosVERB_LOW)
// Create a linear solver based on the forward
operator A RefCountPtrltThyraLinearOpWithSolv
eBaseltdoublegt gt lows ThyralinearOpWithSo
lve(lowsFactory,A) // Solve the linear
system (note the initial guess in 'x' is
critical) ThyraSolveStatusltdoublegt
status Thyrasolve(lows,ThyraNOTRANS,b,x)
out ltlt "\nSolve status\n" ltlt status
// Write the linear solver parameters after they
were read linearSolverBuilder.writeParamsFile(
lowsFactory)
  • This part of the code has nothing to do with
    Epetra!
  • This is really only a trivial interaction with
    Thyra!

31
E) Post process the solution (if needed) using
your objects
// // E) Post process the solution and
check the error // // Note that the below
code is based only on the Epetra objects
themselves // and does not in any way depend
or interact with any Thyra-based // objects.
The point is that most users of Thyra can largely
gloss over // the fact that Thyra is really
being used for anything. // // Wipe out
the Thyra wrapper for x to guarantee that the
solution will be // written back to
epetra_x! x Teuchosnull out
ltlt "\nSolution epetra_x2 " ltlt
epetraNorm2(epetra_x) ltlt "\n" out ltlt
"\nTesting the solution error b-Ax/b
computed through the Epetra objects ...\n"
// r b - Ax Epetra_Vector
epetra_r(epetra_b) if(1)
Epetra_Vector epetra_A_x(epetra_A-gtOperatorRangeMa
p()) epetra_A-gtApply(epetra_x,epetra_A_x)
epetra_r.Update(-1.0,epetra_A_x,1.0)
const double nrm_r
epetraNorm2(epetra_r), nrm_b
epetraNorm2(epetra_b), rel_err ( nrm_r /
nrm_b ) const bool passed (rel_err
lt tol) out ltlt "b-Ax/b "
ltlt nrm_r ltlt "/" ltlt nrm_b ltlt " " ltlt rel_err
ltlt " lt tol " ltlt tol ltlt " ? " ltlt ( passed ?
"passed" "failed" ) ltlt "\n"
32
Stratimikos Parameter List and Sublists
ltParameterList nameStratimikosgt ltParameter
name"Linear Solver Type" type"string"
valueAztecOO"/gt ltParameter name"Preconditione
r Type" type"string" value"Ifpack"/gt
ltParameterList name"Linear Solver Types"gt
ltParameterList name"Amesos"gt ltParameter
name"Solver Type" type"string" value"Klu"/gt
ltParameterList name"Amesos Settings"gt
ltParameter name"MatrixProperty" type"string"
value"general"/gt ...
ltParameterList name"Mumps"gt ...
lt/ParameterListgt ltParameterList
name"Superludist"gt ... lt/ParameterListgt
lt/ParameterListgt lt/ParameterListgt
ltParameterList name"AztecOO"gt
ltParameterList name"Forward Solve"gt
ltParameter name"Max Iterations" type"int"
value"400"/gt ltParameter name"Tolerance"
type"double" value"1e-06"/gt
ltParameterList name"AztecOO Settings"gt
ltParameter name"Aztec Solver" type"string"
value"GMRES"/gt ...
lt/ParameterListgt lt/ParameterListgt
... lt/ParameterListgt ltParameterList
name"Belos"gt ... lt/ParameterListgt
lt/ParameterListgt ltParameterList
name"Preconditioner Types"gt ltParameterList
name"Ifpack"gt ltParameter name"Prec Type"
type"string" value"ILU"/gt ltParameter
name"Overlap" type"int" value"0"/gt
ltParameterList name"Ifpack Settings"gt
ltParameter name"fact level-of-fill" type"int"
value"0"/gt ... lt/ParameterListgt
lt/ParameterListgt ltParameterList name"ML"gt
... lt/ParameterListgt lt/ParameterListgt lt/Paramete
rListgt
Top level parameters
Sublists passed on to package code!
Linear Solvers
Every parameter and sublist not in red is handled
by Thyra code and is fully validated!
Preconditioners
See Doxygen documentation for ThyraDefaultRealLi
nearSolverBuilder!
33
Automatically Generated Parameter List
Documentation
Human readable automatically generated
documentation for Stratimikos
Linear Solver Type string Amesos
Determines the type of linear solver that will be
used. The parameters for each solver type
are specified in the sublist "Linear Solver
Types" Valid values "Belos", "Amesos",
"AztecOO" Preconditioner Type string ML
Determines the type of preconditioner that will
be used. This option is only meaningful for
linear solvers that accept preconditioner factory
objects! The parameters for each
preconditioner are specified in the sublist
"Preconditioner Types" Valid values
"None", "Ifpack", "ML" Linear Solver Types -gt
AztecOO -gt Output Every RHS bool 0
Determines if output is created for each
individual RHS (true or 1) or if output
is just created for an entire set of RHSs (false
or 0). Forward Solve -gt Max
Iterations int 400 The maximum
number of iterations the AztecOO solver is
allowed to perform. Tolerance double
1e-06 The tolerence used in the
convergence check (see the convergence test
in the sublist "AztecOO Settings")
AztecOO Settings -gt Aztec Solver
string GMRES Type of linear
solver algorithm to use. Valid
values "CG", "GMRES", "CGS", "TFQMR",
"BiCGStab", "LU" Convergence Test
string r0 The convergence test to
use for terminating the iterative solver.
Valid values "r0", "rhs", "Anorm", "no
scaling", "sol" ... ...
See Doxygen documentation for ThyraDefaultRealLi
nearSolverBuilder! Development version of
Trilinos Only!
34
Open Issues for Stratimikos
  • ThyraDefaultRealLinearSolverBuilder
  • Not every parameter can be read from an XML file
    currently.
  • Common presolve operations (e.g. prescaling and
    singleton filter removal) are not supported yet.
  • Only double precision is supported currently.
  • AztecOO, Amesos, Ifpack, and ML all currently
    require Epetra views of the objects.
  • Future needs
  • Other scalar types (i.e. float,
    stdcomplexltfloatgt, stdcomplexltdoublegt )
  • Specialized/blocked preconditioners (e.g. Meros
    )
  • Smart solver managers (e.g. pick the best
    method automatically)

35
Outline
  • Overview of Thyra
  • Why should anyone care about Thyra
  • Stratimikos (unified access to linear solvers
    algebraic preconditioners)
  • Wrapping it up

36
Summary
  • Thyra interfaces provide minimal but efficient
    connectivity between ANAs and linear algebra
    implementations and applications
  • Thyra is the critical standard for
    interoperability between ANAs in Trilinos
  • Thyra can be used in Serial/SMP, SPMD,
    client/server and master/slave
  • Thyra provides a growing set of optional
    utilities for ANA development and subclass
    implementation support
  • Thyra support for nonlinear ANAs (i.e. the model
    evaluator) is being developed as well as general
    support for linear solvers
  • Thyra interfaces and adapters are provided for
    preconditioner factories and linear solver
    factories (Stratimikos)
  • Thyra adapters are available for Epetra, Amesos,
    AztecOO, Belos, Anasazi, Rythmos, and MOOCHO with
    others on the way (e.g. NOX, )
  • Python/Thyra wrappers are on the way as well
    (Bill Spotz)!
  • Trilinos website
  • http//software.sandia.gov/trilinos
Write a Comment
User Comments (0)
About PowerShow.com