Forum Jump

Select Group :
Select Forum :
Sorted By :
Sort Order :
From The :
 
Thread Tools  Search this thread 
david.sallngc.com
July 7, 2009 11:39 AM PDT
Errors using MKL FFTW, OpenMP, and Visual Fortran 9.1
Hi!

I am getting data errors when using the Intel MKL FFTW libraires and Fortran code compiled using OpenMP.  I am generating a mexfunction for Matlab and am using the Intel 9.1 Visual Fortran compiler for Windows and the Intel MKL 10.1.3.028 libraires (I must use the version 9.1 compiler due to restrictions from the version of Matlab I am using).  I am generating a static build of my mexfunction using the command,

> mex foo.f90 'c:\program files\intel\mkl\10.1.3.028\ia32\lib\fftw3xf_ms.lib' 'c:\...\libguide40.lib' 'c:\...\mkl_intel_thread.lib' 'c:\...\mkl_intel_c.lib' 'c:\...\mkl_core.lib'

and using the option '/Qopenmp' in the COMPFLAGS in the mexopts.bat file.

If I create my mexfunction without using OpenMP then the program results using the MKL FFTW and the FFTW library from www.fftw.org are identical.  Compiling the code using OpenMP gives erroneous results.

Are there incompatabilities using Intel Visual Fortran 9.1 and MKL 10.1.3.028?  Am I inadvertently trying to run a threaded version of FFTW?  In my code, I do NOT call for a threaded version of FFTW.  I use OpenMP to speed up DO-LOOPS that contain FFTW calls.

Thank you very much for your help.

Sincerely,

David
tim18
Total Points:
66,397
Status Points:
66,397
Black Belt
July 7, 2009 11:54 AM PDT
Rate
 
#1
You may require the libguide from MKL (newer than the one from ifort 9.1) to find a version which is compatible both with ifort 9 and with MKL 10.1.  If you don't want MKL to start its own threads or have problems with OpenMP run time link compatibility, use the mkl_sequential library in place of mkl_intel_thread.  Then you should not have a problem with the libguide chosen by ifort 9.1.   These problems should be alleviated by ifort professional (all recent versions), where the current MKL is included in ifort.


david.sallngc.com
July 8, 2009 5:20 AM PDT
Rate
 
#2 Reply to #1
Quoting - tim18
You may require the libguide from MKL (newer than the one from ifort 9.1) to find a version which is compatible both with ifort 9 and with MKL 10.1.  If you don't want MKL to start its own threads or have problems with OpenMP run time link compatibility, use the mkl_sequential library in place of mkl_intel_thread.  Then you should not have a problem with the libguide chosen by ifort 9.1.   These problems should be alleviated by ifort professional (all recent versions), where the current MKL is included in ifort.
Hi tim18!

Thank you for the response but I still get the same result using the mkl_sequential library.  I must make a static build (my mexfunction dll will be on computers that do not have MSVS and Intel compilers and MKL) and require OpenMP for program speed.  I am also limited to using the Intel Visual Fortran version 9.1 because of Matlab restrictions.  I have tried using MKL 9.1.027 using the following library list,

> mex foo.f90 'c:\program files\intel\mkl\9.1.027\ia32\lib\fftw3xf_ms.lib' 'c:\...\lib\libguide40.lib' 'c:\...\lib\mkl_c.lib' 'c:\...\lib\mkl_ia32.lib'

but this crashes Matlab when I run the dll.

So this is where I stand:
1) if I use MKL 9.1.027 I can not make either a static or shared version of my code.  Both will crash Matlab.
2) if I use MKL 10.1.3.028 I can make a static build without OpenMP and get correct output data.  If I compile using /Qopenmp, I get incorrect output (but does not crash Matlab)

Do I have any options left?

Thanks again for your help.

Sincerely,

David



Intel Software Network Forums Statistics

8285 users have contributed to 31229 threads and 99107 posts to date.
In the past 24 hours, we have 11 new thread(s) 45 new posts(s), and 61 new user(s).

In the past 3 days, the most popular thread for everyone has been comparison cilk++, openmp, pthreads first results The most posts were made to comparison cilk++, openmp, pthreads first results The post with the most views is Very amusing...  Escalated as

Please welcome our newest member tvinni