Lab 6: MPI
To get experience writing multi-process programs with MPI.
For this lab, you will write an MPI version of the Pi estimator program.
You can start with your version from lab 1, or use my version here.
To complete the lab, you will need to:
- Add in code to set the random seed to the process rank (using srand).
This will ensure each process has its own random numbers.
- Have each process send its estimate of Pi to process 0.
- Have process 0 receive each estimate and average them.
- Have process 0 print the final answer.
- Have each process still do the same number of tosses. The program won't speed up,
but should be more accurate.
- Compile and run your program to ensure that it works.
When your program works, email the source code to firstname.lastname@example.org.
Copyright © 2018 Ian Finlayson | Licensed under a Creative Commons Attribution 4.0 International License.