PRIME
Make an MPI version of Prime Count Program


PRIME is a version of the prime summing program that we have seen earlier. Your task is to make an MPI version of it. If you become interested in this problem, then your secondary task can be to make an efficient MPI version of it.

The original program counts the primes from 2 to 100,000. The program you are to start with still has this behavior. However, to help you make an MPI version, the program has broken up the computation into P subloops.

The program should be reasonably easy to convert to MPI. Each process can figure out its subinterval just based on its ID number. The only communication comes at the end, when each process must send its sum back to process 0 to be totaled. This can be done with an MPI_REDUCE call.


Source Code:


Last revised on 07 October 2013.