Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/anicolaspp/sieves
GO implementation of parallel sieves of Eratosthenes
https://github.com/anicolaspp/sieves
distributed-computing golang parallel sieve-of-eratosthenes-prime-numbers
Last synced: 2 days ago
JSON representation
GO implementation of parallel sieves of Eratosthenes
- Host: GitHub
- URL: https://github.com/anicolaspp/sieves
- Owner: anicolaspp
- Created: 2020-09-08T18:28:18.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-09-09T13:53:07.000Z (over 4 years ago)
- Last Synced: 2023-03-01T20:26:00.505Z (almost 2 years ago)
- Topics: distributed-computing, golang, parallel, sieve-of-eratosthenes-prime-numbers
- Language: Go
- Homepage:
- Size: 12.7 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# sieves
GO implementation of parallel sieves of Eratosthenes.This implementation uses a master / slave approach instead of using `pipelining`. The `pipelining` implementation is more simpler, but there is no control on the number of workers and there is no notion of distribution.
On the other hand, the master / slave approach, initializes a number of workers where each of them contains a subset of the dataset. This allows for natural distribution where the problem size is partitioned into smaller chucks.
Channels are used for communication between the master and the slaves. The master tasks is to send values to each worker (slave) so these values are used to filter the worker partition. Then, each worker sends the smaller value in the partition after filtering. The master receives all these local min values and calculates a global min which in turns is used again to filter in the workers.
When there is no more work, the master receives each partition and forms the final solution, the calculated prime numbers.
check the C implementation here https://github.com/anicolaspp/Sieve-of-Eratosthenes