<?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 Conversion to sparse matrix: wrong behavior of mkl_zdnscsr in Intel® oneAPI Math Kernel Library</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Conversion-to-sparse-matrix-wrong-behavior-of-mkl-zdnscsr/m-p/776819#M1138</link>
    <description>Hi,&lt;BR /&gt;&lt;BR /&gt;many thanks for the quick response! I'll look forward to the fixed version (and will use other means to convert the complex matrix in the meanwhile :-) )&lt;BR /&gt;&lt;BR /&gt;Massimiliano</description>
    <pubDate>Thu, 24 Mar 2011 20:55:18 GMT</pubDate>
    <dc:creator>Massimiliano_Culpo</dc:creator>
    <dc:date>2011-03-24T20:55:18Z</dc:date>
    <item>
      <title>Conversion to sparse matrix: wrong behavior of mkl_zdnscsr</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Conversion-to-sparse-matrix-wrong-behavior-of-mkl-zdnscsr/m-p/776814#M1133</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;I am trying to convert a complex(8) dense matrix into csr sparse format using MKL specific routines. Anyhow, I encountered a problem I was able to isolate in the code attached below:&lt;BR /&gt;&lt;BR /&gt;&lt;PRE&gt;[fortran]program dns2csr

  complex(8),      allocatable :: Aall(:,:)
  integer,         allocatable :: ia  (:)
  integer,         allocatable :: ja  (:)
  complex(8),      allocatable :: zval(:)
  real(8),         allocatable :: dval(:)
  ! Variables needed by MKL
  integer                      :: job(1:8)
  integer                      :: info
  
  integer,           parameter :: nrow = 3
  integer,           parameter :: ncol = 3
  
  ! Allocate workspace
  allocate(Aall(1:3,1:3))
  allocate(ia (1:nrow+1))
  ! Initialize dns matrix
  Aall      = cmplx(0.0d0,0.0d0)
  Aall(1,1) = cmplx(1.0d0,0.0d0)
  Aall(3,1) = cmplx(5.0d0,0.0d0)
  Aall(2,2) = cmplx(4.0d0,0.0d0)
  Aall(3,2) = cmplx(0.0d0,4.0d0)
  Aall(1,3) = cmplx(3.0d0,0.0d0)

  ! Set job
  job(1) = 0 ! Convert from dense to CSR format
  job(2) = 1 ! One-based indexing for dense
  job(3) = 1 ! One-based indexing for CSR
  job(4) = 2 ! Pass the whole dense matrix to MKL routines 
  
  ! Compute ia only
  job(5) = 0 ! Max number of nnz
  job(6) = 0 ! Construct ia only
  allocate(ja(1),zval(1),dval(1))
  call mkl_zdnscsr(job,nrow,ncol,Aall,nrow,zval,ja,ia,info)
  print *,ia
  print *,info
  call mkl_ddnscsr(job,nrow,ncol,real(Aall),nrow,dval,ja,ia,info)
  print *,ia
  print *,info

  deallocate(ia,ja,dval,zval)
  deallocate(Aall)

end program dns2csr[/fortran]&lt;/PRE&gt; I compile this program with the command:&lt;BR /&gt;&lt;PRE&gt;[bash]ifort -O0 -warn all dns2csr.f90 -lmkl_intel -lmkl_sequential  -lmkl_core[/bash]&lt;/PRE&gt; Then running a.out I get the following output:&lt;BR /&gt;&lt;PRE&gt;[bash]$ ./a.out 
           1           1           1           1
           0
           1           3           4           5
           3
[/bash]&lt;/PRE&gt; While the correct one should have been:&lt;BR /&gt;&lt;PRE&gt;[bash]$ ./a.out 
           1           3           4           6
           3
           1           3           4           5
           3
[/bash]&lt;/PRE&gt;It seems that conversion from dense format to csr format works properly only with real(8) type. I wonder if the routine mkl_zdnscsr is somehow buggy or if I am doing some trivial error I am not able to spot. Is anyone able to reproduce the same behavior?&lt;BR /&gt;&lt;BR /&gt;M.</description>
      <pubDate>Wed, 23 Mar 2011 21:27:56 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Conversion-to-sparse-matrix-wrong-behavior-of-mkl-zdnscsr/m-p/776814#M1133</guid>
      <dc:creator>Massimiliano_Culpo</dc:creator>
      <dc:date>2011-03-23T21:27:56Z</dc:date>
    </item>
    <item>
      <title>Conversion to sparse matrix: wrong behavior of mkl_zdnscsr</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Conversion-to-sparse-matrix-wrong-behavior-of-mkl-zdnscsr/m-p/776815#M1134</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;According to MKL Reference Manual&lt;BR /&gt;&lt;BR /&gt;&lt;H1 class="topictitle1"&gt;mkl_?dnscsr&lt;/H1&gt;&lt;!--Convert a sparse matrix in dense representation to the CSR format and vice versa.--&gt;&lt;DIV&gt;&lt;P&gt;Convert a sparse matrix in dense representation to the CSR format and vice versa.&lt;/P&gt;&lt;/DIV&gt;&lt;BR /&gt;but&lt;BR /&gt;&lt;BR /&gt;&lt;P&gt;COMPLEX for mkl_cdnscsr&lt;BR /&gt;DOUBLE COMPLEX for mkl_zdnscsr&lt;BR /&gt;&lt;BR /&gt;INTERFACE is as follows:&lt;BR /&gt;&lt;BR /&gt;SUBROUTINE mkl_zdnscsr(job, m, n, adns, lda, acsr, ja, ia, info)&lt;/P&gt;&lt;PRE&gt;  INTEGER       job(8)&lt;/PRE&gt;&lt;PRE&gt;  INTEGER       m, n, lda, info&lt;/PRE&gt;&lt;PRE&gt;  INTEGER      ja(*), ia(m+1)&lt;/PRE&gt;&lt;PRE&gt;  DOUBLE COMPLEX      adns(*), acsr(*)&lt;/PRE&gt;&lt;P&gt;&lt;BR /&gt;However, in your example complex(8) and real(8)are used for mkl_zdnscsr function.&lt;/P&gt;</description>
      <pubDate>Thu, 24 Mar 2011 08:58:25 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Conversion-to-sparse-matrix-wrong-behavior-of-mkl-zdnscsr/m-p/776815#M1134</guid>
      <dc:creator>barragan_villanueva_</dc:creator>
      <dc:date>2011-03-24T08:58:25Z</dc:date>
    </item>
    <item>
      <title>Conversion to sparse matrix: wrong behavior of mkl_zdnscsr</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Conversion-to-sparse-matrix-wrong-behavior-of-mkl-zdnscsr/m-p/776816#M1135</link>
      <description>Hi Victor,&lt;BR /&gt;&lt;BR /&gt;and many thanks for your reply!&lt;BR /&gt;&lt;BR /&gt;Nonetheless I think you misunderstood my post a little. I used complex(8) (syntax equivalent to a complex*16 declaration, at least on my machine) in the calling mkl_zdnscsr, while real(8) (syntax equivalent to a real*8 declaration, at least on my machine) was used in the calling to mkl_ddnscsr.&lt;BR /&gt;&lt;BR /&gt;My point was to say that the same piece of code works if I am using double precision matrix, while it is not if I am using double complex matrix. Of course when I work with complex(8)/real(8) I call the z/d version of mkl_Xdnscsr.&lt;BR /&gt;&lt;BR /&gt;Any suggestion on what to do? Are you able to reproduce this problem?&lt;BR /&gt;&lt;BR /&gt;Many thanks again,&lt;BR /&gt;Massimiliano&lt;BR /&gt;</description>
      <pubDate>Thu, 24 Mar 2011 10:13:30 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Conversion-to-sparse-matrix-wrong-behavior-of-mkl-zdnscsr/m-p/776816#M1135</guid>
      <dc:creator>Massimiliano_Culpo</dc:creator>
      <dc:date>2011-03-24T10:13:30Z</dc:date>
    </item>
    <item>
      <title>Conversion to sparse matrix: wrong behavior of mkl_zdnscsr</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Conversion-to-sparse-matrix-wrong-behavior-of-mkl-zdnscsr/m-p/776817#M1136</link>
      <description>Massimiliano,&lt;DIV&gt;yes, it looks like the bug. Please let us the time we will investigate and back to you shortly.&lt;/DIV&gt;&lt;DIV&gt;--Gennady&lt;/DIV&gt;</description>
      <pubDate>Thu, 24 Mar 2011 16:27:22 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Conversion-to-sparse-matrix-wrong-behavior-of-mkl-zdnscsr/m-p/776817#M1136</guid>
      <dc:creator>Gennady_F_Intel</dc:creator>
      <dc:date>2011-03-24T16:27:22Z</dc:date>
    </item>
    <item>
      <title>Conversion to sparse matrix: wrong behavior of mkl_zdnscsr</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Conversion-to-sparse-matrix-wrong-behavior-of-mkl-zdnscsr/m-p/776818#M1137</link>
      <description>Hi Massimiliano,&lt;BR /&gt;&lt;BR /&gt;Thank you for reporting this issue. The subroutine works correctly if you set both imaginary and real parts of a complex number to non-zero. It seems like the component that checks whether an entry is nonzero or not is in error. We will fix this as soon as possible.&lt;BR /&gt;&lt;BR /&gt;-- Efe</description>
      <pubDate>Thu, 24 Mar 2011 16:57:41 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Conversion-to-sparse-matrix-wrong-behavior-of-mkl-zdnscsr/m-p/776818#M1137</guid>
      <dc:creator>Murat_G_Intel</dc:creator>
      <dc:date>2011-03-24T16:57:41Z</dc:date>
    </item>
    <item>
      <title>Conversion to sparse matrix: wrong behavior of mkl_zdnscsr</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Conversion-to-sparse-matrix-wrong-behavior-of-mkl-zdnscsr/m-p/776819#M1138</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;many thanks for the quick response! I'll look forward to the fixed version (and will use other means to convert the complex matrix in the meanwhile :-) )&lt;BR /&gt;&lt;BR /&gt;Massimiliano</description>
      <pubDate>Thu, 24 Mar 2011 20:55:18 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Conversion-to-sparse-matrix-wrong-behavior-of-mkl-zdnscsr/m-p/776819#M1138</guid>
      <dc:creator>Massimiliano_Culpo</dc:creator>
      <dc:date>2011-03-24T20:55:18Z</dc:date>
    </item>
    <item>
      <title>Conversion to sparse matrix: wrong behavior of mkl_zdnscsr</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Conversion-to-sparse-matrix-wrong-behavior-of-mkl-zdnscsr/m-p/776820#M1139</link>
      <description>&lt;DIV id="_mcePaste"&gt;&lt;P style="mso-margin-top-alt: auto; mso-margin-bottom-alt: auto;" class="MsoNormal"&gt;&lt;/P&gt;&lt;P style="line-height: 12.0pt; background: white;" class="MsoNormal"&gt;&lt;/P&gt;&lt;P style="line-height: 12.0pt; background: white;" class="MsoNormal"&gt;&lt;SPAN style="mso-fareast-font-family: " times="" new="" roman=""&gt;Hi&lt;/SPAN&gt;&lt;SPAN style="mso-fareast-font-family: " times="" new="" roman=""&gt;Massimiliano,
thanks &lt;/SPAN&gt;&lt;SPAN style="mso-fareast-font-family: " times="" new="" roman=""&gt;&lt;SPAN style="mso-spacerun: yes;"&gt;&lt;/SPAN&gt;for the problem you raised.This issue
has been submitted to our internal development tracking database for further
investigation, we will inform you once a new update becomes available.&lt;P&gt;&lt;/P&gt;&lt;/SPAN&gt;&lt;/P&gt;

&lt;P class="MsoNormal"&gt;&lt;SPAN style="mso-fareast-font-family: " times="" new="" roman=""&gt;Here is a bug tracking number
for your reference: &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: " arial=""&gt;200209064.&lt;P&gt;&lt;/P&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 25 Mar 2011 06:54:27 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Conversion-to-sparse-matrix-wrong-behavior-of-mkl-zdnscsr/m-p/776820#M1139</guid>
      <dc:creator>Gennady_F_Intel</dc:creator>
      <dc:date>2011-03-25T06:54:27Z</dc:date>
    </item>
    <item>
      <title>Conversion to sparse matrix: wrong behavior of mkl_zdnscsr</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Conversion-to-sparse-matrix-wrong-behavior-of-mkl-zdnscsr/m-p/776821#M1140</link>
      <description>Massimiliano,&lt;DIV&gt;c&lt;SPAN style="font-family: verdana, sans-serif;"&gt;ould you please check how it works with the latest &lt;B&gt;10.3 update 4&lt;/B&gt; which was released yesterday and let us know if you will see the same behavior?&lt;/SPAN&gt;&lt;DIV&gt;&lt;SPAN style="font-family: verdana, sans-serif;"&gt;--Gennady&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 13 May 2011 09:12:22 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Conversion-to-sparse-matrix-wrong-behavior-of-mkl-zdnscsr/m-p/776821#M1140</guid>
      <dc:creator>Gennady_F_Intel</dc:creator>
      <dc:date>2011-05-13T09:12:22Z</dc:date>
    </item>
    <item>
      <title>Conversion to sparse matrix: wrong behavior of mkl_zdnscsr</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Conversion-to-sparse-matrix-wrong-behavior-of-mkl-zdnscsr/m-p/776822#M1141</link>
      <description>I have just tried MKL 10.3 Update 4.&lt;BR /&gt;&lt;BR /&gt;The output now is:&lt;BR /&gt;&lt;BR /&gt;&lt;PRE&gt;[bash]1           3           4           6
0
1           3           4           5
0
[/bash]&lt;/PRE&gt; which I think is fine. Many thanks for updating me on the issue!&lt;BR /&gt;&lt;BR /&gt;Massimiliano</description>
      <pubDate>Fri, 13 May 2011 09:15:32 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Conversion-to-sparse-matrix-wrong-behavior-of-mkl-zdnscsr/m-p/776822#M1141</guid>
      <dc:creator>Massimiliano_Culpo</dc:creator>
      <dc:date>2011-05-13T09:15:32Z</dc:date>
    </item>
  </channel>
</rss>

