Difference between revisions of "CSC352 Homework 1"
(Created page with '<onlydft> </onlydft>') |
|||
Line 1: | Line 1: | ||
<onlydft> | <onlydft> | ||
+ | |||
+ | This homework is due on 1/9/10. Submit all the parts electronically using your 352 accounts, and the submit command. | ||
+ | |||
+ | =Problem #1= | ||
+ | Why am I asking you to read the first six section of John Von Neumann's [[Media:VonNewmannEdvac.pdf | First Draft Report on the EDVAC]]? | ||
+ | |||
+ | Write up your answer (at most one page) in pdf form in a file called '''part1.pdf''' and submit it electronically from your | ||
+ | |||
+ | 352 account this way: | ||
+ | |||
+ | submit hw1 part1.pdf | ||
+ | |||
+ | =Problem #2= | ||
+ | After having discussed the [[http://www.eecs.berkeley.edu/Pubs/TechRpts/2006/EECS-2006-183.pdf View from Berkeley]] paper, rewrite your summary, and make it more precise. For the 1/2 page summary, pick on what you think are the most important message(s). You are free to submit the same summary as the one you submitted on 1/2/10 if you feel you had already answered this part. | ||
+ | |||
+ | submit hw1 part2.pdf | ||
+ | |||
+ | =Problem #3= | ||
+ | |||
+ | Take the threaded ''N''-Queens problem and find a different approach to parallelize it. | ||
+ | |||
+ | The version that was given to you in class launches ''N'' new threads, each one putting the first queen on Row 0, Column ''i'', with ''i'' ranging from 0 to ''N''-1. | ||
+ | |||
+ | Figure out a different approach, and show that in some cases you out-perform the threaded ''N''-queens I gave you. | ||
+ | |||
+ | In order to do so, you will have to measure the timing of your version and compare it to the timing of the class N-Queens for several values of ''N''. | ||
+ | |||
+ | Here's an example for timing the execution of the ''N''-queens problem. You can adapt it to measure the execution time of your version. The information is taken from http://www.cyberciti.biz/faq/bash-for-loop/ | ||
+ | |||
+ | * create a text file in the directory where you have your ''N''-queens problem. Call it '''timeIt.sh'' | ||
+ | #! /bin/bash | ||
+ | for i in {10..20} | ||
+ | do | ||
+ | echo "-----------------------------------" | ||
+ | echo $i | ||
+ | time python threadedNQueens.py $i > /dev/null | ||
+ | done | ||
+ | |||
+ | * make the file executable | ||
+ | chmod +x timeIt.sh | ||
+ | |||
+ | * run the file | ||
+ | ./timeIt.sh | ||
+ | |||
</onlydft> | </onlydft> |