<?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 Wrong results for SpMV in Intel® oneAPI Math Kernel Library</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Wrong-results-for-SpMV/m-p/811695#M3981</link>
    <description>The Harwell-Boeing format stores the matrix by packing column-1, followed by packing column-2, etc, which is the traditional storage order in Fortran.&lt;BR /&gt;&lt;BR /&gt;By interpreting the columns as rows, in effect you are using the transpose of the matrix, and the matrix is not symmetric. If that is what you really desire, simply change the first subroutine argument from 'T' to 'N' in my listing and you will get the results in #3. &lt;BR /&gt;&lt;BR /&gt;Or, in your C code, change the first argument to 'T'.&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Sun, 12 Feb 2012 17:22:14 GMT</pubDate>
    <dc:creator>mecej4</dc:creator>
    <dc:date>2012-02-12T17:22:14Z</dc:date>
    <item>
      <title>Wrong results for SpMV</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Wrong-results-for-SpMV/m-p/811691#M3977</link>
      <description>Hello,&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;While doing SpMVusing MKL routines I got wrong (inaccurate) results for both COO and CSR formats. I checked it with several matrices eg:&lt;A href="http://math.nist.gov/MatrixMarket/data/NEP/chuck/ck400.html" title="ck400 matrix"&gt;ck400&lt;/A&gt;. I have taken 1-based index matrices from the .mtx files. I observed that single precision results are still worse, resulting in huge numbers.&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;Output of y = Ax (x=1) for COO and CSR routines&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV id="_mcePaste"&gt;0.792798&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;3.828488&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;3.575541&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;0.787644&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;2.179928&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;0.935596&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;0.826411&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;2.150882&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;1.681057&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;1.230554&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV id="_mcePaste"&gt;Output of my implementation&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;1.594622&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&lt;DIV id="_mcePaste"&gt;3.375540&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;2.971066&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;1.472197&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;1.733999&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;0.933401&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;0.841957&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;1.671079&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;1.527866&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;Why is this happening?&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;Thanks in advance.&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;Regards,&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;Jay&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Sun, 12 Feb 2012 14:22:29 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Wrong-results-for-SpMV/m-p/811691#M3977</guid>
      <dc:creator>jaidotsh</dc:creator>
      <dc:date>2012-02-12T14:22:29Z</dc:date>
    </item>
    <item>
      <title>Wrong results for SpMV</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Wrong-results-for-SpMV/m-p/811692#M3978</link>
      <description>&lt;DIV id="_mcePaste"&gt;Could you please give us the example of the code which we can compile and check on our side.&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;There are many similar requests on mkl forum, but mostly the cause of the problem is incorrect usage ot this sort of routines.&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;There are numbers of examples of program for using MKL Sparse BLAS routines for matrices represented in the different sparse formats including COO and CSR.&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;I would recomend to see at these examples first of all.&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;You can find these example ( cspblas_ccoo.c cspblas_ccsr.c) &amp;lt; MKLROOT&amp;gt;\examples\spblasc\&lt;/DIV&gt;</description>
      <pubDate>Sun, 12 Feb 2012 15:06:35 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Wrong-results-for-SpMV/m-p/811692#M3978</guid>
      <dc:creator>Gennady_F_Intel</dc:creator>
      <dc:date>2012-02-12T15:06:35Z</dc:date>
    </item>
    <item>
      <title>Wrong results for SpMV</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Wrong-results-for-SpMV/m-p/811693#M3979</link>
      <description>The results that you showed under "Output of y = Ax (x=1) for COO and CSR routines" are correct. They are what I get from the MKL call&lt;BR /&gt;&lt;PRE&gt;[bash]      call mkl_scsrgemv('T',NCOL,values,colptr,rowind,x,y)&lt;BR /&gt;[/bash]&lt;/PRE&gt; &lt;BR /&gt;after reading in the matrix "ck400" using the skeleton code from&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://math.nist.gov/MatrixMarket/src/hbcode1.f"&gt;http://math.nist.gov/MatrixMarket/src/hbcode1.f&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;You did not say anything about "my implementation", yet you ask us to tell you what is wrong with it. Well, there are zillion ways of calling MKL (or any other library) incorrectly.&lt;BR /&gt;&lt;BR /&gt;For reference, the complete code follows.&lt;BR /&gt;&lt;BR /&gt;&lt;PRE&gt;[fxfortran]      program jdotsh&lt;BR /&gt;      implicit none&lt;BR /&gt;      include 'mkl_spblas.fi'&lt;BR /&gt;      integer NMAX, NNZMAX,I, LUNIT&lt;BR /&gt;      parameter (NMAX=400, NNZMAX=2860, LUNIT=11)&lt;BR /&gt;!     ================================================================&lt;BR /&gt;!     ... SAMPLE CODE FOR READING A SPARSE MATRIX IN STANDARD FORMAT&lt;BR /&gt;!     ================================================================&lt;BR /&gt;&lt;BR /&gt;      CHARACTER      TITLE*72 , KEY*8    , MXTYPE*3 ,  &amp;amp;&lt;BR /&gt;                     PTRFMT*16, INDFMT*16, VALFMT*20, RHSFMT*20&lt;BR /&gt;&lt;BR /&gt;      INTEGER        TOTCRD, PTRCRD, INDCRD, VALCRD, RHSCRD, &amp;amp;&lt;BR /&gt;                     NROW  , NCOL  , NNZERO, NELTVL&lt;BR /&gt;&lt;BR /&gt;      INTEGER        COLPTR (NMAX+1), ROWIND (NNZMAX)&lt;BR /&gt;&lt;BR /&gt;      REAL           VALUES (NNZMAX), X(NMAX), Y(NMAX)&lt;BR /&gt;&lt;BR /&gt;!    ------------------------&lt;BR /&gt;!     ... READ IN HEADER BLOCK&lt;BR /&gt;!     ------------------------&lt;BR /&gt;      open(unit=LUNIT,file='ck400.rua',status='old')&lt;BR /&gt;&lt;BR /&gt;      READ ( LUNIT, 1000 ) TITLE , KEY   ,   &amp;amp;&lt;BR /&gt;                           TOTCRD, PTRCRD, INDCRD, VALCRD, RHSCRD,  &amp;amp;&lt;BR /&gt;                           MXTYPE, NROW  , NCOL  , NNZERO, NELTVL,  &amp;amp;&lt;BR /&gt;                           PTRFMT, INDFMT, VALFMT, RHSFMT&lt;BR /&gt; 1000 FORMAT ( A72, A8,/,5I14,/ A3, 11X, 4I14,/,2A16, 2A20 )&lt;BR /&gt;&lt;BR /&gt;!     -------------------------&lt;BR /&gt;!     ... READ MATRIX STRUCTURE&lt;BR /&gt;!     -------------------------&lt;BR /&gt;&lt;BR /&gt;      READ ( LUNIT, PTRFMT ) ( COLPTR (I), I = 1, NCOL+1 )&lt;BR /&gt;&lt;BR /&gt;      READ ( LUNIT, INDFMT ) ( ROWIND (I), I = 1, NNZERO )&lt;BR /&gt;&lt;BR /&gt;      IF  ( VALCRD .GT. 0 )  THEN&lt;BR /&gt;&lt;BR /&gt;!         ----------------------&lt;BR /&gt;!         ... READ MATRIX VALUES&lt;BR /&gt;!         ----------------------&lt;BR /&gt;&lt;BR /&gt;          READ ( LUNIT, VALFMT ) ( VALUES (I), I = 1, NNZERO )&lt;BR /&gt;&lt;BR /&gt;      ENDIF&lt;BR /&gt;      X(1:NCOL) = 1.0&lt;BR /&gt;      call mkl_scsrgemv('T',NCOL,values,colptr,rowind,x,y)&lt;BR /&gt;      write(*,2000)y(1:10)&lt;BR /&gt; 2000 format(1x,5ES16.7)&lt;BR /&gt;      end program jdotsh&lt;BR /&gt;[/fxfortran]&lt;/PRE&gt; &lt;BR /&gt;</description>
      <pubDate>Sun, 12 Feb 2012 15:20:57 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Wrong-results-for-SpMV/m-p/811693#M3979</guid>
      <dc:creator>mecej4</dc:creator>
      <dc:date>2012-02-12T15:20:57Z</dc:date>
    </item>
    <item>
      <title>Wrong results for SpMV</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Wrong-results-for-SpMV/m-p/811694#M3980</link>
      <description>@mecej4&lt;DIV&gt;Thanks for the code. I'm not that good in fortran, anyways I have attached my MKL kernel call code with this post. Actually, I'm not supposed to disclose my implementation. But I'll show you that my results are right&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;When I do SpMV from ck400 matrix I get these results&lt;/DIV&gt;&lt;DIV&gt;Eg: First row&lt;/DIV&gt;&lt;DIV&gt;&lt;PRE&gt;[bash]1 1  4.5988460100000e-01
2 1  3.6284045000000e-02
5 1  1.0781816600000e+00
6 1  2.8797109600000e-02
203 1 -8.6315697400000e-03
204 1  1.0598980300000e-04[/bash]&lt;/PRE&gt;&lt;PRE&gt;[bash]0.459+0.0036+1.07+0.028-0.0086+0.00010 = 1.594622[/bash]&lt;/PRE&gt;  Fourth row&lt;/DIV&gt;&lt;DIV&gt;&lt;PRE&gt;[bash]3 4 -2.4700304700000e-02
4 4  4.4020096400000e-01
7 4 -1.2549445700000e-02
8 4  1.0782397800000e+00
201 4 -1.0598980300000e-04
202 4 -8.8883786800000e-03
[/bash]&lt;/PRE&gt;&lt;PRE&gt;[bash]-0.024+0.44-0.012+1.07-0.00010-0.0088 = 1.472197[/bash]&lt;/PRE&gt;&lt;/DIV&gt;
which is same as the results of my implementation&lt;DIV&gt;@Fedorov I'll have a look at it. I've attached the routine calling codes.&lt;/DIV&gt;</description>
      <pubDate>Sun, 12 Feb 2012 16:54:59 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Wrong-results-for-SpMV/m-p/811694#M3980</guid>
      <dc:creator>jaidotsh</dc:creator>
      <dc:date>2012-02-12T16:54:59Z</dc:date>
    </item>
    <item>
      <title>Wrong results for SpMV</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Wrong-results-for-SpMV/m-p/811695#M3981</link>
      <description>The Harwell-Boeing format stores the matrix by packing column-1, followed by packing column-2, etc, which is the traditional storage order in Fortran.&lt;BR /&gt;&lt;BR /&gt;By interpreting the columns as rows, in effect you are using the transpose of the matrix, and the matrix is not symmetric. If that is what you really desire, simply change the first subroutine argument from 'T' to 'N' in my listing and you will get the results in #3. &lt;BR /&gt;&lt;BR /&gt;Or, in your C code, change the first argument to 'T'.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Sun, 12 Feb 2012 17:22:14 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Wrong-results-for-SpMV/m-p/811695#M3981</guid>
      <dc:creator>mecej4</dc:creator>
      <dc:date>2012-02-12T17:22:14Z</dc:date>
    </item>
    <item>
      <title>Wrong results for SpMV</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Wrong-results-for-SpMV/m-p/811696#M3982</link>
      <description>@mecej4 Thanks a lot, it worked. @Fedorov So true!</description>
      <pubDate>Sun, 12 Feb 2012 17:28:42 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Wrong-results-for-SpMV/m-p/811696#M3982</guid>
      <dc:creator>jaidotsh</dc:creator>
      <dc:date>2012-02-12T17:28:42Z</dc:date>
    </item>
    <item>
      <title>Wrong results for SpMV</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Wrong-results-for-SpMV/m-p/811697#M3983</link>
      <description>I'm stuck with another problem!!. When I give matrices like ck400,&lt;A href="http://www.cise.ufl.edu/research/sparse/matrices/Boeing/pwtk.html"&gt;pwtk&lt;/A&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;But, when I give &lt;A href="http://www.cise.ufl.edu/research/sparse/matrices/Williams/consph.html"&gt;consph&lt;/A&gt;, &lt;A href="http://www.cise.ufl.edu/research/sparse/matrices/Bova/rma10.html"&gt;rma10&lt;/A&gt;I get a segmentation fault. I've thoroughly checked the indices from the&lt;/DIV&gt;&lt;DIV&gt;file, I still can't find the error!&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;Thanks in advance!&lt;/DIV&gt;</description>
      <pubDate>Fri, 17 Feb 2012 20:34:55 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Wrong-results-for-SpMV/m-p/811697#M3983</guid>
      <dc:creator>jaidotsh</dc:creator>
      <dc:date>2012-02-17T20:34:55Z</dc:date>
    </item>
  </channel>
</rss>

