SPM
SPM: SParse Matrix package
SPM (SParse Matrix package) is a scientific library that provides comprehensive basic routines to manipulate sparse matrices in CSC, CSR, and IJV formats. The functionalities covered are:
- Sparse matrix -by- dense matrix products
- Sparse matrix -by- vector products
- Norm computations
- Matrix and vector scaling
- Sort functions
- Graph symmetrization and merge of duplicate entries
- Random generators for right-hand sides
- Verification routines for linear solvers
- In-place format conversion routines
- Drivers to read matrices from files (MatrixMarket, Harwell-Boeing/RSA, IJV, …)
- Laplacian generators for stencils
- Multi-DOF and variadic DOF support
Python, Julia, and Fortran 90 wrappers are included in the package.
Warning: This package does not currently aim for peak performance, but rather provides a portable API and a simple interface to manipulate sparse matrices in both shared and distributed memory. This is conceptually similar to what was proposed in the GNU Scientific Library (GSL) Sparse Matrix module for shared memory.
Get SPM
The latest official release is v1.2.4 (July 2024). All releases, source tarballs, and changelogs are available on GitLab Releases.
To use the latest development version of SPM, please clone the master
branch. Note that SPM contains the morse_cmake git submodule.
To obtain the source code, please use the following commands:
# Clone with submodules
git clone --recursive https://gitlab.inria.fr/solverstack/spm.git
cd spm
Documentation
The latest Doxygen documentation is available here.
The main functionalities are listed here.
Installation
Build and install with CMake
SPM can be built using CMake. The build requires several library dependencies to be installed on the system:
- BLAS (MKL, OpenBLAS, …) and CBLAS (sequential version required)
- LAPACK and LAPACKE
- Python and Fortran compiler for wrappers and examples (optional)
For instance, on Debian-like systems, dependencies can be installed with the following command:
sudo apt-get install cmake gcc gfortran libopenblas-dev liblapacke-dev python-numpy
The main options to configure the SPM build are:
- Standard CMake options:
CMAKE_BUILD_TYPE: Debug, RelWithDebInfo, Release, MinSizeRel; we recommend usingReleaseorRelWithDebInfofor best performance.CMAKE_INSTALL_PREFIX: Specify the prefix directory to install the library.BUILD_SHARED_LIBS=[OFF]: Enable building shared libraries (required for the Python wrapper).
- Integer type:
SPM_INT64[=ON]: Enable/disable int64_t for integer arrays.
- Documentation:
BUILD_DOCUMENTATION[=OFF]: Enable Doxygen documentation generation.
Get involved!
Reporting an issue
We strongly recommend all users to use the issue tracker to report any problems with the software, or to submit feature requests. We will do our best to answer them in a timely manner.
Contributions
https://gitlab.inria.fr/solverstack/spm/blob/master/CONTRIBUTING.md
Authors
The following people contribute or contributed to the development of SPM:
- Mathieu Faverge
- Matthieu Kuhn
- Xavier Lacoste
- Selmane Lebdaoui
- Grégoire Pichon
- Florent Pruvost
- Pierre Ramet
- Theophile Terraz
- Tony Delarue
If we missed your name, please let us know so we can update the list.
License