<?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 Re: Tridiagonal AX=B in Intel® oneAPI Math Kernel Library</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Tridiagonal-AX-B/m-p/863925#M7712</link>
    <description>&lt;DIV style="margin:0px;"&gt;
&lt;DIV id="quote_reply" style="width: 100%; margin-top: 5px;"&gt;
&lt;DIV style="margin-left:2px;margin-right:2px;"&gt;Quoting - &lt;A href="https://community.intel.com/en-us/profile/422325"&gt;ozarbit&lt;/A&gt;&lt;/DIV&gt;
&lt;DIV style="background-color:#E5E5E5; padding:5px;border: 1px; border-style: inset;margin-left:2px;margin-right:2px;"&gt;&lt;EM&gt;Hello, I have a known tridiagonal matrix n*n A and a known vector B.
&lt;DIV&gt;The usual tridiagonal algorithm to solve for X is of order(n)&lt;/DIV&gt;
&lt;DIV&gt;Is it available somewhere in MKL?&lt;BR /&gt;&lt;/DIV&gt;
&lt;BR /&gt;&lt;/EM&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
Library implementations of basic tridiagonal solver usually aren't efficient, and don't maintain the ease of use you have in your own source code.&lt;BR /&gt;If you would use the search function, you would see that MKL supports tridiagonal BLAS operations such as ?gtrfs ?gtsv&lt;BR /&gt;If BLAS is overkill for your case, you may not be interested in MKL.&lt;BR /&gt;</description>
    <pubDate>Wed, 08 Apr 2009 13:40:46 GMT</pubDate>
    <dc:creator>TimP</dc:creator>
    <dc:date>2009-04-08T13:40:46Z</dc:date>
    <item>
      <title>Tridiagonal AX=B</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Tridiagonal-AX-B/m-p/863924#M7711</link>
      <description>Hello, I have a known tridiagonal matrix n*n A and a known vector B.
&lt;DIV&gt;The usual tridiagonal algorithm to solve for X is of order(n)&lt;/DIV&gt;
&lt;DIV&gt;Is it available somewhere in MKL?&lt;BR /&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;BR /&gt;&lt;/DIV&gt;
&lt;DIV&gt;regards,&lt;/DIV&gt;</description>
      <pubDate>Wed, 08 Apr 2009 12:56:38 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Tridiagonal-AX-B/m-p/863924#M7711</guid>
      <dc:creator>ozarbit</dc:creator>
      <dc:date>2009-04-08T12:56:38Z</dc:date>
    </item>
    <item>
      <title>Re: Tridiagonal AX=B</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Tridiagonal-AX-B/m-p/863925#M7712</link>
      <description>&lt;DIV style="margin:0px;"&gt;
&lt;DIV id="quote_reply" style="width: 100%; margin-top: 5px;"&gt;
&lt;DIV style="margin-left:2px;margin-right:2px;"&gt;Quoting - &lt;A href="https://community.intel.com/en-us/profile/422325"&gt;ozarbit&lt;/A&gt;&lt;/DIV&gt;
&lt;DIV style="background-color:#E5E5E5; padding:5px;border: 1px; border-style: inset;margin-left:2px;margin-right:2px;"&gt;&lt;EM&gt;Hello, I have a known tridiagonal matrix n*n A and a known vector B.
&lt;DIV&gt;The usual tridiagonal algorithm to solve for X is of order(n)&lt;/DIV&gt;
&lt;DIV&gt;Is it available somewhere in MKL?&lt;BR /&gt;&lt;/DIV&gt;
&lt;BR /&gt;&lt;/EM&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
Library implementations of basic tridiagonal solver usually aren't efficient, and don't maintain the ease of use you have in your own source code.&lt;BR /&gt;If you would use the search function, you would see that MKL supports tridiagonal BLAS operations such as ?gtrfs ?gtsv&lt;BR /&gt;If BLAS is overkill for your case, you may not be interested in MKL.&lt;BR /&gt;</description>
      <pubDate>Wed, 08 Apr 2009 13:40:46 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Tridiagonal-AX-B/m-p/863925#M7712</guid>
      <dc:creator>TimP</dc:creator>
      <dc:date>2009-04-08T13:40:46Z</dc:date>
    </item>
    <item>
      <title>Re: Tridiagonal AX=B</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Tridiagonal-AX-B/m-p/863926#M7713</link>
      <description>&lt;DIV style="margin:0px;"&gt;
&lt;DIV id="quote_reply" style="width: 100%; margin-top: 5px;"&gt;
&lt;DIV style="margin-left:2px;margin-right:2px;"&gt;Quoting - &lt;A href="https://community.intel.com/en-us/profile/367365"&gt;tim18&lt;/A&gt;&lt;/DIV&gt;
&lt;DIV style="background-color:#E5E5E5; padding:5px;border: 1px; border-style: inset;margin-left:2px;margin-right:2px;"&gt;&lt;EM&gt;
&lt;DIV style="margin:0px;"&gt;&lt;/DIV&gt;
Library implementations of basic tridiagonal solver usually aren't efficient, and don't maintain the ease of use you have in your own source code.&lt;BR /&gt;If you would use the search function, you would see that MKL supports tridiagonal BLAS operations such as ?gtrfs ?gtsv&lt;BR /&gt;If BLAS is overkill for your case, you may not be interested in MKL.&lt;BR /&gt;&lt;/EM&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
That's what I thought, I was just checking.
&lt;DIV&gt;Besides my matrix is really smaller (order of n=20), even though it may be called 1000 times every 1s.&lt;/DIV&gt;
&lt;DIV&gt;I will just go for e.g. with tridiag() function presented in numerical recipes.&lt;/DIV&gt;
&lt;DIV&gt;&lt;BR /&gt;&lt;/DIV&gt;
&lt;DIV&gt;thank you,&lt;/DIV&gt;</description>
      <pubDate>Wed, 08 Apr 2009 14:16:14 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Tridiagonal-AX-B/m-p/863926#M7713</guid>
      <dc:creator>ozarbit</dc:creator>
      <dc:date>2009-04-08T14:16:14Z</dc:date>
    </item>
    <item>
      <title>Re: Tridiagonal AX=B</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Tridiagonal-AX-B/m-p/863927#M7714</link>
      <description>&lt;DIV style="margin:0px;"&gt;&lt;/DIV&gt;
As a matter of a check, I've tried the code posted in
&lt;DIV&gt;&lt;A href="http://codepad.org/rM6MHqhT" target="_blank"&gt;http://codepad.org/rM6MHqhT&lt;/A&gt;&lt;BR /&gt;&lt;/DIV&gt;
&lt;DIV&gt;on a SSSE3 Q6700 quad 2.66Ghz with 2 L1 32kb and 2 L2 4MB 4GB DDR2&lt;/DIV&gt;
&lt;DIV&gt;on a vs2005+intel11 platform&lt;/DIV&gt;
&lt;DIV&gt;&lt;BR /&gt;&lt;/DIV&gt;
&lt;DIV&gt;The numerical recipes version takes 1000 ticks while the &lt;SPAN style="font-style: italic;"&gt;dgtsv &lt;/SPAN&gt;takes 70000 ticks... the .exe was ran 10 times.&lt;/DIV&gt;
&lt;DIV&gt;&lt;BR /&gt;&lt;/DIV&gt;
&lt;DIV&gt;Probably because &lt;SPAN style="font-style: italic;"&gt;dgtsv &lt;/SPAN&gt;uses a LU decomposition first, while the NR code doesn't and is of order n.&lt;/DIV&gt;
&lt;DIV&gt;Also, the NR code was vectorized by the intel compiler&lt;/DIV&gt;</description>
      <pubDate>Mon, 27 Apr 2009 12:56:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Tridiagonal-AX-B/m-p/863927#M7714</guid>
      <dc:creator>ozarbit</dc:creator>
      <dc:date>2009-04-27T12:56:00Z</dc:date>
    </item>
    <item>
      <title>Re: Tridiagonal AX=B</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Tridiagonal-AX-B/m-p/863928#M7715</link>
      <description>&lt;DIV&gt;&lt;/DIV&gt;
&lt;P&gt;ozarbit,&lt;BR /&gt;&lt;BR /&gt;Your testcase is not 100% fair. You are measuring the first (and the only)call of dgtsv. MKL does a lot of additional initializing work during the first call, while NR implementation does not have specific initialing activities. Further calls are much faster.&lt;BR /&gt;&lt;BR /&gt;So, if you make some some call of dgtsv (just for initialing purpose, effect of the first time initializationshould be neglible in real-life app) and measure performance on the second call of dgtsv, then the difference will not be so huge. You will still see around 20% ofperformance difference. This is because of usage ofGaussian elimination with partial pivoting to cover bad cases in MKL routine, while NR gives wrong answer in such cases. &lt;BR /&gt;&lt;BR /&gt;We know about this performance gap and investigate possibilities to cover it.&lt;BR /&gt;&lt;BR /&gt;By the way, compiler does not vectorize NR codes, because of explicite data dependencies.&lt;/P&gt;</description>
      <pubDate>Mon, 27 Apr 2009 14:08:41 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Tridiagonal-AX-B/m-p/863928#M7715</guid>
      <dc:creator>Ilya_B_Intel</dc:creator>
      <dc:date>2009-04-27T14:08:41Z</dc:date>
    </item>
    <item>
      <title>Re: Tridiagonal AX=B</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Tridiagonal-AX-B/m-p/863929#M7716</link>
      <description>&lt;DIV style="margin: 0px; height: auto;"&gt;&lt;/DIV&gt;
An external function call will necessarily involve more overhead than computation time for tridiagonal operations on short vectors.&lt;BR /&gt;If you use tridiagonal on problems which don't satisfy diagonal dominance properties, you may need the partial pivoting; otherwise BLAS is not a competitive solution, nor was it intended to be.&lt;BR /&gt;</description>
      <pubDate>Mon, 27 Apr 2009 14:35:33 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Tridiagonal-AX-B/m-p/863929#M7716</guid>
      <dc:creator>TimP</dc:creator>
      <dc:date>2009-04-27T14:35:33Z</dc:date>
    </item>
    <item>
      <title>Re: Tridiagonal AX=B</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Tridiagonal-AX-B/m-p/863930#M7717</link>
      <description>&lt;DIV style="margin:0px;"&gt;
&lt;DIV id="quote_reply" style="width: 100%; margin-top: 5px;"&gt;
&lt;DIV style="margin-left:2px;margin-right:2px;"&gt;Quoting - &lt;A href="https://community.intel.com/en-us/profile/404361"&gt;Ilya Burylov (Intel)&lt;/A&gt;&lt;/DIV&gt;
&lt;DIV style="background-color:#E5E5E5; padding:5px;border: 1px; border-style: inset;margin-left:2px;margin-right:2px;"&gt;&lt;EM&gt;
&lt;P&gt;ozarbit,&lt;BR /&gt;&lt;BR /&gt;Your testcase is not 100% fair. You are measuring the first (and the only)call of dgtsv. MKL does a lot of additional initializing work during the first call, while NR implementation does not have specific initialing activities. Further calls are much faster.&lt;BR /&gt;&lt;BR /&gt;So, if you make some some call of dgtsv (just for initialing purpose, effect of the first time initializationshould be neglible in real-life app) and measure performance on the second call of dgtsv, then the difference will not be so huge. You will still see around 20% ofperformance difference. This is because of usage ofGaussian elimination with partial pivoting to cover bad cases in MKL routine, while NR gives wrong answer in such cases. &lt;BR /&gt;&lt;BR /&gt;We know about this performance gap and investigate possibilities to cover it.&lt;BR /&gt;&lt;BR /&gt;By the way, compiler does not vectorize NR codes, because of explicite data dependencies.&lt;/P&gt;
&lt;/EM&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;DIV&gt;tim18, ilya, thank you for your answers.&lt;/DIV&gt;
&lt;DIV&gt;in&lt;SPAN style="font-family: Verdana;"&gt;&lt;A href="http://codepad.org/cHgP2JAa"&gt;http://codepad.org/cHgP2JAa&lt;/A&gt;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN style="font-family: Verdana;"&gt;I called dgtsv many times before the measure.&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;Now it's only 3000 ticks, correct.&lt;/DIV&gt;
&lt;DIV&gt;&lt;BR /&gt;&lt;/DIV&gt;
&lt;DIV&gt;And yes, I misread the vectorization message.&lt;/DIV&gt;
&lt;DIV&gt;&lt;BR /&gt;&lt;/DIV&gt;
&lt;DIV&gt;Btw, is the partial pivoting required as soon as the matrix is not diagonally dominant (in my case, clearly, it is not diagonally dominant, however NR code works fine), or in &lt;SPAN style="font-style: italic;"&gt;some&lt;/SPAN&gt;cases when it isn't dominant, it &lt;SPAN style="font-style: italic;"&gt;may &lt;/SPAN&gt;run into trouble.&lt;/DIV&gt;
&lt;DIV&gt;&lt;BR /&gt;&lt;/DIV&gt;
&lt;DIV&gt;tim18, true, it is an external library call... I just wanted an idea of the difference..&lt;/DIV&gt;
&lt;DIV&gt;I have an order of 16384 for the matrix.... What sort of orders should the additional tests be negligible?&lt;/DIV&gt;
&lt;DIV&gt;&lt;BR /&gt;&lt;/DIV&gt;
&lt;DIV&gt;regards,&lt;/DIV&gt;</description>
      <pubDate>Mon, 27 Apr 2009 15:54:46 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Tridiagonal-AX-B/m-p/863930#M7717</guid>
      <dc:creator>ozarbit</dc:creator>
      <dc:date>2009-04-27T15:54:46Z</dc:date>
    </item>
    <item>
      <title>Re: Tridiagonal AX=B</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Tridiagonal-AX-B/m-p/863931#M7718</link>
      <description>&lt;DIV style="margin:0px;"&gt;&lt;/DIV&gt;
If the matrix isn't diagonally dominant, or positive definite, failing to implement a pivoting strategy may (or may not) encounter excessively small pivots. I'm sure cases could be made up where it isn't diagonal dominant, but the partial pivoting doesn't change the result. On such large problems, if the behavior isn't well known, the point about checking for pivoting requirements is well taken.&lt;BR /&gt;I'm sorry, I misread your statement about the size of the problem. Your size should be large enough to make the library call overhead insignificant once the initializations have completed. The cost of checking pivots still may be significant for such a case, and once the pivoting has changed the order, the run-time cost could be several times as large.&lt;BR /&gt;</description>
      <pubDate>Mon, 27 Apr 2009 17:48:49 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Tridiagonal-AX-B/m-p/863931#M7718</guid>
      <dc:creator>TimP</dc:creator>
      <dc:date>2009-04-27T17:48:49Z</dc:date>
    </item>
  </channel>
</rss>

