<?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 Quote:mecej4 wrote: in Intel® oneAPI Math Kernel Library</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Rewrite-subroutine-to-use-MKL-matrix-multiplication/m-p/1045897#M20966</link>
    <description>&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;mecej4 wrote:&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;I do not understand the problem description. If A is n X n and B is m X m, the matrix pairs (A&lt;SUP&gt;T&lt;/SUP&gt;,&amp;nbsp;B) and (B, A) are not suitable for multiplication when m is not equal to n. Please explain.&lt;/P&gt;

&lt;P&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;Mecej4,&lt;/P&gt;

&lt;P&gt;For each step J, B is a subset of B : A&lt;SUP&gt;T&lt;/SUP&gt;(3,3) * B(3,12) and then B(12,3)*A(3,3)&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 11 Sep 2014 08:13:59 GMT</pubDate>
    <dc:creator>Lars_M_</dc:creator>
    <dc:date>2014-09-11T08:13:59Z</dc:date>
    <item>
      <title>Rewrite subroutine to use MKL - matrix multiplication</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Rewrite-subroutine-to-use-MKL-matrix-multiplication/m-p/1045893#M20962</link>
      <description>&lt;P&gt;
	&lt;STYLE type="text/css"&gt;p { margin-bottom: 0.1in; line-height: 120%; }
	&lt;/STYLE&gt;
&lt;/P&gt;

&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;My first post on the forum!&lt;/P&gt;

&lt;P&gt;I'm working with an older code written i Fortran at uni. The program consists of several subroutines and I would like to rewrite parts (subroutines) of the code so it runs faster (parallel). My knowledge of Fortran is limited/"ok". The first routine I like to look into is MT:&lt;/P&gt;

&lt;P&gt;description:&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; “Matrix multiplication&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; B = AA*B*A (AA is the transpose of A)&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; B = Full, symmetric matrix&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; A = Unit matrix with an n by n submatrix (argument A) on the diagonal”&lt;/P&gt;

&lt;P&gt;&lt;BR /&gt;
	&amp;nbsp;&lt;/P&gt;

&lt;P&gt;For code, please see attachment.&lt;/P&gt;

&lt;P&gt;The subroutine is often called like this:&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&amp;nbsp; do J = 1,10,3&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CALL MT(UM,FS,WE,12,3,J,PU,ER)&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&amp;nbsp; continue&lt;/P&gt;

&lt;P&gt;Then UM(3,3), FS(12,12) and WE(3)&lt;/P&gt;

&lt;P&gt;Is there any way I can use MKL to rewrite the code? Using dgemm? Or maybe use openmp?&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Any clues?&lt;/P&gt;

&lt;P&gt;&lt;BR /&gt;
	Thanks,&lt;/P&gt;

&lt;P&gt;Lars&lt;/P&gt;</description>
      <pubDate>Wed, 10 Sep 2014 22:00:41 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Rewrite-subroutine-to-use-MKL-matrix-multiplication/m-p/1045893#M20962</guid>
      <dc:creator>Lars_M_</dc:creator>
      <dc:date>2014-09-10T22:00:41Z</dc:date>
    </item>
    <item>
      <title>The problem is rather small</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Rewrite-subroutine-to-use-MKL-matrix-multiplication/m-p/1045894#M20963</link>
      <description>&lt;P&gt;The problem is rather small so I would not expect MKL to be of much help.&amp;nbsp; As you show the possibility of executing 2 or 4 of them in parallel, there may be some scope for threading.&lt;/P&gt;

&lt;P&gt;Inside MT, it may help to give loop count directives or to assure that the compiler can take advantage of such information through interprocedural analysis.&amp;nbsp; Just in case, you would examine vec-report to assure that the inner loops have vectorized (with the proviso that the loops are rather short and probably do better with minimal unroll).&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Sep 2014 22:36:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Rewrite-subroutine-to-use-MKL-matrix-multiplication/m-p/1045894#M20963</guid>
      <dc:creator>TimP</dc:creator>
      <dc:date>2014-09-10T22:36:00Z</dc:date>
    </item>
    <item>
      <title>Quote:Tim Prince wrote:</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Rewrite-subroutine-to-use-MKL-matrix-multiplication/m-p/1045895#M20964</link>
      <description>&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;Tim Prince wrote:&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;The problem is rather small so I would not expect MKL to be of much help.&amp;nbsp; As you show the possibility of executing 2 or 4 of them in parallel, there may be some scope for threading.&lt;/P&gt;

&lt;P&gt;Inside MT, it may help to give loop count directives or to assure that the compiler can take advantage of such information through interprocedural analysis.&amp;nbsp; Just in case, you would examine vec-report to assure that the inner loops have vectorized (with the proviso that the loops are rather short and probably do better with minimal unroll).&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;
	&lt;STYLE type="text/css"&gt;p { margin-bottom: 0.1in; line-height: 120%; }
	&lt;/STYLE&gt;
&lt;/P&gt;

&lt;P&gt;Thanks for the answer Tim, but as I wrote, my Fortran knowledge is limited. Are you able to make an example?&lt;/P&gt;</description>
      <pubDate>Wed, 10 Sep 2014 23:46:07 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Rewrite-subroutine-to-use-MKL-matrix-multiplication/m-p/1045895#M20964</guid>
      <dc:creator>Lars_M_</dc:creator>
      <dc:date>2014-09-10T23:46:07Z</dc:date>
    </item>
    <item>
      <title>I do not understand the</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Rewrite-subroutine-to-use-MKL-matrix-multiplication/m-p/1045896#M20965</link>
      <description>&lt;P&gt;I do not understand the problem description. If A is n X n and B is m X m, the matrix pairs (A&lt;SUP&gt;T&lt;/SUP&gt;,&amp;nbsp;B) and (B, A) are not suitable for multiplication when m is not equal to n. Please explain.&lt;/P&gt;</description>
      <pubDate>Wed, 10 Sep 2014 23:49:15 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Rewrite-subroutine-to-use-MKL-matrix-multiplication/m-p/1045896#M20965</guid>
      <dc:creator>mecej4</dc:creator>
      <dc:date>2014-09-10T23:49:15Z</dc:date>
    </item>
    <item>
      <title>Quote:mecej4 wrote:</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Rewrite-subroutine-to-use-MKL-matrix-multiplication/m-p/1045897#M20966</link>
      <description>&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;mecej4 wrote:&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;I do not understand the problem description. If A is n X n and B is m X m, the matrix pairs (A&lt;SUP&gt;T&lt;/SUP&gt;,&amp;nbsp;B) and (B, A) are not suitable for multiplication when m is not equal to n. Please explain.&lt;/P&gt;

&lt;P&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;Mecej4,&lt;/P&gt;

&lt;P&gt;For each step J, B is a subset of B : A&lt;SUP&gt;T&lt;/SUP&gt;(3,3) * B(3,12) and then B(12,3)*A(3,3)&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 11 Sep 2014 08:13:59 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Rewrite-subroutine-to-use-MKL-matrix-multiplication/m-p/1045897#M20966</guid>
      <dc:creator>Lars_M_</dc:creator>
      <dc:date>2014-09-11T08:13:59Z</dc:date>
    </item>
  </channel>
</rss>

