This archive contains the finalized individual assignments and course notes completed during the 2022-2023 session of the "Techniques of High-Performance Computing (PHAS0102)" module.
File: assignment_1.ipynb
- Key Results: Achieved massive performance improvements over naive nested-loop matrix multiplications. By transitioning to NumPy's vectorized operations and implementing Numba JIT (Just-In-Time) compilation, the execution time was drastically reduced. The benchmark results clearly illustrate the exponential speedup and demonstrate the performance impact of memory access patterns (C-contiguous vs. Fortran-contiguous arrays).
- Core Technologies: NumPy, Numba JIT, Performance Benchmarking, Matplotlib.
File: assignment_2.ipynb
-
Key Results: Successfully solved two 1D partial differential equations. First, solved the 1D time-harmonic wave equation using the Finite Difference Method (FDM) with sparse matrices, demonstrating accurate convergence as the grid size
$N$ increases. Second, solved the 1D heat equation and achieved massive speedups via GPU parallelization using Numba CUDA, efficiently handling long-term heat diffusion simulations that would otherwise be computationally expensive on a CPU. -
Core Technologies: Finite Difference Method (FDM),
scipy.sparse, Numba CUDA (GPU Parallel Computing).
File: assignment_3.ipynb
- Key Results: Engineered a custom CSR (Compressed Sparse Row) matrix class from scratch by subclassing
scipy.sparse.linalg.LinearOperator. By designing a custom block-matrix structure and separating the computational logic, the algorithm's time complexity was significantly reduced. The custom operator was successfully validated against SciPy's built-in GMRES and CG iterative solvers, proving its numerical stability and efficiency. - Core Technologies: Sparse Matrix Storage (CSR, COO), Object-Oriented Programming (OOP),
scipy.sparse.linalg.LinearOperator, Iterative Solvers.
File: assignment_4.ipynb
-
Key Results: Successfully implemented the Finite Element Method (FEM) to solve a 2D Helmholtz wave equation on an
$N \times N$ discrete grid.-
Matrix Assembly: Accurately constructed the massive sparse matrix
$\mathrm{A}$ and RHS vector$\mathbf{b}$ handling complex boundary conditions and corner/edge cases. - Solver Benchmarks: Conducted rigorous performance comparisons across multiple Direct Solvers and Iterative Solvers (enhanced with Preconditioners).
-
Analysis & Visualization: Visualized the 3D wave solutions successfully, and provided detailed empirical analysis on the solvers'
$\mathcal{O}(N)$ time complexities and error convergence rates.
-
Matrix Assembly: Accurately constructed the massive sparse matrix
- Core Technologies: Finite Element Method (FEM), 2D PDEs, Iterative Solvers vs Direct Solvers, Preconditioning, Big-O Complexity Analysis, 3D Data Visualization.
(Figure: The $N \times N$ discrete finite element mesh representing the domain in Assignment 4)