From ffc46a77a9c71c0a339621b48e3df027c92909d6 Mon Sep 17 00:00:00 2001 From: Jose Alves Date: Thu, 18 Sep 2025 00:46:17 +0200 Subject: [PATCH 01/22] first draft for stdlib_sparse paper --- .github/workflows/draft-pdf.yml | 24 ++++++ joss/paper_sparse.bib | 90 ++++++++++++++++++++ joss/paper_sparse.md | 144 ++++++++++++++++++++++++++++++++ 3 files changed, 258 insertions(+) create mode 100644 .github/workflows/draft-pdf.yml create mode 100644 joss/paper_sparse.bib create mode 100644 joss/paper_sparse.md diff --git a/.github/workflows/draft-pdf.yml b/.github/workflows/draft-pdf.yml new file mode 100644 index 000000000..720b13412 --- /dev/null +++ b/.github/workflows/draft-pdf.yml @@ -0,0 +1,24 @@ +name: Draft PDF +on: [push] + +jobs: + paper: + runs-on: ubuntu-latest + name: Paper Draft + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Build draft PDF + uses: openjournals/openjournals-draft-action@master + with: + journal: joss + # This should be the path to the paper within your repo. + paper-path: joss/paper_sparse.md + - name: Upload + uses: actions/upload-artifact@v4 + with: + name: paper_sparse + # This is the output path where Pandoc will write the compiled + # PDF. Note, this should be the same directory as the input + # paper.md + path: joss/paper_sparse.pdf \ No newline at end of file diff --git a/joss/paper_sparse.bib b/joss/paper_sparse.bib new file mode 100644 index 000000000..667919957 --- /dev/null +++ b/joss/paper_sparse.bib @@ -0,0 +1,90 @@ +@book{saad2003iterative, + title={Iterative methods for sparse linear systems}, + author={Saad, Yousef}, + year={2003}, + publisher={SIAM} +} +@article{MUMPS:1, + title = {A Fully Asynchronous Multifrontal Solver Using Distributed Dynamic Scheduling}, + author = {P.R. Amestoy and I. S. Duff and J. Koster and J.-Y. L'Excellent}, + journal = {SIAM Journal on Matrix Analysis and Applications}, + volume = {23}, + number = {1}, + year = {2001}, + pages = {15-41} +} +@article{MUMPS:2, + title = {{Performance and Scalability of the Block Low-Rank Multifrontal + Factorization on Multicore Architectures}}, + author = {P.R. Amestoy and A. Buttari and J.-Y. L'Excellent and T. Mary}, + journal = {ACM Transactions on Mathematical Software}, + volume = 45, + issue = 1, + pages = {2:1--2:26}, + year={2019}, +} + +@Misc{petsc-web-page, + author = {Satish Balay and Shrirang Abhyankar and Mark~F. Adams and Jed Brown and Peter Brune + and Kris Buschelman and Lisandro Dalcin and Victor Eijkhout and William~D. Gropp + and Dinesh Kaushik and Matthew~G. Knepley + and Lois Curfman McInnes and Karl Rupp and Barry~F. Smith + and Stefano Zampini and Hong Zhang}, + title = {{PETS}c {W}eb page}, + url = {http://www.mcs.anl.gov/petsc}, + howpublished = {\url{http://www.mcs.anl.gov/petsc}}, + year = {2015} +} + +@techreport{bell2008efficient, + title={Efficient sparse matrix-vector multiplication on CUDA}, + author={Bell, Nathan and Garland, Michael}, + year={2008}, + institution={Nvidia Technical Report NVR-2008-004, Nvidia Corporation} +} +@book{magoules2017calcul, + title={Calcul scientifique parall{\`e}le-2e {\'e}d.: Cours, exemples avec openMP et MPI, exercices corrig{\'e}s}, + author={Magoul{\`e}s, Fr{\'e}d{\'e}ric and Roux, Fran{\c{c}}ois-Xavier}, + year={2017}, + publisher={Dunod} +} +@article{anzt2014implementing, + title={Implementing a Sparse Matrix Vector Product for the SELL-C/SELL-C-$\sigma$ formats on NVIDIA GPUs}, + author={Anzt, Hartwig and Tomov, Stanimire and Dongarra, Jack}, + journal={University of Tennessee, Tech. Rep. ut-eecs-14-727}, + year={2014} +} +@software{fsparse2024, + author = {José R. Alves Z. and + Samuele Giuli}, + title = {FSPARSE: Fortran Sparse Gallery library}, + month = may, + year = 2024, + publisher = {Zenodo}, + version = {v0.1.1}, + doi = {10.5281/zenodo.11175000}, + url = {https://doi.org/10.5281/zenodo.11175000}, +} +@ARTICLE{2020SciPy-NMeth, + author = {Virtanen, Pauli and Gommers, Ralf and Oliphant, Travis E. and + Haberland, Matt and Reddy, Tyler and Cournapeau, David and + Burovski, Evgeni and Peterson, Pearu and Weckesser, Warren and + Bright, Jonathan and {van der Walt}, St{\'e}fan J. and + Brett, Matthew and Wilson, Joshua and Millman, K. Jarrod and + Mayorov, Nikolay and Nelson, Andrew R. J. and Jones, Eric and + Kern, Robert and Larson, Eric and Carey, C J and + Polat, {\.I}lhan and Feng, Yu and Moore, Eric W. and + {VanderPlas}, Jake and Laxalde, Denis and Perktold, Josef and + Cimrman, Robert and Henriksen, Ian and Quintero, E. A. and + Harris, Charles R. and Archibald, Anne M. and + Ribeiro, Ant{\^o}nio H. and Pedregosa, Fabian and + {van Mulbregt}, Paul and {SciPy 1.0 Contributors}}, + title = {{{SciPy} 1.0: Fundamental Algorithms for Scientific + Computing in Python}}, + journal = {Nature Methods}, + year = {2020}, + volume = {17}, + pages = {261--272}, + adsurl = {https://rdcu.be/b08Wh}, + doi = {10.1038/s41592-019-0686-2}, +} \ No newline at end of file diff --git a/joss/paper_sparse.md b/joss/paper_sparse.md new file mode 100644 index 000000000..fe26ecbc3 --- /dev/null +++ b/joss/paper_sparse.md @@ -0,0 +1,144 @@ +--- +title: 'stdlib sparse: A high level Fortran sparse matrix library' +tags: + - Fortran + - linear algebra + - sparse matrix +authors: + - name: José R. Alves Z. + corresponding: true + orcid: 0000-0001-9448-0145 + affiliation: 1 + - name: Ivan Pribec + affiliation: 2 + - name: Jeremie Vandenplas + affiliation: 3 + orcid: 0000-0002-2554-072X + - name: Federico Perini + affiliation: 4 +affiliations: + - name: Transvalor S.A., France + index: 1 + - name: Leibniz Centre of Supercomputing, Germany + index: 2 + - name: Wageningen University, The Netherlands + index: 3 + - name: Wisconsin Engine Research Consultants, USA + index: 4 +date: 17 September 2025 +bibliography: paper_sparse.bib +--- + +# Summary + +Sparse matrices are a core building block in scientific computing, particularly in fields such as computational physics, engineering, and graph analysis. Despite Fortran’s long tradition in numerical computing, its ecosystem lacks a canonical, modern, high-level library for sparse data structures. + +We present stdlib_sparse, a sparse matrix library implemented in modern Fortran as part of the (community) Fortran Standard Library (stdlib). It provides well-defined sparse storage formats, conversion routines, and core operations such as sparse matrix–vector multiplication. This library aims to improve reproducibility, interoperability, and performance across Fortran applications by offering standardized, extensible data structures. + +# Statement of need + +Many scientific applications require sparse linear algebra routines for efficient storage and computation with large, structured matrices. Fortran users have traditionally relied on external libraries (e.g. SPARSKIT, MUMPS, SuiteSparse) or custom implementations. This fragmentation leads to challenges in portability, maintainability, and discoverability. + +The stdlib_sparse library addresses this gap by offering: + +* A consistent set of sparse matrix formats (COO, CSR, CSC, ELLPACK, SELL-C). +* Format conversion routines to enable interoperability. +* Standardized operations such as sparse matrix–vector multiplication (SpMV). +* A unified API, following modern Fortran practices, as part of the official Fortran stdlib project. + +By integrating directly into stdlib, stdlib_sparse lowers the barrier for Fortran developers to adopt sparse methods, reduces code duplication, and promotes best practices for numerical software development. + +# Related work + +Several sparse libraries exist in Fortran and other languages: + +* SPARSKIT (Fortran 77, Saad 1994) — influential, but outdated syntax and limited interoperability [@saad2003iterative]. +* MUMPS [@MUMPS:1] and PETSc [@petsc-web-page] — high-performance solvers written in Fortran/C with broad functionality, but heavy dependencies and steeper learning curve. +* SciPy.sparse (Python) [@2020SciPy-NMeth] and Eigen (C++) — modern high-level APIs in other ecosystems, demonstrating the value of standardized interfaces. + +Compared to these, stdlib_sparse focuses on providing a lightweight, modern Fortran interface integrated into the stdlib, emphasizing portability and extensibility rather than complete solver functionality. + +# Design and implementation +## Data structures + +All sparse formats extend an abstract base type sparse_type, which holds metadata such as number of rows, columns, and nonzeros. Implementations include: + +* COO: coordinate (triplet) format. +* CSR: compressed sparse row (Yale) format. +* CSC: compressed sparse column format. +* ELLPACK: fixed number of nonzeros per row, suited for vectorization. +* SELL-C: sliced ELLPACK, balancing CSR and ELLPACK trade-offs [@anzt2014implementing]. + +## Core functionality + +* Construction: from triplet (`i,j,v`) arrays or dense matrices. +* Data accessors: `add` (insert/update entries) and `at` (element access with management zero/NaN handling of missing entries). +* Operations: sparse matrix–vector multiplication (`spmv`), with optional transpose and hermitian variants: +$$ y = \alpha op(A) * x + \beta * y$$ +* Conversions: between sparse formats and dense matrices. +* Utilities: diagonal extraction, symmetry flags, duplicate entry handling. + +## Implementation details + +Before introducing stdlib_sparse, the core structure and API was crafted under a stand-aline project, FSPARSE [@fsparse2024]. This enabled testing and refinement of the library before integration into stdlib. + +The module is designed with the following key features: + +* Generic procedures support both real and complex kinds. +* Memory is allocated dynamically with type-bound malloc routines. +* Conversions handle duplicate entries, with options for summation or overwriting. + +# Example usage + +```fortran +program main + use stdlib_linalg_constants, only: dp + use stdlib_sparse + implicit none + + integer, parameter :: m = 4, n = 2 + real(dp) :: A(m,n), x(n) + real(dp) :: y_dense(m), y_coo(m), y_csr(m) + real(dp) :: alpha, beta + type(COO_dp_type) :: COO + type(CSR_dp_type) :: CSR + + call random_number(A) + ! Convert from dense to COO and CSR matrices + call dense2coo( A , COO ) + call coo2csr( COO , CSR ) + + ! Initialize vectors + x = 1._dp + y_dense = 2._dp + y_coo = y_dense + y_csr = y_dense + + ! Perform matrix-vector product + alpha = 3._dp; beta = 2._dp + y_dense = alpha * matmul(A,x) + beta * y_dense + call spmv( COO , x , y_coo , alpha = alpha, beta = beta ) + call spmv( CSR , x , y_csr , alpha = alpha, beta = beta ) + + print *, 'dense :', y_dense + print *, 'coo :', y_coo + print *, 'csr :', y_csr + +end program main +``` + +# Performance and limitations + +Sparse matrix–vector multiplication has been implemented for all formats. Preliminary tests confirm correctness and scalability to moderately large problems. However: + +* No sparse matrix–matrix multiplication or factorizations are yet implemented. +* Parallelism (multi-thread or multi-process) and GPU acceleration are not currently supported. +* Interfaces are subject to change while the module remains experimental. + +Future work will address these limitations by adding additional kernels, improving performance portability, and expanding supported formats. + +# Acknowledgements + +This work is part of the Fortran-lang community project. We thank the contributors to stdlib and the Fortran community for discussions, reviews, and development efforts. + +# References \ No newline at end of file From 60de27841697aefd0996431798f9cbed927fc69f Mon Sep 17 00:00:00 2001 From: Jose Alves Date: Thu, 18 Sep 2025 01:06:04 +0200 Subject: [PATCH 02/22] try actions change to output pdf --- .github/workflows/draft-pdf.yml | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/.github/workflows/draft-pdf.yml b/.github/workflows/draft-pdf.yml index 720b13412..6e65583af 100644 --- a/.github/workflows/draft-pdf.yml +++ b/.github/workflows/draft-pdf.yml @@ -1,5 +1,9 @@ name: Draft PDF -on: [push] +on: + push: + paths: + - joss/** + - .github/workflows/draft-pdf.yml jobs: paper: @@ -8,17 +12,15 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 + - name: Build draft PDF - uses: openjournals/openjournals-draft-action@master + uses: openjournals/openjournals-draft-pdf@master with: journal: joss - # This should be the path to the paper within your repo. paper-path: joss/paper_sparse.md - - name: Upload + + - name: Upload PDF uses: actions/upload-artifact@v4 with: name: paper_sparse - # This is the output path where Pandoc will write the compiled - # PDF. Note, this should be the same directory as the input - # paper.md path: joss/paper_sparse.pdf \ No newline at end of file From 01e946942be1e4a7deffd528a623d4529311516e Mon Sep 17 00:00:00 2001 From: Jose Alves Date: Thu, 18 Sep 2025 01:07:50 +0200 Subject: [PATCH 03/22] rollback actions name --- .github/workflows/draft-pdf.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/draft-pdf.yml b/.github/workflows/draft-pdf.yml index 6e65583af..a79465a33 100644 --- a/.github/workflows/draft-pdf.yml +++ b/.github/workflows/draft-pdf.yml @@ -14,7 +14,7 @@ jobs: uses: actions/checkout@v4 - name: Build draft PDF - uses: openjournals/openjournals-draft-pdf@master + uses: openjournals/openjournals-draft-action@master with: journal: joss paper-path: joss/paper_sparse.md From 678c315c33f765c2e5d04036b6df545ef8c5fee0 Mon Sep 17 00:00:00 2001 From: Jose Alves Date: Thu, 18 Sep 2025 01:17:30 +0200 Subject: [PATCH 04/22] try change name --- .github/workflows/draft-pdf.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/draft-pdf.yml b/.github/workflows/draft-pdf.yml index a79465a33..a701f3920 100644 --- a/.github/workflows/draft-pdf.yml +++ b/.github/workflows/draft-pdf.yml @@ -22,5 +22,5 @@ jobs: - name: Upload PDF uses: actions/upload-artifact@v4 with: - name: paper_sparse + name: joss/paper_sparse path: joss/paper_sparse.pdf \ No newline at end of file From b21c1657a7a790c3a238a1e2bfad20669b3ba328 Mon Sep 17 00:00:00 2001 From: Jose Alves Date: Thu, 18 Sep 2025 01:21:52 +0200 Subject: [PATCH 05/22] try changing path --- .github/workflows/draft-pdf.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/draft-pdf.yml b/.github/workflows/draft-pdf.yml index a701f3920..896fea056 100644 --- a/.github/workflows/draft-pdf.yml +++ b/.github/workflows/draft-pdf.yml @@ -22,5 +22,5 @@ jobs: - name: Upload PDF uses: actions/upload-artifact@v4 with: - name: joss/paper_sparse - path: joss/paper_sparse.pdf \ No newline at end of file + name: paper_sparse + path: paper_sparse.pdf \ No newline at end of file From e3fadee933a29ef4bc562c8e0a4bedb52209ff03 Mon Sep 17 00:00:00 2001 From: Jose Alves Date: Thu, 18 Sep 2025 11:53:09 +0200 Subject: [PATCH 06/22] add orcid --- joss/paper_sparse.md | 1 + 1 file changed, 1 insertion(+) diff --git a/joss/paper_sparse.md b/joss/paper_sparse.md index fe26ecbc3..8f37f82c3 100644 --- a/joss/paper_sparse.md +++ b/joss/paper_sparse.md @@ -11,6 +11,7 @@ authors: affiliation: 1 - name: Ivan Pribec affiliation: 2 + orcid: 0000-0001-8436-882X - name: Jeremie Vandenplas affiliation: 3 orcid: 0000-0002-2554-072X From e01c83ebe961e6d90e676c89e229e473d1bcfb49 Mon Sep 17 00:00:00 2001 From: Jose Alves Date: Thu, 18 Sep 2025 12:22:46 +0200 Subject: [PATCH 07/22] try mv --- .github/workflows/draft-pdf.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/draft-pdf.yml b/.github/workflows/draft-pdf.yml index 896fea056..886251c8d 100644 --- a/.github/workflows/draft-pdf.yml +++ b/.github/workflows/draft-pdf.yml @@ -19,8 +19,11 @@ jobs: journal: joss paper-path: joss/paper_sparse.md + - name: Move PDF into joss folder + run: mv paper.pdf joss/paper_sparse.pdf + - name: Upload PDF uses: actions/upload-artifact@v4 with: name: paper_sparse - path: paper_sparse.pdf \ No newline at end of file + path: joss/paper_sparse.pdf \ No newline at end of file From 7d3a8c029554ab0e6d3dd58e2e809cf339e7f61a Mon Sep 17 00:00:00 2001 From: Jose Alves Date: Thu, 18 Sep 2025 12:27:50 +0200 Subject: [PATCH 08/22] trial --- .github/workflows/draft-pdf.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/draft-pdf.yml b/.github/workflows/draft-pdf.yml index 886251c8d..d3bdc1622 100644 --- a/.github/workflows/draft-pdf.yml +++ b/.github/workflows/draft-pdf.yml @@ -20,7 +20,7 @@ jobs: paper-path: joss/paper_sparse.md - name: Move PDF into joss folder - run: mv paper.pdf joss/paper_sparse.pdf + run: mv paper_sparse.pdf joss/ - name: Upload PDF uses: actions/upload-artifact@v4 From c7db0023ed48904bea1a86393c423f347e32ba37 Mon Sep 17 00:00:00 2001 From: Jose Alves Date: Thu, 18 Sep 2025 12:31:18 +0200 Subject: [PATCH 09/22] trial --- .github/workflows/draft-pdf.yml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/workflows/draft-pdf.yml b/.github/workflows/draft-pdf.yml index d3bdc1622..37a93c1a7 100644 --- a/.github/workflows/draft-pdf.yml +++ b/.github/workflows/draft-pdf.yml @@ -19,11 +19,8 @@ jobs: journal: joss paper-path: joss/paper_sparse.md - - name: Move PDF into joss folder - run: mv paper_sparse.pdf joss/ - - name: Upload PDF uses: actions/upload-artifact@v4 with: - name: paper_sparse - path: joss/paper_sparse.pdf \ No newline at end of file + name: paper + path: paper.pdf \ No newline at end of file From d1215cc868028fa3521218c1b2dfa2d82b927e25 Mon Sep 17 00:00:00 2001 From: Jose Alves Date: Thu, 18 Sep 2025 12:41:34 +0200 Subject: [PATCH 10/22] trial --- .github/workflows/draft-pdf.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/draft-pdf.yml b/.github/workflows/draft-pdf.yml index 37a93c1a7..9630fe8b5 100644 --- a/.github/workflows/draft-pdf.yml +++ b/.github/workflows/draft-pdf.yml @@ -23,4 +23,4 @@ jobs: uses: actions/upload-artifact@v4 with: name: paper - path: paper.pdf \ No newline at end of file + path: joss/paper.pdf \ No newline at end of file From 1b1983bc703a174a5461fa35139acae5ba2b7f27 Mon Sep 17 00:00:00 2001 From: Jose Alves Date: Thu, 18 Sep 2025 16:38:53 +0200 Subject: [PATCH 11/22] updates --- joss/paper_sparse.bib | 2 +- joss/paper_sparse.md | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/joss/paper_sparse.bib b/joss/paper_sparse.bib index 667919957..942b1dc26 100644 --- a/joss/paper_sparse.bib +++ b/joss/paper_sparse.bib @@ -55,7 +55,7 @@ @article{anzt2014implementing year={2014} } @software{fsparse2024, - author = {José R. Alves Z. and + author = {José Alves and Samuele Giuli}, title = {FSPARSE: Fortran Sparse Gallery library}, month = may, diff --git a/joss/paper_sparse.md b/joss/paper_sparse.md index 8f37f82c3..39c90045c 100644 --- a/joss/paper_sparse.md +++ b/joss/paper_sparse.md @@ -5,7 +5,7 @@ tags: - linear algebra - sparse matrix authors: - - name: José R. Alves Z. + - name: José Alves corresponding: true orcid: 0000-0001-9448-0145 affiliation: 1 @@ -133,7 +133,7 @@ end program main Sparse matrix–vector multiplication has been implemented for all formats. Preliminary tests confirm correctness and scalability to moderately large problems. However: * No sparse matrix–matrix multiplication or factorizations are yet implemented. -* Parallelism (multi-thread or multi-process) and GPU acceleration are not currently supported. +* For data-parallelism (multi-processing with MPI or coarrays) the `spmv` kernel can be used as basis within each process. Multi-threading or GPU acceleration is not currently supported. * Interfaces are subject to change while the module remains experimental. Future work will address these limitations by adding additional kernels, improving performance portability, and expanding supported formats. From ea9b2ca475c1e0f2acf517827898f643a98578b5 Mon Sep 17 00:00:00 2001 From: Jose Alves Date: Fri, 19 Sep 2025 20:08:21 +0200 Subject: [PATCH 12/22] update orcid --- joss/paper_sparse.md | 1 + 1 file changed, 1 insertion(+) diff --git a/joss/paper_sparse.md b/joss/paper_sparse.md index 39c90045c..78e9673ed 100644 --- a/joss/paper_sparse.md +++ b/joss/paper_sparse.md @@ -17,6 +17,7 @@ authors: orcid: 0000-0002-2554-072X - name: Federico Perini affiliation: 4 + orcid: 0000-0001-8017-1747 affiliations: - name: Transvalor S.A., France index: 1 From f09171d4da8c8d67598beaccffcbe5bb929ae355 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Alves?= <102541118+jalvesz@users.noreply.github.com> Date: Fri, 26 Sep 2025 11:55:26 +0200 Subject: [PATCH 13/22] Update joss/paper_sparse.md Co-authored-by: Jeremie Vandenplas --- joss/paper_sparse.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/joss/paper_sparse.md b/joss/paper_sparse.md index 78e9673ed..9f059bf03 100644 --- a/joss/paper_sparse.md +++ b/joss/paper_sparse.md @@ -23,7 +23,7 @@ affiliations: index: 1 - name: Leibniz Centre of Supercomputing, Germany index: 2 - - name: Wageningen University, The Netherlands + - name: Wageningen University and Research, The Netherlands index: 3 - name: Wisconsin Engine Research Consultants, USA index: 4 From fadcb3e94976404496b08f1de5ed121f49c43a59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Alves?= <102541118+jalvesz@users.noreply.github.com> Date: Fri, 26 Sep 2025 11:55:46 +0200 Subject: [PATCH 14/22] Update joss/paper_sparse.md Co-authored-by: Jeremie Vandenplas --- joss/paper_sparse.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/joss/paper_sparse.md b/joss/paper_sparse.md index 9f059bf03..96a285cb7 100644 --- a/joss/paper_sparse.md +++ b/joss/paper_sparse.md @@ -35,7 +35,7 @@ bibliography: paper_sparse.bib Sparse matrices are a core building block in scientific computing, particularly in fields such as computational physics, engineering, and graph analysis. Despite Fortran’s long tradition in numerical computing, its ecosystem lacks a canonical, modern, high-level library for sparse data structures. -We present stdlib_sparse, a sparse matrix library implemented in modern Fortran as part of the (community) Fortran Standard Library (stdlib). It provides well-defined sparse storage formats, conversion routines, and core operations such as sparse matrix–vector multiplication. This library aims to improve reproducibility, interoperability, and performance across Fortran applications by offering standardized, extensible data structures. +We present stdlib_sparse, a sparse matrix library implemented in modern Fortran as part of the (community-driven) Fortran Standard Library (stdlib). It provides well-defined sparse storage formats, conversion routines, and core operations such as sparse matrix–vector multiplication. This library aims to improve reproducibility, interoperability, and performance across Fortran applications by offering standardized and extensible data structures. # Statement of need From 34ff16bc3cabb533889358df0f2b735890a39643 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Alves?= <102541118+jalvesz@users.noreply.github.com> Date: Fri, 26 Sep 2025 11:57:36 +0200 Subject: [PATCH 15/22] Update joss/paper_sparse.md Co-authored-by: Jeremie Vandenplas --- joss/paper_sparse.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/joss/paper_sparse.md b/joss/paper_sparse.md index 96a285cb7..825c99d13 100644 --- a/joss/paper_sparse.md +++ b/joss/paper_sparse.md @@ -82,7 +82,7 @@ $$ y = \alpha op(A) * x + \beta * y$$ ## Implementation details -Before introducing stdlib_sparse, the core structure and API was crafted under a stand-aline project, FSPARSE [@fsparse2024]. This enabled testing and refinement of the library before integration into stdlib. +Before introducing stdlib_sparse, the core structure and API was crafted under a stand-alone project, FSPARSE [@fsparse2024]. This enabled testing and refinement of the library before integration into stdlib. The module is designed with the following key features: From 4895e92bfb96fe650d3bde3db7279c3d47210c4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Alves?= <102541118+jalvesz@users.noreply.github.com> Date: Fri, 26 Sep 2025 11:57:59 +0200 Subject: [PATCH 16/22] Update joss/paper_sparse.md Co-authored-by: Jeremie Vandenplas --- joss/paper_sparse.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/joss/paper_sparse.md b/joss/paper_sparse.md index 825c99d13..e28c26d5b 100644 --- a/joss/paper_sparse.md +++ b/joss/paper_sparse.md @@ -48,7 +48,7 @@ The stdlib_sparse library addresses this gap by offering: * Standardized operations such as sparse matrix–vector multiplication (SpMV). * A unified API, following modern Fortran practices, as part of the official Fortran stdlib project. -By integrating directly into stdlib, stdlib_sparse lowers the barrier for Fortran developers to adopt sparse methods, reduces code duplication, and promotes best practices for numerical software development. +By integrating it directly into stdlib, stdlib_sparse lowers the barrier for Fortran developers to adopt sparse methods, reduces code duplication, and promotes best practices for numerical software development. # Related work From fef07b4b3ea55b7c63203c80986f90fbe0f9ad36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Alves?= <102541118+jalvesz@users.noreply.github.com> Date: Fri, 26 Sep 2025 11:58:11 +0200 Subject: [PATCH 17/22] Update joss/paper_sparse.md Co-authored-by: Jeremie Vandenplas --- joss/paper_sparse.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/joss/paper_sparse.md b/joss/paper_sparse.md index e28c26d5b..d1c946b18 100644 --- a/joss/paper_sparse.md +++ b/joss/paper_sparse.md @@ -63,7 +63,7 @@ Compared to these, stdlib_sparse focuses on providing a lightweight, modern Fort # Design and implementation ## Data structures -All sparse formats extend an abstract base type sparse_type, which holds metadata such as number of rows, columns, and nonzeros. Implementations include: +All sparse formats extend an abstract base derived type sparse_type, which holds metadata such as number of rows, columns, and nonzeros. Implementations include: * COO: coordinate (triplet) format. * CSR: compressed sparse row (Yale) format. From e21f94b7855d3b84d6ff2550ef5cd6390ceaef3c Mon Sep 17 00:00:00 2001 From: Jose Alves Date: Fri, 26 Sep 2025 12:19:34 +0200 Subject: [PATCH 18/22] mention psblas --- joss/paper_sparse.bib | 22 +++++++++++++++++++++- joss/paper_sparse.md | 3 ++- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/joss/paper_sparse.bib b/joss/paper_sparse.bib index 942b1dc26..97fb32e33 100644 --- a/joss/paper_sparse.bib +++ b/joss/paper_sparse.bib @@ -87,4 +87,24 @@ @ARTICLE{2020SciPy-NMeth pages = {261--272}, adsurl = {https://rdcu.be/b08Wh}, doi = {10.1038/s41592-019-0686-2}, -} \ No newline at end of file +} + +@article{psblas, +author = {Filippone, Salvatore and Buttari, Alfredo}, +title = {Object-Oriented Techniques for Sparse Matrix Computations in Fortran 2003}, +year = {2012}, +issue_date = {August 2012}, +publisher = {Association for Computing Machinery}, +address = {New York, NY, USA}, +volume = {38}, +number = {4}, +issn = {0098-3500}, +url = {https://doi.org/10.1145/2331130.2331131}, +doi = {10.1145/2331130.2331131}, +abstract = {The efficiency of a sparse linear algebra operation heavily relies on the ability of the sparse matrix storage format to exploit the computing power of the underlying hardware. Since no format is universally better than the others across all possible kinds of operations and computers, sparse linear algebra software packages should provide facilities to easily implement and integrate new storage formats within a sparse linear algebra application without the need to modify it; it should also allow to dynamically change a storage format at run-time depending on the specific operations to be performed. Aiming at these important features, we present an Object Oriented design model for a sparse linear algebra package which relies on Design Patterns. We show that an implementation of our model can be efficiently achieved through some of the unique features of the Fortran 2003 language. Experimental results show that the proposed software infrastructure improves the modularity and ease of use of the code at no performance loss.}, +journal = {ACM Trans. Math. Softw.}, +month = aug, +articleno = {23}, +numpages = {20}, +keywords = {sparse matrices, object-oriented design, Mathematics of computing} +} diff --git a/joss/paper_sparse.md b/joss/paper_sparse.md index d1c946b18..c46e5be34 100644 --- a/joss/paper_sparse.md +++ b/joss/paper_sparse.md @@ -56,9 +56,10 @@ Several sparse libraries exist in Fortran and other languages: * SPARSKIT (Fortran 77, Saad 1994) — influential, but outdated syntax and limited interoperability [@saad2003iterative]. * MUMPS [@MUMPS:1] and PETSc [@petsc-web-page] — high-performance solvers written in Fortran/C with broad functionality, but heavy dependencies and steeper learning curve. +* PSBLAS [@psblas] A Parallel Sparse BLAS library in Fortran 2003 and 2008. * SciPy.sparse (Python) [@2020SciPy-NMeth] and Eigen (C++) — modern high-level APIs in other ecosystems, demonstrating the value of standardized interfaces. -Compared to these, stdlib_sparse focuses on providing a lightweight, modern Fortran interface integrated into the stdlib, emphasizing portability and extensibility rather than complete solver functionality. +Compared to these, stdlib_sparse focuses on providing a lightweight, modern Fortran interface integrated into the stdlib, emphasizing portability and modularity rather than fully-integrated solvers frameworks. # Design and implementation ## Data structures From b45467c4a37033329d418007b785f2c06b2fe7e3 Mon Sep 17 00:00:00 2001 From: jalvesz Date: Sat, 27 Sep 2025 10:10:58 +0200 Subject: [PATCH 19/22] reviews from Ivan --- joss/paper_sparse.bib | 13 +++++++++++++ joss/paper_sparse.md | 8 ++++---- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/joss/paper_sparse.bib b/joss/paper_sparse.bib index 97fb32e33..41db0f92f 100644 --- a/joss/paper_sparse.bib +++ b/joss/paper_sparse.bib @@ -108,3 +108,16 @@ @article{psblas numpages = {20}, keywords = {sparse matrices, object-oriented design, Mathematics of computing} } + +@article{scellc, +author = {Kreutzer, Moritz and Hager, Georg and Wellein, Gerhard and Fehske, Holger and Bishop, Alan R.}, +title = {A Unified Sparse Matrix Data Format for Efficient General Sparse Matrix-Vector Multiplication on Modern Processors with Wide SIMD Units}, +journal = {SIAM Journal on Scientific Computing}, +volume = {36}, +number = {5}, +pages = {C401-C423}, +year = {2014}, +doi = {10.1137/130930352}, +url = { https://doi.org/10.1137/130930352 }, +eprint = { https://doi.org/10.1137/130930352 }, +} diff --git a/joss/paper_sparse.md b/joss/paper_sparse.md index c46e5be34..63a5f1ddb 100644 --- a/joss/paper_sparse.md +++ b/joss/paper_sparse.md @@ -21,7 +21,7 @@ authors: affiliations: - name: Transvalor S.A., France index: 1 - - name: Leibniz Centre of Supercomputing, Germany + - name: Leibniz Supercomputing Centre, Garching, Germany index: 2 - name: Wageningen University and Research, The Netherlands index: 3 @@ -70,7 +70,7 @@ All sparse formats extend an abstract base derived type sparse_type, which holds * CSR: compressed sparse row (Yale) format. * CSC: compressed sparse column format. * ELLPACK: fixed number of nonzeros per row, suited for vectorization. -* SELL-C: sliced ELLPACK, balancing CSR and ELLPACK trade-offs [@anzt2014implementing]. +* SELL-C: sliced ELLPACK, balancing CSR and ELLPACK trade-offs [@scellc,@anzt2014implementing]. ## Core functionality @@ -83,7 +83,7 @@ $$ y = \alpha op(A) * x + \beta * y$$ ## Implementation details -Before introducing stdlib_sparse, the core structure and API was crafted under a stand-alone project, FSPARSE [@fsparse2024]. This enabled testing and refinement of the library before integration into stdlib. +Before introducing stdlib_sparse, the core structure and API was crafted under a standalone project, FSPARSE [@fsparse2024]. This enabled testing and refinement of the library before integration into stdlib. The module is designed with the following key features: @@ -132,7 +132,7 @@ end program main # Performance and limitations -Sparse matrix–vector multiplication has been implemented for all formats. Preliminary tests confirm correctness and scalability to moderately large problems. However: +Sparse matrix–vector multiplication has been implemented for all formats. Tests confirm correctness and scalability to moderately large problems. However: * No sparse matrix–matrix multiplication or factorizations are yet implemented. * For data-parallelism (multi-processing with MPI or coarrays) the `spmv` kernel can be used as basis within each process. Multi-threading or GPU acceleration is not currently supported. From d40d39f2e29f391ce641743679ce6692b79beb7a Mon Sep 17 00:00:00 2001 From: jalvesz Date: Sat, 27 Sep 2025 10:14:23 +0200 Subject: [PATCH 20/22] move files to respect the joss name "paper" only --- .github/workflows/draft-pdf.yml | 4 ++-- joss/{paper_sparse.bib => sparse/paper.bib} | 0 joss/{paper_sparse.md => sparse/paper.md} | 0 3 files changed, 2 insertions(+), 2 deletions(-) rename joss/{paper_sparse.bib => sparse/paper.bib} (100%) rename joss/{paper_sparse.md => sparse/paper.md} (100%) diff --git a/.github/workflows/draft-pdf.yml b/.github/workflows/draft-pdf.yml index 9630fe8b5..40718b39d 100644 --- a/.github/workflows/draft-pdf.yml +++ b/.github/workflows/draft-pdf.yml @@ -17,10 +17,10 @@ jobs: uses: openjournals/openjournals-draft-action@master with: journal: joss - paper-path: joss/paper_sparse.md + paper-path: joss/sparse/paper.md - name: Upload PDF uses: actions/upload-artifact@v4 with: name: paper - path: joss/paper.pdf \ No newline at end of file + path: joss/sparse/paper.pdf \ No newline at end of file diff --git a/joss/paper_sparse.bib b/joss/sparse/paper.bib similarity index 100% rename from joss/paper_sparse.bib rename to joss/sparse/paper.bib diff --git a/joss/paper_sparse.md b/joss/sparse/paper.md similarity index 100% rename from joss/paper_sparse.md rename to joss/sparse/paper.md From 29ad30e34d5c151d924b422a822f11b1f4015024 Mon Sep 17 00:00:00 2001 From: jalvesz Date: Sat, 27 Sep 2025 10:16:22 +0200 Subject: [PATCH 21/22] forgot to rename bib file --- joss/sparse/paper.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/joss/sparse/paper.md b/joss/sparse/paper.md index 63a5f1ddb..9524503b0 100644 --- a/joss/sparse/paper.md +++ b/joss/sparse/paper.md @@ -28,7 +28,7 @@ affiliations: - name: Wisconsin Engine Research Consultants, USA index: 4 date: 17 September 2025 -bibliography: paper_sparse.bib +bibliography: paper.bib --- # Summary From b341be741cc9631b6ad7203dfaf2442623245c40 Mon Sep 17 00:00:00 2001 From: jalvesz Date: Sat, 27 Sep 2025 10:22:05 +0200 Subject: [PATCH 22/22] fix multi citation --- joss/sparse/paper.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/joss/sparse/paper.md b/joss/sparse/paper.md index 9524503b0..457e6daeb 100644 --- a/joss/sparse/paper.md +++ b/joss/sparse/paper.md @@ -70,7 +70,7 @@ All sparse formats extend an abstract base derived type sparse_type, which holds * CSR: compressed sparse row (Yale) format. * CSC: compressed sparse column format. * ELLPACK: fixed number of nonzeros per row, suited for vectorization. -* SELL-C: sliced ELLPACK, balancing CSR and ELLPACK trade-offs [@scellc,@anzt2014implementing]. +* SELL-C: sliced ELLPACK, balancing CSR and ELLPACK trade-offs [@scellc;@anzt2014implementing]. ## Core functionality