Giter Site home page Giter Site logo

okaemii / totient-range-parallel Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 25 KB

A reliable implementation of the totient range function in Erlang. This is a parallel and distributed implementation.

License: MIT License

Erlang 100.00%
erlang totient totient-range functional-programming reliable distributed-computing

totient-range-parallel's Introduction

A Reliable Totient Range Function in Parallel

A reliable implementation of the totient range function in Erlang. This is a parallel and distributed implementation. A server process is spawned, which watches over its worker processes that it will spawn NWorker number of (specified by the user). Its worker: totientWorker process will compute a section of the totient range, all workers will be accumulated in the server during the final step.

This program simulates an environment where any of its important processes may be killed at anytime (a Chaos Monkey). As such, a reliable implementation will restart them, and proceed as normal.

Totient Function

In number theory, Euler's totient function counts the positive integers up to a given integer n that are relatively prime to n. It is written using the Greek letter phi as ฯ• or ฯ†, and may also be called Euler's phi function.

Expected Output

> totientrange:testRobust(4, 3).
Watching ClientWorker worker1
Watching ClientWorker worker2
Watching ClientWorker worker3
Watching ClientWorker worker4
Worker : Computing Range 1 3750
Worker : Computing Range 3751 7500
Worker : Computing Range 7501 11250
Worker : Computing Range 11251 15000
workerChaos killing worker4
workerChaos killing worker1
workerChaos killing worker4 [ true , true , true ]
Worker : Finished
Server : Received Sum 4275174
Worker : Finished
Server : Received Sum 12824238
Worker : Finished
Server : Received Sum 21371600
Worker : Finished
Server : Received Sum 29923304
Server : Sum of totients : 68394316
Server : Time taken in Secs , MicroSecs 13 302830

Manual

compile from the shell: >c(totientrange).

NWorkers number of workers
ATotient beginning integer for totient range
BTotient ending integer for totient range
run from the shell: `>server ! {range, ATotient, BTotient, NWorkers}.

totient-range-parallel's People

Contributors

okaemii avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.