NERSC logo National Energy Research Scientific Computing Center
  A DOE Office of Science User Facility
  at Lawrence Berkeley National Laboratory
 
PackagePlatformVersionModule Docs
fftw bassi 2.1.5 fftw  Vendor
fftw bassi 3.0.1 fftw/3.0.1  Vendor
fftw bassi 3.1 fftw/3.1  Vendor
fftw davinci 3.1.2 fftw/3.1.2  Vendor
fftw franklin 2.1.5 fftw  Vendor
fftw franklin 3.1.1 fftw/3.1.1  Vendor
fftw jacquard 2.1.5 fftw  Vendor
fftw jacquard 3.0.1 fftw/3.0.1  Vendor
(*) Denotes limited support

FFTW Math Library

FFTW is a portable, free, high performance FFT library which implements arbitrary radix, serial and multiple dimensional transforms in serial or parallel (MPI and POSIX threads models). One unique aspect of FFTW is its optional use of self-optimizing strategies, whereby subsequent calls become faster by building on previous timings. Wrapper functions provide a Fortran API to this native C library.

Since many parallel codes use single precision FFTs in order to halve the communication required we provide both single and double precision libraries. Select the precision by using the proper prefix to the library "d" for double (8 byte) and "s" for single (4 byte) floating point numbers. For detailed information on how FFTW is built on NERSC machines see this script.

How to use the FFTW library

On Franklin, to use fftw/2.1.5 (default version), users need to include the corresponding include file according to the code type, FFT type, precision type, and also link with the correct library (please see table below):

% module load fftw 
% ftn ... -lcorrect_library 
% cc ... -lcorrect_library  
% CC ... -lcorrect_library  

Code TypeFFT TypePrecisionInclude File name Library NameLink With
Serial Complex Single sfftw.h libsfftw.a -lsfftw
Serial Real Single srfftw.h libsrfftw.h -lsrfftw
Serial Complex Double dfftw.h libdfftw.h -ldfftw
Serial Real Double drfftw.h libdrfftw.h -ldrfftw
Parallel Complex Single sfftw_mpi.h libsfftw_mpi.h -lsfftw_mpi
Parallel Real Single srfftw_mpi.h libsrfftw_mpi.h -lsrfftw_mpi
Parallel Complex Double dfftw_mpi.h libdfftw_mpi.h -ldfftw_mpi
Parallel Real Double drfftw_mpi.h libdrfftw_mpi.h -ldrfftw_mpi
On Franklin, to use fftw/3.1.1, the correct library will be automatically linked:
% module load fftw/3.1.1 
% ftn ...  or
% cc ...  or
% CC ...  
On Bassi, Jacquard, and Davinci (single precision):
% module load fftw 
% $(CC)   $FFTW -lsfftw -lm ...  or 
% $(F77)   $FFTW -lsfftw  ...  or 
% $(F90)   $FFTW -lsfftw ...  or
% $(MPICC)   $FFTW -lsfftw_mpi -lsfftw -lm ... 
On Bassi, Jacquard, and Davinci (double precision):
% module load fftw 
% $(CC)   $FFTW -ldfftw -lm ...  or 
% $(F77)   $FFTW -ldfftw  ...  or 
% $(F90)   $FFTW -ldfftw ...  or
% $(MPICC)   $FFTW -ldfftw_mpi -ldfftw -lm ... 

Example Programs

In your code you should select the proper include file "dfftw.h" or sfftw.h" in the same way as above. The FFTW include files will then properly define types like "fftw_complex" as being of the appropriate precision.

Documentation

For FFTW on-line documentation in HTML format, see the FFTW website .


LBNL Home
Page last modified: Tue, 26 Feb 2008 01:28:20 GMT
Page URL: http://www.nersc.gov/nusers/resources/software/libs/math/fft/fftw/
Web contact: webmaster@nersc.gov
Computing questions: consult@nersc.gov

Privacy and Security Notice
DOE Office of Science