Giter Site home page Giter Site logo

zamb0 / 2d_fast_fourier_transform_openmpi Goto Github PK

View Code? Open in Web Editor NEW
4.0 1.0 1.0 372 KB

2D Fast Fourier Transform (2D FFT) parallel algorithm using OpenMPI. The algorithm is implemented in C and it is based on the Cooley-Tukey iterative algorithm.

License: MIT License

C 100.00%
2dfft openmpi parallel-computing parallel-programming

2d_fast_fourier_transform_openmpi's Introduction

C-Language OpenMPI

2D Fast Fourier Transform (2D FFT) OpenMPI Implementation

fft_cover

This repository contains the code for the Advanced Computer Architecture project (2022/2023).

Aim of the Project

The aim of the project is to parallelize a serial C code of a 2D Fast Fourier Transform (FFT) algorithm, the Colley-Tukey one, through OpenMPI. The input of the algorithm is a type P2 PGM image and the outputs are the 2D FFT of the image and the 2D iFFT image.

Execution Instructions

1 - Setup the Git Repository

If not already done, download and install git from git-scm.com. Then clone the repository with the following command:

git clone https://github.com/zamb0/ACA.git

2 - Install OpenMPI

Download Open MPI 4.1.1 from the official Open MPI website and install it.

3 - Compile

To compile and run the serial application, run the following commands:

gcc -Wall -o executableFile -lm -std=c99 *.c

you need to compile using all the .c files in the folder but fft_parallel.c and img_generator.c.

If you want to compile and run the parallel application instead, then compile in the following way:

mpicc -Wall -o executableFile -lm -std=c99 *.c

also in this case you need to compile using all the .c files in the folder but fft_serial.c and img_generator.c.

3b - Generate the Images (if needed)

If you do not have images to run the 2D FFT algorithm on, you can compile the img_generator.c to generate sample images of your choice. To compile the image generator, run the following command:

gcc -Wall -o img_gen img_generator.c pgm.c

Then, to generate an image, run the following command:

./img_gen [outputFile] [width] [height] [pgmType] [maxValue]

where outputFile is the name of the file where the image will be saved, width is the width of the image, height is the height of the image, pgmType is the type of pgm image (i.e. P2 is the one allowed to be used in our project), maxValue is the maximum value of the pixels in the image.

4 - Run the Program

To compile and run the serial application, run the following commands:

./executableFile [inputImage]

If you want to run the parallel application instead:

mpirun -np N executableFile [inputImage]

where N is the number of processes you want to use.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.