# Parallel sparse matrix vector product

**URL:** <https://discourse.julialang.org/t/parallel-sparse-matrix-vector-product/12064>\
**Category:** Internals & Design\
**Created:** [June 29, 2018, 1:54pm UTC](https://discourse.julialang.org/t/parallel-sparse-matrix-vector-product/12064 "2018-06-29T13:54:47Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gregstrq](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gregstrq/32/20620_2.png) [@Gregstrq](https://discourse.julialang.org/u/Gregstrq)\
**Post date:** [June 29, 2018, 1:54pm UTC](https://discourse.julialang.org/t/parallel-sparse-matrix-vector-product/12064/1 "2018-06-29T13:54:47Z")

</div>

Hello, guys!  
Matrix-matrix and matrix-vector product operations are the core of linear algebra.  
For dense matrices, the underlying implementation uses OpenBLAS and it hugely benefits from using multithreading.

For sparse matrices we have only sequential Julia functions, implementing matmat or matvec.  
Are there any plans to develop parallel (multithreaded/multiworker) matmat and matvec operations for sparse matrices?  
I believe it is an important part and should be included into stdlib/sparse.

Is there some kind of recommended replacement to stick to in the mean-time?

---

<div class="post-metadata">

**Author:** ![PetrKryslUCSD](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/petrkryslucsd/32/215825_2.png) [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Post date:** [June 29, 2018, 2:03pm UTC](https://discourse.julialang.org/t/parallel-sparse-matrix-vector-product/12064/2 "2018-06-29T14:03:49Z")

</div>

Which kind of parallel? SMP or DMP? Did you check out DistributedArrays?

---

<div class="post-metadata">

**Author:** ![kristoffer.carlsson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kristoffer.carlsson/32/22_2.png) [@kristoffer.carlsson](https://discourse.julialang.org/u/kristoffer.carlsson)\
**Post date:** [June 29, 2018, 2:17pm UTC](https://discourse.julialang.org/t/parallel-sparse-matrix-vector-product/12064/3 "2018-06-29T14:17:54Z")

</div>

> **[GitHub - JuliaSparse/MKLSparse.jl: Make available to Julia the sparse...](https://github.com/JuliaSparse/MKLSparse.jl)**
>
> Make available to Julia the sparse functionality in MKL - GitHub - JuliaSparse/MKLSparse.jl: Make available to Julia the sparse functionality in MKL

MKL has parallel matvec.

---

<div class="post-metadata">

**Author:** ![Gregstrq](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gregstrq/32/20620_2.png) [@Gregstrq](https://discourse.julialang.org/u/Gregstrq)\
**Post date:** [June 29, 2018, 3:28pm UTC](https://discourse.julialang.org/t/parallel-sparse-matrix-vector-product/12064/4 "2018-06-29T15:28:12Z")

</div>

> [@PetrKryslUCSD](#):
>
> DistributedArrays

It seems, that in the end we need a combination of both:  
Arrays, which store the data for the sparse matrix, should be distributed across available nodes, but should be shared across the different cores in the same node.  
You could say that we only need to distribute everything beforehand, but, as I understand, for the cores on the same node there is no substantial overhead in making memory shared, and it can potentially diminish amount of overhead connected to information exchange between the cores of the same node.

Is it possible to make the chunks of DistributedArray be SharedArrays?

---

<div class="post-metadata">

**Author:** ![Gregstrq](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gregstrq/32/20620_2.png) [@Gregstrq](https://discourse.julialang.org/u/Gregstrq)\
**Post date:** [June 29, 2018, 3:33pm UTC](https://discourse.julialang.org/t/parallel-sparse-matrix-vector-product/12064/5 "2018-06-29T15:33:34Z")

</div>

Does MKL support distributed computations?

Is it optimised for non-uniform memory access?
