- C++14 or higher
- CMake 3.18 or higher
- CUDA 12.5
- Ruby 3+ (for matrix generation scripts)
- MATLAB (optional, for performance comparison scripts)
-
Clone the repository:
git clone https://github.com/Wolwer1nE/bsmp.git
-
We have
bin/*scripts for building and running examples. To build the project, run:bin/g matrix data/100.txt 100 4
This will create a block sparse matrix with 100 blocks of size 4x4 and save it to
data/100.txtwith right-hand side vector indata/rhs_100.txt.After generating the matrix, you can run the multiplication example:
bin/r mult data/100.txt --rhs data/rhs_100.txt --mults 10 --verbose
This will build and run the multiplication example 10 times, printing verbose output. It should also work on Ubuntu 22.04 and WSL by hitting F5 in VSCode, but you will have to provide inputs.
Loads a sparse matrix from a file in triplet format or Matrix Market format into BlockSparseMatrix structure.
Implements Block Sparse Matrix structure and operations such as matrix-vector multiplication. To test multiplication, run:
bin/r mult data/100.txt --rhs data/rhs_100.txt --mults 10 --verboseData should be generated using the generator script in generators/matrix.rb.
Implements the BiCGSTAB iterative method for solving systems of linear equations with block sparse matrices
bin/r solve -m bicgstab --matrix data/bsmp1.txt --rhs data/bsmp1_rhs.txt --output data/bsmp1_x.txtImplements methods for solving generalized eigenvalue problems with block sparse matrices.
Scripts for generating test sparse matrices in triplets.
Recomennded convention is to store generated matrices in data/ directory.
Generates a block sparse matrix in triplet format and saves it to a file.
ruby generators/matrix.rb output_file.txt [n_blocks] [block_size]output_file.txt: Path to the output file.n_blocks: (Optional) Number of blocks to generate. Default is 1000.block_size: (Optional) Size of each block. Default is 4.
Will also generate right-hand side vector with name rhs_output_file.txt.
Scripts for comparing BSMP performance with Matlab's built-in functions and visualizing results.
Reads a sparse matrix in MATLAB format and makes nice plot. Can compute bandwidth.
Multiplies a sparse matrix by a vector
Solves a system of linear equations with a sparse matrix in MATLAB, loads external solution for comparison.