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
- sparse matrix sparse matrix multiplication

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

kirankumarm

Beginner

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

04-13-2011
12:14 PM

63 Views

sparse matrix sparse matrix multiplication

I want to multiply sparse matrix with a sparse matrix. Both matrices are stored in CSR format. The suitable function to do this operation is mkl_scsrmultcsr. I wrote a sample code but I'm getting incorrect result. Can you please help me in debugging the program or provide an example to use this function.

I'm having a i7 980x processor and fc13 OS.

The command I used for compiling is

gcc multiplication.c -L/opt/intel/mkl/lib/intel64 -Wl,--start-group -lmkl_intel_lp64 -lmkl_gnu_thread -lmkl_core -Wl,--end-group -fopenmp -lpthread -lm

The program is here http://pastebin.com/pf3pJwE8

The output matrix should be [4,0;0,9] ( [2,0;0,3] * [2,0;0,3] ) but the output the program is giving is

Result nnz = 1

ic[0] = 1

ic[1] = 1

ic[2] = 1

0.000000 0

Thanks and Regards,

M. Kiran Kumar.

Link Copied

1 Reply

Alexander_K_Intel2

Employee

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

04-13-2011
06:15 PM

63 Views

It's seems that you use zero-based indexing in arrays ia and ja in one-based functionmkl_scsrmultcsr. I've change arrays ia and ja in your code from

int ja[] = {0,1};

int ia[] = {0,1,2};

to

int ja[] = {1,2};

int ia[] = {1,2,3};

and got output from your example:

4.000000 1

9.000000 2

0.000000 0

With best regards,

Alexander Kalinkin

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.