Specifying number of processes : mpirun -np 3 executable-file.
Once you got your program running, you should do the following
exercises to get a feeling of parallel computing. (20 points)
Add an MPI function to compute and print out the time elapsed between
the computations (see Tutorial on MPI: The Message-Passing Interface).
Choose the number of nodes (intervals) to be a large number,
say, 2,000,000
and run the program by specifying 1, 2, 4, 8, 16, 32 etc. processes and
record the elapsed time.
Choose the number of nodes (intervals) to be a smaller number, say, 200, and
repeat the above procedure.
Graph the relation between the number of processes and the timings.
Modify the code so that you will not use MPI_Reduce to collect
the final result. Instead, ask each process to send its local sum to the
process 0, which will compute the final sum and output the result.
Submit a print-out of your code, two graphs showing the above tests, and
a short explanation on the results you obtained.