<?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 Very slow matrix multiplication! in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Very-slow-matrix-multiplication/m-p/891095#M78293</link>
    <description>&lt;P&gt;You are right. I switched to the Release configuration as you said and now it is by the same factor faster. Thanks, It was amazing. BTW I get a warning message right before running as below&lt;/P&gt;
&lt;P&gt;________________________________________________________________________________________&lt;/P&gt;
&lt;P&gt;No debugging information&lt;/P&gt;
&lt;P&gt;Debugging information for 'code_name.exe' can not be found or does not match. Binary was not build with debug information.&lt;BR /&gt;&lt;BR /&gt;Do you want to continue debugging?&lt;/P&gt;
&lt;P&gt;________________________________________________________________________________________&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;I just hit yes to get rid of it though I am not really aware of the penalty! Could you please tell me if it is OK to do so? or if I should do something to be sure that I will not get some wrong results due to debugging problems etc.&lt;/P&gt;</description>
    <pubDate>Thu, 18 Feb 2010 12:47:36 GMT</pubDate>
    <dc:creator>Mahdi_S_1</dc:creator>
    <dc:date>2010-02-18T12:47:36Z</dc:date>
    <item>
      <title>Very slow matrix multiplication!</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Very-slow-matrix-multiplication/m-p/891090#M78288</link>
      <description>&lt;P&gt;I have written a code in which it is needed to multiply 4 vectors of length 2000 with 4 square matrixes of the same length then add the results up together. Finally repeat the whole procedure 31 times (as can be seen through the code below). The problem is, it takes more than 20 seconds to do these simple matrix calculations while I expected it to be much faster. Does anyone know why is it so slow or how can I do it faster?&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;B&gt;REAL*8&lt;/B&gt;, &lt;B&gt;ALLOCATABLE&lt;/B&gt;, &lt;B&gt;DIMENSION&lt;/B&gt;(:,:) :: dummy, dummy2&lt;/P&gt;
&lt;P&gt;&lt;B&gt;REAL*8&lt;/B&gt;, &lt;B&gt;ALLOCATABLE&lt;/B&gt;, &lt;B&gt;DIMENSION&lt;/B&gt;(:,:,:) :: TPLTZ&lt;/P&gt;
&lt;P&gt;&lt;B&gt;integer&lt;/B&gt; Nt, NN, ic&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Nt = 2000&lt;/P&gt;
&lt;P&gt;NN = 31&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;B&gt;ALLOCATE&lt;/B&gt;( dummy(4,Nt) )&lt;/P&gt;
&lt;P&gt;dummy = 0d0&lt;/P&gt;
&lt;P&gt;&lt;B&gt;ALLOCATE&lt;/B&gt;( dummy2(NN,Nt) )&lt;/P&gt;
&lt;P&gt;dummy2 = 0d0&lt;/P&gt;
&lt;P&gt;&lt;B&gt;ALLOCATE&lt;/B&gt;( TPLTZ(Nt,Nt,4) )&lt;/P&gt;
&lt;P&gt;TPLTZ = 0d0&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;B&gt;do&lt;/B&gt; ic=1,NN&lt;/P&gt;
&lt;P&gt;dummy2(ic,:) = matmul(dummy(1,:),TPLTZ(:,:,1))+matmul(dummy(2,:),TPLTZ(:,:,2))+matmul(dummy(3,:),TPLTZ(:,:,3))+matmul(dummy(4,:),TPLTZ(:,:,4))&lt;/P&gt;
&lt;B&gt;end do&lt;/B&gt;</description>
      <pubDate>Wed, 17 Feb 2010 07:48:14 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Very-slow-matrix-multiplication/m-p/891090#M78288</guid>
      <dc:creator>Mahdi_S_1</dc:creator>
      <dc:date>2010-02-17T07:48:14Z</dc:date>
    </item>
    <item>
      <title>Very slow matrix multiplication!</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Very-slow-matrix-multiplication/m-p/891091#M78289</link>
      <description>&lt;P&gt;You could do two things:&lt;/P&gt;
&lt;P&gt;Reverse the index order of dummy and dummy2 so that the mutiplication uses vectors of stride one.&lt;/P&gt;
&lt;P&gt;Use the MKL library routines to do the multplication. DGEMM I think.&lt;/P&gt;</description>
      <pubDate>Wed, 17 Feb 2010 10:52:27 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Very-slow-matrix-multiplication/m-p/891091#M78289</guid>
      <dc:creator>Andrew_Smith</dc:creator>
      <dc:date>2010-02-17T10:52:27Z</dc:date>
    </item>
    <item>
      <title>Very slow matrix multiplication!</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Very-slow-matrix-multiplication/m-p/891092#M78290</link>
      <description>&lt;DIV id="tiny_quote"&gt;
&lt;DIV style="margin-left: 2px; margin-right: 2px;"&gt;Quoting &lt;A rel="/en-us/services/profile/quick_profile.php?is_paid=&amp;amp;user_id=99034" class="basic" href="https://community.intel.com/en-us/profile/99034/"&gt;Andrew Smith&lt;/A&gt;&lt;/DIV&gt;
&lt;DIV style="background-color: #e5e5e5; padding: 5px; border: 1px inset; margin-left: 2px; margin-right: 2px;"&gt;&lt;I&gt;
&lt;P&gt;You could do two things:&lt;/P&gt;
&lt;P&gt;Reverse the index order of dummy and dummy2 so that the mutiplication uses vectors of stride one.&lt;/P&gt;
&lt;P&gt;Use the MKL library routines to do the multplication. DGEMM I think.&lt;/P&gt;
&lt;/I&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;DGEMV should improve speed by avoiding some of the temporary vector allocations for each intermediate result.&lt;/P&gt;
&lt;P&gt;Are you asking for the compiler to shortcut the meaningless operations? Perhaps it might do some of that at -O3.&lt;/P&gt;</description>
      <pubDate>Wed, 17 Feb 2010 13:56:56 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Very-slow-matrix-multiplication/m-p/891092#M78290</guid>
      <dc:creator>TimP</dc:creator>
      <dc:date>2010-02-17T13:56:56Z</dc:date>
    </item>
    <item>
      <title>Very slow matrix multiplication!</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Very-slow-matrix-multiplication/m-p/891093#M78291</link>
      <description>Actually I was wondering why such a simple calculation is so slow in FORTRAN, though I know it is not a small size problem (not yet a really large one) so thinking that maybe I am using bad way of coding that slows it down i.e. I can use some programming tricks that makes it faster such as what . I just timed MATLAB in doing so and it seems that MATLAB is even faster that FORTRAN!!!</description>
      <pubDate>Wed, 17 Feb 2010 16:46:11 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Very-slow-matrix-multiplication/m-p/891093#M78291</guid>
      <dc:creator>Mahdi_S_1</dc:creator>
      <dc:date>2010-02-17T16:46:11Z</dc:date>
    </item>
    <item>
      <title>Very slow matrix multiplication!</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Very-slow-matrix-multiplication/m-p/891094#M78292</link>
      <description>&lt;P&gt;Are you running this code with the default project settings?&lt;/P&gt;
&lt;P&gt;If so you are using debugging options that slow the execution.&lt;/P&gt;
&lt;P&gt;My computer shows 4 x speedup with your code when I switch to Release configuration.&lt;/P&gt;
&lt;P&gt;Build: Configuration Manager: Active solution configuration: Release.&lt;/P&gt;
&lt;P&gt;You can also add a configuation dropdown list to the toolbar.&lt;/P&gt;</description>
      <pubDate>Wed, 17 Feb 2010 19:15:50 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Very-slow-matrix-multiplication/m-p/891094#M78292</guid>
      <dc:creator>Andrew_Smith</dc:creator>
      <dc:date>2010-02-17T19:15:50Z</dc:date>
    </item>
    <item>
      <title>Very slow matrix multiplication!</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Very-slow-matrix-multiplication/m-p/891095#M78293</link>
      <description>&lt;P&gt;You are right. I switched to the Release configuration as you said and now it is by the same factor faster. Thanks, It was amazing. BTW I get a warning message right before running as below&lt;/P&gt;
&lt;P&gt;________________________________________________________________________________________&lt;/P&gt;
&lt;P&gt;No debugging information&lt;/P&gt;
&lt;P&gt;Debugging information for 'code_name.exe' can not be found or does not match. Binary was not build with debug information.&lt;BR /&gt;&lt;BR /&gt;Do you want to continue debugging?&lt;/P&gt;
&lt;P&gt;________________________________________________________________________________________&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;I just hit yes to get rid of it though I am not really aware of the penalty! Could you please tell me if it is OK to do so? or if I should do something to be sure that I will not get some wrong results due to debugging problems etc.&lt;/P&gt;</description>
      <pubDate>Thu, 18 Feb 2010 12:47:36 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Very-slow-matrix-multiplication/m-p/891095#M78293</guid>
      <dc:creator>Mahdi_S_1</dc:creator>
      <dc:date>2010-02-18T12:47:36Z</dc:date>
    </item>
    <item>
      <title>Very slow matrix multiplication!</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Very-slow-matrix-multiplication/m-p/891096#M78294</link>
      <description>&lt;P&gt;When you hit F5 it means start to debug the exe. Release exe cannot be debugged since it is designed for speed and has no debug info.&lt;/P&gt;
&lt;P&gt;Start your exe using Ctrl F5 and it wont complain!&lt;/P&gt;</description>
      <pubDate>Thu, 18 Feb 2010 13:04:06 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Very-slow-matrix-multiplication/m-p/891096#M78294</guid>
      <dc:creator>Andrew_Smith</dc:creator>
      <dc:date>2010-02-18T13:04:06Z</dc:date>
    </item>
    <item>
      <title>Very slow matrix multiplication!</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Very-slow-matrix-multiplication/m-p/891097#M78295</link>
      <description>&lt;P&gt;Or you can set full optimizations in Debug build. Debugging is difficult but you can still do some debugging.&lt;/P&gt;
&lt;P&gt;Or you can leave full debugging on,in the project browse tree select just the file with your matrix multiplication, right-click, properties, full optimizations, build. Now only this module is full speed.&lt;/P&gt;
&lt;P&gt;Jim Dempsey&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Feb 2010 13:59:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Very-slow-matrix-multiplication/m-p/891097#M78295</guid>
      <dc:creator>IDZ_A_Intel</dc:creator>
      <dc:date>2010-02-18T13:59:00Z</dc:date>
    </item>
    <item>
      <title>Very slow matrix multiplication!</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Very-slow-matrix-multiplication/m-p/891098#M78296</link>
      <description>Thank you guys for the very useful information and tricks.</description>
      <pubDate>Thu, 18 Feb 2010 14:23:48 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Very-slow-matrix-multiplication/m-p/891098#M78296</guid>
      <dc:creator>Mahdi_S_1</dc:creator>
      <dc:date>2010-02-18T14:23:48Z</dc:date>
    </item>
  </channel>
</rss>

