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

Problem with mkl FFTW

mhort
Beginner
1,370 Views

Hello,

I have this code to test my implementation of dft_r2c_1d. It runs perfectly fine if fft_length = 2**13, but it crashes with an Access violation in dfftw_execute_dft_r2c. I hve no idea why it orks with a length of ^2**13 but not with 2**14 and higher exponents.

some insight is greatly appreciated. Many thanks in advance for your help,

Matthias

************* code *****************

program test_fftw

!use IFPORT
!use iso_fortran_env

implicit none

Include 'C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2020.2.254\windows\mkl\include\fftw\fftw3.f'

real*4 :: pi_r4, pi_inc
integer*4 :: fft_length

integer*4 :: i, j
integer*8 :: my_plan

double complex, allocatable :: fftw1d( : ) ! help array for 1D FFT for phase calculation
real*8, allocatable :: input( : ) ! help array for 1D FFT for phase calculation

Parameter( fft_length = 2**13, pi_r4 = 3.141592653589793238462643383279502884)

allocate( fftw1d( fft_length/2+1 ) )
allocate( input( fft_length ) )

pi_inc = pi_r4/(fft_length-1)*100.
do i =1,fft_length
input( i ) = sin(float(i-1)*pi_inc)
end do

! do FFT
fftw1d = ( 0.d00, 0.d00 )

call dfftw_plan_dft_r2c_1d( my_plan,fft_length,input,fftw1d,FFTW_ESTIMATE )
write(*,*) fftw_estimate
call dfftw_execute_dft_r2c( my_plan,input,fftw1d )

call dfftw_destroy_plan( my_plan )

stop

end program test_fftw

0 Kudos
4 Replies
IntelSupport
Community Manager
1,325 Views

Hi,


Thanks for sharing your requirement details. We are looking into your issue internally. We will get back to you soon with an update.


Regards,

Jilani


0 Kudos
IntelSupport
Community Manager
1,305 Views

Hi,

 

Thank you for posting in Intel Communities.

 

We tried to reproduce the issue, but it appears to be working fine on our side.

When we use the following fft_lengths, the outcomes are as follows.

fft_length = 2**13, result is 64.

fft_length = 2**14, result is 64.

 

We would like to request you to use the latest version of MKL. And please let us know if the issue still persists.

Please find the attached screenshots for the fft_length results for 2**13 and 2**14.

 

Regards,

Jilani

 

0 Kudos
mhort
Beginner
1,284 Views

Dear Jilani,

great many thanks for testing it. I am using an older Version of the fortran compiler (19.1.2.254) with the attached math Kernel Library. I am developing code in visual studio.

As far as I can see you tested 2 compiler versions, both newer than mine. So maybe its a problem with the compiler and the mkl Version in my installation. Maybe I have overlooked one switch in visual studio..

Many thanks for your help,

Matthias

 

0 Kudos
IntelSupport
Community Manager
1,255 Views

Hi,


Many thanks for your reply. We would like to request you to use the latest version of MKL, in case you run into any other issues please feel free to create a new thread.


Regards,

Jilani


0 Kudos
Reply