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 Development SDKs and Libraries
- Intel® oneAPI Math Kernel Library & Intel® Math Kernel Library
- sparse matrix vector products

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

itabhiyanta

Beginner

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

02-21-2013
01:28 AM

42 Views

sparse matrix vector products

Hi

I hope you are doing good. I am using INtel MKl 10.3 2011_sp1.12.361. I want to try out all the marix formats the nkl librayr provides for the matrices i have.

I have been able to use COO and CSR but i have troubles using the BSR format. It seems while specifiying the size of the column and value arrays for BSR i must know the number of non-zero blocks. I do not know how to calculate that. Is there a function for this. I am pasting here what i do and it generates segfaults.

job[0]=0; job[1]=1; job[2]=1; job[4]=0; job[5]=3; mblk=2;

mb = (rowlenA + mblk-1)/mblk;

nb = (collenA + mblk-1)/mblk;

ldabsr=mblk*mblk;

absrvals=(double*) initVector(mb*nb*mblk*mblk, MYDOUBLE);

absrcols=(int*)initVector(mb*nb,MYINT);

absrrows=(int*)initVector(rowlenA+1,MYINT);

mkl_dcsrbsr (job, &rowlenA, &mblk, &ldabsr, a0csrvals, a0csrcols, a0rwcsr,

absrvals, absrcols, absrrows, &info);

Please not that rowlenA and collenA are actual row and column lengths for the matrix A. initvector is just a wrapper for malloc on the CPU. Kindly suggest what i am not doing correctly.

thanks for your attention and time in reading my question.

with best regards

rohit

Link Copied

3 Replies

Gennady_F_Intel

Moderator

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

02-21-2013
05:55 AM

42 Views

itabhiyanta

Beginner

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

02-23-2013
02:10 AM

42 Views

thanks gennady for your prompt reply. i looked through the example you had mentioned. HOwever i still cannot understand how to find out the number of non-zeroes in the bsr matrix and assign the right about of space for the column and the values matrix.

you have mentioned that my cope snip is incomplete. do you suggest sending a standalone working code?

my intention was to find out if my calculation of the sizes of the matrices was ok or not because i get segmentation faults when i use this function with the arrays specified in the code snip.

kindly suggest/advise on how to choose the number of non-zeros in the bsr matrix or if you have any advice about how to debug this problem.

thanks and regards

SKost

Valued Contributor II

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

02-25-2013
05:41 AM

42 Views

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