<?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 i'm using the latest 2019.5 in Intel® oneAPI Math Kernel Library</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Serious-memory-leak-problem-of-mkl-sparse-d-add-subroutine/m-p/1178543#M29166</link>
    <description>&lt;P&gt;i'm using the latest 2019.5 64 bit version together with the latest VISUAL STUDIO update. It's the openmp version with qmkl:parallel option turned on. You could easily see memory usage blows if above mentioned code runs.&lt;/P&gt;&lt;P&gt;The code shows a comparison between COO and CSR internal formats, CSR has the problem, COO does't.&lt;/P&gt;</description>
    <pubDate>Mon, 14 Oct 2019 03:47:00 GMT</pubDate>
    <dc:creator>yang__xiaodong</dc:creator>
    <dc:date>2019-10-14T03:47:00Z</dc:date>
    <item>
      <title>Serious memory leak problem of mkl_sparse_d_add subroutine</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Serious-memory-leak-problem-of-mkl-sparse-d-add-subroutine/m-p/1178539#M29162</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I'm currently programming with the new sparse interface, and experienced serious memory leak problem when this routine: mkl_sparse_d_add is called several thousand times, it takes up all my 64 GB memory and program cannot go on. I'm not sure whether other sparse routines has similar problems, but at least routines mkl_sparse_d_create_coo,&amp;nbsp;mkl_sparse_convert_csr,&amp;nbsp;mkl_sparse_d_mv do not have this problem.&lt;/P&gt;&lt;P&gt;Please take a check of it, thank you very much!&lt;/P&gt;</description>
      <pubDate>Sun, 13 Oct 2019 02:34:07 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Serious-memory-leak-problem-of-mkl-sparse-d-add-subroutine/m-p/1178539#M29162</guid>
      <dc:creator>yang__xiaodong</dc:creator>
      <dc:date>2019-10-13T02:34:07Z</dc:date>
    </item>
    <item>
      <title>by the way, I'm a windows</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Serious-memory-leak-problem-of-mkl-sparse-d-add-subroutine/m-p/1178540#M29163</link>
      <description>&lt;P&gt;by the way, I'm a windows fortran MKL user.&lt;/P&gt;</description>
      <pubDate>Sun, 13 Oct 2019 02:34:41 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Serious-memory-leak-problem-of-mkl-sparse-d-add-subroutine/m-p/1178540#M29163</guid>
      <dc:creator>yang__xiaodong</dc:creator>
      <dc:date>2019-10-13T02:34:41Z</dc:date>
    </item>
    <item>
      <title>more precisely, it works well</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Serious-memory-leak-problem-of-mkl-sparse-d-add-subroutine/m-p/1178541#M29164</link>
      <description>&lt;P&gt;more precisely, it works well with COO internal format, but mkl_sparse_d_add fails with CSR internal format, you can check the following sample code and monitoring the memory usage during running:&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; include "mkl_spblas.f90"&lt;BR /&gt;&amp;nbsp; &amp;nbsp; program matrix&lt;BR /&gt;&amp;nbsp; &amp;nbsp; use mkl_spblas&lt;BR /&gt;&amp;nbsp; &amp;nbsp; implicit none&lt;BR /&gt;&amp;nbsp; &amp;nbsp; integer :: info,i&lt;BR /&gt;&amp;nbsp; &amp;nbsp; integer :: d_row(10)=[1,2,3,4,5,6,7,8,9,10]&lt;BR /&gt;&amp;nbsp; &amp;nbsp; integer :: d_COL(10)=[1,2,3,4,5,6,7,8,9,10]&lt;BR /&gt;&amp;nbsp; &amp;nbsp; real(8) :: d_VAL(10)=[0,0,0,0,0,0,0,0,0,0]&lt;BR /&gt;&amp;nbsp; &amp;nbsp; type(SPARSE_MATRIX_T) :: a_mkl,b_mkl&lt;BR /&gt;&amp;nbsp; &amp;nbsp; info = mkl_sparse_d_create_coo (a_mkl, SPARSE_INDEX_BASE_one, 10, 10, 1, d_ROW, d_COL, d_VAL)&lt;BR /&gt;&amp;nbsp; &amp;nbsp; ! it works well with COO internal format&lt;BR /&gt;&amp;nbsp; &amp;nbsp; do i=1,1000000&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; info = mkl_sparse_d_add (SPARSE_OPERATION_NON_TRANSPOSE, a_mkl, 1.d0, a_mkl, a_mkl)&lt;BR /&gt;&amp;nbsp; &amp;nbsp; end do&lt;BR /&gt;&amp;nbsp; &amp;nbsp; ! but mkl_sparse_d_add fails with CSR internal format&lt;BR /&gt;&amp;nbsp; &amp;nbsp; info = mkl_sparse_convert_csr (a_mkl, SPARSE_OPERATION_NON_TRANSPOSE, b_mkl)&lt;BR /&gt;&amp;nbsp; &amp;nbsp; do i=1,1000000&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; info = mkl_sparse_d_add (SPARSE_OPERATION_NON_TRANSPOSE, b_mkl, 1.d0, b_mkl, b_mkl)&lt;BR /&gt;&amp;nbsp; &amp;nbsp; end do&lt;BR /&gt;&amp;nbsp; &amp;nbsp; end program&lt;/P&gt;</description>
      <pubDate>Sun, 13 Oct 2019 03:05:22 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Serious-memory-leak-problem-of-mkl-sparse-d-add-subroutine/m-p/1178541#M29164</guid>
      <dc:creator>yang__xiaodong</dc:creator>
      <dc:date>2019-10-13T03:05:22Z</dc:date>
    </item>
    <item>
      <title>how did you detect the</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Serious-memory-leak-problem-of-mkl-sparse-d-add-subroutine/m-p/1178542#M29165</link>
      <description>&lt;P&gt;how did you detect&amp;nbsp;the memleeks?&amp;nbsp;&lt;/P&gt;&lt;P&gt;which version of mkl do you use?&lt;/P&gt;&lt;P&gt;64 or 32 bit?&lt;/P&gt;&lt;P&gt;did you link with treaded mode of mkl?&amp;nbsp;&lt;/P&gt;&lt;P&gt;is that openmp or tbb?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 14 Oct 2019 01:38:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Serious-memory-leak-problem-of-mkl-sparse-d-add-subroutine/m-p/1178542#M29165</guid>
      <dc:creator>Gennady_F_Intel</dc:creator>
      <dc:date>2019-10-14T01:38:00Z</dc:date>
    </item>
    <item>
      <title>i'm using the latest 2019.5</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Serious-memory-leak-problem-of-mkl-sparse-d-add-subroutine/m-p/1178543#M29166</link>
      <description>&lt;P&gt;i'm using the latest 2019.5 64 bit version together with the latest VISUAL STUDIO update. It's the openmp version with qmkl:parallel option turned on. You could easily see memory usage blows if above mentioned code runs.&lt;/P&gt;&lt;P&gt;The code shows a comparison between COO and CSR internal formats, CSR has the problem, COO does't.&lt;/P&gt;</description>
      <pubDate>Mon, 14 Oct 2019 03:47:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Serious-memory-leak-problem-of-mkl-sparse-d-add-subroutine/m-p/1178543#M29166</guid>
      <dc:creator>yang__xiaodong</dc:creator>
      <dc:date>2019-10-14T03:47:00Z</dc:date>
    </item>
    <item>
      <title>Hello,</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Serious-memory-leak-problem-of-mkl-sparse-d-add-subroutine/m-p/1178544#M29167</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;The thing is, the routine mkl_sparse_?_add allocates&amp;nbsp;the output matrix always. So, when you call it in a loop with the same matrix handle A as both input and output arguments, each time the memory has been allocated and has replaced the original matrix. Since with probability one when you add two different sparse matrices you'll get an extended stencil, it is reasonable to allocate the output arrays. The same reasoning was used for other routines which create the output matrix (say, mkl_sparse_?_spmm and others).&lt;/P&gt;&lt;P&gt;We'll consider&amp;nbsp;making the documentation more precise about it, especially for Fortran users.&lt;/P&gt;&lt;P&gt;So, what you can do in your case is create a temporary matrix as a buffer,&amp;nbsp;destroy the input matrix and rename the temp to the original name if you want to mimic an in-place addition.&lt;/P&gt;&lt;P&gt;As for the COO format, there actually the info is SPARSE_STATUS_NOT_SUPPORTED, so nothing is computed in the loop where&amp;nbsp;you call mkl_sparse_?_add with coordinate format.&lt;/P&gt;&lt;P&gt;Hope this helps!&lt;/P&gt;&lt;P&gt;Best,&lt;BR /&gt;Kirill&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 14 Oct 2019 04:07:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Serious-memory-leak-problem-of-mkl-sparse-d-add-subroutine/m-p/1178544#M29167</guid>
      <dc:creator>Kirill_V_Intel</dc:creator>
      <dc:date>2019-10-14T04:07:00Z</dc:date>
    </item>
    <item>
      <title>Thank you for your detailed</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Serious-memory-leak-problem-of-mkl-sparse-d-add-subroutine/m-p/1178545#M29168</link>
      <description>&lt;P&gt;Thank you for your detailed reply Voronin.&lt;/P&gt;&lt;P&gt;Another advice is that could MKL makes the routine&amp;nbsp;mkl_sparse_?_add be able to calculate formula&amp;nbsp;like&lt;/P&gt;&lt;P&gt;C := alpha*op(A) + beta*op(B)&lt;/P&gt;&lt;P&gt;because this is hard to do, I have to create a 0 matrix and add separately by following codes:&lt;/P&gt;
&lt;PRE class="brush:fortran; class-name:dark;"&gt;    info = mkl_sparse_d_add (SPARSE_OPERATION_NON_TRANSPOSE, A_mkl,-1.d0 , A_mkl, Z_mkl)
    info = mkl_sparse_d_add (SPARSE_OPERATION_NON_TRANSPOSE, A_mkl,av , Z_mkl, AT_mkl)
    info = mkl_sparse_d_add (SPARSE_OPERATION_NON_TRANSPOSE, B_mkl,bv , Z_mkl, BT_mkl)
    info = mkl_sparse_d_add (SPARSE_OPERATION_NON_TRANSPOSE, AT_mkl,1.d0, BT_mkl, C_mkl)
&lt;/PRE&gt;

&lt;P&gt;during which enconter with the mentioned problem.&lt;/P&gt;</description>
      <pubDate>Mon, 14 Oct 2019 22:12:23 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Serious-memory-leak-problem-of-mkl-sparse-d-add-subroutine/m-p/1178545#M29168</guid>
      <dc:creator>yang__xiaodong</dc:creator>
      <dc:date>2019-10-14T22:12:23Z</dc:date>
    </item>
    <item>
      <title>Hello again,</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Serious-memory-leak-problem-of-mkl-sparse-d-add-subroutine/m-p/1178546#M29169</link>
      <description>&lt;P&gt;Hello again,&lt;/P&gt;&lt;P&gt;Thanks for your feedback, we'll take it into the consideration.&lt;/P&gt;&lt;P&gt;As a side note, you could get away with a simpler code (two calls to add instead of three)&amp;nbsp;if I am not mistaken:&lt;/P&gt;&lt;P&gt;// if Z_mkl is a zero matrix, Temp is an intermediate results which should be deleted after Res_mkl is computed&lt;/P&gt;&lt;P&gt;info = mkl_sparse_d_add (SPARSE_OPERATION_NON_TRANSPOSE, A_mkl, alpha&amp;nbsp;, Z_mkl, Temp_mkl) // Temp = alpha * A + Z = A&lt;/P&gt;&lt;P&gt;info = mkl_sparse_d_add (SPARSE_OPERATION_NON_TRANSPOSE, B_mkl, beta&amp;nbsp;, Temp_mkl, Res_mkl) // Res = beta * B + Temp = beta * B + alpha * A&lt;/P&gt;&lt;P&gt;and the zero matrix Z can be more efficiently created by hand (through mkl_sparse_d_create_csr), just manually creating the CSR format arrays.&lt;/P&gt;&lt;P&gt;Best,&lt;BR /&gt;Kirill&lt;/P&gt;</description>
      <pubDate>Tue, 15 Oct 2019 02:21:32 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Serious-memory-leak-problem-of-mkl-sparse-d-add-subroutine/m-p/1178546#M29169</guid>
      <dc:creator>Kirill_V_Intel</dc:creator>
      <dc:date>2019-10-15T02:21:32Z</dc:date>
    </item>
    <item>
      <title>Intel MKL 2020 has been</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Serious-memory-leak-problem-of-mkl-sparse-d-add-subroutine/m-p/1178547#M29170</link>
      <description>&lt;P&gt;Intel MKL 2020 has been released the last week. We updated SpBLAS documentation regarding the topics discussed above.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 16 Dec 2019 05:03:27 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Serious-memory-leak-problem-of-mkl-sparse-d-add-subroutine/m-p/1178547#M29170</guid>
      <dc:creator>Gennady_F_Intel</dc:creator>
      <dc:date>2019-12-16T05:03:27Z</dc:date>
    </item>
    <item>
      <title>Re: Hello,</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Serious-memory-leak-problem-of-mkl-sparse-d-add-subroutine/m-p/1417360#M33708</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;Just to let you know: I have a use case for the addition C = alpha * A + B, with A, B and C sparse CSR matrices with the same stencil (i.e. nonzero entries). This operation should be very cheap, since it can be done without using the row and column information. The function mkl_sparse_?_add is not suitable for this use case, because it is far too slow. In the end I managed to solve the performance problem by directly applying the operation on the value arrays of A, B and C. In particular I have used vector wrappers of the Eigen library to do it. Under the hood the computation is translated into MKL library calls on dense vectors.&lt;/P&gt;
&lt;P&gt;Best regards,&lt;/P&gt;
&lt;P&gt;Wieger&lt;/P&gt;</description>
      <pubDate>Mon, 26 Sep 2022 15:59:55 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Serious-memory-leak-problem-of-mkl-sparse-d-add-subroutine/m-p/1417360#M33708</guid>
      <dc:creator>wiegerw</dc:creator>
      <dc:date>2022-09-26T15:59:55Z</dc:date>
    </item>
  </channel>
</rss>

