Code Monkey home page Code Monkey logo

chotpeval's Introduction

chotpeval

Cloud Haskell / OTP evaluation

This program uses Cloud Haskell to dispatch jobs to nodes on the network and collect the result.

The nodes are connected in a ring structure. Every node has one neighbour it can communicate with. This leads to n network connections with n nodes.

A message is passed from one node to another, until it reaches the originator again. On message receipt every node does its job and attaches a new message to the incoming messages, then sends these to its next node. Therefore, a package contains at most n messages when received and resent in a ring with n nodes.

Running

./bin/chotpeval worker -p 10010 &
./bin/chotpeval worker -p 10011 &
./bin/chotpeval worker -p 10012 &
./bin/chotpeval controller --send-for=10 --wait-for=5 --with-seed=77

On my dated laptop this has a throughput of about 8000 messages per second.

Stack

  • stack build; stack install
  • stack haddock
  • stack test

Verification

in GHCi the distributed computation can be verified:

stack ghci
ghci> setStdGen $ mkStdGen <rng seed>
ghci> sumprod <lastindex>

Liquid Haskell

Using LiquidHaskell types in Haskell can be restrained further and the propositions automatically checked with a SMT solver (e.g. z3).

for the random number generator, its output is restricted to be in the interval (0,1] (not including zero)

  stack exec liquid -- --notermination src/HCOTP/Computation/Random.hs 

in the controller we validate that at least two nodes are present when running the network

  stack exec liquid -- --notermination src/HCOTP/Network/Controller.hs 

chotpeval's People

Contributors

codiepp avatar

Stargazers

 avatar

Watchers

 avatar  avatar  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.