<?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 There are many strategies mkl in Intel® oneAPI Math Kernel Library</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/about-non-zeros-distribution-used-by-the-mkl-sparse-mv-function/m-p/1163359#M28046</link>
    <description>&lt;P style="margin-left:0in; margin-right:0in"&gt;There are many strategies mkl spblas chooses to call the CSR format and mkl applies all of these at different times.&lt;/P&gt;&lt;P style="margin-left:0in; margin-right:0in"&gt;What do you mean by "Can the user manipulate the distribution?"&lt;/P&gt;</description>
    <pubDate>Thu, 16 Apr 2020 04:51:28 GMT</pubDate>
    <dc:creator>Gennady_F_Intel</dc:creator>
    <dc:date>2020-04-16T04:51:28Z</dc:date>
    <item>
      <title>about non-zeros distribution used by the mkl_sparse_?_mv function.</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/about-non-zeros-distribution-used-by-the-mkl-sparse-mv-function/m-p/1163358#M28045</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;I am using the sparse matrix-vector multiplication operation in the MKL library.&lt;/P&gt;&lt;P&gt;I started with a CSR representation (the classical three arrays of the CSR format) and use the mkl_sparse_d_create_csr() function to create a "sparse_matrix_t" handle. Then I ran the mkl_sparse_optimize () function using the handle, and finally the mkl_sparse_d_mv() function for the desired operation.&lt;/P&gt;&lt;P&gt;It works. So far so good. The answers I am getting are correct.&lt;/P&gt;&lt;P&gt;I am able to manipulate the number of threads used in the solution by setting the environmental variable "OMP_NUM_THREADS". This also work as expected.&lt;/P&gt;&lt;P&gt;My question is:&lt;/P&gt;&lt;P&gt;How the sparse matrix is distributed among the treads?&lt;/P&gt;&lt;P&gt;is the distribution based on a similar number of rows per thread?&lt;/P&gt;&lt;P&gt;or&lt;/P&gt;&lt;P&gt;is it based on a similar number of non-zeros per thread?&lt;/P&gt;&lt;P&gt;or something else?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;One more question: Can the user manipulate the distribution?&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Apr 2020 13:31:55 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/about-non-zeros-distribution-used-by-the-mkl-sparse-mv-function/m-p/1163358#M28045</guid>
      <dc:creator>black__edgar</dc:creator>
      <dc:date>2020-04-15T13:31:55Z</dc:date>
    </item>
    <item>
      <title>There are many strategies mkl</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/about-non-zeros-distribution-used-by-the-mkl-sparse-mv-function/m-p/1163359#M28046</link>
      <description>&lt;P style="margin-left:0in; margin-right:0in"&gt;There are many strategies mkl spblas chooses to call the CSR format and mkl applies all of these at different times.&lt;/P&gt;&lt;P style="margin-left:0in; margin-right:0in"&gt;What do you mean by "Can the user manipulate the distribution?"&lt;/P&gt;</description>
      <pubDate>Thu, 16 Apr 2020 04:51:28 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/about-non-zeros-distribution-used-by-the-mkl-sparse-mv-function/m-p/1163359#M28046</guid>
      <dc:creator>Gennady_F_Intel</dc:creator>
      <dc:date>2020-04-16T04:51:28Z</dc:date>
    </item>
    <item>
      <title>Quote:Gennady F. (Blackbelt)</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/about-non-zeros-distribution-used-by-the-mkl-sparse-mv-function/m-p/1163360#M28047</link>
      <description>&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;Gennady F. (Blackbelt) wrote:&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There are many strategies mkl spblas chooses to call the CSR format and mkl applies all of these at different times.&lt;/P&gt;&lt;P&gt;What do you mean by "Can the user manipulate the distribution?"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for your answer.&lt;/P&gt;&lt;P&gt;Basically, I would like to know is:&lt;/P&gt;&lt;P&gt;how are the non-zeros distributed among the threads?&lt;/P&gt;&lt;P&gt;Is each thread assigned a similar amount of non-zeros? or&lt;/P&gt;&lt;P&gt;Is each thread assigned a similar amount of rows? or&lt;/P&gt;&lt;P&gt;is something else done instead of the two strategies mentioned above?&lt;/P&gt;&lt;P&gt;can the user indicate how the non-zeros should be distributed among the threads?&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Apr 2020 13:43:09 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/about-non-zeros-distribution-used-by-the-mkl-sparse-mv-function/m-p/1163360#M28047</guid>
      <dc:creator>black__edgar</dc:creator>
      <dc:date>2020-04-16T13:43:09Z</dc:date>
    </item>
    <item>
      <title>Hello Edgar,</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/about-non-zeros-distribution-used-by-the-mkl-sparse-mv-function/m-p/1163361#M28048</link>
      <description>&lt;P&gt;Hello Edgar,&lt;/P&gt;&lt;P&gt;The design of IE SpBLAS intentionally suggests that the user does not need to know about the details you've mentioned. There are multiple reasons which justify it.&lt;/P&gt;&lt;P&gt;Shortly speaking, the ideas of having opaque matrix handles and not exposing&amp;nbsp;optimized data make&amp;nbsp;it unreasonable to provide the user a low-level control over things like threads and work balancing.&amp;nbsp;As a possibly non-obvious consequence, if you see that MKL routines (say, mkl_sparse_?_mv) dn't show optimal performance for your application which affects the overall app performance, you can always tell us about your case and we'll investigatewhether we can improve MKL to do better.&lt;/P&gt;&lt;P&gt;A wider explanation:&lt;BR /&gt;IE SpBLAS in MKL&amp;nbsp;is storing internal optimized data inside opaque matrix handles, and can use optimized non-exposed storage formats internally. Since the optimized data are not exposed,&amp;nbsp;MKL takes care of parallelization and work balancing.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;For different formats different strategies are used&lt;/STRONG&gt; (answering you questions about how nnz are distributed among threads). As you might imagine, there is a&amp;nbsp;complicated dispatching inside IE SpBLAS and the details (like the distribution of the work between threads) can change every time&amp;nbsp;new optimizations are implemented. Of course, distributing the work by giving each threads a similar amount of rows would be a bad idea, e.g. when the CSR is used for computations and&amp;nbsp;the matrix nnz distribution over rows is skewed. So,in such case&amp;nbsp;mkl_sparse_optimize will try to figure out what is the best internal format and the best work distrubution for it.&lt;/P&gt;&lt;P&gt;The user can choose a suitable threading (OpenMP or TBB, e.g., the most commonly used options) and control in the application the parallel runtime (e.g., set the # openmp threads and enable/disable nested parallelism) by means of standard routines and MKL service functions.&lt;/P&gt;&lt;P&gt;Best,&lt;BR /&gt;Kirill&lt;/P&gt;</description>
      <pubDate>Sun, 19 Apr 2020 01:19:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/about-non-zeros-distribution-used-by-the-mkl-sparse-mv-function/m-p/1163361#M28048</guid>
      <dc:creator>Kirill_V_Intel</dc:creator>
      <dc:date>2020-04-19T01:19:00Z</dc:date>
    </item>
  </channel>
</rss>

