ArticleslgStudy

computer science

SPIKE algorithm

SPIKE algorithm is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand SPIKE algorithm rather than just read about it. In short: The SPIKE algorithm is a hybrid parallel solver for banded linear systems developed by Eric Polizzi and Ahmed Sameh[1]^[2] Overview The SPIKE algorithm deals with a linear system AX = F, where A is a banded n×n matrix of bandwidth much less than n, and F is an n×s matrix containing s right-hand sides. It is divided into a preprocessing stage and a postprocessing stage.

Key takeaways

  • SPIKE algorithm belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect SPIKE algorithm to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of SPIKE algorithm from memory before moving on to harder problems.

Reference excerpt

The SPIKE algorithm is a hybrid parallel solver for banded linear systems developed by Eric Polizzi and Ahmed Sameh[1]^[2]

Overview The SPIKE algorithm deals with a linear system AX = F, where A is a banded n×n matrix of bandwidth much less than n, and F is an n×s matrix containing s right-hand sides. It is divided into a preprocessing stage and a postprocessing stage.

Preprocessing stage In the preprocessing stage, the linear system AX = F is partitioned into a block tridiagonal form

[𝑨1𝑩1𝑪2𝑨2𝑩2⋱⋱⋱𝑪p−1𝑨p−1𝑩p−1𝑪p𝑨p][𝑿1𝑿2⋮𝑿p−1𝑿p]=[𝑭1𝑭2⋮𝑭p−1𝑭p]. Assume, for the time being, that the diagonal blocks Aj (j = 1,...,p with p ≥ 2) are nonsingular. Define a block diagonal matrix

D = diag(A1,...,Ap), then D is also nonsingular. Left-multiplying D−1 to both sides of the system gives

[𝑰𝑽1𝑾2𝑰𝑽2⋱⋱⋱𝑾p−1𝑰𝑽p−1𝑾p𝑰][𝑿1𝑿2⋮𝑿p−1𝑿p]=[𝑮1𝑮2⋮𝑮p−1𝑮p], which is to be solved in the postprocessing stage. Left-multiplication by D−1 is equivalent to solving p systems of the form

Aj[Vj Wj Gj] = [Bj Cj Fj] (omitting W1 and C1 for j=1, and Vp and Bp for j=p), which can be carried out in parallel. Due to the banded nature of A, only a few leftmost columns of each Vj and a few rightmost columns of each Wj can be nonzero. These columns are called the spikes.

Postprocessing stage Without loss of generality, assume that each spike contains exactly m columns (m is much less than n) (pad the spike with columns of zeroes if necessary). Partition the spikes in all Vj and Wj into

[𝑽j(t)𝑽j′𝑽j(b)] and [𝑾j(t)𝑾j′𝑾j(b)] where V (t)j , V (b)j , W (t)j and W (b)j are of dimensions m×m. Partition similarly all Xj and Gj into

[𝑿j(t)𝑿j′𝑿j(b)] and [𝑮j(t)𝑮j′𝑮j(b)]. Notice that the system produced by the preprocessing stage can be reduced to a block pentadiagonal system of much smaller size (recall that m is much less than n)

[𝑰m0𝑽1(t)0𝑰m𝑽1(b)00𝑾2(t)𝑰m0𝑽2(t)𝑾2(b)0𝑰m𝑽2(b)0⋱⋱⋱⋱⋱0𝑾p−1(t)𝑰m0𝑽p−1(t)𝑾p−1(b)0𝑰m𝑽p−1(b)00𝑾p(t)𝑰m0𝑾p(b)0𝑰m][𝑿1(t)𝑿1(b)𝑿2(t)𝑿2(b)⋮𝑿p−1(t)𝑿p−1(b)𝑿p(t)𝑿p(b)]=[𝑮1(t)𝑮1(b)𝑮2(t)𝑮2(b)⋮𝑮p−1(t)𝑮p−1(b)𝑮p(t)𝑮p(b)], which we call the reduced system and denote by S̃X̃ = G̃. Once all X (t)j and X (b)j are found, all X′j can be recovered with perfect parallelism via

{𝑿1′=𝑮1′−𝑽1′𝑿2(t),𝑿j′=𝑮j′−𝑽j′𝑿j+1(t)−𝑾j′𝑿j−1(b),j=2,…,p−1,𝑿p′=𝑮p′−𝑾p𝑿p−1(b).

SPIKE as a polyalgorithmic banded linear system solver Despite being logically divided into two stages, computationally, the SPIKE algorithm comprises three stages:

factorizing the diagonal blocks, computing the spikes, solving the reduced system. Each of these stages can be accomplished in several ways, allowing a multitude of variants. Two notable variants are the recursive SPIKE algorithm for non-diagonally-dominant cases and the truncated SPIKE algorithm for diagonally-dominant cases. Depending on the variant, a system can be solved either exactly or approximately. In the latter case, SPIKE is used as a preconditioner for iterative schemes like Krylov subspace methods and iterative refinement.

Recursive SPIKE

Preprocessing stage The first step of the preprocessing stage is to factorize the diagonal blocks Aj. For numerical stability, one can use LAPACK's XGBTRF routines to LU factorize them with partial pivoting. Alternatively, one can also factorize them without partial pivoting but with a "diagonal boosting" strategy. The latter method tackles the issue of singular diagonal blocks. In concrete terms, the diagonal boosting strategy is as follows. Let 0ε denote a configurable "machine zero". In each step of LU factorization, we require that the pivot satisfy the condition

|pivot| > 0ε‖A‖1. If the pivot does not satisfy the condition, it is then boosted by

pivot={pivot+ϵ‖𝑨j‖1if pivot≥0,pivot−ϵ‖𝑨j‖1if pivot<0 where ε is a positive parameter depending on the machine's unit roundoff, and the factorization continues with the boosted pivot. This can be achieved by modified versions of ScaLAPACK's XDBTRF routines. After the diagonal blocks are factorized, the spikes are computed and passed on to the postprocessing stage.

Postprocessing stage

The two-partition case In the two-partition case, i.e., when p = 2, the reduced system S̃X̃ = G̃ has the form

[𝑰m0𝑽1(t)0𝑰m𝑽1(b)00𝑾2(t)𝑰m0𝑾2(b)0𝑰m][𝑿1(t)𝑿1(b)𝑿2(t)𝑿2(b)]=[𝑮1(t)𝑮1(b)𝑮2(t)𝑮2(b)]. An even smaller system can be extracted from the center:

[𝑰m𝑽1(b)𝑾2(t)𝑰m][𝑿1(b)𝑿2(t)]=[𝑮1(b)𝑮2(t)], which can be solved using the block LU factorization

[𝑰m𝑽1(b)𝑾2(t)𝑰m]=[𝑰m𝑾2(t)𝑰m][𝑰m𝑽1(b)𝑰m−𝑾2(t)𝑽1(b)]. Once X (b)1 and X (t)2 are found, X (t)1 and X (b)2 can be computed via

X (t)1 = G (t)1 − V (t)1 X (t)2 , X (b)2 = G (b)2 − W (b)2 X (b)1 .

The multiple-partition case Assume that p is a power of two, i.e., p = 2d. Consider a block diagonal matrix

D̃1 = diag(D̃ [1]1 ,...,D̃ [1]p/2 ) where

𝑫~k[1]=[𝑰m0𝑽2k−1(t)0𝑰m𝑽2k−1(b)00𝑾2k(t)𝑰m0𝑾2k(b)0𝑰m] for k = 1,...,p/2. Notice that D̃1 essentially consists of diagonal blocks of order 4m extracted from S̃. Now we factorize S̃ as

S̃ = D̃1S̃2. The new matrix S̃2 has the form

[𝑰3m0𝑽1[2](t)0𝑰m𝑽1[2](b)00𝑾2[2](t)𝑰m0𝑽2[2](t)𝑾2[2](b)0𝑰3m𝑽2[2](b)0⋱⋱⋱⋱⋱0𝑾p/2−1[2](t)𝑰3m0𝑽p/2−1[2](t)𝑾p/2−1[2](b)0𝑰m𝑽p/2−1[2](b)00𝑾p/2[2](t)𝑰m0𝑾p/2[2](b)0𝑰3m]. Its structure is very similar to that of S̃2, only differing in the number of spikes and their height (their width stays the same at m). Thus, a similar factorization step can be performed on S̃2 to produce

S̃2 = D̃2S̃3 and

S̃ = D̃1D̃2S̃3. Such factorization steps can be performed recursively. After d − 1 steps, we obtain the factorization

S̃ = D̃1⋯D̃d−1S̃d, where S̃d has only two spikes. The reduced system will then be solved via

X̃ = S̃ −1d D̃ −1d−1 ⋯D̃ −11 G̃. The block LU factorization technique in the two-partition case can be used to handle the solving steps involving D̃1, ..., D̃d−1 and S̃d for they essentially solve multiple independent systems of generalized two-partition forms. Generalization to cases where p is not a power of two is almost trivial.

Truncated SPIKE When A is diagonally-dominant, in the reduced system

[𝑰m0𝑽1(t)0𝑰m𝑽1(b)00𝑾2(t)𝑰m0𝑽2(t)𝑾2(b)0𝑰m𝑽2(b)0⋱⋱⋱⋱⋱0𝑾p−1(t)𝑰m0𝑽p−1(t)𝑾p−1(b)0𝑰m𝑽p−1(b)00𝑾p(t)𝑰m0𝑾p(b)0𝑰m][𝑿1(t)𝑿1(b)𝑿2(t)𝑿2(b)⋮𝑿p−1(t)𝑿p−1(b)𝑿p(t)𝑿p(b)]=[𝑮1(t)𝑮1(b)𝑮2(t)𝑮2(b)⋮𝑮p−1(t)𝑮p−1(b)𝑮p(t)𝑮p(b)], the blocks V (t)j and W (b)j are often negligible. With them omitted, the reduced system becomes block diagonal

… excerpt ends here. Continue reading the full article.

Worked examples

Example 1 — a first encounter with SPIKE algorithm

Start with the simplest possible case. Write down what SPIKE algorithm claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to SPIKE algorithm before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about SPIKE algorithm ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of SPIKE algorithm

In research
SPIKE algorithm appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses SPIKE algorithm in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
SPIKE algorithm is common in secondary-school and first-year university syllabi. It links to neighbouring topics Numerical linear algebra, so understanding it makes those chapters shorter.
In everyday life
Look for SPIKE algorithm outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “SPIKE algorithm” →

How to study SPIKE algorithm in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what SPIKE algorithm means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain SPIKE algorithm out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is SPIKE algorithm in simple terms?

The SPIKE algorithm is a hybrid parallel solver for banded linear systems developed by Eric Polizzi and Ahmed Sameh[1]^[2] Overview The SPIKE algorithm deals with a linear system AX = F, where A is a banded n×n matrix of bandwidth much less than n, and F is an n×s matrix containing s right-hand sid…

Why does SPIKE algorithm matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study SPIKE algorithm?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on SPIKE algorithm.

Tags

  • Numerical linear algebra

Keep exploring