Title: ScaLAPACK
1Introduction to the ACTS Collection Why/How Do We
Use These Tools?
Tony Drummond Computational Research
Division Lawrence Berkeley National
Laboratory University of California, Berkeley -
CS267 April 20, 2006 - Berkeley, California
2Lesson High Quality Software Reusability
Introduction to The ACTS Collection
Hardware - Middleware - Firmware
3ACTS Numerical Tools Functionality
4ACTS Numerical Tools Functionality
5Structure of PETSc
6Hypre Conceptual Interfaces
7Hypre Conceptual Interfaces
INTERFACE TO SOLVERS
List of Solvers and Preconditioners per
Conceptual Interface
8ACTS Numerical Tools Functionality
9ACTS Numerical Tools Functionality
10ACTS Numerical Tools Functionality
11ACTS Numerical Tools Functionality
12ACTS Numerical Tools Functionality
13TAO - Interface with PETSc
14OPT Interfaces
- Four major classes of problems available
- NLF0(ndim, fcn, init_fcn, constraint)
- Basic nonlinear function, no derivative
information available - NLF1(ndim, fcn, init_fcn, constraint)
- Nonlinear function, first derivative information
available - FDNLF1(ndim, fcn, init_fcn, constraint)
- Nonlinear function, first derivative information
approximated - NLF2(ndim, fcn, init_fcn, constraint)
- Nonlinear function, first and second derivative
information available
15ACTS Numerical Tools Functionality
16ACTS Numerical Tools Functionality
17ACTS Numerical Tools Functionality
18ACTS Numerical Tools Functionality
19User Interfaces
Introduction to The ACTS Collection
Command lines
20User Interfaces
Introduction to The ACTS Collection
PyACTS
Ax b
matlabP
Star-P
View_field(T1)
User
NetSolve
21Tool Interoperability Tool-to-Tool
TOOL B
TOOL C
TOOL A
TOOL F
TOOL E
TOOL D
Trilinos
Ex 3
22Component Technology!
Tool C
Tool A
Tool D
Tool B
ESI
CCA
23Introduction to PETSc
- Introducción a PETSC
- Vectors
- Matrices
- PETSc viewers
- Use of Preconditioners in PETSc
- Some examples using PETSc
24What is PETSc?
PETSc Portable Extensible Toolkit for Scientific
Computation
- Developed at Argonne National Laboratory
- Library that supports work with PDE
- Public Domain
- Portable to a variety of platforms
- Project started in 1991.
- Written in C with a fortran interface and OO
flavor
25(No Transcript)
26Nonlinear Solvers
Time Steppers
Newton-based Methods
Other
Euler
Backward Euler
Pseudo Time Stepping
Other
Line Search
Trust Region
Krylov Subspace Methods
Richardson
Chebychev
Other
GMRES
CG
CGS
Bi-CG-STAB
TFQMR
Preconditioners
Additive Schwartz
Block Jacobi
Jacobi
ILU
ICC
LU (Sequential only)
Others
Matrices
Compressed Sparse Row (AIJ)
Blocked Compressed Sparse Row (BAIJ)
Block Diagonal (BDIAG)
Dense
Other
Matrix-free
Distributed Arrays
Index Sets
Indices
Block Indices
Stride
Other
Vectors
27Vectors Fundamental Objects to store fields,
right-hand side vectors, etc. .
Matrices Fundamental Objects to store operators
(like Jacobians)
28- Each process owns a piece of the vector
- VECTOR Types Sequential, MPI or SHARED
- VecCreate(MPI_Comm Comm,Vec v)
- comm - MPI_Comm parallel processes
- v vector
- VecSetType(Vec,VecType)
- Valid Types are
- VEC_SEQ, VEC_MPI, o VEC_SHARED
- VecSetSizes(Vec v,int n, int N)
- Where n or N (not both) can be
- PETSC_DECIDE
- VecDestroy(Vec )
29PETSc - Vector Example (in C)
include petscvec.h int main(int argc,char
argv) Vec x
int n 20,m4, ierr
PetscInitialize(argc,argv)
VecCreate(PETSC_COMM_WORLD,x)
VecSetSizes(x,PETSC_DECIDE,n)
VecSetFromOptions(x) lt-- USER_CODEWork with
PETSc VECTOR --gt PetscFinalize()
return 0
30(No Transcript)
31- Types
- default sparse AIJ MPIAIJ, SEQAIJ
- block sparse AIJ (for multi-component PDEs)
MPIAIJ, SEQAIJ - symmetric block sparse AIJ MPISBAIJ, SAEQSBAIJ
- block diagonal MPIBDIAG, SEQBDIAG
- dense MPIDENSE, SEQDENSE
- matrix-free
- MatCreate(MPI_Comm Comm, Mat A)
- MPI_Comm - group of process that work on A
- MatSetSizes(Mat A, PetscInt m, PetscInt n,
PetscInt M, PetscInt N) - MatSetType(Mat,MatType)
- MatDestroy(Mat)
32- Single user interface to matrices (operators)
- Input values to a PETSc matrix
- MatSetValues(Mat mat,PetscInt m,const PetscInt
idxm,PetscInt n,const PetscInt idxn,const
PetscScalar v,InsertMode addv) - Matriz-vector multiplication
- For instance MatMult(A,y,x) (y?x)
- Matrix viewing
- MatView()
- Multiple underlying implementations
- AIJ, block AIJ, symmetric block AIJ, block
diagonal, dense, matrix-free, etc.
33Block-Row distribution per process
M8,N8,m3,nk1 rstart0,rend4
proc 1
M8,N8,m3,nk2 rstart3,rend6
proc 2
M8,N8,m2,n k3 rstart6,rend8
proc 3
- The values of k1, k2 y k3 depend on the
application and must be compatible with vector x
(Axb) - MatGetOwnershipRange(Mat A, int rstart, int
rend) - rstart first global row number that belongs
to a process - rend -1 Last row global number that belongs to
a process
34PETSc Matrix Example
- Included in PETSc Distribution
- PETSC_DIR/src/mat/tutorial/ex2.c
- PETSC_DIR/src/mat/tutorial/ex5.c
35- Obtain basic information on PETSc viewers
- Run time options
- Extract data that can be later use by other
packages/app. programs. - vector fields, matrix contents
- various formats (ASCII, binary)
- Visualization
- simple graphics created with X11 to display
vector campo, non-zero element structure of a
matrix, etc.
36- MatView(Mat A, PetscViewer v)
- Runtime options available after matrix assembly
- -mat_view_info Information related to matrix type
- -mat_view_draw nonzero pattern
- -mat_view
- data in ASCII
- etc.
37Examples of Viewers and Matrices
- Included in PETSc Distribution
- PETSC_DIR/src/mat/tests/ex2.c
- Using the -mat_view_info_detailed, etc
- PETSC_DIR/src/mat/tests/ex3.c
- Using the -mat-view-draw
38- Objective Support the solution of Linear System
of the form, - Axb,
- Krylov Subspace methods are highly dependent of
the spectrum of the matrix A. The use of
preconditioners can speed-up their convergence.
KRYLOV SUBSPACE METHODS PRECONDITIONERS R.
Freund, G. H. Golub, and N. Nachtigal. Iterative
Solution of Linear Systems,pp 57-100. ACTA
Numerica. Cambridge University Press, 1992.
39 40Main Routine
PETSc
Linear Solvers (SLES)
Solve Ax b
PC
KSP
Application Initialization
Evaluation of A and b
Post- Processing
PETSc code
User code
41Krylov Methods (KSP)
Preconditioners (PC)
- Block Jacobi
- Overlapping Additive Schwarz
- ICC, ILU via BlockSolve95
- ILU(k), LU
- etc.
- Conjugate Gradient
- GMRES
- CG-Squared
- Bi-CG-stab
- Transpose-free QMR
- Chebychev
- CGNE
- Many more (check manual)
42(No Transcript)
43Time Stepper Types (TS)
TS_EULER - Euler TS_SUNDIALS- SUNDIALS
interface TS_BEULER - Backward Euler TS_PSEUDO-
Pseudo-timestepping