1 / 23

Parallelization of ‘Sieve of Eratosthenes ’ Algorithm

Parallelization of ‘Sieve of Eratosthenes ’ Algorithm. Presented by: Vladimir Aerov Yoed Ginzburg. Background. A prime number (or a prime) is a natural number greater than 1 that has no positive divisors other than 1 and itself.

maia
Télécharger la présentation

Parallelization of ‘Sieve of Eratosthenes ’ Algorithm

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Parallelization of ‘Sieve of Eratosthenes’ Algorithm Presented by: Vladimir Aerov YoedGinzburg

  2. Background • A prime number (or a prime) is a natural number greater than 1 that has no positive divisors other than 1 and itself. • Prime numbers have a central role in number theory: any integer greater than 1 can be expressed as a product of primes that is unique(Also knows as Elucid’s theorem). • As of October 2013, the largest known prime number is  −1, a number with 17,425,170 digits.

  3. Applications • One of the most important use of prime deals with encryption. For example, when an email is sent it is often encrypted and then decrypted upon receipt- usually with a function that has a connection to primes. • Naturally, the bigger the prime number used, the harder and longer the decryption process takes. • Another use is in finance, where banks use prime numbers to collect the reminders from different transactions.

  4. Motivation • It has been proven that there are an infinite number of primes, making their future use promising and everlasting. • Finding a new prime number is a difficult process that cannot be done by hand. A super computer is needed because a potential number is divided by every number smaller than it to see if it is in fact prime. This can take days, months, or even years. • Therefore, a fast and efficient method for checking whether a number is prime us needed,

  5. Who Can Help Us?!

  6. Eratosthenes(ehr-uh-TAHS-thuh-neez) Eratosthenes was the librarian at Alexandria, Egypt in 200 B.C. Also, he was good at mathematics.

  7. Eratosthenes(ehr-uh-TAHS-thuh-neez) • Eratosthenes was a Greek mathematician, astronomer, and geographer. • He invented a method for finding prime numbers that is still used today as a standing ground for many advanced algorithms. • This method is called Sieve of Eratosthenes.

  8. Eratosthenes’ Sieve • A sieve has holes in it and is used to filter out the liquid. • Eratosthenes’s sieve works the same way, only with prime numbers.

  9. The Sieve of Eratosthenes • While sieve of Eratosthenes is simple to grasp and somewhat intuitive, it’s a strong algorithm that not only can decide if a number is prime, but find all the primes between it’s limit.

  10. Hundreds Chart

  11. 1- Cross out 1 ; it is not a prime

  12. 2- Leave 2 ; cross out its multiples

  13. Repeat this for all the rest of the list

  14. Enjoy your new bunch of Primes!

  15. Pseudo - Code

  16. But it has one little weakness…

  17. The Computing time rapidly increase with the size of the list

  18. Parallelizing the Algorithm • Since there is no correlation between primes, we can simply divide the list equally between the processes, which make Sieve of Eratosthenes an embarrassingly parallel algorithm. • The algorithm need to be repeated only for the first elements! • Simply use Open MP on a serial implantation! • The Algorithm bottle neck is off course the last check of the whole list in order to determinate the prime numbers.

  19. The Results

  20. Running time

  21. Speedup

  22. Efficiency

  23. Conclusion • Parallelizing Sieve of Eratosthenes proved to be extremely useful, and sticking to Amdahl's law up until the processor limit of the hobbit system. • Taking the test into up to 6,000,000 showed even better result: 18 seconds as a serial process and only 2.3 at 8 processors. • Checking for bigger natural proved to by problematic as the serial program took minutes to run.

More Related