JsDist - Distributing scientific computing tasks with javascript

Jump to schema image | Read the paper (Slovak only, but there are pictures) 6/2013 | Try demo computation

Smart execution

multi-threading, saving partials on leave, Round-robin scheduling

No damage to UX

estimates current, maximal CPU load and adjusts computation

Flexible & secure.

Your DOM is not exposed

Sandboxed environment

harmful code is disabled, loopy code is promptly killed.

For scientists - very simple api

Protected against malicious code hijacking

What?

Consumer CPUs are underutilized - CPU cycles are wasted, but users don't want to install anything new. JsDist can seamlessly utilize virtually petaflops of power by bringing computation into web browser.

Execution can be initiated by simply including one javascript file into websites (just like ads). While visitor is browsing your page, his unused CPU power helps solve scientific problems. It's a supercomputer with browsers being nodes.



How it's done (javascript tricks)

Maximizing performance

By running various amounts of parallel webworkers we can estimate amount of cores (threads) user's CPU provides.

Not creating sluggish experience

By benchmarking the CPU and extrapolating result. After that, current user's cpu load is periodically reevaluated - shrinking our CPU demand (on top of OS/browser scheduler) when user needs the power most.

Not loosing work done

In era of single-paged ajax-powered websites, users often spends a lot of time without leaving page.

Using localStorage we freeze and save unfinished computation just before user leaves page distributing our system. We continue whenever user visits any other website distributing our project (localStorage access is linked to JsDist domain). Combined with optimal task granularity, this ensures minimal CPU power waste.

Security

All non-essential javascript is executed in iframe and isolated from your DOM. Scientific (3rd party, possibly untrusted) code is executed inside webworker in special design - disabling taking over control of program flow and scheduler.

Speed?

Current optimization (pre-compiled, V8) allows javascript to be closer to ferrari than to a bicycle.
How fast is the distributed code executed depends on our scheduler (amount of function calls). If the scheduler can't response to a security challenge (evidence of tampering), respective webworker is terminated from execution verification kernel.

JsDist also creates gobal localStorage locks to prevent execution of multiple instances.

API

Scientists can use global variables, multiple functions, but they don't have access to secured storage or possibly harmful functions (such as alert)

Verification

Same as any computing on untrusted devices, results need to be verified. You can merge tasks and verify them inside the network, allowing very low failure probabilities while minimizing the overhead.

More?

Checkout Github repository, read the paper or send an e-mail