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.
Here are "completed" versions of the programs.
Before using MPI on the FSU_HPC cluster, you must first set up the appropriate environment. You can do this by typing
module load gnu-openmpi
Once you have set up the environment, you should compile your program, using one of the following: