Question: Part II: ( PLO S 2 / CLO 2 . 2 / SO 6 ) The Prime Factorization algorithm finds the prime factors of a
Part II:
PLO S CLO SO
The Prime Factorization algorithm finds the prime factors of a given number. The Parallel
Prime Factorization approach can be effective for huge numbers. This can be implemented
as a sharedmemory or distributedmemory versions.
Here's a highlevel overview of the Parallel Prime Factorization algorithm:
Domain Decomposition: In MPI, the range of numbers to be factored is split among
the processes that are available; in OpenMP, it is split among the threads.
Local Factorization: Each process or thread performs the prime factorization on its
assigned range of numbers.
Communication: In the case of MPI, the processes exchange information about the
prime factors they discovered, ensuring that all processes have a complete view of
the factorization findings.
Global Reduction: The processes or threads combine their results to provide the
final prime factorization of a given number.
i Implementation:
Implement a program in C or C using OpenMP following the algorithm described
above. Think about sufficient data structures for storing the elements. Run your program
for different values of N ie and
if your computer permit. Run your code for different amount of threads
and What do you observe? For control, always print the list of prime factors
found.
Extend your program with the necessary parallel functionality using MPI. Try to think and
use the collective communication commands. Run your program for same values of
from previous implementation and different amount of processes ie and
What do you observe now? For control, always print the list of prime factors found.
ii Benchmark:
Sketch your results ie execution times of your OpenMPMPI program for different and
different amount of processes in two diagrams showing speedup and parallel efficiency.
You can use any plotting tool Excel Python, etc. of your choice.
In order to 'benchmark' your results, also make a theoretical approach to compute
speedup and efficiency according to Amdahl. Therefore, estimate the serial part of your
program and compute the corresponding speedup and efficiency values. Compare
those with the ones measured and discuss your observation. Please refer to Chapter in
introduction to parallel programming textbook: section and when you are
writing up the analysis part of your report.
iii Report and presentation:
Write a final report pages including a brief description of your parallelization strategy
and the necessary MPI communication in your code ie sketch the communication
idea The report should further highlight your achieved results for both parallelization
approaches ie OpenMP and MPI including your diagrams and benchmark results.
Evaluate your results by discussing if in your opinion the results obtained are good or bad
and where you might have lost performance within your parallelization. The quality of
the writeup is part of the grade. Moreover, please provide a presentation along with the
report including your observations from Part I.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
