<?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 Bug in sparse libraries in (Fortran) MKL 2025.2 and 2025.3 versions in Intel® oneAPI Math Kernel Library</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Bug-in-sparse-libraries-in-Fortran-MKL-2025-2-and-2025-3/m-p/1724171#M37413</link>
    <description>&lt;P&gt;I find that several bugs, at least feature variations, exist in (Fortran) MKL 2025.2 and 2025.3 versions:&lt;/P&gt;&lt;P&gt;1 MKL_CREATE_COO&lt;/P&gt;&lt;P&gt;the 2025.1 version sum terms with the same index up, while&amp;nbsp;2025.2 and 2025.3 do not.&lt;/P&gt;&lt;P&gt;2 MKL_CONVERT_CSR&lt;/P&gt;&lt;P&gt;it works with small arrays, while crashes with no warning (sometimes access violation) with large arrays.&lt;/P&gt;&lt;P&gt;3 MKL_EXPORT_CSR&lt;/P&gt;&lt;P&gt;With large arrays, it exports first several row indexes correctly, but it exports wrong results afterwards.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I feel that these newer versions are not suitable for large-scale scientific computations.&lt;/P&gt;</description>
    <pubDate>Thu, 30 Oct 2025 10:06:51 GMT</pubDate>
    <dc:creator>yxddyxzh</dc:creator>
    <dc:date>2025-10-30T10:06:51Z</dc:date>
    <item>
      <title>Bug in sparse libraries in (Fortran) MKL 2025.2 and 2025.3 versions</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Bug-in-sparse-libraries-in-Fortran-MKL-2025-2-and-2025-3/m-p/1724171#M37413</link>
      <description>&lt;P&gt;I find that several bugs, at least feature variations, exist in (Fortran) MKL 2025.2 and 2025.3 versions:&lt;/P&gt;&lt;P&gt;1 MKL_CREATE_COO&lt;/P&gt;&lt;P&gt;the 2025.1 version sum terms with the same index up, while&amp;nbsp;2025.2 and 2025.3 do not.&lt;/P&gt;&lt;P&gt;2 MKL_CONVERT_CSR&lt;/P&gt;&lt;P&gt;it works with small arrays, while crashes with no warning (sometimes access violation) with large arrays.&lt;/P&gt;&lt;P&gt;3 MKL_EXPORT_CSR&lt;/P&gt;&lt;P&gt;With large arrays, it exports first several row indexes correctly, but it exports wrong results afterwards.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I feel that these newer versions are not suitable for large-scale scientific computations.&lt;/P&gt;</description>
      <pubDate>Thu, 30 Oct 2025 10:06:51 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Bug-in-sparse-libraries-in-Fortran-MKL-2025-2-and-2025-3/m-p/1724171#M37413</guid>
      <dc:creator>yxddyxzh</dc:creator>
      <dc:date>2025-10-30T10:06:51Z</dc:date>
    </item>
    <item>
      <title>Re: Bug in sparse libraries in (Fortran) MKL 2025.2 and 2025.3 versions</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Bug-in-sparse-libraries-in-Fortran-MKL-2025-2-and-2025-3/m-p/1724178#M37415</link>
      <description>&lt;P&gt;People who want to further investigate this issue may refer to the following code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;with MKL 2025.1, it works well.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;with MKL 2025.3, it craches at LINE 404, which is caused by wrong output of&lt;/P&gt;&lt;P&gt;call mkl_to_csr(md%a_mkl,nsys,nnzsys,vsys,isys,jsys)&lt;/P&gt;&lt;P&gt;at LINE 400.&lt;/P&gt;</description>
      <pubDate>Thu, 30 Oct 2025 10:52:17 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Bug-in-sparse-libraries-in-Fortran-MKL-2025-2-and-2025-3/m-p/1724178#M37415</guid>
      <dc:creator>yxddyxzh</dc:creator>
      <dc:date>2025-10-30T10:52:17Z</dc:date>
    </item>
    <item>
      <title>Re: Bug in sparse libraries in (Fortran) MKL 2025.2 and 2025.3 versions</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Bug-in-sparse-libraries-in-Fortran-MKL-2025-2-and-2025-3/m-p/1724337#M37421</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for sharing the source code.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;While reviewing the test code for the mkl_to_csr subroutine, I noticed two areas that may require further attention:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Uninitialized Variable:&lt;/LI&gt;&lt;/UL&gt;&lt;P class=""&gt;In line 529 of DCFI_COR.f90, the line !index = SPARSE_INDEX_BASE_ONE is commented out. This leaves the index variable uninitialized, which could lead to undefined behavior during runtime.&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Potential Overlapping Memory Writes:&lt;/LI&gt;&lt;/UL&gt;&lt;P class=""&gt;Lines 538–539 appear to perform assignments that may result in overlapping writes:&lt;/P&gt;&lt;P class=""&gt;i_csr (1:n_csr) = isys_1&lt;/P&gt;&lt;P class=""&gt;i_csr (2:n_csr+1) = isys_2&lt;/P&gt;&lt;P class=""&gt;isys_1 and isys_2 are both pointers to arrays of size n_csr, but the second assignment tries to write to i_csr(2:n_csr+1). Indices 2 through n_csr overlap, causing the values from the first assignment to be overwritten. You may try if this works for you:&lt;/P&gt;&lt;P class=""&gt;i_csr(1:n_csr) = isys_1(1:n_csr)&lt;/P&gt;&lt;P class=""&gt;i_csr(n_csr+1) = isys_2(n_csr)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 31 Oct 2025 08:49:54 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Bug-in-sparse-libraries-in-Fortran-MKL-2025-2-and-2025-3/m-p/1724337#M37421</guid>
      <dc:creator>sc_Intel</dc:creator>
      <dc:date>2025-10-31T08:49:54Z</dc:date>
    </item>
    <item>
      <title>Re: Bug in sparse libraries in (Fortran) MKL 2025.2 and 2025.3 versions</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Bug-in-sparse-libraries-in-Fortran-MKL-2025-2-and-2025-3/m-p/1724388#M37424</link>
      <description>&lt;P&gt;Thanks for your quick reply.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The program should be run with the following Command Arguments: &lt;STRONG&gt;-f mod1&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried your suggestions, but the problem keeps unchanged.&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The Uninitialized Variable suggestion: index is an output variable of mkl_sparse_?_export_csr, it is also undefined in Official examples.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The Potential Overlapping Memory Writes suggestion: I tried this yet problem remains.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 31 Oct 2025 14:42:27 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Bug-in-sparse-libraries-in-Fortran-MKL-2025-2-and-2025-3/m-p/1724388#M37424</guid>
      <dc:creator>yxddyxzh</dc:creator>
      <dc:date>2025-10-31T14:42:27Z</dc:date>
    </item>
    <item>
      <title>Re: Bug in sparse libraries in (Fortran) MKL 2025.2 and 2025.3 versions</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Bug-in-sparse-libraries-in-Fortran-MKL-2025-2-and-2025-3/m-p/1724594#M37425</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.intel.com/t5/user/viewprofilepage/user-id/298497"&gt;@yxddyxzh&lt;/a&gt;, Thank you for reporting this issue. I’ve been able to reproduce the crash on my end and confirmed that it occurs within the PARDISO routine. We've logged the issue internally and will keep you updated as we make progress.&lt;/P&gt;</description>
      <pubDate>Mon, 03 Nov 2025 07:43:07 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Bug-in-sparse-libraries-in-Fortran-MKL-2025-2-and-2025-3/m-p/1724594#M37425</guid>
      <dc:creator>sc_Intel</dc:creator>
      <dc:date>2025-11-03T07:43:07Z</dc:date>
    </item>
    <item>
      <title>Re: Bug in sparse libraries in (Fortran) MKL 2025.2 and 2025.3 versions</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Bug-in-sparse-libraries-in-Fortran-MKL-2025-2-and-2025-3/m-p/1725246#M37438</link>
      <description>&lt;P&gt;Dear yxddyxzh,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for bringing this to our attention. It is indeed an issue with the &lt;EM&gt;mkl_sparse_convert_csr&lt;/EM&gt; API, which fails to sort or reduce duplicate entries in the 2025.2 and 2025.3 releases. The issue will be fixed in the 2026.0 release. In the meantime, we suggest two possible solutions:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&amp;nbsp;Keep using the same API from the 2025.1 release or before.&lt;/LI&gt;&lt;LI&gt;You may want to write your own summation routine for duplicate entries following the process below:&lt;OL&gt;&lt;LI&gt;&lt;STRONG&gt;Convert, order and export the CSR matrix&lt;BR /&gt;&lt;/STRONG&gt;Use &lt;EM&gt;mkl_sparse_convert_csr&lt;/EM&gt; to convert the COO matrix to CSR format as you do now. Use &lt;EM&gt;mkl_sparse_order&lt;/EM&gt; to sort the CSR matrix. Then export the resulting arrays using &lt;EM&gt;mkl_sparse_?_export_csr&lt;/EM&gt;. The exported arrays will be in sorted CSR format but may contain duplicate entries.&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;Preprocess row pointers&lt;BR /&gt;&lt;/STRONG&gt;Allocate &lt;EM&gt;ia_new&lt;/EM&gt; with length &lt;EM&gt;nrows + 1&lt;/EM&gt;. For each row, determine the number of unique nonzero entries from the &lt;EM&gt;ia&lt;/EM&gt; and &lt;EM&gt;ja&lt;/EM&gt; arrays (this step can be parallelized). Store the result for row &lt;EM&gt;k&lt;/EM&gt; in &lt;EM&gt;ia_new[k+1]&lt;/EM&gt;, set&lt;EM&gt; ia_new[0] = index&lt;/EM&gt;, and compute the inclusive prefix sum of &lt;EM&gt;ia_new&lt;/EM&gt;. The total number of unique nonzeros is then &lt;EM&gt;nnz_new = ia_new[nrows] - index&lt;/EM&gt;.&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;Allocate output arrays&lt;BR /&gt;&lt;/STRONG&gt;Allocate &lt;EM&gt;ja_new&lt;/EM&gt; and &lt;EM&gt;a_new&lt;/EM&gt; with length &lt;EM&gt;nnz_new&lt;/EM&gt;.&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;Fill and accumulate values&lt;BR /&gt;&lt;/STRONG&gt;Using &lt;EM&gt;ia_new&lt;/EM&gt; as row pointers, populate &lt;EM&gt;ja_new&lt;/EM&gt; and &lt;EM&gt;a_new&lt;/EM&gt; (potentially in parallel). For each row, accumulate values corresponding to duplicate column indices—since the entries are sorted within a row, duplicates can be efficiently detected and combined.&lt;/LI&gt;&lt;/OL&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For information, here is a past forum post about a Fortran implementation for a summation routine for duplicate COO entries (that version is not in parallel but functional):&amp;nbsp;&lt;A href="https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/About-COO-with-duplicate-entries-and-MKL-sparse-export-csr/m-p/1160741" target="_blank"&gt;https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/About-COO-with-duplicate-entries-and-MKL-sparse-export-csr/m-p/1160741&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best,&lt;BR /&gt;Nicolas&lt;/P&gt;</description>
      <pubDate>Thu, 06 Nov 2025 20:26:15 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Bug-in-sparse-libraries-in-Fortran-MKL-2025-2-and-2025-3/m-p/1725246#M37438</guid>
      <dc:creator>noffermans</dc:creator>
      <dc:date>2025-11-06T20:26:15Z</dc:date>
    </item>
    <item>
      <title>Re: Bug in sparse libraries in (Fortran) MKL 2025.2 and 2025.3 versions</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Bug-in-sparse-libraries-in-Fortran-MKL-2025-2-and-2025-3/m-p/1725499#M37439</link>
      <description>&lt;P&gt;Thanks a lot for carefully debugging my code! I have been using MKL libraries for several years, and it performs really well in sparse system solutions. &lt;SPAN&gt;I appreciate your long-term dedication.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 09 Nov 2025 20:16:46 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Bug-in-sparse-libraries-in-Fortran-MKL-2025-2-and-2025-3/m-p/1725499#M37439</guid>
      <dc:creator>yxddyxzh</dc:creator>
      <dc:date>2025-11-09T20:16:46Z</dc:date>
    </item>
  </channel>
</rss>

