In order to successfully complete this assignment you must do the required reading, watch the provided videos and complete all instructions. The embedded survey form must be entirely filled out and submitted on or before 11:59pm on Thursday March 16. Students must come to class the next day prepared to discuss the material covered in this assignment.
Recall that we are trying to compute the integral
$$ \int_0^1 \frac{4}{1+x^2} dx, $$by approximation using quadrature. In the code cmse401-s23/wave_project/MPI_1D/pi.cpp
this is done in the lines
for (int i = istart; i <=iend ; i++)
x(i) = x_min + h*(i-1);
double rsum = 0.0;
for (int i = istart; i <=iend ; i++)
rsum = rsum + h*integrand(x(i));
✅ DO THIS: Make sure you understand how istart
and iend
are computed for each rank.
✅ DO THIS: Write out at least one speciffic example, say size=3
and M=10
.
In the code we are adding up the Riemann sums from each processor by a sequence of send and recieves. As mentioned in class this only provides the rank=0 processor with the correct global sum.
✅ DO THIS: Add (essentially the reversed communication pattern) send/recv communications so that rank=0 shares the correct result with all processes.
Read the tutorials on broadcast, Scatter / Gather and Reduce
✅ DO THIS: How can you use scatter to inform every other process of the global value. Implement this.
✅ DO THIS: How can MPI_allreduce
be used to replace the send/recv combinations? Implement this.
Please fill out the form that appears when you run the code below. You must completely fill this out in order to receive credits for the assignment!
If you have trouble with the embedded form, please make sure you log on with your MSU google account at googleapps.msu.edu and then click on the direct link above.
✅ QUESTION: Summarize what you did in this assignment.
Put your answer to the above question here
✅ QUESTION: What questions do you have, if any, about any of the topics discussed in this assignment after working through the jupyter notebook?
Put your answer to the above question here
✅ QUESTION: How well do you feel this assignment helped you to achieve a better understanding of the above mentioned topic(s)?
Put your answer to the above question here
✅ QUESTION: What was the most challenging part of this assignment for you?
Put your answer to the above question here
✅ QUESTION: What was the least challenging part of this assignment for you?
Put your answer to the above question here
✅ QUESTION: What kind of additional questions or support, if any, do you feel you need to have a better understanding of the content in this assignment?
Put your answer to the above question here
✅ QUESTION: Do you have any further questions or comments about this material, or anything else that's going on in class?
Put your answer to the above question here
✅ QUESTION: Approximately how long did this pre-class assignment take?
Put your answer to the above question here
from IPython.display import HTML
HTML(
"""
<iframe
src="https://cmse.msu.edu/cmse401-pc-survey"
width="100%"
height="500px"
frameborder="0"
marginheight="0"
marginwidth="0">
Loading...
</iframe>
"""
)
To get credit for this assignment you must fill out and submit the above survey from on or before the assignment due date.
Written by Dr. Dirk Colbry, Michigan State University
This work is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License.