Intel® oneAPI Math Kernel Library
Ask questions and share information with other developers who use Intel® Math Kernel Library.

fftw3 function crashes when running intel MKL

Yuri_F_
Beginner
566 Views

Hi, I have very annoying problem. I installed  Intel composer 2013 which I run with Ultimate Visual studio 2010. My fortran program uses fftw3 functions , for which Intel Visual Fortran has an appropriate wrapper. To build the application I have done the 2 following steps:

1. Put the path for fftw.h in the project->Properties->Fortran->Additional Include Directories to the location where the Intel composer 2013 is installed.

2. Enabled "UseIntel Math  Kernel Library" by choosing  "Sequential (/Qmkl:sequential)" oprion  in the project->Properties->Fortran->libraries->.

I also increased the allocation of Stack Reserbve Size and Stack Commit Size to fit them to the program requirements.

After all that I have succesfully compiled and built the program

The problem shows up when the program is running, generating the following error when trying to execute  fftw_execute_r2r(forward, in, in) function:

Unhandled exception at 0x00302827 in proba.exe: 0xC0000005: Access violation reading location 0x00000004.

When I run the same program on the Unix system, where  the both program and  fftw libriary were compiled with intel compiler everything is working perfect.

Many thanks for your help, Yuri

 

0 Kudos
9 Replies
Anonymous66
Valued Contributor I
567 Views
Hello Yuri, I am transferring this issue to the MKL forum. Someone on that forum should help you shortly. Regards, Annalee Intel Developer Support
0 Kudos
Dmitry_B_Intel
Employee
567 Views
Hi Yuri, Accessing data at address 0x00000004 often aborts an application. Could you try to trace where this access took place? The address it printed may help if you have the application link map. One of reasons why the incorrect access may happen is missing check for NULL plan returned by fftw_plan_r2r. Additional information, maybe a piece of code and a build log, could help to identify the reason. Thanks Dima
0 Kudos
Gennady_F_Intel
Moderator
567 Views
Yuri, Could you check how the test will work when you link the example from command line? Is that 32 or 64 bit application?
0 Kudos
Yuri_F_
Beginner
567 Views
I tried both 32 and 64 bit application with the same outcome. For 64 bit applicatio the following error is generated: Unhandled exception at 0x000000013fe228c4 in proba.exe: 0xC0000005: Access violation reading location 0x0000000000000040. Also the build log file is attached :
Build Log
  

Build started: Project: proba, Configuration: Debug|x64

Output
  
Compiling with Intel(R) Visual Fortran Compiler XE 13.0.0.089 [Intel(R) 64]...
ifort /nologo /debug:full /Od /I&quotC:\Program Files (x86)\Intel\Composer XE 2013\mkl\include\fftw" /warn:interfaces /module:&quotx64\Debug\\" /object:&quotx64\Debug\\" /Fd&quotx64\Debug\vc100.pdb" /traceback /check:bounds /check:stack /libs:static /threads /dbglibs /Qmkl:sequential /c /Qvc10 /Qlocation,link,&quotC:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\\bin\amd64" &quotD:\PostDoc\AirFoil\Generic\proba\src\parameters.f90"
ifort /nologo /debug:full /Od /I&quotC:\Program Files (x86)\Intel\Composer XE 2013\mkl\include\fftw" /warn:interfaces /module:&quotx64\Debug\\" /object:&quotx64\Debug\\" /Fd&quotx64\Debug\vc100.pdb" /traceback /check:bounds /check:stack /libs:static /threads /dbglibs /Qmkl:sequential /c /Qvc10 /Qlocation,link,&quotC:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\\bin\amd64" &quotD:\PostDoc\AirFoil\Generic\proba\src\grid.f90"
ifort /nologo /debug:full /Od /I&quotC:\Program Files (x86)\Intel\Composer XE 2013\mkl\include\fftw" /warn:interfaces /module:&quotx64\Debug\\" /object:&quotx64\Debug\\" /Fd&quotx64\Debug\vc100.pdb" /traceback /check:bounds /check:stack /libs:static /threads /dbglibs /Qmkl:sequential /c /Qvc10 /Qlocation,link,&quotC:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\\bin\amd64" &quotD:\PostDoc\AirFoil\Generic\proba\src\user.f90"
ifort /nologo /debug:full /Od /I&quotC:\Program Files (x86)\Intel\Composer XE 2013\mkl\include\fftw" /warn:interfaces /module:&quotx64\Debug\\" /object:&quotx64\Debug\\" /Fd&quotx64\Debug\vc100.pdb" /traceback /check:bounds /check:stack /libs:static /threads /dbglibs /Qmkl:sequential /c /Qvc10 /Qlocation,link,&quotC:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\\bin\amd64" &quotD:\PostDoc\AirFoil\Generic\proba\src\myfft.f90"
ifort /nologo /debug:full /Od /I&quotC:\Program Files (x86)\Intel\Composer XE 2013\mkl\include\fftw" /warn:interfaces /module:&quotx64\Debug\\" /object:&quotx64\Debug\\" /Fd&quotx64\Debug\vc100.pdb" /traceback /check:bounds /check:stack /libs:static /threads /dbglibs /Qmkl:sequential /c /Qvc10 /Qlocation,link,&quotC:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\\bin\amd64" &quotD:\PostDoc\AirFoil\Generic\proba\src\variables.f90"
ifort /nologo /debug:full /Od /I&quotC:\Program Files (x86)\Intel\Composer XE 2013\mkl\include\fftw" /warn:interfaces /module:&quotx64\Debug\\" /object:&quotx64\Debug\\" /Fd&quotx64\Debug\vc100.pdb" /traceback /check:bounds /check:stack /libs:static /threads /dbglibs /Qmkl:sequential /c /Qvc10 /Qlocation,link,&quotC:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\\bin\amd64" &quotD:\PostDoc\AirFoil\Generic\proba\src\operators.f90"
ifort /nologo /debug:full /Od /I&quotC:\Program Files (x86)\Intel\Composer XE 2013\mkl\include\fftw" /warn:interfaces /module:&quotx64\Debug\\" /object:&quotx64\Debug\\" /Fd&quotx64\Debug\vc100.pdb" /traceback /check:bounds /check:stack /libs:static /threads /dbglibs /Qmkl:sequential /c /Qvc10 /Qlocation,link,&quotC:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\\bin\amd64" &quotD:\PostDoc\AirFoil\Generic\proba\src\operators_pressure.f90"
ifort /nologo /debug:full /Od /I&quotC:\Program Files (x86)\Intel\Composer XE 2013\mkl\include\fftw" /warn:interfaces /module:&quotx64\Debug\\" /object:&quotx64\Debug\\" /Fd&quotx64\Debug\vc100.pdb" /traceback /check:bounds /check:stack /libs:static /threads /dbglibs /Qmkl:sequential /c /Qvc10 /Qlocation,link,&quotC:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\\bin\amd64" &quotD:\PostDoc\AirFoil\Generic\proba\src\main.f90"
Linking...
Link /OUT:&quotx64\Debug\proba.exe" /INCREMENTAL:NO /NOLOGO /MANIFEST /MANIFESTFILE:&quotD:\PostDoc\AirFoil\Generic\proba\x64\Debug\proba.exe.intermediate.manifest" /MANIFESTUAC:&quotlevel='asInvoker' uiAccess='false'" /DEBUG /PDB:&quotD:\PostDoc\AirFoil\Generic\proba\x64\Debug\proba.pdb" /SUBSYSTEM:CONSOLE /STACK:99999999,99999999 /IMPLIB:&quotD:\PostDoc\AirFoil\Generic\proba\x64\Debug\proba.lib" &quotx64\Debug\parameters.obj" &quotx64\Debug\grid.obj" &quotx64\Debug\user.obj" &quotx64\Debug\myfft.obj" &quotx64\Debug\variables.obj" &quotx64\Debug\operators.obj" &quotx64\Debug\operators_pressure.obj" &quotx64\Debug\main.obj"
Link: executing 'link'

Embedding manifest...
mt.exe /nologo /outputresource:&quotD:\PostDoc\AirFoil\Generic\proba\x64\Debug\proba.exe;#1" /manifest &quotD:\PostDoc\AirFoil\Generic\proba\x64\Debug\proba.exe.intermediate.manifest"

proba - 0 error(s), 0 warning(s)
0 Kudos
Yuri_F_
Beginner
567 Views
Can I upload the whole project, so you could exam it on your mashine? Many thanks, Yuri
0 Kudos
Gennady_F_Intel
Moderator
567 Views
yes, you can, but it would be much better if you prepare the smallest test case as you can for reproducing the problem on our side.
0 Kudos
Yuri_F_
Beginner
567 Views
Ok, attached is a very simple project which is supposed to perform fft transform Note that in order to run it on your machine you will need to change the include path for fftw. The program crashes when dfftw_execute_r2r routine is called Thank you for your help, Yuri
0 Kudos
Yuri_F_
Beginner
567 Views
Ok, attached is a very simple project which is supposed to perform fft transform Note that in order to run it on your machine you will need to change the include path for fftw. The program crashes when dfftw_execute_r2r routine is called Thank you for your help, Yuri
0 Kudos
Dmitry_B_Intel
Employee
567 Views
Yuri, Thank you for posting the example. MKL FFTW wrappers do not support 2D r2r. MKL conveys this information by returning null fftw plan. Thanks Dima
0 Kudos
Reply