<?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 Possible bug (or misleading documentation) in mkl_zcsradd in Intel® oneAPI Math Kernel Library</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Possible-bug-or-misleading-documentation-in-mkl-zcsradd/m-p/767825#M391</link>
    <description>Hi,&lt;BR /&gt;&lt;BR /&gt;I found a possibly wrong behavior of the function mkl_zcsradd, isolated in the example below:&lt;BR /&gt;&lt;PRE&gt;[fortran]program csradd

  implicit none

  ! Matrix A
  integer    :: aia (1:4)
  integer    :: aja (1:5)
  complex(8) :: aval(1:5)
  ! Matrix B
  integer    :: bia (1:4)
  integer    :: bja (1:2)
  complex(8) :: bval(1:2)
  ! Matrix C
  integer    :: cia (1:4)
  integer    :: cja (1:7)
  complex(8) :: cval(1:7)
  ! MKL variables
  integer    :: info
  integer    :: request
  integer    :: nrow = 3
  integer    :: ncol = 3
  integer    :: sort = 3
  integer    :: nnz  = 7
  complex(8) :: beta = cmplx(1.0d0,0.0d0,8)
  
  ! Set Matrix A
  aia     = (/ 1, 3, 4, 6 /)
  aja     = (/ 1, 3, 2, 1, 2 /)
  aval(1) = cmplx(1.0d0,0.0d0,8)
  aval(2) = cmplx(3.0d0,0.0d0,8)
  aval(3) = cmplx(4.0d0,0.0d0,8)
  aval(4) = cmplx(5.0d0,0.0d0,8)
  aval(5) = cmplx(0.0d0,4.0d0,8)
  ! Set Matrix B
  bia     = (/ 1, 1, 2, 3 /)
  bja     = (/ 3, 3 /)
  bval(1) = cmplx(2.0d0,0.0d0,8)
  bval(2) = cmplx(2.0d0,0.0d0,8)
  ! C = A + B
  request = 1
  call mkl_zcsradd("N",request,sort,nrow,ncol,aval,aja,aia,beta,bval,bja,bia,cval,cja,cia,nnz,info)
  print *, info
  print *&lt;BR /&gt;  ! nnz = size(cja)  (as in MKL documentation)&lt;BR /&gt;  request = 0
  call mkl_zcsradd("N",request,sort,nrow,ncol,aval,aja,aia,beta,bval,bja,bia,cval,cja,cia,nnz,info)
  print *, info
  print *, cja
  print *
  ! nnz = size(cja) + 1&lt;BR /&gt;  request = 0
  call mkl_zcsradd("N",request,sort,nrow,ncol,aval,aja,aia,beta,bval,bja,bia,cval,cja,cia,nnz+1,info)
  print *, info
  print *, cja
  
end program csradd
[/fortran]&lt;/PRE&gt; The program is compiled with the command:&lt;BR /&gt;&lt;PRE&gt;[bash]ifort -O0 -warn all csradd.f90 -lmkl_intel -lmkl_sequential -lmkl_core[/bash]&lt;/PRE&gt; and gives the following output:&lt;BR /&gt;&lt;PRE&gt;[bash]           0
 
           3
           1           3           2           3           1           2
           0
 
           0
           1           3           2           3           1           2
           3
[/bash]&lt;/PRE&gt; In the documentation it is written:&lt;BR /&gt;&lt;PRE&gt;[xml]nzmax    INTEGER. The length of the arrays c and jc.[/xml]&lt;/PRE&gt; while it seems that for the function to work correctly nzmax must be set to:&lt;BR /&gt;&lt;PRE&gt;[fortran]nzmax = size(jc) + 1[/fortran]&lt;/PRE&gt; I would like to ask if this behavior is reproducible by anyone.&lt;BR /&gt;&lt;BR /&gt;Also, if the problem will be confirmed, I am not sure if it is really a bug or just a typo in the documentation.&lt;BR /&gt;&lt;BR /&gt;Massimiliano</description>
    <pubDate>Thu, 07 Apr 2011 12:27:15 GMT</pubDate>
    <dc:creator>Massimiliano_Culpo</dc:creator>
    <dc:date>2011-04-07T12:27:15Z</dc:date>
    <item>
      <title>Possible bug (or misleading documentation) in mkl_zcsradd</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Possible-bug-or-misleading-documentation-in-mkl-zcsradd/m-p/767825#M391</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;I found a possibly wrong behavior of the function mkl_zcsradd, isolated in the example below:&lt;BR /&gt;&lt;PRE&gt;[fortran]program csradd

  implicit none

  ! Matrix A
  integer    :: aia (1:4)
  integer    :: aja (1:5)
  complex(8) :: aval(1:5)
  ! Matrix B
  integer    :: bia (1:4)
  integer    :: bja (1:2)
  complex(8) :: bval(1:2)
  ! Matrix C
  integer    :: cia (1:4)
  integer    :: cja (1:7)
  complex(8) :: cval(1:7)
  ! MKL variables
  integer    :: info
  integer    :: request
  integer    :: nrow = 3
  integer    :: ncol = 3
  integer    :: sort = 3
  integer    :: nnz  = 7
  complex(8) :: beta = cmplx(1.0d0,0.0d0,8)
  
  ! Set Matrix A
  aia     = (/ 1, 3, 4, 6 /)
  aja     = (/ 1, 3, 2, 1, 2 /)
  aval(1) = cmplx(1.0d0,0.0d0,8)
  aval(2) = cmplx(3.0d0,0.0d0,8)
  aval(3) = cmplx(4.0d0,0.0d0,8)
  aval(4) = cmplx(5.0d0,0.0d0,8)
  aval(5) = cmplx(0.0d0,4.0d0,8)
  ! Set Matrix B
  bia     = (/ 1, 1, 2, 3 /)
  bja     = (/ 3, 3 /)
  bval(1) = cmplx(2.0d0,0.0d0,8)
  bval(2) = cmplx(2.0d0,0.0d0,8)
  ! C = A + B
  request = 1
  call mkl_zcsradd("N",request,sort,nrow,ncol,aval,aja,aia,beta,bval,bja,bia,cval,cja,cia,nnz,info)
  print *, info
  print *&lt;BR /&gt;  ! nnz = size(cja)  (as in MKL documentation)&lt;BR /&gt;  request = 0
  call mkl_zcsradd("N",request,sort,nrow,ncol,aval,aja,aia,beta,bval,bja,bia,cval,cja,cia,nnz,info)
  print *, info
  print *, cja
  print *
  ! nnz = size(cja) + 1&lt;BR /&gt;  request = 0
  call mkl_zcsradd("N",request,sort,nrow,ncol,aval,aja,aia,beta,bval,bja,bia,cval,cja,cia,nnz+1,info)
  print *, info
  print *, cja
  
end program csradd
[/fortran]&lt;/PRE&gt; The program is compiled with the command:&lt;BR /&gt;&lt;PRE&gt;[bash]ifort -O0 -warn all csradd.f90 -lmkl_intel -lmkl_sequential -lmkl_core[/bash]&lt;/PRE&gt; and gives the following output:&lt;BR /&gt;&lt;PRE&gt;[bash]           0
 
           3
           1           3           2           3           1           2
           0
 
           0
           1           3           2           3           1           2
           3
[/bash]&lt;/PRE&gt; In the documentation it is written:&lt;BR /&gt;&lt;PRE&gt;[xml]nzmax    INTEGER. The length of the arrays c and jc.[/xml]&lt;/PRE&gt; while it seems that for the function to work correctly nzmax must be set to:&lt;BR /&gt;&lt;PRE&gt;[fortran]nzmax = size(jc) + 1[/fortran]&lt;/PRE&gt; I would like to ask if this behavior is reproducible by anyone.&lt;BR /&gt;&lt;BR /&gt;Also, if the problem will be confirmed, I am not sure if it is really a bug or just a typo in the documentation.&lt;BR /&gt;&lt;BR /&gt;Massimiliano</description>
      <pubDate>Thu, 07 Apr 2011 12:27:15 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Possible-bug-or-misleading-documentation-in-mkl-zcsradd/m-p/767825#M391</guid>
      <dc:creator>Massimiliano_Culpo</dc:creator>
      <dc:date>2011-04-07T12:27:15Z</dc:date>
    </item>
    <item>
      <title>Possible bug (or misleading documentation) in mkl_zcsradd</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Possible-bug-or-misleading-documentation-in-mkl-zcsradd/m-p/767826#M392</link>
      <description>&lt;P&gt;Massimiliano,&lt;/P&gt;&lt;P&gt;Yes, I reproduced the behavior.This is the bug in the code.The documentation is correct.Nzmax must be equal size(jc) as originally is pointed into manual.&lt;/P&gt;

&lt;P&gt;--Gennady&lt;/P&gt;



&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Apr 2011 13:28:12 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Possible-bug-or-misleading-documentation-in-mkl-zcsradd/m-p/767826#M392</guid>
      <dc:creator>Gennady_F_Intel</dc:creator>
      <dc:date>2011-04-11T13:28:12Z</dc:date>
    </item>
    <item>
      <title>Possible bug (or misleading documentation) in mkl_zcsradd</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Possible-bug-or-misleading-documentation-in-mkl-zcsradd/m-p/767827#M393</link>
      <description>Hi Massimiliano. The problem you reported has been fixed in Update 5 available now. Please check the problem and let us know the resullts.&lt;DIV&gt;--Gennady&lt;/DIV&gt;</description>
      <pubDate>Wed, 24 Aug 2011 14:25:59 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Possible-bug-or-misleading-documentation-in-mkl-zcsradd/m-p/767827#M393</guid>
      <dc:creator>Gennady_F_Intel</dc:creator>
      <dc:date>2011-08-24T14:25:59Z</dc:date>
    </item>
    <item>
      <title>Possible bug (or misleading documentation) in mkl_zcsradd</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Possible-bug-or-misleading-documentation-in-mkl-zcsradd/m-p/767828#M394</link>
      <description>Hi Gennady,&lt;BR /&gt;sorry for the late answer. I just checked the test and now it works fine. The new output is:&lt;BR /&gt;&lt;BR /&gt;&lt;PRE&gt;[bash]0
 
0
1           3           2           3           1           2
3
 
0
1           3           2           3           1           2
3
[/bash]&lt;/PRE&gt;&lt;BR /&gt;Massimiliano</description>
      <pubDate>Sat, 03 Sep 2011 12:47:41 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Possible-bug-or-misleading-documentation-in-mkl-zcsradd/m-p/767828#M394</guid>
      <dc:creator>Massimiliano_Culpo</dc:creator>
      <dc:date>2011-09-03T12:47:41Z</dc:date>
    </item>
  </channel>
</rss>

