This snippet of code reads in a bit of unformatted, double precision data, and returns a real FFTW on it:
#include <stdio.h>
#include <fftw3.h>
#include <fcntl.h>
#include <unistd.h>
int main() {
int i, fdin;
int count=128;
static fftw_plan fplan=0;
double alldata[2][count];
fdin = open("rand_walk.dat", O_RDONLY);
read(fdin, alldata[0], sizeof(double)*count);
fplan = fftw_plan_r2r_1d(count, alldata[0],
alldata[1], FFTW_R2HC, FFTW_ESTIMATE);
fftw_execute_r2r(fplan, alldata[0], alldata[1]);
printf("%lf\n",alldata[0][0]);
printf("%lf\n",alldata[1][10]);
return 0;
}
It works just fine when compiled under GNU or Cray. When compiled under Intel, it runs without any error message, but the output array (alldata[1]
)is filled with zeros. Apparently, there is something about FFTW3 with Intel that I don't understand. Anyone know what that might be? BTW, switching to FFTW2 is not an option on the platform I have to work on.