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 Tuesday February 9. Students must come to class the next day prepared to discuss the material covered in this assignment.
Lets continue the Intel OpenMP video series and learn about Threads.
✅ DO THIS: Watch the following video on YouTube Intel Introduction to OpenMP: 05 Module 3
from IPython.display import YouTubeVideo
YouTubeVideo("FQ1k_YpyG_A",width=640,height=360)
✅ QUESTION: Do some research. What are pthreads
and how do they relate to OpenMP?
Put your answer to the above question here.
In the above video there is a program to solve the following integral.
$$\int{\frac{4}{1+x^2}}dx = \pi$$✅ DO THIS: On the HPC create a C++ file with the following contents to estimate a solution to the above equation.
static long num_steps = 100000;
double step;
int main()
{
int i; double x,pi,sum=0.0;
step = 1.0/(double) num_steps;
for (i=0;i<num_steps;i++)
{
x = (i + 0.5) * step;
sum = sum+4.0/(1.0+x*x);
}
pi = step * sum;
}
✅ DO THIS: Vary the number of steps (num_steps) and try to do a timing study to show how long the serial code will take. Have your study generate two plots:
Bring your plots and plot generation code to class for discussion.
# Use this space to generate your plots in python (if need be)
✅ DO THIS: As per the video, try to make a parallel version of the pi estimation program using OpenMP and bring this program to class. Note: Use your time wisely, this is not a graded assignment. I do expect you to make an attempt so we have something to discuss in class but I don't want you spending too much time on this assignment.
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.
✅ Assignment-Specific QUESTION: Where you able to get the OMP Pi example working? If not, where did you get stuck?
Put your answer to the above question here
✅ 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.