[LORENE] New FFT in Lorene

Jerome Novak Jerome.Novak at obspm.fr
Tue Dec 21 18:24:26 CET 2004

Dear all,

A big change in LORENE: you now have the possibility of using the fftw 
(Fastest Fourier Transform in the West) library (see 
http://www.fftw.org/). The advantages are double:
_ it's really faster (10 to 20% speed enhancement, depending on the 
Lorene code and the CPU)
_ you can use any even number of points for the FFT (but, of course, 
it's faster with powers of 2), so you can use any *odd* number of points 
for the r- and theta- directions on the spectral grid, and any even 
number for the phi-direction.
Now, if you DO NOT want to use it, just copy the new version of the 
local_settings file that meets your system, or simply add the following 
line to your 'local_settings' file:
You can then forget about this message, all changes ought to be 
transparent to you.

Otherwise, you first need to install this library on your computer: it 
comes with many linux distributions but be carefull to install *fftw3* 
and NOT fftw2 or lower. Version 3 is not compatible with previous ones!! 
  You might also have a look at their web page: http://www.fftw.org/

Make a  'make uninstall' and a 'cvs update -d' in the Lorene/C++ directory.

Then, if you are running Linux with GNU make, take the new file
local_settings_linux...  there should now be a FFT_DIR Macro. By 
default, it is set to FFT991, which is the old Fortran FFT library. Set 
it to FFTW3, and eventually, if you have your fftw3 library installed at 
some different location than /usr/local/lib change the path accordingly 
at the begining of the LIB_CXX Macro. Save the file as your new 
local_settings and compile Lorene.

Try to compile the Lorene/Test/test_fft code and run it with e.g. 14 
points when it asks you. This should give a nice plot with just 3 bars.

If you are running some other system, you might have to help yourself 
but you must:
_ have the Macro FFT_DIR defined in your local_settings file, and
_ add the libfftw3 library (together with its path) as part of the 
LIB_CXX libraries.

An example is given for SGI IRIX under local_settings_irix_fftw3

In case you find any difference in the runs of your codes, please tell 
me! By 'difference' I mean any change in the physical results that is 
greater than the numerical error (of course, this last is certainly 
changed by using the new FFT).

Finally, if you want to come back to the old FFT, just type 'make 
uninstall',copy the local_settings_linux... to local_settings and 
re-compile Lorene.

Bon code,

Jerome Novak
Laboratoire de l'Univers et de ses THeories (LUTH)
Observatoire de Meudon       92195 Meudon FRANCE
tel: (33) 01 45 07 75 82     fax: (33) 01 45 07 79 71

More information about the Lorene.list mailing list