<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Problem with sparse BLAS Level 2 function mkl_scsrgemv() in Intel® oneAPI Math Kernel Library</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Problem-with-sparse-BLAS-Level-2-function-mkl-scsrgemv/m-p/813082#M4062</link>
    <description>Hi David&lt;BR /&gt;&lt;BR /&gt;As I understand your first matrix has 4 rows and 9 columns with next scheme:&lt;BR /&gt;(x x x - - - - - -)&lt;BR /&gt;(- - - x x x- - -)&lt;BR /&gt;(- - -- - - x x x)&lt;BR /&gt;(x- - x - - x - -)&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;In this cases youshould use row_num =4 instead of row_num = 9.&lt;BR /&gt;&lt;BR /&gt;Victor</description>
    <pubDate>Fri, 14 Oct 2011 04:28:31 GMT</pubDate>
    <dc:creator>Victor_Gladkikh</dc:creator>
    <dc:date>2011-10-14T04:28:31Z</dc:date>
    <item>
      <title>Problem with sparse BLAS Level 2 function mkl_scsrgemv()</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Problem-with-sparse-BLAS-Level-2-function-mkl-scsrgemv/m-p/813081#M4061</link>
      <description>Hi!&lt;DIV&gt;When programming with mkl sparse BLAS level 2 fucntion to implement a matrix-vector mulitplication, I met a trouble in function mlk_?csrgemv(). A simplified and clear code is given below, in which the same problem happened.&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;!-----------------------------------------------&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV id="_mcePaste"&gt;program main&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;implicit none&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;real, dimension(12) :: val = (/-1, 1,-1, &amp;amp;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;						 1,-1, 1, &amp;amp;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;						 1,-1, 1, &amp;amp;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;						 -1, 1,-1 /)&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;	integer, dimension(12) :: column = (/1,2,3, 4,5,6, 7,8,9, 1,4,7/)&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;	integer, dimension(5) :: rowIndex= (/1,4,7, 10,13/)&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;	real, dimension(9) :: v = 1.0&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;	real, dimension(9) :: res = 0&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;	character :: transa = 'n'&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;	integer :: row_num = 9&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;	call mkl_scsrgemv(transa, row_num, val, rowIndex, column, v, res)&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;	write(*,*) "result = "&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;	write(*,*) res&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;	stop&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;end program&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;!------------------------------------------&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;Error info is: Unhandled exception at 0x0117d008 in SparseBLAS.exe: 0xC0000005: Access violation reading location 0xff25e07c.&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;It shoud be pointed out that the matrix is not a square matrix of the dimension m*m.&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;But another non square sparse matrix,&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;val = (/-1,1,1,-1,1,-1,-1,1/)&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;column = (/1,2,3,4,5,6,2,4/)&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;rowIndex = (/1,3,5,7,9/)&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;worked successfully.&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;My question is, what is wrong with the code? Can the nonsquare matrix vector multiplication be implemented with CSR(3 array variation) data structure? And How?&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;(Platform: Intel Pentium T4200, VS2008, MKL 10.3)&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;Expecting for your help and Thanks a lot.&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 14 Oct 2011 02:37:17 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Problem-with-sparse-BLAS-Level-2-function-mkl-scsrgemv/m-p/813081#M4061</guid>
      <dc:creator>Wu__Wentao</dc:creator>
      <dc:date>2011-10-14T02:37:17Z</dc:date>
    </item>
    <item>
      <title>Problem with sparse BLAS Level 2 function mkl_scsrgemv()</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Problem-with-sparse-BLAS-Level-2-function-mkl-scsrgemv/m-p/813082#M4062</link>
      <description>Hi David&lt;BR /&gt;&lt;BR /&gt;As I understand your first matrix has 4 rows and 9 columns with next scheme:&lt;BR /&gt;(x x x - - - - - -)&lt;BR /&gt;(- - - x x x- - -)&lt;BR /&gt;(- - -- - - x x x)&lt;BR /&gt;(x- - x - - x - -)&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;In this cases youshould use row_num =4 instead of row_num = 9.&lt;BR /&gt;&lt;BR /&gt;Victor</description>
      <pubDate>Fri, 14 Oct 2011 04:28:31 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Problem-with-sparse-BLAS-Level-2-function-mkl-scsrgemv/m-p/813082#M4062</guid>
      <dc:creator>Victor_Gladkikh</dc:creator>
      <dc:date>2011-10-14T04:28:31Z</dc:date>
    </item>
    <item>
      <title>Problem with sparse BLAS Level 2 function mkl_scsrgemv()</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Problem-with-sparse-BLAS-Level-2-function-mkl-scsrgemv/m-p/813083#M4063</link>
      <description>&lt;P&gt;Or you can keep row_num = 9 and extend RowIndex: integer, dimension(10) ::rowindex=(/1,4,7,10,13,13,13,13,13,13/)&lt;BR /&gt;&lt;BR /&gt;Victor&lt;/P&gt;</description>
      <pubDate>Fri, 14 Oct 2011 04:32:02 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Problem-with-sparse-BLAS-Level-2-function-mkl-scsrgemv/m-p/813083#M4063</guid>
      <dc:creator>Victor_Gladkikh</dc:creator>
      <dc:date>2011-10-14T04:32:02Z</dc:date>
    </item>
    <item>
      <title>Problem with sparse BLAS Level 2 function mkl_scsrgemv()</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Problem-with-sparse-BLAS-Level-2-function-mkl-scsrgemv/m-p/813084#M4064</link>
      <description>What is the size of your matrix? Could you show the full matrix in standard mathematical notation? Then we could check whether you are describing it in compact row-major storage format. &lt;BR /&gt;&lt;BR /&gt;See also the examples that came with MKL or the ones in the MKL documentation.</description>
      <pubDate>Fri, 14 Oct 2011 04:50:49 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Problem-with-sparse-BLAS-Level-2-function-mkl-scsrgemv/m-p/813084#M4064</guid>
      <dc:creator>mecej4</dc:creator>
      <dc:date>2011-10-14T04:50:49Z</dc:date>
    </item>
    <item>
      <title>Problem with sparse BLAS Level 2 function mkl_scsrgemv()</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Problem-with-sparse-BLAS-Level-2-function-mkl-scsrgemv/m-p/813085#M4065</link>
      <description>Victor, Thank you so much!&lt;DIV&gt;&lt;SPAN style="font-family: Verdana, Arial, Helvetica, sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;DIV&gt;This is the right answer I am expecting. I have tried and it worked successfully.&lt;/DIV&gt;&lt;DIV&gt;But setting the row number to be 4 seems not a perfect idea, though it returns right answer if transa = 'N'. The result is incorrect without any warning and error reports from compiler when transa = 'T'. However, the extended rowIndex works no matter transa = 'N' or 'T'.&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;Best regards,&lt;/DIV&gt;&lt;DIV&gt;David.&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 14 Oct 2011 05:14:04 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Problem-with-sparse-BLAS-Level-2-function-mkl-scsrgemv/m-p/813085#M4065</guid>
      <dc:creator>Wu__Wentao</dc:creator>
      <dc:date>2011-10-14T05:14:04Z</dc:date>
    </item>
    <item>
      <title>Problem with sparse BLAS Level 2 function mkl_scsrgemv()</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Problem-with-sparse-BLAS-Level-2-function-mkl-scsrgemv/m-p/813086#M4066</link>
      <description>&lt;P&gt;Hi David,&lt;/P&gt;&lt;P&gt;In MKL manual this functionality is described as working with square matrices:&lt;/P&gt;&lt;P&gt;The mkl_?csrgemv routine performs a matrix-vector operation defined as&lt;/P&gt;&lt;P&gt;y := A*x&lt;/P&gt;&lt;P&gt;or&lt;/P&gt;&lt;P&gt;y := A'*x,&lt;/P&gt;&lt;P&gt;where: x and y are vectors, A is an m-by-m sparse square matrix in the CSR format (3-array variation), A' is the transpose of A.&lt;/P&gt;&lt;P&gt;So for rectangular matrices it works improperly in some cases.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sergey &lt;/P&gt;</description>
      <pubDate>Fri, 14 Oct 2011 08:40:21 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Problem-with-sparse-BLAS-Level-2-function-mkl-scsrgemv/m-p/813086#M4066</guid>
      <dc:creator>Sergey_P_Intel2</dc:creator>
      <dc:date>2011-10-14T08:40:21Z</dc:date>
    </item>
    <item>
      <title>Problem with sparse BLAS Level 2 function mkl_scsrgemv()</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Problem-with-sparse-BLAS-Level-2-function-mkl-scsrgemv/m-p/813087#M4067</link>
      <description>&lt;P&gt;Anyway the second solution have to work because we extend rectangular matrixto square matrix.&lt;BR /&gt;&lt;BR /&gt;Victor&lt;/P&gt;</description>
      <pubDate>Fri, 14 Oct 2011 09:07:39 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Problem-with-sparse-BLAS-Level-2-function-mkl-scsrgemv/m-p/813087#M4067</guid>
      <dc:creator>Victor_Gladkikh</dc:creator>
      <dc:date>2011-10-14T09:07:39Z</dc:date>
    </item>
    <item>
      <title>Problem with sparse BLAS Level 2 function mkl_scsrgemv()</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Problem-with-sparse-BLAS-Level-2-function-mkl-scsrgemv/m-p/813088#M4068</link>
      <description>&lt;DIV id="tiny_quote"&gt;
                &lt;DIV style="margin-left: 2px; margin-right: 2px;"&gt;Quoting &lt;A rel="/en-us/services/profile/quick_profile.php?is_paid=&amp;amp;user_id=415602" class="basic" href="https://community.intel.com/en-us/profile/415602/"&gt;Victor Gladkikh (Intel)&lt;/A&gt;&lt;/DIV&gt;
                &lt;DIV style="background-color: #e5e5e5; padding: 5px; border: 1px; border-style: inset; margin-left: 2px; margin-right: 2px;"&gt;&lt;I&gt;&lt;P&gt;Anyway the second solution have to work because we extend rectangular matrixto square matrix.&lt;BR /&gt;&lt;BR /&gt;Victor&lt;/P&gt;&lt;/I&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&lt;/P&gt;Victor, Thank you very much again.&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;While, When you said we extend the rectanglar matrix to a square one, I get a new idea:&lt;/DIV&gt;&lt;DIV&gt;If we have a exact matrix,&lt;/DIV&gt;&lt;DIV&gt;(/ x x x x&lt;/DIV&gt;&lt;DIV&gt; x 1 2 x&lt;/DIV&gt;&lt;DIV&gt; x x x x&lt;/DIV&gt;&lt;DIV&gt; 3 x 4 x&lt;/DIV&gt;&lt;DIV&gt; x x x x&lt;/DIV&gt;&lt;DIV&gt; x 5 6 x /)&lt;/DIV&gt;&lt;DIV&gt;then it can be presented in a sparse form with CSR (3 array variation)&lt;/DIV&gt;&lt;DIV&gt;value  = (/1, 2, 3, 4, 5, 6/)&lt;/DIV&gt;&lt;DIV&gt;column = (/2, 3, 1, 3, 2, 3/)&lt;/DIV&gt;&lt;DIV&gt;rowIndex = (/1, 1, 3, 3, 5, 5, 7/).&lt;/DIV&gt;&lt;DIV&gt;That is to say, if there is a trival row(all zero elements row) in the matrix, a duplicated row index can be used to represent this row. I have tried some examples, and it does work!&lt;/DIV&gt;&lt;DIV&gt;But according to the MKL reference manual, "The 3-array variation of the CSR format has a restriction: all non-zero elements are stored continuously, that is the set of non-zero elements in the row&lt;VAR&gt;J&lt;/VAR&gt;goes just after the set of non-zero elements in the row&lt;SAMP class="codeph"&gt;&lt;VAR&gt;J-1&lt;/VAR&gt;&lt;/SAMP&gt;."&lt;/DIV&gt;&lt;DIV&gt;What do you think of it, does my duplicated row index method always work? Or it just fits for the lucky simple cases.&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;Regrads,&lt;/DIV&gt;&lt;DIV&gt;David.&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 14 Oct 2011 12:34:36 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Problem-with-sparse-BLAS-Level-2-function-mkl-scsrgemv/m-p/813088#M4068</guid>
      <dc:creator>Wu__Wentao</dc:creator>
      <dc:date>2011-10-14T12:34:36Z</dc:date>
    </item>
    <item>
      <title>Problem with sparse BLAS Level 2 function mkl_scsrgemv()</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Problem-with-sparse-BLAS-Level-2-function-mkl-scsrgemv/m-p/813089#M4069</link>
      <description>Your proposal, it appears to me, goes against the principal reason for the existence of sparse storage schemes: to avoid calculations with zero elements. &lt;BR /&gt;&lt;BR /&gt;Once you allow more than the minimal number of zeros (this number is non-zero for banded matrices, zero in packed storage schemes), the efficiency of the sparse matrix method deteriorates.</description>
      <pubDate>Fri, 14 Oct 2011 13:04:15 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Problem-with-sparse-BLAS-Level-2-function-mkl-scsrgemv/m-p/813089#M4069</guid>
      <dc:creator>mecej4</dc:creator>
      <dc:date>2011-10-14T13:04:15Z</dc:date>
    </item>
  </channel>
</rss>

