184
Direct Methods and Algebraic Preconditioners for Solving Large and Sparse Systems of Linear Equations Miroslav Tůma Institute of Computer Science Academy of Sciences of the Czech Republic [email protected] Presentation supported by the project by the Grant Agency of the Czech Republic under No. 108/11/095 Liberec, January 23-27, 2012 1 / 125

Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

  • Upload
    others

  • View
    5

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Direct Methods and Algebraic Preconditioners for

Solving Large and Sparse Systems of Linear Equations

Miroslav Tůma

Institute of Computer Science

Academy of Sciences of the Czech Republic

[email protected]

Presentation supported by the project

by the Grant Agency of the Czech Republic

under No. 108/11/095

Liberec, January 23-27, 2012

1 / 125

Page 2: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Outline

1 Foreword

2 Direct methods and algebraic preconditioners

3 Sparsity

4 Direct Methods

5 Notes on direct methods: models, complexity, parallelism

6 Decomposition and computer architectures

7 From direct to iterative methods

8 Algebraic preconditioners and complexity

9 Combining direct and inverse decompositions

10 Conclusions

2 / 125

Page 3: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Introductory notes

Assuming basic knowledge of algebraic iterative (Krylov space) anddirect (dense) solvers (elimination/factorization/solve)

Many techniques can be formulated for both SPD and nonsymmetriccases with only slight algorithmic (but possibly strong theoretical)differences. Orientation in variants of Cholesky and LUdecompositions is assumed.

We will concentrate here on purely algebraic techniques which oftenserve as building blocks for more complex approaches.

Some important techniques are not mentioned at all (MG/MLpreconditioners, DD techniques, row projection techniques).

Some ideas and techniques are only mentioned (block algorithms)Only preconditioning of real systems is considered here.

3 / 125

Page 4: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Outline

1 Foreword

2 Direct methods and algebraic preconditioners

3 Sparsity

4 Direct Methods

5 Notes on direct methods: models, complexity, parallelism

6 Decomposition and computer architectures

7 From direct to iterative methods

8 Algebraic preconditioners and complexity

9 Combining direct and inverse decompositions

10 Conclusions

4 / 125

Page 5: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

The problem

Ax = b

Direct methods

Iterative methods

Practical boundaries between them more and more fuzzy.

But they are principially different.

5 / 125

Page 6: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Direct methods and algebraic preconditioners

Direct methods

Direct methods: the name traditionally used for the approach basedon decomposition and subsequent substitutions

The most simple case: A → LLT or LDLT or LUIn principal = Gaussian elimination. Modern (decompositional) formbased a lot on the work of Householder (end of 1950’s)

◮ Occasionally other decompositions◮ Most work is in the (Cholesky, indefinite, LU) decomposition.◮ But: It is the computer model (sequential, concurrent processors,

multicore, GPU) which decides about the relative complexity of the twosteps.

The algorithms can be made more efficient/stable by the use ofadditional techniques used before, after or during the decomposition.

In particular, solution can be made more precise by an auxiliaryiterative method.

6 / 125

Page 7: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Direct methods and algebraic preconditioners

Iterative methods

Iterative method are usually accompanied by a problemtransformation based on a direct method called preconditioner.

Algebraic preconditioners are tools to convert the problem Ax = binto the one which is easier to solve. They are typically expressed inmatrix form as a transformation like:

MAx = Mb

M can be then used to apply approximation to A−1 to vectors usedin the iterative method.

In practice, it can store approximation to A or A−1 (approximateinverse).

The computation is often based on a relaxation of a direct method,but not always.

7 / 125

Page 8: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Outline

1 Foreword

2 Direct methods and algebraic preconditioners

3 Sparsity

4 Direct Methods

5 Notes on direct methods: models, complexity, parallelism

6 Decomposition and computer architectures

7 From direct to iterative methods

8 Algebraic preconditioners and complexity

9 Combining direct and inverse decompositions

10 Conclusions

8 / 125

Page 9: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Sparsity

Sparsity: taking into account the structure of matrix nonzeros

Absolutely crucial for direct methods: complexity for generally densematrices, sequential case: O(n3) factorization, O(n2) substitutions

Useful for iterative methods as well: repeated multiplications

sparse matrix: its combinatorial structure of zeros and nonzeros canbe exploited

complexity in the sparse case depends on the decomposition model(implementation, completeness/incompleteness)

Dense matrix

dim space dec time (s)

3000 4.5M 5.72

4000 8M 14.1

5000 12.5M 27.5

6000 18M 47.8

Sparse matrix

dim space dec time (s)

10000 40k 0.02

90000 0.36M 0.5

1M 4M 16.6

2M 8M 49.8

9 / 125

Page 10: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Sparsity

SPARSITY!

Sparse decompositions

Exact (direct) decompositions A = LLT , LU (up to thefloating-point model) → Direct methods

Inexact processes able to provide approximation to A−1

◮ incomplete decompositions (A ≈ LLT , LU etc.)◮ incomplete inverse decompositions (A−1 ≈ ZZT , WZT etc. )

→ Preconditioners

10 / 125

Page 11: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Outline

1 Foreword

2 Direct methods and algebraic preconditioners

3 Sparsity

4 Direct Methods

5 Notes on direct methods: models, complexity, parallelism

6 Decomposition and computer architectures

7 From direct to iterative methods

8 Algebraic preconditioners and complexity

9 Combining direct and inverse decompositions

10 Conclusions

11 / 125

Page 12: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Direct methods

Direct decomposition may fill

0 10 20 30 40 50 60

0

10

20

30

40

50

60

nz = 2880 10 20 30 40 50 60

0

10

20

30

40

50

60

nz = 974

12 / 125

Page 13: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Direct methods

Direct decomposition may fill

0 5 10 15 20 25 30 35 40 45

0

5

10

15

20

25

30

35

40

45

nz = 4000 5 10 15 20 25 30 35 40 45

0

5

10

15

20

25

30

35

40

45

nz = 1822

12 / 125

Page 14: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Direct methods

Direct decomposition may fill

0 5 10 15 20 25 30 35 40 45

0

5

10

15

20

25

30

35

40

45

nz = 4000 5 10 15 20 25 30 35 40 45

0

5

10

15

20

25

30

35

40

45

nz = 1050

12 / 125

Page 15: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Direct methods

Direct decomposition may fill

0 5 10 15 20 25 30 35 40 45

0

5

10

15

20

25

30

35

40

45

nz = 4000 5 10 15 20 25 30 35 40 45

0

5

10

15

20

25

30

35

40

45

nz = 1050

Need to describe the fill-in: 1) describe it 2) avoid it

Need to exploit the fill-in structure algorithmically

Or ... we can cut the fill-in and perform an incomplete process ... later

12 / 125

Page 16: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Direct methods

Direct methods - decomposition schemes

Left-looking schemes

Right-looking schemes

Although some techniques and theorems are more general we will dealwith the SPD systems only

13 / 125

Page 17: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Direct methods

Fill-in description

Combinatorial structure of zeros and nonzeros → graphs

∗ ∗∗ ∗ ∗

∗ ∗∗ ∗

∗ ∗∗ ∗ ∗

Fill-in changes during the decomposition: dynamic description

Data structures, implementation with respect to the architecture

14 / 125

Page 18: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Direct methods

Fill-in description

Combinatorial structure of zeros and nonzeros → graphs

∗ ∗ ∗∗ ∗

∗ ∗ ∗ ∗∗ ∗

∗ ∗∗ ∗

Fill-in changes during the decomposition: dynamic description

Data structures, implementation with respect to the architecture

14 / 125

Page 19: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Direct methods

Fill-in description

Combinatorial structure of zeros and nonzeros → graphs

∗ ∗∗ ∗ ∗

∗ ∗∗ ∗

∗ ∗∗ ∗ ∗

Fill-in changes during the decomposition: dynamic description

Data structures, implementation with respect to the architecture

14 / 125

Page 20: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Direct methods

The fill-in changes during the decomposition

Arrow matrix - original matrices

∗ ∗ ∗ ∗ ∗∗ ∗∗ ∗∗ ∗∗ ∗

∗ ∗∗ ∗

∗ ∗∗ ∗

∗ ∗ ∗ ∗ ∗

15 / 125

Page 21: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Direct methods

The fill-in changes during the decomposition

Arrow matrix - structure after elimination

∗ ∗ ∗ ∗ ∗∗ ∗ f f f∗ f ∗ f f∗ f f ∗ f∗ f f f ∗

∗ ∗∗ ∗

∗ ∗∗ ∗

∗ ∗ ∗ ∗ ∗

15 / 125

Page 22: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Direct methods

The fill-in changes during the decomposition

Arrow matrix - structure after elimination

∗ ∗ ∗ ∗ ∗∗ ∗ f f f∗ f ∗ f f∗ f f ∗ f∗ f f f ∗

∗ ∗∗ ∗

∗ ∗∗ ∗

∗ ∗ ∗ ∗ ∗

How to describe and avoid the fill-in dynamically?

15 / 125

Page 23: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Direct methods

Dynamic development of the fill-in

∗ ∗∗ ∗

∗ ∗ ∗∗ ∗ ∗∗ ∗

16 / 125

Page 24: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Direct methods

Dynamic development of the fill-in

∗ ∗∗ ∗

∗ ∗ ∗∗ ∗ ∗∗ ∗

∗ ∗∗ ∗

∗ f ∗ ∗∗ ∗ ∗∗ ∗

elimination of the first row and column

16 / 125

Page 25: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Direct methods

Dynamic development of the fill-in

∗ ∗∗ ∗

∗ ∗ ∗∗ ∗ ∗∗ ∗

∗ ∗∗ ∗

∗ f ∗ f ∗∗ ∗ ∗∗ f ∗

elimination of the second row and column

16 / 125

Page 26: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Direct methods

Dynamic development of the fill-in

∗ ∗∗ ∗

∗ ∗ ∗∗ ∗ ∗∗ ∗

∗ ∗∗ ∗

∗ f ∗ f ∗∗ ∗ ∗ f∗ f ∗

elimination of the third row and column

16 / 125

Page 27: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Direct methods

Dynamic development of the fill-in

∗ ∗∗ ∗

∗ ∗ ∗∗ ∗ ∗∗ ∗

∗ ∗∗ ∗

∗ f ∗ f ∗∗ ∗ ∗ f∗ f ∗

elimination of the third row and column

Formal description: sequence E of elimination matrices

How should be E captured in the graph form?

How should be E stored in the computer?

16 / 125

Page 28: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Direct methods

Dynamic development of the fill-in: II.

∗ ∗ ∗∗ ∗ ∗ ∗∗ ∗ ∗

∗ ∗∗ ∗ ∗

5

1

4

2

3

17 / 125

Page 29: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Direct methods

Dynamic development of the fill-in: II.

∗ ∗ ∗∗ ∗ ∗ ∗∗ ∗ ∗

∗ ∗∗ ∗ ∗

∗ ∗ ∗∗ ∗ f ∗ ∗∗ f ∗ ∗

∗ ∗∗ ∗ ∗

elimination of the first row and column

5

1

4

2

3

5

1

4

2

3

17 / 125

Page 30: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Direct methods

Dynamic development of the fill-in: II.

∗ ∗ ∗∗ ∗ ∗ ∗∗ ∗ ∗

∗ ∗∗ ∗ ∗

∗ ∗ ∗∗ ∗ f ∗ ∗∗ f ∗ f ∗

∗ f ∗ f∗ ∗ f ∗

elimination of the second row and column

5

1

4

2

3

5

1

4

2

3

17 / 125

Page 31: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Direct methods

Dynamic development of the fill-in: III.

5

1

4

2

3

5

1

4

2

3

after 1st step after second step

18 / 125

Page 32: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Direct methods

Dynamic development of the fill-in: III.

5

1

4

2

35

1

4

2

3

after 1st step after second step

The elimination step induces a clique in the graph model

Storing clique instead of a subgraph → complexity?

A clique can be stored just implicitly - storing entries that caused it!

18 / 125

Page 33: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Direct methods

Memory considerations

1st approximation: Data structures for direct methods (here we havejust the SPD case): just data structures for recursive storing of thecliques caused by the elimination?

5

1

4

2

3

5

1

4

2

3

{{1,3},{1,4},{1,5}, {3,4}, {3,5},{4,5}} → {1,3,4,5}

too local, no use of the row/column character of the decomposition

The final “elimination graph” is called the filled graph

19 / 125

Page 34: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Direct methods

Global description of the fill-in

Algorithm

(Fill-in path theorem (Rose, Tarjan, Lueker, 1976)) Let n > i > j.Then lij 6= 0 ⇔ ∃ a path xi, xp1 , . . . , xpt , xj in G(A) such that(∀l ∈ t)(pl < min(i, j)).

i

j

p1p2

Nice global description, but somewhat implicit as well. Does not seemto be an algorithmic one.

20 / 125

Page 35: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Direct methods

Global description of the fill-in: II.

i

j

p1p2

p1

p2

i

j

Graph interpretation of elimination based on the fill-in path theorem

21 / 125

Page 36: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Direct methods

Global description of the fill-in: II.

i

j

p1p2

p1

p2

i

j f

Graph interpretation of elimination based on the fill-in path theorem

21 / 125

Page 37: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Direct methods

Global description of the fill-in: II.

i

j

p1p2

p1

p2

i

j f f

We need some simple data structure enabling to control the fill-ingeneration

We need a symbolic description first for setting up the data structure

The enabler is called the elimination tree

21 / 125

Page 38: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Direct methods

The elimination tree

The elimination tree is a depth-first search tree of the filled graphwith the search started at the vertex xn.

But, what is the depth-first search tree?

1

2

3

4

5

6stack

traversal

7

22 / 125

Page 39: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Direct methods

The elimination tree

The elimination tree is a depth-first search tree of the filled graphwith the search started at the vertex xn.

But, what is the depth-first search tree?

1

2

3

4

5

6stack

traversal

1

1

7

22 / 125

Page 40: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Direct methods

The elimination tree

The elimination tree is a depth-first search tree of the filled graphwith the search started at the vertex xn.

But, what is the depth-first search tree?

1

2

3

4

5

6stack

traversal

1

1

2

2

7

22 / 125

Page 41: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Direct methods

The elimination tree

The elimination tree is a depth-first search tree of the filled graphwith the search started at the vertex xn.

But, what is the depth-first search tree?

1

2

3

4

5

6stack

traversal

1

1

2

2

7 4

4

22 / 125

Page 42: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Direct methods

The elimination tree

The elimination tree is a depth-first search tree of the filled graphwith the search started at the vertex xn.

But, what is the depth-first search tree?

1

2

3

4

5

6stack

traversal

1

1

2

2

7 5

5

4

4

22 / 125

Page 43: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Direct methods

The elimination tree

The elimination tree is a depth-first search tree of the filled graphwith the search started at the vertex xn.

But, what is the depth-first search tree?

1

2

3

4

5

6stack

traversal

1

1

2

2

7 5

5

4

4

3

3

22 / 125

Page 44: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Direct methods

The elimination tree

The elimination tree is a depth-first search tree of the filled graphwith the search started at the vertex xn.

But, what is the depth-first search tree?

1

2

3

4

5

6stack

traversal

1

1

2

2

7 5

5

4

4 3

22 / 125

Page 45: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Direct methods

The elimination tree

The elimination tree is a depth-first search tree of the filled graphwith the search started at the vertex xn.

But, what is the depth-first search tree?

1

2

3

4

5

6stack

traversal

1

1

2

2

7 5

5

4

4 3

6

6

22 / 125

Page 46: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Direct methods

The elimination tree

The elimination tree is a depth-first search tree of the filled graphwith the search started at the vertex xn.

But, what is the depth-first search tree?

1

2

3

4

5

6stack

traversal

1

1

2

2

7 5

5

4

4 3 6

22 / 125

Page 47: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Direct methods

The elimination tree

The elimination tree is a depth-first search tree of the filled graphwith the search started at the vertex xn.

But, what is the depth-first search tree?

1

2

3

4

5

6stack

traversal

1

1

2

2

7

5

4

4 3 6

22 / 125

Page 48: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Direct methods

The elimination tree

The elimination tree is a depth-first search tree of the filled graphwith the search started at the vertex xn.

But, what is the depth-first search tree?

1

2

3

4

5

6stack

traversal

1

1

2

2

7

54 3 6

22 / 125

Page 49: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Direct methods

The elimination tree

The elimination tree is a depth-first search tree of the filled graphwith the search started at the vertex xn.

But, what is the depth-first search tree?

1

2

3

4

5

6stack

traversal

1

1 2

7

54 3 6

22 / 125

Page 50: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Direct methods

The elimination tree

The elimination tree is a depth-first search tree of the filled graphwith the search started at the vertex xn.

But, what is the depth-first search tree?

1

2

3

4

5

6stack

traversal

1

1 2

7

54 3 6

7

7

22 / 125

Page 51: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Direct methods

The elimination tree

The elimination tree is a depth-first search tree of the filled graphwith the search started at the vertex xn.

But, what is the depth-first search tree?

1

2

3

4

5

6stack

traversal

1

1 2

7

54 3 6 7

22 / 125

Page 52: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Direct methods

The elimination tree

The elimination tree is a depth-first search tree of the filled graphwith the search started at the vertex xn.

But, what is the depth-first search tree?

1

2

3

4

5

6stack

traversal 1 2

7

54 3 6 7

22 / 125

Page 53: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Direct methods

The elimination tree: II

∗ ∗ ∗ ∗∗ ∗ ∗ ∗

∗ ∗ ∗∗ ∗ ∗ ∗

∗ ∗ ∗ ∗∗ ∗ ∗ ∗

∗ ∗ ∗∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗

23 / 125

Page 54: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Direct methods

The elimination tree: II

∗ ∗ ∗ ∗∗ ∗ ∗ ∗

∗ ∗ ∗∗ ∗ ∗ ∗

∗ ∗ ∗ ∗∗ ∗ ∗ ∗

∗ ∗ ∗∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗

∗ ∗ ∗ ∗∗ ∗ f ∗ ∗

∗ ∗ ∗∗ ∗ ∗ ∗

∗ f ∗ ∗ f ∗∗ ∗ f ∗ f ∗

∗ f ∗ ∗∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗

23 / 125

Page 55: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Direct methods

The elimination tree: II

∗ ∗ ∗ ∗∗ ∗ ∗ ∗

∗ ∗ ∗∗ ∗ ∗ ∗

∗ ∗ ∗ ∗∗ ∗ ∗ ∗

∗ ∗ ∗∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗

∗ ∗ ∗ ∗∗ ∗ f ∗ ∗

∗ ∗ ∗∗ ∗ ∗ ∗

∗ f ∗ ∗ f ∗∗ ∗ f ∗ f ∗

∗ f ∗ ∗∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗

1

2

5

3

4

6

7

8

storing elimination tree: vector parent

23 / 125

Page 56: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Direct methods

The elimination tree: III

Elimination tree (or its variations) is the most fundamental treestructure connected with the elimination.

Elimination tree is defined via the filled graph (the graph with allfill-in)

But it should be computed from the original matrix A

24 / 125

Page 57: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Direct methods

The elimination tree: IV

The construction

for i = 1 to n doparent(i) = 0for k such that xk ∈ adj(xi) ∧ k < i do

j = kwhile (parent(j) 6= 0 ∧ parent(j) 6= i) do

j = parent(j)end whileif parent(j) = 0 then parent(j) = i

end kend i

25 / 125

Page 58: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Direct methods

The elimination tree: V

The construction

∗ ∗ ∗∗ ∗ ∗

∗ ∗ ∗ ∗∗ ∗ ∗

∗ ∗ ∗ ∗∗ ∗ ∗

26 / 125

Page 59: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Direct methods

The elimination tree: V

The construction

∗ ∗ ∗∗ ∗ ∗

∗ ∗ ∗ ∗∗ ∗ ∗

∗ ∗ ∗ ∗∗ ∗ ∗

∗ ∗ ∗∗ ∗ ∗

∗ ∗ ∗ ∗∗ ∗ f ∗

∗ ∗ ∗ f ∗ f∗ ∗ f ∗

26 / 125

Page 60: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Direct methods

The elimination tree: V

The construction

∗ ∗ ∗∗ ∗ ∗

∗ ∗ ∗ ∗∗ ∗ ∗

∗ ∗ ∗ ∗∗ ∗ ∗

∗ ∗ ∗∗ ∗ ∗

∗ ∗ ∗ ∗∗ ∗ f ∗

∗ ∗ ∗ f ∗ f∗ ∗ f ∗

1

26 / 125

Page 61: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Direct methods

The elimination tree: V

The construction

∗ ∗ ∗∗ ∗ ∗

∗ ∗ ∗ ∗∗ ∗ ∗

∗ ∗ ∗ ∗∗ ∗ ∗

∗ ∗ ∗∗ ∗ ∗

∗ ∗ ∗ ∗∗ ∗ f ∗

∗ ∗ ∗ f ∗ f∗ ∗ f ∗

1 1 2

26 / 125

Page 62: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Direct methods

The elimination tree: V

The construction

∗ ∗ ∗∗ ∗ ∗

∗ ∗ ∗ ∗∗ ∗ ∗

∗ ∗ ∗ ∗∗ ∗ ∗

∗ ∗ ∗∗ ∗ ∗

∗ ∗ ∗ ∗∗ ∗ f ∗

∗ ∗ ∗ f ∗ f∗ ∗ f ∗

1 1 2

3

1

2

26 / 125

Page 63: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Direct methods

The elimination tree: V

The construction

∗ ∗ ∗∗ ∗ ∗

∗ ∗ ∗ ∗∗ ∗ ∗

∗ ∗ ∗ ∗∗ ∗ ∗

∗ ∗ ∗∗ ∗ ∗

∗ ∗ ∗ ∗∗ ∗ f ∗

∗ ∗ ∗ f ∗ f∗ ∗ f ∗

3

13

1

1 1 2

24

2

26 / 125

Page 64: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Direct methods

The elimination tree: V

The construction

∗ ∗ ∗∗ ∗ ∗

∗ ∗ ∗ ∗∗ ∗ ∗

∗ ∗ ∗ ∗∗ ∗ ∗

∗ ∗ ∗∗ ∗ ∗

∗ ∗ ∗ ∗∗ ∗ f ∗

∗ ∗ ∗ f ∗ f∗ ∗ f ∗

42

3

1

5

26 / 125

Page 65: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Direct methods

The elimination tree: V

The construction

∗ ∗ ∗∗ ∗ ∗

∗ ∗ ∗ ∗∗ ∗ ∗

∗ ∗ ∗ ∗∗ ∗ ∗

∗ ∗ ∗∗ ∗ ∗

∗ ∗ ∗ ∗∗ ∗ f ∗

∗ ∗ ∗ f ∗ f∗ ∗ f ∗

42

3

1

542

3

1

56

26 / 125

Page 66: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Direct methods

The elimination tree: VIThe construction of the elimination tree: improved

Problem with long dependency chains during the tree traversal

for i = 1 to n doparent(i) = 0; ancestor(i) = 0for k such that xk ∈ adj(xi) ∧ k < i do

j = kwhile (ancestor(j) 6= 0 ∧ ancestor(j) 6= i) do

j = ancestor(j); ancestor(j) = i; j = tend whileif ancestor(j) = 0 then parent(j) = i; ancestor(j) = i

end kend i

Complexity O(m log2 n). Can be further reduced by other generaltree techniques up to close O(n).

27 / 125

Page 67: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Direct methods

Let us repeat our motivation and goals

How can be the fill-in described (and avoided ... later)? How shouldbe data structures set up?

Row structure of L: row subtrees of the elimination tree

Lemma

For j > i we have lji 6= 0 if and only if xi is an ancestor of some xk in theelimination tree for which ajk 6= 0.

describes fill-in in the j-th row of L, column i

some xk must be precede xi in the elimination tree

just the vertices in the row subtree rooted at xj determine nonzerosin the row j of L

28 / 125

Page 68: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Direct methods

Row subtrees

∗ ∗ ∗

∗ ∗

∗ ∗ ∗

∗ ∗

∗ ∗ ∗

∗ ∗ f ∗

∗ ∗ ∗ ∗ f

∗ ∗ ∗

∗ f ∗ ∗ f

∗ ∗ ∗ ∗ f ∗ f ∗

29 / 125

Page 69: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Direct methods

The elimination tree: VII

∗ ∗ ∗

∗ ∗

∗ ∗ ∗

∗ ∗

∗ ∗ ∗

∗ ∗ f ∗

∗ ∗ ∗ ∗ f

∗ ∗ ∗

∗ f ∗ ∗ f

∗ ∗ ∗ ∗ f ∗ f ∗

1 2 3 4 55

5

6 7

3 4

8

1

9

7 6

10

8

1

2 9

7

3

6

30 / 125

Page 70: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Direct methods: postordering

Labels in subtrees form intervals + parents with higher labels

∗ ∗ ∗∗ ∗ ∗

∗ ∗ ∗ ∗∗ ∗ ∗

∗ ∗ ∗ ∗∗ ∗ ∗

∗ ∗ ∗∗ ∗ ∗

∗ ∗ ∗ ∗∗ ∗ f ∗

∗ ∗ ∗ f ∗ f∗ ∗ f ∗

31 / 125

Page 71: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Direct methods: postordering

Labels in subtrees form intervals + parents with higher labels

∗ ∗ ∗∗ ∗ ∗

∗ ∗ ∗ ∗∗ ∗ ∗

∗ ∗ ∗ ∗∗ ∗ ∗

∗ ∗ ∗∗ ∗ ∗

∗ ∗ ∗ ∗∗ ∗ f ∗

∗ ∗ ∗ f ∗ f∗ ∗ f ∗

42

3

1

5

6

31 / 125

Page 72: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Direct methods: postordering

Labels in subtrees form intervals + parents with higher labels

∗ ∗ ∗∗ ∗ ∗

∗ ∗ ∗ ∗∗ ∗ ∗

∗ ∗ ∗ ∗∗ ∗ ∗

∗ ∗ ∗∗ ∗ ∗

∗ ∗ ∗ ∗∗ ∗ f ∗

∗ ∗ ∗ f ∗ f∗ ∗ f ∗

6

1

5

2

34

31 / 125

Page 73: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Direct methods: postordering

Labels in subtrees form intervals + parents with higher labels

∗ ∗ ∗∗ ∗ ∗

∗ ∗ ∗ ∗∗ ∗ ∗

∗ ∗ ∗ ∗∗ ∗ ∗

∗ ∗ ∗∗ ∗ ∗

∗ ∗ ∗ ∗∗ ∗ f ∗

∗ ∗ ∗ f ∗ f∗ ∗ f ∗

6

1

5

2

34

∗ ∗ ∗∗ ∗ ∗ ∗

∗ ∗ f ∗∗ ∗ ∗

∗ ∗ f ∗ ∗ f∗ ∗ f ∗

31 / 125

Page 74: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Direct methods

The elimination tree: VIII

Why do we need a postordering?Necessary for efficient exploiting of memory hierarchies, pagingenvironment, crucial for multifrontal methods, efficient computationof factor row counts etc.

1

2

5

3

4

6

7

8

6

7

8

1

Postordered tree

2

3

4 5

32 / 125

Page 75: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Direct methods

Row counts: simple algorithm

initialize all colcounts to 1for i = 1 to n do

rowcount(i) = 1mark(xi) = ifor k such that k < i ∧ aik 6= 0 do

j = kwhile mark(xj) 6= i do

rowcount(i) = rowcount(i) + 1colcount(j) = colcount(j) + 1mark(xj) = ij = parent(j)

end whileend k

end i

i

k k’ k’’

k’’’

33 / 125

Page 76: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Direct methods

Row counts: more sophisticated algorithm

i

k k’ k’’

k’’’

Needed: fast algorithm to determine the “junctions” of branches inthe elimination tree,

and fast algorithm to find leaves of the elimination tree.

Just by traversing the postordered elimination tree.

The complexity can be then nearly linear in m.34 / 125

Page 77: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Direct methods

Motivation and goals again

How can be the fill-in described (and avoided ... later)? How shouldbe data structures set up?

It could seem that knowing structure of L by rows is enough.

We then know the size of the factor, we can allocate the final factorstructure

and do just the factorization ...

But, what are the ways to do the factorization (repetition)?

35 / 125

Page 78: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Direct methods

The factorization

Basically, two main ways to factorize a sparse SPD matrix efficiently:1) Column algorithm, 2) Submatrix algorithm

j

i k

Indices i, j, k: traditional meaning for 6 possible ways to describe thedecomposition.In the sparse setting: totally different computational aspects.Still very different implementations possible.Column structure important as well.

36 / 125

Page 79: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Direct methods

It would be nice to know the column structure of L

1

2

5

3

4

6

7

8

row structure column structure

row subtrees ?

37 / 125

Page 80: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Direct methods

Column structure of L

Lemma

Column j is updated by the columns i such that lij 6= 0.

j

i

Lemma

Struct(L∗j) = Struct(A∗j) ∪⋃

i,lij 6=0 Struct(L∗i) \ {1, . . . , j − 1}.

38 / 125

Page 81: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Direct methods

Column structure of L

Lemma

Struct(L∗j) = Struct(A∗j) ∪⋃

i,lij 6=0 Struct(L∗i) \ {1, . . . , j − 1}.

*

*

*

*

**

*

*

**

*

39 / 125

Page 82: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Direct methods

Column structure of L

Lemma

Struct(L∗j) {j} ⊆ Struct(L∗parent(j))

Struct(L∗j) = Struct(A∗j) ∪⋃

i,j=parent(i)

Struct(L∗i) \ {1, . . . , j − 1}.

40 / 125

Page 83: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Direct methods

Column structure of L: algorithm

for j = 1 to n dolist(xj) = ∅

end jfor j = 1 to n do

col(j) = adj(xj) \{x1, . . . , xj−1}for xk ∈ list(xj) do

col(j) = col(j) ∪ col(k) \ {xj}end xk

if col(j) 6= 0 thenp = min{i | xi ∈ col(j)}list(xp) = list(xp) ∪ {xj}

end ifend j

end i

list(x) is nothing more than the list of the vertices y for which wehave parent(y) = x

41 / 125

Page 84: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Direct methods

Recapitulation

Fill-in described both by rows and columns.

How to avoid it: reorderings: just keep in mind the arrow matrixexample

∗ ∗ ∗ ∗ ∗∗ ∗∗ ∗∗ ∗∗ ∗

∗ ∗∗ ∗

∗ ∗∗ ∗

∗ ∗ ∗ ∗ ∗

But this is not enough for an efficient algorithm: we need also blocks

42 / 125

Page 85: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Direct methods

Avoiding fill-in: reorderings: two basic types

local reorderings: based on local greedy criterion

global reorderings: taking into account the whole graph / matrix

Local reorderings

G = G(A)for i = 1 to n do

find v such that degG(v) = minv∈V degG(v)G = Gv

end iThe order of found vertices induces their new renumbering

deg(v) = |Adj(v)|; graph G as a superscript determines the currentgraph

43 / 125

Page 86: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Direct methods

Local reorderings: example

v v

G G_v

44 / 125

Page 87: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Direct methods

Global reorderings: nested dissection

1 7 4 43 22 28 25

3 8 6 44 24 29 27

2 9 5 45 23 30 36

19 20 21 46 40 41 42

10 16 13 47 31 37 34

1712 15 48 33 38 36

11 18 14 49 32 39 35

45 / 125

Page 88: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Direct methods

Global reorderings: nested dissection: tree

1 2

3

4 5

6

7

8

9

10 11 13 14

12 15

16

17

1819

20

21

22 23

24

25 26

27

28

29

30

31 32

33

34 35

36

37

38

3940

41

42

43

44

45

46

47

48

49

46 / 125

Page 89: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Direct methods

Classical local reorderings: shape pushers

****

*******

*******

****

*

**

*******

****

**

*

Band 6

****

*******

*******

****

*

**

*******

****

**

*

Profile 6

****

*******

*******

****

*

**

*******

****

**

*

Frontal method - dynamic band

Movingwindow -

47 / 125

Page 90: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Direct methods

Classical local reorderings: shape pushers

Band(L + LT ) = Band(A)

Profile(L + LT ) = Profile(A)

48 / 125

Page 91: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Direct methods

Blocks

Blocks are absolutely crucial to compute efficiently on contemporarycomputers: we need as much data as possible for a unit of datatransfer inside memory hierarchy.

In BLAS terminology:

z = x + αy −→ Z = X + αY

saxpy −→ dgemm

But we have sparse matrices. It is not so straightforward to split theirnonzeros into blocks.

In fact, we need to reorder them in order to get blocks.◮ Application-based blocks in discretized systems.◮ Graph-based strategies which can be very fast.◮ But we need to optimize the block structure of L: supernodes.◮ Help: again our good friend, the elimination tree.

49 / 125

Page 92: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Direct methods

Supernodes

Definition

Let s, t ∈ {1, . . . , n} such that s + t − 1 ≤ n. Then the columns withindices {s, s + 1, . . . , s + t − 1} form a supernode if these columns satisfyStruct(L∗s) = Struct(L∗s+t−1) ∪ {s, . . . , s + t − 2}, and the sequence ismaximal.

* * * ** * * ** * * ** * * *

s−t+1

**

**

***

** *

s

Can be found in a nearly optimal time by traversing the postordered50 / 125

Page 93: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Direct methods

Supernodes and efficient computation

the loop over rows has no indirect addressing: (dense BLAS1)

���������������������������

���������������������������

��������������������������������������������������

��������������������������������������������������

������������������

51 / 125

Page 94: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Direct methods

Supernodes and efficient computation

the loop over rows has no indirect addressing: (dense BLAS1)

���������������������������

���������������������������

��������������������������������������������������

��������������������������������������������������

������������������

51 / 125

Page 95: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Direct methods

Supernodes and efficient computation

the loop over rows has no indirect addressing: (dense BLAS1)

the loop over columns of the updating supernode can be unrolled tosave memory references (dense BLAS2)

���������������������������

���������������������������

��������������������������������������������������

��������������������������������������������������

������������������

51 / 125

Page 96: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Direct methods

Supernodes and efficient computation

the loop over rows has no indirect addressing: (dense BLAS1)

the loop over columns of the updating supernode can be unrolled tosave memory references (dense BLAS2)

���������������������������

���������������������������

��������������������������������������������������

��������������������������������������������������

������������������

}

51 / 125

Page 97: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Direct methods

Supernodes and efficient computation

the loop over rows has no indirect addressing: (dense BLAS1)

the loop over columns of the updating supernode can be unrolled tosave memory references (dense BLAS2)

parts of the updating supernode can be used for blocks of updatedsupernode (dense BLAS3)

���������������������������

���������������������������

��������������������������������������������������

��������������������������������������������������

������������������

51 / 125

Page 98: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Direct methods

Factorization again: general strategy in the SPD case

Preprocessing

– prepares the matrix so that the fill-in would be as small aspossible

Symbolic factorization

– elimination tree, determines structures of columns of L.Consequently, L can be allocated and used for the actualdecomposition

– the boundary between the first two steps is somewhatblurred due to many possible enhancements

Numeric factorization

– the actual decomposition to obtain numerical values of thefactor L

Multifrontal algorithm

Block left-looking algorithm

52 / 125

Page 99: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Direct methods: Multifrontal method

∗ ∗ ∗∗ ∗

∗ ∗ ∗∗ ∗

∗ ∗ ∗∗ ∗ f ∗

∗ ∗ ∗ ∗ f∗ ∗ ∗

∗ f ∗ ∗ f∗ ∗ ∗ ∗ f ∗ f ∗

10

108

8

10

108

8

1

8

10

1 8 10

stack

stack

53 / 125

Page 100: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Direct methods: Multifrontal method

∗ ∗ ∗∗ ∗

∗ ∗ ∗∗ ∗

∗ ∗ ∗∗ ∗ f ∗

∗ ∗ ∗ ∗ f∗ ∗ ∗

∗ f ∗ ∗ f∗ ∗ ∗ ∗ f ∗ f ∗

10

108

810

102

2

10

10

10

10

stack

stack

54 / 125

Page 101: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Direct methods: Multifrontal method

∗ ∗ ∗∗ ∗

∗ ∗ ∗∗ ∗

∗ ∗ ∗∗ ∗ f ∗

∗ ∗ ∗ ∗ f∗ ∗ ∗

∗ f ∗ ∗ f∗ ∗ ∗ ∗ f ∗ f ∗

10

108

8

10

10

7

7

10

10

7

7

10

10

stack

stack

1010

3

3

7

7

55 / 125

Page 102: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Direct methods: Multifrontal method

∗ ∗ ∗∗ ∗

∗ ∗ ∗∗ ∗

∗ ∗ ∗∗ ∗ f ∗

∗ ∗ ∗ ∗ f∗ ∗ ∗

∗ f ∗ ∗ f∗ ∗ ∗ ∗ f ∗ f ∗

10

108

8

10

10

7

7

10

77

77

stack

stack

10

4

4

7

7

56 / 125

Page 103: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Direct methods: Multifrontal method

∗ ∗ ∗∗ ∗

∗ ∗ ∗∗ ∗

∗ ∗ ∗∗ ∗ f ∗

∗ ∗ ∗ ∗ f∗ ∗ ∗

∗ f ∗ ∗ f∗ ∗ ∗ ∗ f ∗ f ∗

10

108

8

10

10

7

7

10

6

6 9

9

6

6 9

9stack

stack

10

77

5

5 6

6

9

9

57 / 125

Page 104: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Direct methods: Multifrontal method

∗ ∗ ∗∗ ∗

∗ ∗ ∗∗ ∗

∗ ∗ ∗∗ ∗ f ∗

∗ ∗ ∗ ∗ f∗ ∗ ∗

∗ f ∗ ∗ f∗ ∗ ∗ ∗ f ∗ f ∗

10

108

8

10

10

7

7

10

6

6 9

9

6

6 9

9

10

109

9

10

109

9

stack

10

77

+

stack

6

6 10

10

58 / 125

Page 105: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Direct methods

Multifrontal method: Properties

We do need to have the entries from the stack readily available.

→ elimination tree should be postordered

Arithmetic of dense matrices

Connection with the frontal method (later) is relatively week.

One of the most important methods for the sparse direct factorization.

59 / 125

Page 106: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Direct methods

Postorderings and work/memory issues in factorization

5

1

23

4

6

7

8

9 9

1 2

3 4

56

7 8

First case: Maximum stack size may be 1 × 1+2 × 2+3 × 3+4 × 4

Second case: Maximum stack size may be 4 × 4

Even postorderings can be very different with respect to particularalgorithmic/architecture needs

60 / 125

Page 107: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Outline

1 Foreword

2 Direct methods and algebraic preconditioners

3 Sparsity

4 Direct Methods

5 Notes on direct methods: models, complexity, parallelism

6 Decomposition and computer architectures

7 From direct to iterative methods

8 Algebraic preconditioners and complexity

9 Combining direct and inverse decompositions

10 Conclusions

61 / 125

Page 108: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

From direct to iterative methods

Complexity

Time dominated by time for the factorizationGeneral dense matrices

◮ Space: O(n2)◮ Time: O(n3)

General sparse matrices◮ Space: η(L) = n +

∑n−1

i=1(η(L∗i) − 1)

◮ Time in the i-th step: η(L∗i) − 1 divisions, 1/2(η(L∗i) − 1)η(L∗i)multiple-add pairs

◮ Time totally: 1/2∑n−1

i=1(η(L∗i) − 1)(η(L∗i) + 2)

62 / 125

Page 109: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

From direct to iterative methods

Complexity

Band schemes (β << n)◮ Space: O(βn)◮ Time: O(β2n)

Band

63 / 125

Page 110: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

From direct to iterative methods

Complexity

Profile/envelope schemes◮ Space:

∑ni=1

βi

◮ Frontwidth: ωi(A) = |{k|k > i ∧ akl 6= 0 for some l ≤ i}|◮ Time: 1/2

∑n−1

i=1ωi(A)(ωi(A) + 3)

Profile (Envelope)64 / 125

Page 111: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

From direct to iterative methods

Complexity

General sparse schemes can be analyzed in some cases◮ Nested dissection

1 7 4 43 22 28 25

3 8 6 44 24 29 27

2 9 5 45 23 30 36

19 20 21 46 40 41 42

10 16 13 47 31 37 34

1712 15 48 33 38 36

11 18 14 49 32 39 35

Definition

(α, σ) separation of a graph with n vertices: each its subgraph can beseparated by a vertex separator S such that its size is of the order O(nσ)and the separated subgraphs components have sizes ≤ αn,1/2 ≤ α < 1.

65 / 125

Page 112: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

From direct to iterative methods

Complexity: Generalized nested dissection

Vertex separator

C_1 C_2

S

Planar graphs, 2D finite element graphs◮ σ = 1/2, α = 2/3◮ Space: O(n log n)◮ Time: O(n3/2)

3D Finite element graphs◮ σ = 2/3◮ Space: O(n4/3)◮ Time: O(n2)

Lipton, Rose, Tarjan (1979), Teng (1997).

66 / 125

Page 113: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Outline

1 Foreword

2 Direct methods and algebraic preconditioners

3 Sparsity

4 Direct Methods

5 Notes on direct methods: models, complexity, parallelism

6 Decomposition and computer architectures

7 From direct to iterative methods

8 Algebraic preconditioners and complexity

9 Combining direct and inverse decompositions

10 Conclusions

67 / 125

Page 114: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Decomposition and computer architectures: Parallelism

1. Shared memory computers

1st level of parallelism: global structure of the decomposition.

2nd level of parallelism: local node parallel enhancements.

Both may/should be coordinated.

Parallelism in the tree decreases towards its root.

Dense matrices (e.g. in the multifrontal method) are larger and larger.

68 / 125

Page 115: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Decomposition and computer architectures: 1st level of

parallelism

Two basic possibilities for the 1st level

Dynamic task scheduling on shared memory computers

Direct static mapping: subtree to subcube

1. Dynamic task scheduling on shared memory computers

Dynamic scheduling of the tasks

Each processor selects a task

Again, problem of the elimination tree reordering

Not easy to optimize memory in the multifrontal method

69 / 125

Page 116: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Decomposition and computer architectures: 1st level of

parallelism: II

2. Direct static mapping: subtree to subcube

Recursively map processors to the tree parts from the topVarious ways of mapping.Note: In the SPD (non-pivoting) case we can calculate and considerthe arithmetic workGood at localizing communicationMore difficult to share the work in more complex models

1,2,3,4

1,2,3,4

1,2

1,2

3,4

3,4

70 / 125

Page 117: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Decomposition and computer architectures: 2nd level of

parallelism

Block Cholesky/LU factorization

BLAS / parallel BLAS operations

1D partitioning

2D partitioning

1D and 2D block cyclic distribution

(Only illustrative figures for the talk!)

71 / 125

Page 118: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Decomposition and computer architectures: Distributed

memory parallelism

Basic approaches

Fan-in◮ Demand-driven column-based algorithm◮ Required data are aggregated updates asked from previous columns

Fan-out◮ Data-driven column-based algorithm◮ Updates are broadcasted once computed and aggregated◮ Historically the first approach; greater interprocessor communication

than fan-in

Multifrontal approach◮ Example: MUMPS

72 / 125

Page 119: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Outline

1 Foreword

2 Direct methods and algebraic preconditioners

3 Sparsity

4 Direct Methods

5 Notes on direct methods: models, complexity, parallelism

6 Decomposition and computer architectures

7 From direct to iterative methods

8 Algebraic preconditioners and complexity

9 Combining direct and inverse decompositions

10 Conclusions

73 / 125

Page 120: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

From direct to iterative methods: Iterative + Direct

Why complement a direct by an iterative procedure?

Improving solution accuracy after solving with easier (single)arithmetic.Improving solution after solver relaxation (e.g., in parallelcomputational environment, cf. SuperLU)Simple iterative procedure: iterative improvement.

B is a matrix factorization, Ax∗ = b, x is a current solutionBx∗ = (B − A)x∗ − bIterative procedure: x+ = (I − B−1A)x + B−1bρ(I − B−1A) < 1 sufficient for the convergence

Theorem

One step of single precision iterative refinement enough for obtainingcomponentwise relative backward error to the order of O(ǫ) under weakconditions.Strong result for the error using double precision iterative refinement. 74 / 125

Page 121: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

From direct to iterative methods: Algebraic preconditioners

What we do not treat here

Incomplete factorizations◮ By pattern (simple, level-based)◮ By value◮ Compensations

Incomplete inverse factorizations◮ Factorized◮ Non-factorized

Polynomial preconditioners

Algebraic multigrid

Detailed overviews, citations, etc.: see previous SNA proceedings

Here we try to see simple analyzable cases

75 / 125

Page 122: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Outline

1 Foreword

2 Direct methods and algebraic preconditioners

3 Sparsity

4 Direct Methods

5 Notes on direct methods: models, complexity, parallelism

6 Decomposition and computer architectures

7 From direct to iterative methods

8 Algebraic preconditioners and complexity

9 Combining direct and inverse decompositions

10 Conclusions

76 / 125

Page 123: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Algebraic preconditioners and complexity: Introduction

Only simple algebraic preconditioners can be analyzed by the standard wayvia condition number estimation

We present two examples of the analysis.

1) Classical modified incomplete Cholesky MIC for a simple matrix.◮ In particular, MIC(0).◮ Modification consists of adding the neglected fill-in to the diagonal.

2) Combinatorial preconditioners.

Power of more complex approaches needed

77 / 125

Page 124: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Algebraic preconditioners and complexity: MIC

The matrix

A =

4 −1 −1−1 4 −1 −1

−1 4 −1−1 4 −1 −1

−1 −1 4 −1 −1−1 −1 4 −1

−1 4 −1−1 −1 4 −1

−1 −1 4

78 / 125

Page 125: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Algebraic preconditioners and complexity: MIC: II

A =

4 −1 −1−1 4 −1 ∗ −1

−1 4 ∗ −1−1 ∗ 4 −1 −1

−1 ∗ −1 4 −1 ∗ −1−1 −1 4 ∗ −1

−1 ∗ 4 −1−1 ∗ −1 4 −1

−1 −1 4

M = LD−1LT = A + R

ri,i = −ri,i−m+1 − ri,i+m−1

Here, m = 3 (number of grid points in one dimension of 2D grid)

79 / 125

Page 126: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Algebraic preconditioners and complexity: MIC: III

Idea: Compensate the entries of fill to sum up them to the diagonalof M , perturb diagonal entries

Origins of MIC: Varga (1960), Dupont, Kendall, Rachford (1968)

Here: 5-point stencil.

Generalized by Gustafsson (1978 and later), analysis with similarresults for SSOR given by Axelsson (1972)

M = LD−1LT = A + R + δD

ri,i = −ri,i−m+1 − ri,i+m−1, δ = ch2

di = (1 + δ)aii − ri,i−m+1 − ri,i+m−1 − a2i,i−1/di−1 − a2

i,i−m/di−m

80 / 125

Page 127: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Algebraic preconditioners and complexity: MIC: IV

Lemma

di ≥ 2(1 + c1h), αi = 4, βi ≤ 1, γi ≤ 1

no modification: δ = 0

δ = 0 ⇒ di ≥ 2

di = 4 − 2/di−1 − 2/di−m q.e.d.

nonzero modification δ 6= 0

di ≥ 4(1 + ch2) − 2/(1 + c1h) ≡ 4(1 + ch2) − 2(1 − c1h) + O(h2)

di ≥ 2(1 + c1h) + O(h2) q.e.d.

Corollary

ri+m−1 = ai+m−1,i−1ai,i−1/di−1 ≤ 1/di−1 ≤ 1/2(1 + c1h)

81 / 125

Page 128: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Algebraic preconditioners and complexity: MIC: V

Lemma

(Rx, x) = −∑

i ri,i+m−1(xi+m−1 − xi)2

(Rx, x) = −∑

i ri,ix2i + 2

i ri,i+m−1xi+m−1xi =−∑

i(ri,i−m+1 + ri,i+m−1)x2i + 2

i ri,i+m−1xi+m−1xi

(symmetrically transformed sum + zero row sums)

Since 2xi+m−1xi = x2i+m−1 + x2

i − (xi+m−1 − xi)2 we get

(Rx, x) = −∑

i(ri,i+m−1 + ri,i−m+1)x2i +

i(ri,i+m−1x2i +

ri,i+m−1x2i+m−1) −

i ri,i+m−1(xi+m−1 − xi)2

First entries of the first two sums sum up to zero.

Second entries of the first two sums give zero (formally bytransforming sum indices). q.e.d.

82 / 125

Page 129: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Algebraic preconditioners and complexity: MIC: VI

Lemma

−(Rx, x) ≤ 1/(1 + c1h)(Ax, x)

−(Rx, x) =∑

i ri,i+m−1(xi+m−1 − xi)2 ≤

i 1/di−1(xi+m−1 − xi)2

−(Rx, x) ≤∑

i 1/2(1 + c1h)(xi+m−1 − xi)2

◮ We have (a − b)2 ≤ 2(a − e)2 + 2(e − b)2 (can be easily shown byconsidering various cases of the involved reals)

−(Rx, x) ≤∑

i 1/(1 + c1h)[(xi+m−1 − xi−1)2 + (xi−1 − xi)2] ≤

1/(1 + c1h)(Ax, x)

83 / 125

Page 130: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Algebraic preconditioners and complexity: MIC: VII

Corollary

κ(M−1A) = O(h−1)

(Ax, x)/(Mx, x) = (Ax,x)

(Ax,x)+(Rx,x)+δ(Dx,x)≤ 1

1+(Rx,x)/(Ax,x) ≤1

1− 1(1+c1h)

= 1 + 1c1h

Note that the smallest eigenvalue of A can be written as c0h2.

(Ax, x)/(Mx, x) ≥ 1/(Ax,x)

1+δ(Dx,x)/(Ax,x)= 1

1+ch2(x,x)/(Ax,x) ≥ 11+ c

c0

q.e.d.

84 / 125

Page 131: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Combinatorial preconditioners

Lemma

Let A be symmetric, B SPD. If τB − A is positive semidefinite thenλmax(B−1A) ≤ τ for a real τ .

Proof: Let u be an eigenvector of λ ≡ λmax(B−1A): Au = λBu. IfτB − A is positive semidefinite then

0 ≤ ut(τB − A)u = (τ − λ)uT Bu.

B is SPD ⇒ τ − λ ≥ 0.

85 / 125

Page 132: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Combinatorial preconditioners: II

Definition

Support σ(A, B) of B for A define as

min{τ | τB − A is positive semidefinite}.

Generalized support σ(A, B) of B for A define as

min{τ |xT (τB − A)x ≥ 0 for all x, Ax 6= 0, Bx 6= 0.}

B SPD ⇒ λmax(B−1A) ≤ σ(A, B)

A, B SPD ⇒ κ(B−1A) = λmax(B−1A)/λmin(B−1A) =λmax(B−1A)λmax(A−1B) ≤ σ(A, B)σ(B, A)

86 / 125

Page 133: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Combinatorial preconditioners: III

Example of the support

τ

(

0.5 −0.5−0.5 0.5

)

(

1 −1−1 1

)

to be positive semidefinite⇓

87 / 125

Page 134: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Combinatorial preconditioners: III

Example of the support

τ

(

0.5 −0.5−0.5 0.5

)

(

1 −1−1 1

)

to be positive semidefinite⇓

τ ≥ 2.

87 / 125

Page 135: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Combinatorial preconditioners: III

Example of the support

τ

(

0.5 −0.5−0.5 0.5

)

(

1 −1−1 1

)

to be positive semidefinite⇓

τ ≥ 2.

A = A1 ∪ . . . Ak, B = B1 ∪ . . . Bk

Let τiBi − Ai be positive semidefinite for all i, τ∗ = maxi τi. Thenτ∗B − A is positive semidefinite as well.

σ(A, B) ≤ maxi σ(Ai, Bi)

Pairs of symmetric diagonally dominant matrices → transformed topairs of matrices with zero row sums with equivalent support numbers.

87 / 125

Page 136: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Combinatorial preconditioners: IVCongestion - dilation: more automatic tools for the splitting transformation

Theorem

Let A =

a 0 . . . −a0 0 0 0...

......

0 0 0 0−a 0 . . . 0 a

B =

a −a−a a −a

. . .−a a −a

−a a

with dimensions k + 1, a > 0. Then kB − A is positive semidefinite.

Theorem

Let A =

a 0 . . . −a0 0 0 0...

......

0 0 0 0−a 0 . . . 0 a

B =

b −b−b 2b −b

. . .−b 2b −b

−b b

with dimensions k + 1, a, b > 0. Then (ka/b)B − A is positivesemidefinite. 88 / 125

Page 137: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Combinatorial preconditioners: VCongestion - dilation: more automatic tools for the splitting transformation

Theorem

Let

A =

a 0 . . . −a0 0 0 0...

......

0 0 0 0−a 0 . . . 0 a

B =

d1 −b1

−b1 d2 −b2

. . .−bk−1 dk −bk

−bk dk+1

with dimensions k + 1, di > 0, bi > 0 for all i. Then (ka/min(bi))B − Ais positive semidefinite.

a/min(bi) is called here the congestion

k is the dilation

89 / 125

Page 138: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Combinatorial preconditioners: VIclique - star tool for the splitting transformation

Theorem

Let A =

0 0 . . . 00 (k − 1)a −a . . . −a0 −a (k − 1)a . . . −a...

......

0 −a −a . . . (k − 1)a

B =

kb −b −b . . . −b−b b 0 . . . 0−b 0 b . . . 0...

......

−b 0 0 . . . b

with dimensions k + 1, a, b > 0. Then (ka/b)B − A is positivesemidefinite.

90 / 125

Page 139: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Combinatorial preconditioners: VII

Let A =

a 0 . . . −a0 0 0 0...

......

0 0 0 0−a 0 . . . 0 a

B =

b −b−b 2b −b

. . .−b 2b −b

−b b

Computation of the support numbers can be visualized via graphembeddings.

Matrix is a generalized Laplacian for the derived graph.

91 / 125

Page 140: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Combinatorial preconditioners: VII

Let A =

a 0 . . . −a0 0 0 0...

......

0 0 0 0−a 0 . . . 0 a

B =

b −b−b 2b −b

. . .−b 2b −b

−b b

Computation of the support numbers can be visualized via graphembeddings.

Matrix is a generalized Laplacian for the derived graph.

G(A)

G(B)

−a−b

−b −b−b

−b

91 / 125

Page 141: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Combinatorial preconditioners: VIII

Example of decomposition

−1 −1

−1

−1 −1

−1

−2A B

92 / 125

Page 142: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Combinatorial preconditioners: VIII

Example of decomposition

−1 −1

−1

−2 −0.5

−0.5

−0.5

−1

−0.5

−1 −1

−1

A B

−1

−2 −1 −1

92 / 125

Page 143: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Combinatorial preconditioners: VIII

Example of decomposition

−1 −1

−1

−2 −0.5

−0.5

−0.5

−1

−0.5

−1 −1

−1

A B

−1

−2 −1 −1

sigma(A1,B1) <= 1

sigma(A2,B2) <= 2

sigma(A4,B4) <= 2

sigma(A3,B3) <= (2/0.5)*2=8

92 / 125

Page 144: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Combinatorial preconditioners: IXPositive off-diagonals

Problem of edges with positive weights

Positive edges Bm+k+1, ...Bm+2k

Negative edges of B should support positive edges of B as well

τB − A = (τB1 − A1) + . . . + (τBm − Am) + (τBm+1 + τBm+k+1) +. . . + (τBm+k + τBm+2k) should be positive semidefinite

93 / 125

Page 145: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Combinatorial preconditioners: X

Simpler application of the support

Lemma

Let B = A − R such that A and B and R are positive semidefinite. Ifσ(R, A) = τ ′ < 1 then σ(B, A)σ(A, B) ≤ 1/(1 − τ ′).

Let τ = 1/(1 − τ ′)

The matrix τB − A = τA − τR − A = (τ − 1)A − τR is positivesemidefinite since σ(R, A) = τ ′

Then σ(A, B) ≤ τ

Also σ(B, A) ≤ 1.

Cholesky decomposition of an M-matrix satisfies this assumption(A = LLT − R, R is positive semidefinite)

94 / 125

Page 146: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Combinatorial preconditioners: XI

Vaidya preconditioner 1

Algorithm

Construct a maximum-weight spanning tree of A and use its matrix as apreconditioner

graph of A graph of B

m nonzeros in A ⇒ at most m/2 edges in G(A)2/m fraction of an edge to each pathpath of the maximum lengths of n − 1σ(A, B) ≤ O(mn), σ(B, A) ≤ 1 95 / 125

Page 147: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Combinatorial preconditioners: XII

Vaidya preconditioner 2

Algorithm

Split the matrix graph into t components Vi, i = 1, . . . , t

Construct maximum-weight spanning trees of the components

Connect them pairwise by the edges with the heaviest weights

graph of A graph of B

96 / 125

Page 148: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Combinatorial preconditioners: XIII

Vaidya preconditioner 2: conditioning

graph of A graph of B

assume m ≤ dn for some d (d maximum degree)

paths of lengths at most 1 + 2dn/t

each edge involved in at most d × dn/t ≡ d2n/t paths

κ(B−1A) bounded by O(n2/t2)

97 / 125

Page 149: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Combinatorial preconditioners: XIV

Vaidya preconditioner 2: complexity

graph of A graph of B

contraction: eliminate all nodes of degrees 1 and 2: O(n) fill and work

contracted graph C: number of its internal vertices is at mostnumber of its (componental) leaves

total number of vertices in C: at most O(number of leaves of all Vi)

contraction+factoring of C with at most O(t) vertices → O(t6) work,O(n+t4) nonzeros

iteration count bounded by O(√

n2/t2) = O(n/t)

t = Θ(n0.25) ⇒ total work bounded by O(n/t)O(n + t4) = O(n1.75)

98 / 125

Page 150: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Combinatorial preconditioners: XV

Vaidya preconditioner 2: complexity in planar case

graph of A graph of B

contracted graph C: O(t) vertices

number of edges in the planar graph: O(t) (Euler formula; degrees atmost 5)

O(t) edges altogether O(t1.5) work, O(t log t) nonzeros using nesteddissection

iteration count bounded again by O(√

n2/t2) = O(n/t)

t = Θ(n0.8) ⇒ total work bounded by O(n/t)O(n + t log t) = O(n1.2)

99 / 125

Page 151: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Combinatorial preconditioners: XVI

Modified incomplete factorization

−1

−1 −1

−1

−1−1

−1

−1 −1

−1−1

−1

2D grid - 5-point stencil

100 / 125

Page 152: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Combinatorial preconditioners: XVII

Modified incomplete factorization: MIC

−1

−1 −1

−1

−1−1

−1

−1 −1

−1−1

−1

0.5

0.5 0.5

0.5

2D grid - 5-point stencil - fill-in with MIC

101 / 125

Page 153: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Combinatorial preconditioners: XVIII

Modified incomplete factorization: MIC: Repeat the lemma

Lemma

Let B = A − R such that A and and B and R are positive semidefinite. Ifσ(R, A) = τ ′ < 1 then σ(B, A)σ(A, B) ≤ 1/(1 − τ ′).

Enough to support edges of R such that σ(R, A) = τ ′ < 1

Sophisticated splitting of edges into paths to support R

(i,j)

(i+1,j)

(i,j+1)

(i+1,j+1)

2 sqrt(n)−i−j−12 sqrt(n)−3

2 sqrt(n)−3i+j−1

102 / 125

Page 154: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Combinatorial preconditioners: XIX

Modified incomplete factorization: MIC

(i,j)

(i+1,j)

(i,j+1)

(i+1,j+1)

2 sqrt(n)−i−j−12 sqrt(n)−3

2 sqrt(n)−3i+j−1

internal weight splittings 2√

n−i−j−12√

n−3+ i+j−2

2√

n−3= 1

support of fill edges: 2√

n−i−j−12√

n−3+ i+j−1

2√

n−3= 2

√n−2

2√

n−3= 1/τ ′

path length is 2, fill-in edge weight is 0.5

overall κ(B−1A) = 1/(1 − τ ′) = 2n0.5 − 2

103 / 125

Page 155: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Preconditioners analyzable in this way and reality

Matrix pwtk.rsa: stiffness matrix, pressurized wind tunnel

n=217918, nz=5926171 (a triangular part)

Tested with two preconditioners

1) IC with positive semidefinite modification of the Schur complement(Tismenetsky, 1991)

◮ Often considered as one of the most robust approaches◮ Suffers from extensive memory demands

d lT sT

ls

B

+

0 0

0

(

0s

)

(

0 sT)

d lT sT

ls

B ≡ B +

(

0s

)

(

0 sT)

2) IC based on computing both direct and inverse factors (Bru et al.,2008)

104 / 125

Page 156: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Preconditioners analyzable in this way and reality: II

0 5 10 15

x 106

0

5

10

15

20

25

30

35

40

45

tota

l tim

e (in

sec

onds

)

size of the preconditioner (in the number of nonzeros)

BIF Tismenetsky/Kaporin

105 / 125

Page 157: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Outline

1 Foreword

2 Direct methods and algebraic preconditioners

3 Sparsity

4 Direct Methods

5 Notes on direct methods: models, complexity, parallelism

6 Decomposition and computer architectures

7 From direct to iterative methods

8 Algebraic preconditioners and complexity

9 Combining direct and inverse decompositions

10 Conclusions

106 / 125

Page 158: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Direct and Inverse Factors

Basic inverse decomposition is in principle very simple

Inverse decompositions are in principle based on the generalizedconcept of QR decomposition:

I = ZU

◮ U is upper triangular◮ Z is A-orthogonal ZT AZ = I

Consequently

◮ U is the Cholesky factor of A◮ Z is its inverse

107 / 125

Page 159: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Direct and Inverse Factors: II

I = ZU, I = WLT

:Two generalized Gram-Schmidt recursions

z(j)i = z

(j−1)i − z

(j−1)j

ajz(j−1)i

ajz(j−1)j

w(j)i = w

(j−1)i − w

(j−1)j

aTj w

(j−1)i

aTj w

(j−1)j

Fully sparse operations - no relaxations like fixing band or patternnecessary

Generalized MGS in the SPD case

108 / 125

Page 160: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Direct and Inverse Factors: III

New recursions for Z and V T :

I = Z(WT + VT), I = W(ZT + V

T)

zi = sei −i−1∑

j=1

vTj ei

djzj

vi = (ai − sei)T −i−1∑

j=1

zTj (ai − sei)

djvj

109 / 125

Page 161: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Direct and Inverse Factors: III

New recursions for Z and V T :

I = Z(WT + VT), I = W(ZT + V

T)

zi = sei −i−1∑

j=1

vTj ei

djzj

vi = (ai − sei)T −i−1∑

j=1

zTj (ai − sei)

djvj

Both U and Z contained in V T , similarly for L

109 / 125

Page 162: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Direct and Inverse Factors: III

New recursions for Z and V T :

I = Z(WT + VT), I = W(ZT + V

T)

zi = sei −i−1∑

j=1

vTj ei

djzj

vi = (ai − sei)T −i−1∑

j=1

zTj (ai − sei)

djvj

Both U and Z contained in V T , similarly for L

(Bru, Cerdán, Marín, Mas, SISC, 2006; Bru, Marín, Mas, T., SISC, 2008;Bru, Marín, Mas, T., SIMAX, 2010);

109 / 125

Page 163: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Direct and Inverse Factors: III

New recursions for Z and V T :

I = Z(WT + VT), I = W(ZT + V

T)

zi = sei −i−1∑

j=1

vTj ei

djzj

vi = (ai − sei)T −i−1∑

j=1

zTj (ai − sei)

djvj

Both U and Z contained in V T , similarly for L

(Bru, Cerdán, Marín, Mas, SISC, 2006; Bru, Marín, Mas, T., SISC, 2008;Bru, Marín, Mas, T., SIMAX, 2010);

A lot of other work, e.g., Bollhöfer, Saad; 2002; Bollhöfer, 2003

109 / 125

Page 164: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Direct and Inverse Factors: IV

I = Z(WT + VT), I = W(ZT + V

T)

Computation of L−T , U, U−1, L is interleaved.

It uses each other’s intermediate data

Straightforward sparse, column-based algorithms

Explicit data interconnection of the recursions◮ connected by dropping◮ full interconnection by data exchange between direct and inverse

factors possible as well◮ ill-conditioning in inverse factors directly detected.

Some practical limitations as well

110 / 125

Page 165: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Direct and Inverse Factors: V

����������������������������������������������������������������

���������������������������������������������������������������� ��������

����������������������������������������������������������������

������������������������������������������������������������������������

pp

k kV Vt

v1:p−1 computed using fully filled areas

vp+1:n computed using dashed areas

direct and inverse factors influence each other

111 / 125

Page 166: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Direct and Inverse Factors: VI

Example: matrix PWTK, n=217,918, nnz=5,926,171

0 0.5 1 1.5 2 2.5 3

x 107

0

20

40

60

80

100

120

140

160

180

200nu

mbe

r of

iter

atio

ns

size of the preconditioner (in the number of nonzeros)

BIF Tismenetsky/Kaporin

Figure: Iteration counts for CG preconditioned by BIF and Tismenetsky/Kaporin112 / 125

Page 167: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Direct and Inverse Factors: VII

Example: matrix PWTK, n=217,918, nnz=5,926,171

0 0.5 1 1.5 2 2.5 3

x 107

0

5

10

15

20

25

30

35tim

e to

com

pute

the

prec

ondi

tione

r (in

sec

onds

)

size of the preconditioner (in the number of nonzeros)

BIF Tismenetsky/Kaporin

Figure: Preconditioner construction time for CG preconditioned by BIF and113 / 125

Page 168: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Direct and Inverse Factors: VIII

Example: matrix PWTK, n=217,918, nnz=5,926,171

0 5 10 15

x 106

0

5

10

15

20

25

30

35

40

45to

tal t

ime

(in s

econ

ds)

size of the preconditioner (in the number of nonzeros)

BIF Tismenetsky/Kaporin

Figure: Preconditioner construction time for CG preconditioned by BIF and114 / 125

Page 169: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Direct and Inverse Factors: IX

Example: matrix CFD2, n=123,440, nnz=1,605,669

0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8

x 106

200

250

300

350

400

450

500

550

600nu

mbe

r of

iter

atio

ns

size of the preconditioner (in the number of nonzeros)

BIF Tismenetsky/Kaporin

Figure: Iteration counts for CG preconditioned by BIF and Tismenetsky/Kaporin115 / 125

Page 170: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Direct and Inverse Factors: X

Example: matrix CFD2, n=123,440, nnz=1,605,669

0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8

x 106

0

1

2

3

4

5

6tim

e to

com

pute

the

prec

ondi

tione

r (in

sec

onds

)

size of the preconditioner (in the number of nonzeros)

BIF Tismenetsky/Kaporin

Figure: Preconditioner construction time for CG preconditioned by BIF and116 / 125

Page 171: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Direct and Inverse Factors: XI

Example: matrix CFD2, n=123,440, nnz=1,605,669

0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8

x 106

9.5

10

10.5

11

11.5

12

12.5

13

13.5

14to

tal t

ime

(in s

econ

ds)

size of the preconditioner (in the number of nonzeros)

BIF Tismenetsky/Kaporin

Figure: Preconditioner construction time for CG preconditioned by BIF andTismenetsky/Kaporin IC versus preconditioner size for the matrix CFD2.

117 / 125

Page 172: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Direct and Inverse Factors: XII

Example: matrix CHEM_MASTER, n=40,401, nnz=201,201

0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2 2.2 2.4

x 105

0

200

400

600

800

1000

1200nu

mbe

r of

iter

atio

ns

size of the preconditioner (in the number of nonzeros)

NBIF ILU(tau)ILU−ID(tau)

118 / 125

Page 173: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Direct and Inverse Factors: XIII

Example: matrix EPB3, n=84,617, nnz=463,625

0 0.5 1 1.5 2 2.5

x 106

0

200

400

600

800

1000

1200

1400nu

mbe

r of

iter

atio

ns

size of the preconditioner (in the number of nonzeros)

NBIF ILU(tau)ILU−ID(tau)

119 / 125

Page 174: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Direct and Inverse Factors: XIV

Example: matrix POISSON3DB, n=85,623, nnz=2,374,949

0 2 4 6 8 10 12 14

x 105

0

200

400

600

800

1000

1200

1400nu

mbe

r of

iter

atio

ns

size of the preconditioner (in the number of nonzeros)

NBIF ILU(tau)ILU−ID(tau)

120 / 125

Page 175: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Direct and Inverse Factors: XV

Example: matrix CAGE12, n=130,228, nnz=2,032,536

0 2 4 6 8 10 12 14 16

x 105

4

5

6

7

8

9

10nu

mbe

r of

iter

atio

ns

size of the preconditioner (in the number of nonzeros)

NBIF ILU(tau)ILU−ID(tau)

121 / 125

Page 176: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Direct and Inverse Factors: XVI

Example: matrix MAJOR, n=160,000, nnz=1,750,416

0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2

x 106

0

10

20

30

40

50

60

70

80nu

mbe

r of

iter

atio

ns

size of the preconditioner (in the number of nonzeros)

NBIF ILU(tau)ILU−ID(tau)

122 / 125

Page 177: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Outline

1 Foreword

2 Direct methods and algebraic preconditioners

3 Sparsity

4 Direct Methods

5 Notes on direct methods: models, complexity, parallelism

6 Decomposition and computer architectures

7 From direct to iterative methods

8 Algebraic preconditioners and complexity

9 Combining direct and inverse decompositions

10 Conclusions

123 / 125

Page 178: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Conclusions

Direct methods still strongly developing as stand-alone approaches. Alot of open algorithmic/implementational questions.

124 / 125

Page 179: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Conclusions

Direct methods still strongly developing as stand-alone approaches. Alot of open algorithmic/implementational questions.

Direct and iterative methods coexist together sharing some algorithmsand techniques.

124 / 125

Page 180: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Conclusions

Direct methods still strongly developing as stand-alone approaches. Alot of open algorithmic/implementational questions.

Direct and iterative methods coexist together sharing some algorithmsand techniques.

Borrowing from each other may be the way for more robust solvers.

124 / 125

Page 181: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Last but not least

Thank you for your attention!

125 / 125

Page 182: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Last but not least

Thank you for your attention!

125 / 125

Page 183: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Last but not least

Thank you for your attention!

125 / 125

Page 184: Univerzita Karlova › ~mirektuma › ps › direct_precond.pdfIntroductory notes Assuming basic knowledge of algebraic iterative (Krylov space) and direct (dense) solvers (elimination/factorization/solve)

Last but not least

Thank you for your attention!

125 / 125