Parallelization of ‘Sieve of Eratosthenes’ Algorithm

Slides:



Advertisements
Similar presentations
Slides for Parallel Programming Techniques & Applications Using Networked Workstations & Parallel Computers 2nd ed., by B. Wilkinson & M
Advertisements

Copyright © Cengage Learning. All rights reserved.
Chapter 5 Number Theory © 2008 Pearson Addison-Wesley. All rights reserved.
PrasadPrimes1 VEDIC MATHEMATICS : Primes T. K. Prasad
Prime and Composite Numbers.
Number Theory GONE WILD!
Mathematician, Geographer, Astronomer 276 BC- 194 BC
COMPE575 Parallel & Cluster Computing 5.1 Pipelined Computations Chapter 5.
Energy Model for Multiprocess Applications Texas Tech University.
6 th Grade, HEKASI Mr. Ichigo Korosaki February 14, 2012.
Generating RSA Primes Jim Townsend CSE633 Final Results Fall 2010.
BIRKDALE HIGH SCHOOL MATHEMATICS DEPARTMENT
Prime Numbers and Prime Factorization. Factors Factors are the numbers you multiply together to get a product. For example, the product 24 has several.
Sieve of Eratosthenes.
SECTION 5-1 Prime and Composite Numbers Slide
Primes and Tests for Divisibility Chapter 5 Section 1 By: Tiffany Fey.
Why are Prime Numbers called prime & Sieve of Eratosthenes Group Members – Umang Chandra Sneh Lata Gupta Shivam Rastogi Rohan Chaudhary Vivek Chaudhary.
Sieve of Eratosthenes By Tamika Allen, Frank Koegel, and Kathleen Sylla NSF Pedagogy Conference 2008 April 19, 2008.
Prime numbers Jordi Cortadella Department of Computer Science.
Prime Numbers Eratosthenes’(ehr-uh-TAHS-thuh-neez) Sieve
Prime Numbers With Mrs Ford. Eratosthenes (ehr-uh-TAHS-thuh-neez) Eratosthenes was the librarian at Alexandria, Egypt in 200 B.C. Note every book was.
Our Lesson: Review of factors Confidential.
An ancient method for finding the prime numbers.  Eratosthenes was a Greek mathematician from Cyrene (modern day Libya!). He was born in 276 BC, and.
By: Marlene Reyna and Guadalupe Esquivel
Sieve of Eratosthenes. The Sieve of Eratosthenes is a method that.
April 26, CSE8380 Parallel and Distributed Processing Presentation Hong Yue Department of Computer Science & Engineering Southern Methodist University.
Parallel Processing Sharing the load. Inside a Processor Chip in Package Circuits Primarily Crystalline Silicon 1 mm – 25 mm on a side 100 million to.
Scaling Area Under a Curve. Why do parallelism? Speedup – solve a problem faster. Accuracy – solve a problem better. Scaling – solve a bigger problem.
Chun-Yuan Lin OpenMP-Programming training-5. “Type 2” Pipeline Space-Time Diagram.
Math Module 3 Multi-Digit Multiplication and Division
UNIT-I INTRODUCTION ANALYSIS AND DESIGN OF ALGORITHMS CHAPTER 1:
Is this you (or someone you know) ?. GROUP NORMS AND HOUSEKEEPING Logistics: Phone Calls Rest Rooms Breaks Lunch Punctuality Sharing Group Norms: Participate.
Scaling Conway’s Game of Life. Why do parallelism? Speedup – solve a problem faster. Accuracy – solve a problem better. Scaling – solve a bigger problem.
Prime and Composite Numbers Factors What is a prime number? Is this number prime?
1a.1 Parallel Computing and Parallel Computers ITCS 4/5145 Cluster Computing, UNC-Charlotte, B. Wilkinson, 2006.
Math Question: 1.What is a prime number? 2.What is a method to determine whether or not a number is a prime number?
A prime number is a whole number which only has two factors: one and itself. A prime number is a whole number which only has two factors: one and itself.
Parallel Computing and Parallel Computers
PowerPointmaths.com © 2004 all rights reserved
Halting Problem Dr K R Bond 2009
Prime Numbers Eratosthenes’ Sieve
Prime Numbers Eratosthenes’ Sieve
Factors and Multiples.
WELCOME TO MATHEMATICS WORKSHOP
Prime Numbers Eratosthenes’ Sieve
Prime Numbers Eratosthenes’ Sieve
Prime Numbers Eratosthenes’ Sieve
Prime Numbers Eratosthenes’ Sieve
Using The Sieve of Eratosthenes
Introduction to Parallelism.
Unsolvable Problems December 4, 2017.
Prime Numbers Eratosthenes’ Sieve
MODIFIED SIEVE OF ERATOSTHENES
Parallel Computers.
Prime Numbers Eratosthenes’ Sieve
Prime Numbers Eratosthenes’ Sieve
Parallel Processing Sharing the load.
Prime Numbers Eratosthenes’ Sieve
Prime Numbers Eratosthenes’ Sieve
Prime Numbers Eratosthenes’ Sieve
Parallel Computing Demand for High Performance
Parallel Computing Demand for High Performance
PERFORMANCE MEASURES. COMPUTATIONAL MODELS Equal Duration Model:  It is assumed that a given task can be divided into n equal subtasks, each of which.
Parallel Computing and Parallel Computers
Prime Numbers Eratosthenes’ Sieve
Prime Numbers Eratosthenes’ Sieve
Presentation transcript:

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. 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  2 57,885,161  −1, a number with 17,425,170 digits.

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.

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,

Who Can Help Us?!

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

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.

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.

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.

Hundreds Chart 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100

1- Cross out 1 ; it is not a prime 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100

2- Leave 2 ; cross out its multiples 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100

Repeat this for all the rest of the list 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100

Enjoy your new bunch of Primes! 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100

Pseudo - Code

But it has one little weakness…

The Computing time rapidly increase with the size of the list

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.

The Results

Running time

Speedup

Efficiency

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.