Hi Ghadeer —

Just to follow up on Ben's note, to do a sparse matrix-vector multiplication really cleanly and efficiently in Chapel, you'd want partial reductions (which collapse a 2D array or expression into a 1D result, for example). However, they are a feature that hasn't been
completed yet.

Without them, the alternative is to write it more explicitly, but I'm not aware of an implementation that I think is done well enough to be worth mimicking. If you end up writing a version yourself, I'd be interested in seeing it.

-Brad


On Fri, 12 Apr 2019, Ben Albrecht wrote:

Hello Alabandi,

I would like to know if there is any code that implements efficient sparse 
matrix-vector multiplication.

There is a CSR matrix-vector multiplication implemented through the generic 
`dot` method in the LinearAlgebra.Sparse submodule: 
https://chapel-lang.org/docs/modules/packages/LinearAlgebra/Sparse.html#Sparse.dot

However, I would not consider current implementation well-optimized.

Also, is there is any way to read a matrix from .mtx file and then add it to 
CSR domain if this is not possible can I dump a created CSR matrix to a file.

There is a MatrixMarket mason package: https://github.com/ct-clmsn/MatrixMarket

Unfortunately, it does not yet support CSR matrices. If you end up writing a 
CSR reader/writer, you might consider contributing the implementation to the 
package. See the feature request issue here: 
https://github.com/ct-clmsn/MatrixMarket/issues/4

Best,
Ben

________________________________
From: Alabandi, Ghadeer Ahmed H <[email protected]>
Sent: Thursday, April 11, 2019 7:15 PM
To: [email protected]
Subject: [Chapel-developers] sparse matrix-vector multiplication


Hi,


I'm working on a project where I intend to compare sparse matrix-vector 
multiplication using OpenMP and chapel.

Because I'm not that familiar with chapel I would like to know if there is any 
code that implements efficient sparse matrix-vector multiplication.


Also, is there is any way to read a matrix from .mtx file and then add it to 
CSR domain if this is not possible can I dump a created CSR matrix to a file.



Thank you
_______________________________________________
Chapel-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/chapel-developers

Reply via email to