<?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 Dear Ying, in Intel® oneAPI Math Kernel Library</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/mkl-gives-different-results-from-lfftw3/m-p/1009222#M19158</link>
    <description>&lt;P&gt;Dear Ying,&lt;/P&gt;

&lt;P&gt;This is is fairly large research code under development, and I shouldn't like to post it in a public place. If there is a way to get it to you directly, I will. Otherwise, I could extract a minimal code that demonstrates the problem, but I have little time for that now, it would have to wait a week or two.&lt;/P&gt;

&lt;P&gt;On my laptop, I have MKL as well as the fftw3 package provided by the Ubuntu software centre. I believe the latter includes the library file /usr/lib/x86_64-linux-gnu/libfftw3.so. If I link to this file directly, as in&lt;BR /&gt;
	mpif90 -o test.x &amp;lt;input files&amp;gt; /usr/lib/x86_64-linux-gnu/libfftw3.so&lt;BR /&gt;
	the output is correct. It is also correct if I compile by&lt;BR /&gt;
	mpif90 -mkl -o test.x &amp;lt;input files&amp;gt; -lfftw3&lt;BR /&gt;
	but with only the -mkl flag the output is wrong.&lt;BR /&gt;
	I tried to find out what library is used exaclty by using the -dryrun flag, but could not figure it out. With the -mkl flag I do see the following in the output:&lt;/P&gt;

&lt;P&gt;-I/opt/intel/composer_xe_2011_sp1.6.233/mkl/include/intel64/lp64 \&lt;BR /&gt;
	-I/opt/intel/composer_xe_2011_sp1.6.233/mkl/include \&lt;BR /&gt;
	...&lt;BR /&gt;
	-L/opt/intel/composer_xe_2011_sp1.6.233/mkl/lib/intel64 \&lt;BR /&gt;
	--start-group \&lt;BR /&gt;
	&amp;lt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -lmkl_intel_lp64 \&lt;BR /&gt;
	&amp;lt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -lmkl_intel_thread \&lt;BR /&gt;
	&amp;lt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -lmkl_core \&lt;BR /&gt;
	&amp;lt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -liomp5 \&lt;BR /&gt;
	&amp;lt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; --end-group \&lt;/P&gt;

&lt;P&gt;which is absent without the -mkl flag.&lt;/P&gt;

&lt;P&gt;Regards,&lt;BR /&gt;
	Lennaert.&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 04 Dec 2014 10:38:28 GMT</pubDate>
    <dc:creator>Van_Veen__Lennaert</dc:creator>
    <dc:date>2014-12-04T10:38:28Z</dc:date>
    <item>
      <title>-mkl gives different results from -lfftw3</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/mkl-gives-different-results-from-lfftw3/m-p/1009220#M19156</link>
      <description>&lt;P&gt;I am developing a time-stepping code that calls fft routines in every step. While writing and testing the code, I used the -lfftw3 flag to link to the fftw3 library. Now that the code is functional, I tried to link to the MKL version of this library instead, as I think it may be faster. However, the result is completely different. With the -lfftw3 flag, the output seems to make sense, but not with the -mkl option. I am hoping that somebody can explain the difference. This is of great importance to me, as I often use fftw3, lapack and similar libraries, and it seems that MKL gives the best performance.&lt;/P&gt;

&lt;P&gt;Operating system: ubuntu 13.10, but it happens on our cluster, too.&lt;BR /&gt;
	Hardware: Lenovo laptop with Intel(R) Core(TM) i7-4600U CPU, but it happens on our cluster, too.&lt;BR /&gt;
	Ifort version: Version 12.1.0.233 Build 20110811 (called through mpif90 with OMPI_FC=ifort)&lt;/P&gt;

&lt;P&gt;&amp;gt; mpif90&amp;nbsp; -o test.x LES_cont.f90&amp;nbsp; -llapack -lfftw3&lt;BR /&gt;
	&amp;gt;mpirun -np 1 ./test.x&lt;BR /&gt;
	( ... computation ...)&lt;BR /&gt;
	&amp;nbsp;Residual=&amp;nbsp;&amp;nbsp; 3.237650346704463E-012&lt;/P&gt;

&lt;P&gt;&amp;gt;mpif90&amp;nbsp; -mkl -o test.x LES_cont.f90&lt;BR /&gt;
	&amp;gt;mpirun -np 1 ./test.x&lt;BR /&gt;
	(... computation...)&lt;BR /&gt;
	&amp;nbsp;Residual=&amp;nbsp;&amp;nbsp; 2.33661403394626&lt;/P&gt;

&lt;P&gt;Between the two runs i change only the complier/linker options as shown, nothing else. Thanks in advance for your help!&lt;/P&gt;</description>
      <pubDate>Wed, 03 Dec 2014 07:30:08 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/mkl-gives-different-results-from-lfftw3/m-p/1009220#M19156</guid>
      <dc:creator>Van_Veen__Lennaert</dc:creator>
      <dc:date>2014-12-03T07:30:08Z</dc:date>
    </item>
    <item>
      <title>Hi Lennaert,</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/mkl-gives-different-results-from-lfftw3/m-p/1009221#M19157</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;A href="https://software.intel.com/en-us/user/897599" style="font-size: 11px; line-height: 16.5px; background-color: rgb(238, 238, 238);"&gt;Lennaert&lt;/A&gt;,&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;Could you please attach the&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="font-size: 12px; line-height: 18px;"&gt;LES_cont.f90 so we can test? &amp;nbsp;and where do you get the &amp;nbsp;fftw3 library or build from MKL interface library? &lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 12px; line-height: 18px;"&gt;Thanks&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 12px; line-height: 18px;"&gt;Ying&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Dec 2014 06:09:06 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/mkl-gives-different-results-from-lfftw3/m-p/1009221#M19157</guid>
      <dc:creator>Ying_H_Intel</dc:creator>
      <dc:date>2014-12-04T06:09:06Z</dc:date>
    </item>
    <item>
      <title>Dear Ying,</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/mkl-gives-different-results-from-lfftw3/m-p/1009222#M19158</link>
      <description>&lt;P&gt;Dear Ying,&lt;/P&gt;

&lt;P&gt;This is is fairly large research code under development, and I shouldn't like to post it in a public place. If there is a way to get it to you directly, I will. Otherwise, I could extract a minimal code that demonstrates the problem, but I have little time for that now, it would have to wait a week or two.&lt;/P&gt;

&lt;P&gt;On my laptop, I have MKL as well as the fftw3 package provided by the Ubuntu software centre. I believe the latter includes the library file /usr/lib/x86_64-linux-gnu/libfftw3.so. If I link to this file directly, as in&lt;BR /&gt;
	mpif90 -o test.x &amp;lt;input files&amp;gt; /usr/lib/x86_64-linux-gnu/libfftw3.so&lt;BR /&gt;
	the output is correct. It is also correct if I compile by&lt;BR /&gt;
	mpif90 -mkl -o test.x &amp;lt;input files&amp;gt; -lfftw3&lt;BR /&gt;
	but with only the -mkl flag the output is wrong.&lt;BR /&gt;
	I tried to find out what library is used exaclty by using the -dryrun flag, but could not figure it out. With the -mkl flag I do see the following in the output:&lt;/P&gt;

&lt;P&gt;-I/opt/intel/composer_xe_2011_sp1.6.233/mkl/include/intel64/lp64 \&lt;BR /&gt;
	-I/opt/intel/composer_xe_2011_sp1.6.233/mkl/include \&lt;BR /&gt;
	...&lt;BR /&gt;
	-L/opt/intel/composer_xe_2011_sp1.6.233/mkl/lib/intel64 \&lt;BR /&gt;
	--start-group \&lt;BR /&gt;
	&amp;lt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -lmkl_intel_lp64 \&lt;BR /&gt;
	&amp;lt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -lmkl_intel_thread \&lt;BR /&gt;
	&amp;lt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -lmkl_core \&lt;BR /&gt;
	&amp;lt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -liomp5 \&lt;BR /&gt;
	&amp;lt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; --end-group \&lt;/P&gt;

&lt;P&gt;which is absent without the -mkl flag.&lt;/P&gt;

&lt;P&gt;Regards,&lt;BR /&gt;
	Lennaert.&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Dec 2014 10:38:28 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/mkl-gives-different-results-from-lfftw3/m-p/1009222#M19158</guid>
      <dc:creator>Van_Veen__Lennaert</dc:creator>
      <dc:date>2014-12-04T10:38:28Z</dc:date>
    </item>
    <item>
      <title>Dear Lennaert, </title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/mkl-gives-different-results-from-lfftw3/m-p/1009223#M19159</link>
      <description>&lt;P&gt;Dear&amp;nbsp;&lt;SPAN style="font-size: 12px; line-height: 18px;"&gt;Lennaert,&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;You can send me the code by click "send the author a message" &amp;nbsp;&lt;/P&gt;

&lt;P&gt;And t&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;here are some examples that demonstrate how to use mkl fftw3 &amp;nbsp;. The source code for the &amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;examples, makefiles used to run them, are located in the&lt;/SPAN&gt;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;&amp;nbsp;.\examples\fftw3xfsubdirectories in the Intel MKL directory. &amp;nbsp;You may change the example based on your usage model (including your input data). Then &amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="line-height: 19.5120010375977px; font-size: 1em;"&gt;&amp;nbsp;send us &amp;nbsp;by that way.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;Best Regards,&lt;BR /&gt;
	Ying&lt;/P&gt;</description>
      <pubDate>Wed, 10 Dec 2014 01:26:08 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/mkl-gives-different-results-from-lfftw3/m-p/1009223#M19159</guid>
      <dc:creator>Ying_H_Intel</dc:creator>
      <dc:date>2014-12-10T01:26:08Z</dc:date>
    </item>
    <item>
      <title>Hi Lennaert,</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/mkl-gives-different-results-from-lfftw3/m-p/1009224#M19160</link>
      <description>&lt;P&gt;&lt;SPAN style="font-size: 12px; line-height: 18px;"&gt;Hi Lennaert,&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;I have gotten your test case and be able to reproduce the problem. &amp;nbsp;I have asked our developer to further investigated it . As holiday season, it may take some time. I will update you if any news.&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Best Regards,&lt;/P&gt;

&lt;P&gt;Ying&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 22 Dec 2014 00:50:44 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/mkl-gives-different-results-from-lfftw3/m-p/1009224#M19160</guid>
      <dc:creator>Ying_H_Intel</dc:creator>
      <dc:date>2014-12-22T00:50:44Z</dc:date>
    </item>
    <item>
      <title>Hi Lennaert, </title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/mkl-gives-different-results-from-lfftw3/m-p/1009225#M19161</link>
      <description>&lt;P&gt;Hi Lennaert,&amp;nbsp;&lt;/P&gt;

&lt;P&gt;We found the problem. I share it here so more developers can see it. &amp;nbsp;And will send the fix code to you by private message.&amp;nbsp;&lt;/P&gt;

&lt;P&gt;you &amp;nbsp;creates fftw plan (for 1d c2c fft) with the same input and output array, which means the transform is to be &lt;STRONG&gt;in-place&lt;/STRONG&gt;.&lt;/P&gt;

&lt;P&gt;However on execution stage you provides different arrays (i.e. he performs &lt;STRONG&gt;out-of-place transform&lt;/STRONG&gt;). That is incorrect according to FFTW3 official documentation (Nevertheless, FFTW3 handles this situation, MKL – not).&lt;/P&gt;

&lt;P&gt;Corresponding piece of FFTW3 documentation:&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;&amp;lt;&amp;lt;&amp;lt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;A href="http://www.fftw.org/doc/New_002darray-Execute-Functions.html#New_002darray-Execute-Functions"&gt;http://www.fftw.org/doc/New_002darray-Execute-Functions.html#New_002darray-Execute-Functions&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;&amp;lt;&amp;lt;&amp;lt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;4.6 New-array Execute Functions&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;Normally, one executes a plan for the arrays with which the plan was created, by calling fftw_execute(plan) as described in Using Plans. However, it is possible for sophisticated users to apply a given plan to a different array using the “new-array execute” functions detailed below, provided that the following conditions are met:&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;o) The array size, strides, etcetera are the same (since those are set by the plan).&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;o) &lt;STRONG&gt;The input and output arrays are the same (in-place) or different (out-of-place) if the plan was originally created to be in-place or out-of-place, respectively.&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;. . .&lt;/P&gt;

&lt;P&gt;Best Regards,&lt;/P&gt;

&lt;P&gt;Ying&lt;/P&gt;</description>
      <pubDate>Wed, 24 Dec 2014 05:45:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/mkl-gives-different-results-from-lfftw3/m-p/1009225#M19161</guid>
      <dc:creator>Ying_H_Intel</dc:creator>
      <dc:date>2014-12-24T05:45:00Z</dc:date>
    </item>
    <item>
      <title>Dear Ying,</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/mkl-gives-different-results-from-lfftw3/m-p/1009226#M19162</link>
      <description>&lt;P&gt;Dear Ying,&lt;/P&gt;

&lt;P&gt;Thank you very much for the help, it would have taken me a long time to trace this bug down. Please send me the fixed code, or simply the changed portion, which I assume comprises only a few lines.&lt;/P&gt;

&lt;P&gt;Regards,&lt;/P&gt;

&lt;P&gt;Lennaert.&lt;BR /&gt;
	&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Jan 2015 05:49:37 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/mkl-gives-different-results-from-lfftw3/m-p/1009226#M19162</guid>
      <dc:creator>Van_Veen__Lennaert</dc:creator>
      <dc:date>2015-01-07T05:49:37Z</dc:date>
    </item>
  </channel>
</rss>

