Distributed implementation of the FFT algorithm using MPI, designed for efficient data transformation in clustered systems. Named after the pier structures that break up waves.
Depends on GCC >= 8 or Clang >= 6 as well as a version of MPI. Most development was done with MPICH but no implementation specific features were used. The makefile uses GCC by default, to use Clang add -cc=clang to CC and remove -fcx-limited-range from CFLAGS.
To build just run make
, the executable will be named breakwater
and placed in the root project folder.
To run use mpirun [MPI Options] breakwater [Options] [File]
.
The options for breakwater are:
-h
Display help message and exit
-l
# Set loglevel to #, between 0 (none) and 6 (all), default is 4
-d
Ignore the first line or header of [FILE]
-i
Calculate the inverse FFT
-f
Calculate the forward FFT (default)
The file is expected to have one complex number on each line, with the real and imaginary parts separated by a comma (eg. "1.23,4.56") and in the first two columns respectively. The input will be padded with 0s to reach a power of two in size.
Results will be written to standard output in the same format. Logs are written to standard error.
Let
Let
Let
Let
Then,
If
Otherwise
Let
Let
Let
While
- For each element
$r_a$ of value$q$ in$R$ find the next element in$R$ ,$r_b$ , that also equals$q$ and set$r_b = r_b + r_a$ , and$D_a = b$ . - Set
$q = 2q$ .
Let
Let
For each element
The first and last element of
Let
For each power of two
- For each subset of
$x$ ,$y$ , of size$m$ :- For the first
$m \over 2$ elements in$y$ :$y_a = y_a + e^-{ai\tau\over m} \cdot y_{a+{m \over 2}}$ $y_{a+{m \over 2}} = y_a - e^-{ai\tau\over m} \cdot y_{a+{m \over 2}}$
- For the first
The inverse FFT is the same but the exponent is not negated and a
The only notable quality of how it is implemented in this program is that the butterfly operation, the innermost loop, is a standalone function that is called to consolidate result sets from multiple nodes.
Let
Let
While
- Wait to receive a result set, add set to the end of a list
$L$ . - While there is a set
$S$ of size$n$ in list$L$ :- Pre-append
$S$ to$X$ . - Set
$n = 2n$ . - Do a FFT butterfly operation on
$X$ of size$n$ .
- Pre-append
Send the full result set
Copyright 2023 Zachary Todd Edwards. MIT License