<?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 Quote:Some elements in the in Intel® oneAPI Math Kernel Library</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/different-results-between-mkl-dcscmv-and-gemv/m-p/978420#M17259</link>
    <description>&lt;BLOCKQUOTE&gt;Some elements in the results  are quite different,I don't understand why&lt;/BLOCKQUOTE&gt;

The result vectors that you gave (ansfull.txt,anscsc.txt) have elements as large as 1.6 E4, but the largest difference between the two is 3.7 E-6. 

On what basis do you say that the results are "quite different"?  How much precision do you have in the input matrix and vector, and is a variation of 3.7 E-6 between the two results quite reasonable in that perspective?</description>
    <pubDate>Mon, 24 Dec 2012 13:32:12 GMT</pubDate>
    <dc:creator>mecej4</dc:creator>
    <dc:date>2012-12-24T13:32:12Z</dc:date>
    <item>
      <title>different results between mkl_dcscmv and gemv</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/different-results-between-mkl-dcscmv-and-gemv/m-p/978419#M17258</link>
      <description>&lt;P&gt;In Intel® MKL&amp;nbsp;mkl_dcscmv and gemv produce different result .&lt;/P&gt;
&lt;P&gt;At first,I use the mkl_dcscmv&amp;nbsp;to compute K*X=ANS ,where matrix K(2280,2280) converts to the sparse format CSC (COPPTR,ROWIND,VALUES or&amp;nbsp;ROWIND,VALUES,pointer_B,pointer_E) &amp;nbsp;as follows:&lt;/P&gt;
&lt;P&gt;program CSC_MATRIX_VECTOR&lt;BR /&gt;implicit none&lt;BR /&gt;integer::i,j&lt;BR /&gt;integer,parameter::nRows=2280&lt;/P&gt;
&lt;P&gt;integer,parameter::nNonzero=25395&lt;BR /&gt;&lt;BR /&gt;integer,allocatable::COPPTR(:),ROWIND(:),pointer_B(:),pointer_E(:)&lt;BR /&gt;double precision,allocatable::VALUES(:)&lt;BR /&gt;double precision,allocatable::X(:),ANS(:)&lt;BR /&gt;double precision::alpha,beta&lt;BR /&gt;character(6):: matdescra&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;allocate(COPPTR(nRows+1))&lt;BR /&gt;open(unit=10,file='COPPTR.txt')&lt;BR /&gt;read(10,*)COPPTR&lt;BR /&gt;close(10,status="keep")&lt;/P&gt;
&lt;P&gt;allocate(ROWIND(nNonzero))&lt;BR /&gt;open(unit=10,file='ROWIND.txt')&lt;BR /&gt;read(10,*)ROWIND&lt;BR /&gt;close(10,status="keep")&lt;/P&gt;
&lt;P&gt;allocate(VALUES(nNonzero))&lt;BR /&gt;open(unit=10,file='VALUES.txt')&lt;BR /&gt;read(10,*)VALUES&lt;BR /&gt;close(10,status="keep")&lt;/P&gt;
&lt;P&gt;allocate(X(nRows))&lt;BR /&gt;allocate(ANS(nRows))&lt;/P&gt;
&lt;P&gt;open(unit=10,file='X.txt')&lt;BR /&gt;read(10,*)X&lt;BR /&gt;close(10,status="keep")&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;alpha=1.0&lt;BR /&gt;beta=0.0&lt;BR /&gt;matdescra='SLNF'&lt;/P&gt;
&lt;P&gt;allocate(pointer_B(nRows))&lt;BR /&gt;allocate(pointer_E(nRows))&lt;/P&gt;
&lt;P&gt;do i=1,nRows&lt;BR /&gt; pointer_B(i)=COPPTR(i)&lt;BR /&gt; pointer_E(i)=COPPTR(i+1)&lt;BR /&gt;end do&lt;/P&gt;
&lt;P&gt;call mkl_dcscmv('N', nRows, nRows, alpha, matdescra, VALUES, ROWIND, pointer_B, &lt;BR /&gt;pointer_E,X, beta, ANS)&lt;/P&gt;
&lt;P&gt;open(unit=10,file='ANS.txt')&lt;BR /&gt;write(10,'(D24.16)')ANS&lt;BR /&gt;end&lt;/P&gt;
&lt;P&gt;result::&lt;/P&gt;
&lt;P&gt;ANS(CSC).txt&lt;/P&gt;
&lt;P&gt;Secondly,I use gemv&amp;nbsp;to&amp;nbsp;compute K*X=ANS,as follows:&lt;/P&gt;
&lt;P&gt;include 'blas.f90'&lt;BR /&gt;program FULL_MATRIX_VECTOR&lt;BR /&gt;use MKL95_BLAS&lt;BR /&gt;use f95_precision &lt;BR /&gt;implicit none&lt;BR /&gt;integer::i,j&lt;BR /&gt;integer,parameter::nRows=2280&lt;BR /&gt;double precision,allocatable::K(:,:),X(:),ANS(:)&lt;BR /&gt;double precision::alpha,beta&lt;/P&gt;
&lt;P&gt;allocate(K(nRows,nRows))&lt;BR /&gt;open(unit=10,file='K.txt')&lt;BR /&gt;read(10,*)((K(i,j),j=1,nRows),i=1,nRows)&lt;BR /&gt;close(10,status="keep")&lt;/P&gt;
&lt;P&gt;allocate(X(nRows))&lt;BR /&gt;open(unit=10,file='X.txt')&lt;BR /&gt;read(10,*)X&lt;BR /&gt;close(10,status="keep")&lt;/P&gt;
&lt;P&gt;allocate(ANS(nRows))&lt;/P&gt;
&lt;P&gt;alpha=1.0&lt;BR /&gt;beta=0.0&lt;/P&gt;
&lt;P&gt;call gemv(K, X, ANS,alpha ,beta ,'N')&lt;/P&gt;
&lt;P&gt;open(unit=10,file='ANS.txt')&lt;BR /&gt;write(10,'(D24.16)')ANS&lt;BR /&gt;end&lt;/P&gt;
&lt;P&gt;the result is&lt;/P&gt;
&lt;P&gt;ANS(full).txt&lt;/P&gt;
&lt;P&gt;&amp;nbsp;Some elements in the results &amp;nbsp;are quite different,I don't understand why the&amp;nbsp;mkl_dcscmv and gemv&amp;nbsp;cannot produce the same accuracy.&lt;/P&gt;
&lt;P&gt;Thanks for your help.&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 24 Dec 2012 12:36:59 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/different-results-between-mkl-dcscmv-and-gemv/m-p/978419#M17258</guid>
      <dc:creator>shaopeng_z_</dc:creator>
      <dc:date>2012-12-24T12:36:59Z</dc:date>
    </item>
    <item>
      <title>Quote:Some elements in the</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/different-results-between-mkl-dcscmv-and-gemv/m-p/978420#M17259</link>
      <description>&lt;BLOCKQUOTE&gt;Some elements in the results  are quite different,I don't understand why&lt;/BLOCKQUOTE&gt;

The result vectors that you gave (ansfull.txt,anscsc.txt) have elements as large as 1.6 E4, but the largest difference between the two is 3.7 E-6. 

On what basis do you say that the results are "quite different"?  How much precision do you have in the input matrix and vector, and is a variation of 3.7 E-6 between the two results quite reasonable in that perspective?</description>
      <pubDate>Mon, 24 Dec 2012 13:32:12 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/different-results-between-mkl-dcscmv-and-gemv/m-p/978420#M17259</guid>
      <dc:creator>mecej4</dc:creator>
      <dc:date>2012-12-24T13:32:12Z</dc:date>
    </item>
    <item>
      <title>I have double precision ,15</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/different-results-between-mkl-dcscmv-and-gemv/m-p/978421#M17260</link>
      <description>I have double precision ,15 or16 significant digits are accurate.  I think the order of magnitude may be 1.0E-10 at least. Why the two methods(mkl_dcscmv and gemv)  in the same MKL libary produce different results?</description>
      <pubDate>Mon, 24 Dec 2012 14:48:49 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/different-results-between-mkl-dcscmv-and-gemv/m-p/978421#M17260</guid>
      <dc:creator>shaopeng_z_</dc:creator>
      <dc:date>2012-12-24T14:48:49Z</dc:date>
    </item>
    <item>
      <title>Quote:I have double precision</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/different-results-between-mkl-dcscmv-and-gemv/m-p/978422#M17261</link>
      <description>&lt;BLOCKQUOTE&gt;I have double precision ,15 or16 significant digits are accurate. I think the order of magnitude may be 1.0E-10 at least. &lt;/BLOCKQUOTE&gt;

How did you come to this conclusion? Things may work out in that fashion for some matrices, and not so for others.

You did not show the input file K.txt, which. presumably, contains the same coefficients as in the compressed matrix, augmented by zero elements. We have to establish that the two K matrices are mathematically identical before we compare the two results for K.x.</description>
      <pubDate>Mon, 24 Dec 2012 15:27:56 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/different-results-between-mkl-dcscmv-and-gemv/m-p/978422#M17261</guid>
      <dc:creator>mecej4</dc:creator>
      <dc:date>2012-12-24T15:27:56Z</dc:date>
    </item>
  </channel>
</rss>

