Applications/Fftw3

From HPC
Revision as of 13:14, 19 April 2017 by Pysdlb (talk | contribs) (Pysdlb moved page Fftw3 to Applications/Fftw3 without leaving a redirect)

Jump to: navigation , search

Application Details

  • Description: FFTW is a C subroutine library for computing the discrete Fourier transform (DFT) in one or more dimensions, of arbitrary input size, and of both real and complex data
  • Version: 3.3.5 (compiled with gcc)
  • Module: fftw3/gcc/3.3.5
  • Licence: GNU

Usage

FFTW is a C subroutine library for computing the discrete Fourier transform (DFT) in one or more dimensions, of arbitrary input size, and of both real and complex data (as well as of even/odd data, i.e. the discrete cosine/sine transforms or DCT/DST).

Module

[username@login01 ~]$ module add fftw3/gcc/3.3.5

Compilation

fftw3 is a library required at compilation time.

A typical code snippet requiring is shown below:


#include <fftw3.h>
...
{
    fftw_complex *in, *out;
    fftw_plan p;
    ...
    in = (fftw_complex*) fftw_malloc(sizeof(fftw_complex) * N);
    out = (fftw_complex*) fftw_malloc(sizeof(fftw_complex) * N);
    p = fftw_plan_dft_1d(N, in, out, FFTW_FORWARD, FFTW_ESTIMATE);
    ...
    fftw_execute(p); /* repeat as needed */
    ...
    fftw_destroy_plan(p);
    fftw_free(in); fftw_free(out);
}

You must link this code with the fftw3 library. On Viper, link with -lfftw3 -lm.


Further Information

Icon home.png