Parallel Computation
Project I
Team 07
Neelima Paramatmuni
Padmaja Pentela
Shyamali Balasubramaniyan
Shravanthi Denthumdas
Samira Hemrajani.
Problem Description:
The objective of our project is to parallelize a sequential code such that it can be
executed for N number of processes. The original source code performs Image Analysis for an
image which is treated as a matrix of characters. NOTE : 1 character is a pixel of black and white
image.
The most computation intensive task of the code was FFT operations. These were
parallelized using the MPI based FFT routines.
The major challenge of this task was:
• Understand the sequential code and investigate parallelization approaches.
• Understand data distribution requirements of the FFTW routines.
• Synchronization of tasks to enforce ordering if and when required.
We focused mainly on our solution to be scalable. This is because we would be required to test
our parallelized code for bigger images which are impossible to be viewed on a single processor.
Parallelization Strategy:
The following steps unfold the various stages of our task parallelization strategy.
CASE 1
CASE 2
CASE 3
Figure 2: Image Padding
Since, each process gets a subset of the rows of the data, during parallelization the image
padding will have to be carried in one of the following 3 ways:
Case 1 : A process may have rows that require padding only on right side (refer to figure 2).
Case 2 : A process may have rows that require padding on the bottom and well as the right hand
side.
Case 3 : A process may have chunk of data which is only padding.
Convolution:
FFT of the padded image and filter are performed first, then these are multiplied to get
the convoluted output. Since this task is now divided over multiple processes, we modify the
convolution loop to range from 0 to number of rows on each process (image height on each
process).
Inverse FFT:
This is the Inverse of the FFT operation. For purpose of parallelization we replace the
fftwnd_one() with fftwnd_mpi(ifftplan,1, convolved, NULL, FFTW_NORMAL_ORDER ).
Depadding:
The depadding operation is carried out on the output of the inverse FFT operation. It
separates the image from the padding that we had introduced during the FFT operation.
The following image shows the output of IFFT which needed to be depadded.
The depadding is defined by 3 main scenarios in our parallel environment.
CASE 1
CASE 2
CASE 3
Case1: Process may have only padding and no useful image information.
Case2: Process may contain image information along with padding on the top and left. In this
case we will have to extract the image information accordingly.
Case3: Process may contain image information along with padding to the left.
Results:
We obtained readings on the cluster using the image file provided by Dr. Gabriel under
folder /pvfs2.
We obtained 3 readings for 1, 2, 4 and 8 processed respectively. These are tabulated below.
#
proc 1 2 4 8
Neelima Paramatmuni:
• Analysis of sequential code and identify parts of code that need to be parallelized
• Studied FFTW MPI routines
• Write code to parallelize the sequential code (Reading, Padding and Writing image).
• Debugging the code.
• Testing the code
• Calculating speedup and efficiency.
• Documentation
Padmaja Pentela:
• Analysis of code and FFTW MPI routines
• Helped in file reading , padding and writing to file functions
• Documentation
Shyamali Balasubramaniyan:
• Analyze the code
• Studied the FFTW MPI routines
• Testing the code
• Recording measurements, graphs and documentation.
Shravanthi Denthumdas:
• Analysis of sequential code and studied the FFTW MPI routines
• Testing the code
• Documentation
Samira Hemrajani:
• Contributed to the analysis of the sequential code
• Addressing questions like: What is Image Analysis? How FFT is carried out? What are
filters, Gabor filters, etc?
• Investigated different parallelization approaches, reviewed fftwnd_mpi_local_sizes for
Data distribution in MPI_FFT
• Incorporated the timing functions namely MPI_Wtime and gettimeofday in the parallel and
sequential codes respectively
• Carried out intensive testing
• Helped in documenting the results