Parallel programming coursework: eight problems in C, implemented across pthreads, OpenMP, MPI, AVX2 intrinsics and CUDA, each with benchmarks.
| Directory | Problem | Models |
|---|---|---|
polynomial-multiplication/ |
Dense polynomial product, O(n²) inner loop | pthreads, OpenMP, MPI, AVX2 |
spmv-csr/ |
Sparse matrix-vector product over a compressed sparse row structure | OpenMP, MPI |
mergesort/ |
Top-down mergesort | OpenMP tasks |
synchronization/ |
Four microbenchmarks: atomics vs locks, false sharing, lock granularity, barrier implementations | pthreads |
fdtd-cuda/ |
2D finite-difference time-domain Maxwell solver, GPU port and optimization | CUDA, Thrust, CUB |
Each directory has its own README with the implementation notes and measured results.
Requires a C compiler with OpenMP support (gcc or clang). The AVX2 target needs x86-64 hardware, and the MPI targets need mpicc.
Every program has its own Makefile and builds on its own with make -C <dir>. The top level builds them in groups:
make cpu # everything except MPI
make mpi
make # both
make cleanThe CUDA sources are notebook cells from an NVIDIA training environment and are not part of this build.
Two environments, not interchangeable:
- Shared memory (pthreads, OpenMP, AVX2): AMD Ryzen 7 5700U, 16 cores, Linux 6.17.8, gcc 15.2.1.
- MPI: department lab machines
linux01-linux30, one process per node, so every rank boundary is a network hop.
The same problem gives opposite answers in the two environments. polynomial-multiplication/ has that comparison.
Joint work with Manos Pavlis-Kamarianos.