Assignment 5 Due 05/4/2016
1. Modify the Sieve of Eratosthenes code on the website to
incorporate the first two improvements:
a) Don't evaluate even numbers (we know they aren't
primes.) If the even numbers are not even
considered as part of the values to be checked,
the code will be able to reach larger numbers.
b) Each process should first locate all primes between
3 and sqrt(n). It then does the sieve on
its part of the overall array.
Time the original code by including the MPI function, MPI_Wtime()
and compare the time to your "improved code". You need to search
through a large number of elements to see a difference in timing.
2. (extra credit) Change the sieve code so that it prints out the
prime numbers rather than the count of prime numbers. This will
of course involve the marked[] array.