Linear Algebra and Matrices Flashcards
Why is linear algebra essential in HPC?
It is used to approximate calculus for solving differential equations in scientific and engineering applications.
What numerical method did we use in Week 3 to solve PDEs?
Finite differences with a forward Euler timestep.
Why do many numerical methods require solving systems of linear equations?
Because advanced numerical methods break problems into linear algebraic components for computation.
Why might finite differences not be suitable for complex meshes?
They are easy to implement but struggle with irregular geometries.
What does the finite volume method focus on?
Fluxes (e.g, mass, momentum, energy between adjacent cells)
Name an open-source finite volume CFD software.
OpenFOAM
How does the finite element method approximate solutions?
Using expansion functions that are nonzero over a small region of the domain.
Name two finite element solvers.
- Nektar++
- Firedrake
What makes elliptic equations different from parabolic/hyperbolic equations?
They do not contain a time dependence and cannot be solved with time stepping.
Give an example of an elliptic equation.
The Poisson equation used for self-gravity
What is the difference between a dense and sparse matrix?
- A dense matrix has most elements as nonzero
- A sparse matrix has mostly zero elements
Why is a sparse matrix stored differently from a dense matrix?
Storing all elements of a sparse matrix would be inefficient.
What does BLAS stand for? What does it provide?
Basic Linear Algebra Subprograms
Standardised interfaces for vector and matrix operations in C and Fortran.
Does BLAS support sparse matrices?
No, it only supports dense matrices and specific structured matrices (e.g., banded/symmetric).
What are the three levels of BLAS?
- Level 1: Vector-Vector
- Level 2: Matrix-Vector
- Level 3: Matrix-Matrix
How does arithmetic intensity scale across BLAS levels?
- BLAS 1 (dot product): O(1)
- BLAS 2 (matrix-vector multiplication): O(1)
- BLAS 3 (matrix-matrix multiplication): O(N)
Name an optimised BLAS implementation.
- OpenBLAS
- Intel MKL
- ATLAS
Why use an optimised BLAS library?
It improves performance in applications requiring linear algebra computations.
What does CSR mean? What is CSR format used for?
Compressed Sparse Row Format
Efficiently storing and processing sparse matrices.
How much storage does CSR require compared to a full matrix?
Instead of N{row} x N{col} elements, it stores 2N{NZ} + N{row} + 1 values (where N{NZ} is the number of non-zero elements).
What are the three arrays in CSR format?
-
vals
: Non-zero values -
col_ind
: Column indices of nonzero values -
row_ptr
: Indices invals
andcol_ind
where each new row starts
Why might another sparse matrix format be preferable to CSR?
Some formats are more efficient for structured sparsity patterns (e.g., banded/block-structured matrices).
What mathematical operation does Linpack perform?
Solving Ax = b, using Lower-Upper factorisation.