Showing results for

- Intel Community
- Software Development SDKs and Libraries
- Intel® oneAPI Math Kernel Library & Intel® Math Kernel Library
- Permutation of a large sparse matrix

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

Highlighted
##

Robert_E_

Beginner

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

10-08-2019
11:48 AM

85 Views

Permutation of a large sparse matrix

Hi,

What is the fastest way of permuting a large sparse_matrix_t in csr or csc format?

I could either do manual permutations on the csr arrays or I could create a sparse permutation matrix and use the mkl_sparse_spmm method.

Either method seems to be not optimal since I don't benefit from parallelism on the former method and I have to create additional arrays for the Permutation matrix and create a new copy of the matrix on the latter method.

Also, I notice that there might be performance differences between column and row permutations depending on whether the matrix is in csr or csc.

Is there a better way to do it?

2 Replies

Highlighted
##

Kirill_V_Intel

Employee

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

10-09-2019
08:19 PM

85 Views

Hi Robert,

I don't see any faster way in MKL than using something like spmm (or sp2m) right now.

Do you want to permute the rows, columns or rows and columns?

What do you mean by performance difference, could you please elaborate?

The more substantial question is: what do you want this matrix for? Often, when people think of permuting matrices (say P*A) they only need this product to use in a computation like (P*A)*v. My point is that for, say, (P*A)*v you actually don't need to form the matrix explicitly, you can do it as P*(A*v) and thus simply permute the intermediate vector (A*v).

Another thing is that if you want to compute PAP^T with symmetric A, you can use mkl_sparse_?_sypr to avoid forming the intermediate product.

Best,

Kirill

Highlighted
##

Gennady_F_Intel

Moderator

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

10-09-2019
09:16 PM

85 Views

Robert, could you try to submit the official Feature Request to the Intel Online Service Center?

For more complete information about compiler optimizations, see our Optimization Notice.