Linear Algebra and Matrices Flashcards
(22 cards)
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)
How does the finite element method approximate solutions?
Using expansion functions that are nonzero over a small region of the domain.
What makes elliptic equations different from parabolic/hyperbolic equations?
They do not contain a time dependence and cannot be solved with time stepping.
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?
- Dense matrices can be stored in contiguous memory for efficient access
- 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)
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).
How does CSR store a matrix?
It stores a matrix useing three 1D arrays:
1. vals
: Non-zero values
2. col_ind
: Column indices of nonzero values
3. row_ptr
: Indices in vals
and col_ind
where each new row starts
How do you extract row i
from a CSR matrix?
Unpack:vals(row_ptr(i):row_ptr(i+1)-1)
col_ind(row_ptr(i):row_ptr(i+1)-1)
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.
Where A
is a dense NxN matrix and b, x
are vectors
How does the Linpack workload scale?
O(N) and is compute-bound.
What is HPL? What is it used for?
High-Performance Linpack
Ranking systems in the Top500 list of supercomputers.
Why is HPL optimised for peak floating-point performance?
Matrix sizes can be adjusted to achieve near-theoretical maximum performance.
What does HPCG stand for? What does it do?
High Performance Conjugate Gradients
Benchmarks systems based on sparse linear algebra workloads rather than dense computations.
How does the algorithmic intensity of HPCG compare to HPL?
HPCG has lower arithmetic intensity and is memory-bound, making it more representative of real-world applications.