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
- Questions & Puzzled about mkl_sparse_spmm

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

wen_qiang_z_

Beginner

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

11-04-2018
07:16 PM

91 Views

Questions & Puzzled about mkl_sparse_spmm

Hi, I`m very very very anxious now because of the using of mkl_sparse_spmm function always feedback me an error beyond my understanding. When I trying to compute the product of two sparse matrix created by mkl_sparse_csr_create function, for the foremost, everything tends to be good, but when I tried to compute it again, an Access Conflict error appeared and I have no idea why this error shows.

Here is part of my codes

do i = 1, 5

!*steps to compute the values needed are ignored,and I `ve tested them to make sure they`re correct*!

!create sparse matrix, this step is right and the stat = 0

stat=mkl_sparse_z_create_csr(local(i)%Krc%B,sparse_index_base_one,sub(i)%temp, &

sub(i)%Noc,local(i)%rows_start,local(i)%rows_end,local(i)%col_indx,local(i)%values)

write(*,*) stat

!create sparse matrix, this step is right and the stat = 0

stat=mkl_sparse_z_create_csr(local(i)%Kcr%A,sparse_index_base_one,&

local(i)%Kcr%rows,local(i)%Kcr%cols,local(i)%Kcr%rows_start,local(i)%Kcr%rows_end,&

local(i)%Kcr%col_indx,local(i)%Kcr%values)

write(*,*) stat

!compute the product

info = mkl_sparse_spmm(sparse_operation_non_transpose,local(i)%Kcr%A,local(i)%Krc%B,local(i)%Kcr%B)

write(*,*) info

end do

At the first loop for i == 1, it seems good, bu when it turns to the loop for i == 2, then the compiler feedback an error of Access Conflict which confuses me most. I can make sure that the sparse matrices are correct. and I did not deallocate the memory or destroy the sparse matrix handle ,so I have no ides why this situation shows.

Can U help me?

Link Copied

6 Replies

mecej4

Black Belt

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

11-05-2018
09:03 AM

91 Views

wen_qiang_z_

Beginner

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

11-05-2018
04:35 PM

91 Views

mecej4 wrote:

You mean that I should open up other spaces to save the output matrix C instead of saving in the same type`s space? Am I right?

mecej4

Black Belt

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

11-05-2018
05:53 PM

91 Views

wen_qiang_z_

Beginner

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

11-05-2018
10:26 PM

91 Views

mecej4 wrote:

Hi, I`ve tried what you said, it didn`t work. It looks like that the CSR matrix A created before the multiplication has some problem in saving its components but the stat information shows that the creation procedure is correct. So thanks for your advice but I still confused

mecej4

Black Belt

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

11-06-2018
12:45 AM

91 Views

Please post a small but complete code example that demonstrates what you said "didn't work", and describe how you compiled, linked and ran the example. State your compiler and MKL versions.

You have not shown the declarations of the variables in your code extracts, but I believe that

info = mkl_sparse_spmm(sparse_operation_non_transpose,local(i)%Kcr%A,local(i)%Krc%B,local(i)%Kcr%B)

should actually have been

info = mkl_sparse_spmm(sparse_operation_non_transpose,local(i)%Kcr%A,local(i)%Krc%B,&(local(i)%Kcr%C))

In other words, the last argument should actually be the address to receive a newly created matrix handle, not an existing matrix handle.

If you have not done so already, please look at the example sparse_spmm.c that is provided with MKL in the .../examples/spblasc directory.

wen_qiang_z_

Beginner

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

11-06-2018
03:31 AM

91 Views

mecej4 wrote:Please post a small but complete code example that demonstrates what you said "didn't work", and describe how you compiled, linked and ran the example. State your compiler and MKL versions.

You have not shown the declarations of the variables in your code extracts, but I believe that

info = mkl_sparse_spmm(sparse_operation_non_transpose,local(i)%Kcr%A,local(i)%Krc%B,local(i)%Kcr%B)should actually have been

info = mkl_sparse_spmm(sparse_operation_non_transpose,local(i)%Kcr%A,local(i)%Krc%B,&(local(i)%Kcr%C))In other words, the last argument should actually be the address to receive a newly created matrix handle, not an existing matrix handle.

If you have not done so already, please look at the example sparse_spmm.c that is provided with MKL in the .../examples/spblasc directory.

Thx a lot! And I`ve figured out why this error occurred, thanks for your help!

- 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.