FFTW on 64-bit platforms
Posted: Fri Jan 27, 2006 10:37 am
I recently tried using fftw instead of the built-in fft libraries, and this caused some crashes on Linux/amd64. Turns out that the plan variables need to be big enough for a pointer. One could compile with some "-i8" switch, but the MPI libraries we use want 32-bit integers. So the following patch provides a solution to that problem:
and for the mpi version:
Code: Select all
% diff fftw3d.F.orig fftw3d.F
90c90,92
< integer grid(3), isign, plan
---
> integer, parameter :: pk = selected_int_kind(18)
> integer grid(3), isign
> integer(pk) :: plan
118c120,122
< integer grid(3),plan
---
> integer, parameter :: pk = selected_int_kind(18)
> integer grid(3)
> integer(pk) :: plan
and for the mpi version:
Code: Select all
% diff fftmpiw.F.orig fftmpiw.F
56c56,58
< INTEGER :: planx, plany, planz
---
> ! Integer kind for plans should be large enough for a pointer.
> integer, parameter :: pk = selected_int_kind(18)
> INTEGER(pk) :: planx, plany, planz