CS475 Fall 2008 - Homework 2
Parallel Program for Sieve of Eratosthenes
What to Submit for MPI Programs
- Makefile : It must compile three programs (when make was called with no arguments),
one for each version, named sieve1, sieve2, and sieve3 all of them compiled in debug mode.
The output of each version is described below.
Makefiles should not do anything other than compilation.
- Outputs :
- Your programs should take n as a command line argument.
(Recall: your program is going to find and count all primes less than or equal to n.)
- The output of the programs must contain the following:
- 0: 2 3 5 233 239 241
- 1: 251 257 263 487 491 499
- 2: 503 509 521 733 739 743
- 3: 751 757 761 983 991 997
- There are 168 primes less than or equal to 1000
- Elapsed Time=0.000224
- The C code that produces the above output are already available in the provided starting point.
- The first four lines are primes calculated in processor p,
followed by first and last three primes in their range (p: f1 f2 f3 l3 l2 l1).
The number of these lines changes as number of processor changes.
- You can print these lines in any order.
- Others(To make our grading easier):
- Please use tar, so that tar -xvf xxx.tar unpacks your tar file.
- Please have everything in the top-level directory when untared. No sub-directories.
- Please do not use any interactive inputs (such as scanf).
- READMEs and your jobscripts become important when your program failed on our testcases.
It helps us identify why it failed, and you are less likely to lose points if things were well documented.