This project implements core matrix operations in pure C with OpenMPI-aware test
drivers for matrix multiplication, REF, RREF, and LU decomposition. The matrix
storage is now heap-backed, so the old fixed 2100 x 2100 cap is gone and the
practical limit is determined by available RAM, MPI count limits, and runtime.
The repository includes the core implementation, interactive MPI test binaries, and a repeatable benchmark suite that generates CSV timing tables, PNG figures, and a short LaTeX report.
Matrix/
│
├── benchmarks/ # New benchmark data, figures, scripts, and LaTeX report
├── src/ # Core library: MatrixC.c, MatrixC.h
├── tests/ # Standalone test drivers (luTest.c, refTest.c, etc.)
├── results/ # Older timing spreadsheets (.ods)
├── figs/ # Older performance plots (.png)
├── docs/ # Original project report and slides
├── makefile # Build rules for all test programs
└── README.md # This file
- Matrix multiplication
- Row-Echelon Form (REF)
- Reduced Row-Echelon Form (RREF)
- LU decomposition
- Heap-backed matrix storage with allocation checks
- Pure C with explicit memory management
- Contiguous row-major storage for cache-friendly access
- Clean separation between library and tests
- Easy to benchmark and extend into stronger MPI implementations
Run:
makeAll testing is handled through the unified script:
./runTest.shThis script:
- prompts for matrix size
- selects sequential or parallel mode
- asks how many MPI processes to use
- allows choosing which operation to test
- launches the selected program with
mpirun
This is the only recommended way to run and test in this project.
To regenerate the new benchmark data, plots, and summary CSV files, run:
python3 benchmarks/scripts/run_benchmarks.pyThis benchmark sweep currently covers:
- matrix sizes
250,500,1000, and1500 - MPI process counts
1,2,4,8, and16 - all four shipped executables
Generated artifacts are written to:
benchmarks/data/for timing tables and raw logsbenchmarks/figures/for timing and speedup plotsbenchmarks/report/for the LaTeX benchmark report
./luTest
./refTest
./rrefTest
./multiplyTest(These executables are generated from the sources in tests/.)
make cleanThis repository now contains two sets of performance artifacts:
- the original spreadsheets and figures in
results/andfigs/ - the new reproducible benchmark suite in
benchmarks/
Located in benchmarks/:
data/timings.csv— all benchmark rows with kernel time, wall time, and log pathdata/summary.csv— best MPI result at each tested matrix sizedata/logs/— raw stdout/stderr from each benchmark runfigures/multiply_timing.png— multiplication timing curvesfigures/ref_timing.png— REF timing curvesfigures/rref_timing.png— RREF timing curvesfigures/lu_timing.png— LU timing curvesfigures/speedup_summary.png— combined speedup overviewreport/Benchmark_Timing_Report.tex— short LaTeX benchmark writeupreport/Benchmark_Timing_Report.pdf— compiled benchmark report
Located in results/ and figs/:
multiply.odsref.odsrref.odslu.odsmatrix.pngref.pngrref.pnglu.png
The new benchmark suite uses the timings printed by the test executables themselves, which makes it easy to rerun after code changes.
Documentation is split between the original project writeup in docs/ and the
new benchmark report in benchmarks/report/.
- Matrix_Project_Report.pdf — Complete writeup
- Matrix_Project_Slides.pdf — Presentation / overview
- Matrix_Project_Report.tex — LaTeX source
- Benchmark_Timing_Report.pdf — Short benchmark summary
- Benchmark_Timing_Report.tex — LaTeX source
The core of the project lives in src/MatrixC.c and src/MatrixC.h.
Matrixuses heap-backed contiguous storage.- Each operation is isolated and testable.
- The MPI paths allocate local work buffers based on the real matrix size.
- Large temporary buffers have been moved off the stack.
- The benchmark suite makes it easy to rerun timing studies after changes.
Each test program in tests/ focuses on one operation:
luTest.crefTest.crrefTest.cmultiplyTest.c
These programs validate the core matrix operations (LU, REF, RREF, and multiplication).
- Add a truly distributed MPI LU decomposition
- Add partial pivoting to LU, REF, and RREF
- Add assertion-based correctness tests
- Expand the benchmark suite to larger problem sizes and repeated trials
- Add CSV-to-LaTeX table generation for the benchmark report
This project is licensed under the MIT License. See LICENSE for details.