Programming Challenge 10
Description
Implement algorithms to approximate the value of pi using Monte Carlo sampling. Make two versions, a typical version that is sequential (no threads or tasks) and a parallel version (task-based). The tasked-based version will take an additional input of the number of asynchronous tasks to create (beyond the single parameter of the number of samples). Finally, implement an experimental framework that analyzes sample sizes of powers of two from28
,
29
, ...to..., 224
. Compare your
sequential performance to the asynchronous performance with the number of tasks
that are powers of two from 20
,
21
, ...to..., 27
. Reflect on the
data for the lessons learned.
Details
- Name the files and program
sequential_pi.h
,parallel_pi.h
, andtest_pi.cpp
. - In your top file comment, tell me two things you learned about parallel programming while solving this challenge (not from the lecture notes).
General Instructions, Turning in assignments, and Grading
General Instructions
- Name each file and program as listed in the instructions.
- The top of each program should have a comment block where the first line
is your name and following lines are a description of your program and
references used in programming.
//Name: Jory Denny
//This program debates Batman vs Superman!
//References:
// - Ref 1. - Follow turn-in instructions precisely.
- Failure to complete any of these steps will result in an incomplete.
Turn in Instructions
Each assignment will be turned in through GitHub classroom. Please find the link to create a repository at the top of this page, or through this link. Assignments are due BEFORE, let me repeat, before class starts. This does not mean five minutes after class starts.
- Soft copy (Online submission)
- Accept the invitation to the classroom assignment, which creates your repository on GitHub.
- Clone this repository, which includes some starting files.
- Add assignment files (stage, commit, push).
- Modify the Coverpage.txt file to provide name, sources, signature of following the honor code, etc. Be sure to stage, commit, and push these changes as well. If you do not fill out the coverpage, I will not grade the assignment.
- After the due date, I will clone your repository and add a grade and comments as necessary. After which you can pull these changes for your records.
Points
- Each assignment is a completion grade. In order to receive a completion, the code must compile and all parts of the challenge need to be completed.
- Note - a compiling, correct program ≠ 100%, just like a composed paper with the minimum requirements discussed ≠ 100% for an English Writing class.
- If there are any discrepancies in grades please see the instructor during his office hours or by appointment (do not discuss with the lab assistants or graders).