GithubHelp home page GithubHelp logo

forki / quad-ropes Goto Github PK

View Code? Open in Web Editor NEW

This project forked from popular-parallel-programming/quad-ropes

0.0 3.0 0.0 868 KB

Ropes meet quad trees on .Net

License: MIT License

Makefile 0.20% F# 95.61% Batchfile 2.34% Gnuplot 1.85%

quad-ropes's Introduction

Quad Ropes

A quad rope is a two-dimensional binary tree with small, contiguous arrays at its leafs. Quad ropes combine the ideas of a rope and quad trees.

Two-dimensional array-like data structures are often used in declarative array programming. The overall idea is to allow for constant-time concatenation while roughly retaining efficiency of standard immutable 2D-arrays. Fast concatenation is important for immutable arrays as it allows a more complex gradual construction than a simple unfold.

Another positive property of immutable trees is that they are inherently parallel. At each node, we can spawn new parallel tasks that are handled by the .Net Task-Parallel Library (TPL).

Runtime Complexity Overview

Operation Immutable 2D Array Quad Rope
Index O(1) O(log n)
Set O(n) O(log n)
Map O(n) O(n + m)
Reduce O(n) O(n + m)
Concat O(n) O(log n)

In benchmarks, quad ropes often have only little overhead compared to standard immutable 2D arrays. In more interesting algorithms, quad ropes are often faster. In particular, quad ropes can handle nested parallelism much better than nested for-loops over arrays without any additional tweaking of the TPL thread pool.

Parallel Operations

The majority of functions on quad ropes are available in a parallelized version. Currently, quad ropes use eager tree splitting. Recent research suggests that a more dynamic scheduling approach would be more appropriate.

Benchmarking

NB: To reproduce the results of the ARRAY'17 paper (take a look at the preprint), checkout this commit.

You can test the performance of this quad rope implementation on your own machine. First, compile in release mode.

On Windows:

> build --paket
> build --release

On Linux and Mac with Mono:

$ make paket
$ make release

Now, you can run the benchmarks. The results will be written into the logs folder.

On Windows:

> scripts\benchmark-all.bat

You wan run individual benchmarks without writing to a file:

> scripts\benchmark.bat --help

QuadRope 1.0.0.0
Copyright ©  2017

  -m, --mode       Required. Which benchmark to run.

  -s, --size       (Default: 100) Input size.

  -t, --threads    (Default: 1) Number of threads.

  --help           Display this help screen.

  --version        Display version information.

Available benchmarks:
align
all
fibs
index
mmult
primes
sieve
vdc

On Linux and Mac, run

$ scripts\benchmark --help

to get the same output.

Unit Tests

We use FsCheck for testing.

On Windows:

> debug.bat
> test.bat

On Linux and Mac:

$ make debug
$ make test

Contributions

Please contribute by opening an issue, using quad ropes in your projects or making a pull request.

Maintainers

This repository is maintained by Florian Biermann.

quad-ropes's People

Contributors

fbie avatar

Watchers

Steffen Forkmann avatar James Cloos 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.