Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Intel Community
- Software
- Software Development SDKs and Libraries
- Intel® oneAPI Math Kernel Library
- Problem converting sparse matrix format in MKL using mkl_dcsrcoo

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

sagarmatha

Beginner

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

08-14-2010
11:28 AM

191 Views

Problem converting sparse matrix format in MKL using mkl_dcsrcoo

Hi,

Can the entries of coordinate(ia(nnz),ja(nnz),a(nnz)) formated input sparse matrix be in "ANY" order when connverting it into CSR format using mkl_dcsrcoo in Intel MKL(-in Fortran) or should the order be like(increasing in column or row). I get a wrong converted matrix in CSR format when the INPUT was a random ordered Coordinate sparse matrix.

Following is the code added to the example code in which I changed the order of coordinate formated input sparse matrix and output. The output CSR, i get different than the actual.

Does anyone knows why the converting is not correct? The output i get are:

AI= 1 3 5 7 9

AJ = 1 2 1 2 4 3 4 3

Acsr = 5.0 8.0 9.0 2.0 6.0 3.0 4.0 1.0

the actual ones are

AI_standard 1 3 5 7 9

AJ_standard 1 2 1 2 3 4 3 4

Acsr_standard5.0 8.09.0 2.0 3.0 6.0 1.04.0

thanks a lot

sagarm

Win xp sp3 32-bit

Intel core 2 2 ghz, 2 gb ram

Microsoft Visual Studio 2008

Version 9.0.30729.1 SP

Intel Visual Fortran Compiler Integration Package ID: w_cprof_p_11.1.035

Intel Visual Fortran Compiler Integration for Microsoft Visual Studio* 2008, 11.1.3462.200

[bash]

!C--------------------------------------------------------------------------- !C TASK 4 Obtain sparse row format from sparse coordinate format !C--------------------------------------------------------------------------- job(1)=1 job(6)=3 ! !----------------------------------------! Acsr=.0; AJ=0;AI=0 ! set to zero. !Acoo in different order. ir(1)=1; jc(1)= 1; Acoo(1)=5.0; ir(2)=4; jc(2)= 4; Acoo(2)=4.0; ir(3)=1; jc(3)= 2; Acoo(3)=8.0; ir(4)=4; jc(4)= 3; Acoo(4)=1.0; ir(5)=2; jc(5)= 1; Acoo(5)=9.0; ir(6)=3; jc(6)= 4; Acoo(6)=6.0; ir(7)=2; jc(7)= 2; Acoo(7)=2.0; ir(8)=3; jc(8)= 3; Acoo(8)=3.0; !----------------------------------------! call mkl_dcsrcoo (job,n,Acsr,AJ,AI,nnz,Acoo,ir,jc,info)[/bash]

Link Copied

10 Replies

mecej4

Black Belt

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

08-14-2010
01:01 PM

191 Views

sagarmatha

Beginner

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

08-14-2010
03:37 PM

191 Views

But the problem still exist. I was converting my COO matrix to the 3-array CSR format, simply to use it as input in PARDISO solver and I first started with the given example file as I mentioned in the question.

PARDISO returned me the following error, when I wanted to solve the converted(using mkl_dcsrcoo) CSR matrix from the COO formated(example 4*4 sparse )matrix with 1 rhs( 13, 11, 9, 5) so that solution is (1 1 1 1):

*** Error in PARDISO (incorrect input matrix ) error_num= 24

*** Input check: j=7, ja(j)=4, ja(j+1)=3 are incompatible

Reordering completed ...

The following ERROR was detected: -1

Does this mean, PARDISO requires, in each row, the column indices of the entries to be in increasing order. Am I understanding it correctly ?

thanks

sagarm

mecej4

Black Belt

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

08-14-2010
05:18 PM

191 Views

Let us wait for an Intel representative to address this discrepancy.

sagarmatha

Beginner

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

08-14-2010
05:37 PM

191 Views

I see.

thanks

sagarm

thanks

sagarm

sagarmatha

Beginner

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

08-17-2010
01:48 PM

191 Views

any intel representative please !!

Konstantin_A_Intel

Employee

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

08-18-2010
01:06 AM

191 Views

In fact,mkl_?csrcoo routine in MKL 10.2 and earlier versions didn't sorted column indices withing a row. So, in order to use CSR arrays from the converter in PARDISO you'd need to sort each interval of ja array for each row i: ja(ia(i):ia(i+1)-1)

However, MKL 10.3.Beta supports this feature. If you want, you may download it and follow the documentation:

if job(1)=2, the matrix in the coordinate format isconverted to the CSR format, and the column indices in CSR

representation are sorted in the increasing order within eachrow.

Regards,

Konstantin

sagarmatha

Beginner

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

08-18-2010
01:59 PM

191 Views

thanks a lot for the suggestion. I'll try 10.3.

sagarm

sagarm

Gennady_F_Intel

Moderator

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

08-18-2010
09:52 PM

191 Views

please try to use this link to get 10.3 beta faster..

sagarmatha

Beginner

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

08-19-2010
08:51 AM

191 Views

thanks Gennady

Nicky_Sandhu

Beginner

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

08-29-2012
12:32 PM

191 Views

Topic Options

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

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