The objective of this assignment is to step wise parallelize a Prime Sieve Program, and record the performance of your programs on a Capital machine (Albany to Trenton in the machines list), and to experimentally determine the gains you get with 1, 2, 3, 4, 5, 6, 7, and 8 threads.
Download and untar PA4.tar. You will need to update your makefile for each parallel program you are writing. Do not set the number of threads in the program, set it at the Linux OS level (using the export or setenv command). Otherwise we cannot run your program for different numbers of threads. Write your report in pdf format.
Extra credit (required for 575 students) will be posted later.
For Sieve 3 and 4, default the blockSize to the value that gives the best performance if left unspecified on the command line.
In report.pdf, report performance (time, speedup, efficiency), the best blocksize from your exploration for the 3 values of n(0.5, 1 and 1.5 billion), loop parallelization.
Preliminary Testing:
$./sieve1 100 There are 25 primes less than or equal to 100 First three primes:2 3 5 Last three primes:97 89 83 elapsed time = 0.000046 (sec) $./sieve2 100 There are 25 primes less than or equal to 100 First three primes:2 3 5 Last three primes:97 89 83 elapsed time = 0.000046 (sec) $./sieve3 100 10 There are 25 primes less than or equal to 100 First three primes:2 3 5 Last three primes:97 89 83 elapsed time = 0.000046 (sec) $./sieve4 100 10 There are 25 primes less than or equal to 100 First three primes:2 3 5 Last three primes:97 89 83 elapsed time = 0.000046 (sec)
You can see the Grading Rubric here.
Good luck and have fun!