next up previous contents
Next: Solving the Heat Equation Up: CSC 492: Solving Problems Previous: MPI_Bcast   Contents

Solving Problems and Implementing Solutions in Parallel

In Trying to solve problems and implementing the solutions, one must think about serial solution first and try to parallelize it because for every algorithm solved in parallel can be serialized, but not all parallel algorithms can be serialized. Some problems are even not computable or solvable by the use of computers!

So it is good to see if a problem can be solved at all, and think about how the break the problem down to separable pieces.

the problems with which the serial algorithm to solve can be broken up still has to pass other criteria before clearly being able to see that it would be effective to design and implement a parallel algorithm based on the serial one.

One such criterion would be the problem domain and their dependency of each other. For example,

The effectiveness of parallel algorithms does not always show on the load to the CPUs, but in many instances, the data while running the program can be kept local. That is, while running, the memory or other means of temporary storage will decrease, leaving the system resource usage to a minimum.

To get started with parallel algorithms, I have written a "warm up" programs to get familiar with MPI, as well as to demonstrate how these programs work.

isPrime Factorizer:
This program takes a parameter which is a number to be tested of its primality. The algorithm simply tests if the number n can be divided with a number from 1 to $\lceil \sqrt{n} \rceil$. If and when a number is found which factorizes n, then the program reports the factors. if not, n would be reported to be a prime.

In order to parallelize this algorithm evenly, the potential each potential factor was visited, but one processor would skip to the current potential factor + number of procs. In this way, the problem can be solved. Also, it would be redundant to look for other factors when already a factor is found. So MPI_Bcast was done as soon as the factor was found to stop the iterations and report the result.



Subsections
next up previous contents
Next: Solving the Heat Equation Up: CSC 492: Solving Problems Previous: MPI_Bcast   Contents
J S 2002-08-14