Distributed Computing on Browserscrowdcomputing.eu/documents/10508/844563/Cushing.pdf · Jobs are...
Transcript of Distributed Computing on Browserscrowdcomputing.eu/documents/10508/844563/Cushing.pdf · Jobs are...
![Page 1: Distributed Computing on Browserscrowdcomputing.eu/documents/10508/844563/Cushing.pdf · Jobs are written in JavaScript (WebCL for future browsers) A job is encapsulated in a JavaScript](https://reader036.fdocuments.us/reader036/viewer/2022062607/60571043bb5c020027545dd3/html5/thumbnails/1.jpg)
Distributed Computing onBrowsers
Reggie CushingUniversity of Amsterdam
Crowd Computing25th September 2014
COMMIT/
![Page 2: Distributed Computing on Browserscrowdcomputing.eu/documents/10508/844563/Cushing.pdf · Jobs are written in JavaScript (WebCL for future browsers) A job is encapsulated in a JavaScript](https://reader036.fdocuments.us/reader036/viewer/2022062607/60571043bb5c020027545dd3/html5/thumbnails/2.jpg)
Browser As A Platform
Objectives - distributed computing using web browsers.
Motivation - The proliferation of web browsers and the performance gain being achieved by current JavaScript virtual machines raises the question whether Internet browsers can become yet another middleware for distributed computing.
Web browser is ubiquitous - Every smart device, being a computer or a mobile device, is, nowadays, equipped with an Internet browser. At the heart of every Internet browser is a JavaScript engine
Web Browser shapes our daily lives - by keeping us in contact with friends and collaborate with colleagues through social media such as Twitter and Facebook which have become a main stay in the way humans interact
![Page 3: Distributed Computing on Browserscrowdcomputing.eu/documents/10508/844563/Cushing.pdf · Jobs are written in JavaScript (WebCL for future browsers) A job is encapsulated in a JavaScript](https://reader036.fdocuments.us/reader036/viewer/2022062607/60571043bb5c020027545dd3/html5/thumbnails/3.jpg)
Browser Computing & Social MediaThe social aspect of the current Web is enough to achieve volunteer computing almost instantly.
How does it work: Social media mediates the trust
between the user and the volunteers asked to join the network.
– A user with a distributed application uses social media to get colleagues and friends to donate CPU
– Colleagues and friends join the network by simply opening the shared URL
– Computing can start instantly
![Page 4: Distributed Computing on Browserscrowdcomputing.eu/documents/10508/844563/Cushing.pdf · Jobs are written in JavaScript (WebCL for future browsers) A job is encapsulated in a JavaScript](https://reader036.fdocuments.us/reader036/viewer/2022062607/60571043bb5c020027545dd3/html5/thumbnails/4.jpg)
Browser Computing & Social Media
![Page 5: Distributed Computing on Browserscrowdcomputing.eu/documents/10508/844563/Cushing.pdf · Jobs are written in JavaScript (WebCL for future browsers) A job is encapsulated in a JavaScript](https://reader036.fdocuments.us/reader036/viewer/2022062607/60571043bb5c020027545dd3/html5/thumbnails/5.jpg)
JavaScript Performance - 1
JavaScript is not the bottleneck anymore (quite optimistic statement) -- The interactive nature of websites put a demand for faster JavaScript engines which lead to a JavaScript engine arms race between the main contenders namely; Google, Mozilla, Apple, and Microsoft.
Web Technologies achievements make JavaScript engines more powerful:
Web workers: threads of JavaScript communicating over message passing
web sockets: bi-directional communication channels
WebGL: JavaScript API for rendering 3D graphics.
WebCL: standard for Javascript binding to OpenCL
![Page 6: Distributed Computing on Browserscrowdcomputing.eu/documents/10508/844563/Cushing.pdf · Jobs are written in JavaScript (WebCL for future browsers) A job is encapsulated in a JavaScript](https://reader036.fdocuments.us/reader036/viewer/2022062607/60571043bb5c020027545dd3/html5/thumbnails/6.jpg)
JavaScript
● Linux Kernel in JS– http://bellard.org/jslinux/
● HTML 5– http://slides.html5rocks.com/#web-workers
● Getting the V8 JS engine– https://code.google.com/p/v8/wiki/UsingGit
● Building V8– https://code.google.com/p/v8/wiki/BuildingWithGYP
● Running console JS– ./shell hello.js
● Node.js– http://nodejs.org/
![Page 7: Distributed Computing on Browserscrowdcomputing.eu/documents/10508/844563/Cushing.pdf · Jobs are written in JavaScript (WebCL for future browsers) A job is encapsulated in a JavaScript](https://reader036.fdocuments.us/reader036/viewer/2022062607/60571043bb5c020027545dd3/html5/thumbnails/7.jpg)
JavaScript Performance - 2
Ratios of the execution times of known algorithms compiled and run with 4 versions of Chrome’s V8 JavaScript engine to the respective GNU C
execution times.
![Page 8: Distributed Computing on Browserscrowdcomputing.eu/documents/10508/844563/Cushing.pdf · Jobs are written in JavaScript (WebCL for future browsers) A job is encapsulated in a JavaScript](https://reader036.fdocuments.us/reader036/viewer/2022062607/60571043bb5c020027545dd3/html5/thumbnails/8.jpg)
JavaScript Performance - 3
● Notable performance gains in different versions of Google's V8 JavaScript Engine:– Highly optimized Regex engine (Irregexp)
http://blog.chromium.org/2009/02/irregexp-google-chromes-new-regexp.html
– Crankshaft optimization: ArrayBuffer and Float64Array contribute to SpectralNorm perf gain
![Page 9: Distributed Computing on Browserscrowdcomputing.eu/documents/10508/844563/Cushing.pdf · Jobs are written in JavaScript (WebCL for future browsers) A job is encapsulated in a JavaScript](https://reader036.fdocuments.us/reader036/viewer/2022062607/60571043bb5c020027545dd3/html5/thumbnails/9.jpg)
WebCL
● WebCL is an API for OpenCL to compute directly on the GPU from within the browser.
● Follows WebGL for rendering on the GPU.● Currently not part of browsers but work is
being done: https://www.khronos.org/bugzilla/show_bug.cgi?id=792
![Page 10: Distributed Computing on Browserscrowdcomputing.eu/documents/10508/844563/Cushing.pdf · Jobs are written in JavaScript (WebCL for future browsers) A job is encapsulated in a JavaScript](https://reader036.fdocuments.us/reader036/viewer/2022062607/60571043bb5c020027545dd3/html5/thumbnails/10.jpg)
Applicability to Science
● Many scientific applications are highly parallelizable. ● Data can be decomposed into atomic records. ● The data partitioning defines the concurrency in the application.● Grids/Clusters/Clouds high performance but very tedious.● Nothing stops Browsers adding resources to traditional resources.● Applications that fit a browser scenario are called malleable applications:-
Given a dataset a malleable task can compute on any subset of the dataset
● Malleable applications:-– Monte Carlo Simulations
– Parametric studies
– Indexing
![Page 11: Distributed Computing on Browserscrowdcomputing.eu/documents/10508/844563/Cushing.pdf · Jobs are written in JavaScript (WebCL for future browsers) A job is encapsulated in a JavaScript](https://reader036.fdocuments.us/reader036/viewer/2022062607/60571043bb5c020027545dd3/html5/thumbnails/11.jpg)
WeevilScout Platfrom - 1
The server side is composed of a REST service which creates the list of jobs to be executed while a website handles user interactivity.
Jobs are stored in a runqueue on a database. Server generates multiple jobs for multiple input parameters (cross-product).
Web browsers that load the website pull packaged jobs and send back job outputs to the REST service which in turn stores the results.
![Page 12: Distributed Computing on Browserscrowdcomputing.eu/documents/10508/844563/Cushing.pdf · Jobs are written in JavaScript (WebCL for future browsers) A job is encapsulated in a JavaScript](https://reader036.fdocuments.us/reader036/viewer/2022062607/60571043bb5c020027545dd3/html5/thumbnails/12.jpg)
WeevilScout Platfrom - 2
![Page 13: Distributed Computing on Browserscrowdcomputing.eu/documents/10508/844563/Cushing.pdf · Jobs are written in JavaScript (WebCL for future browsers) A job is encapsulated in a JavaScript](https://reader036.fdocuments.us/reader036/viewer/2022062607/60571043bb5c020027545dd3/html5/thumbnails/13.jpg)
Weevil Jobs - 1
● Jobs are written in JavaScript (WebCL for future browsers)
● A job is encapsulated in a JavaScript funtion called weevil_main() (like C main()). The browser will invoke weevil_main() with the parameters.
● Invocation in a browser is done through message passing since WebWorkers are sandboxed (for security).
![Page 14: Distributed Computing on Browserscrowdcomputing.eu/documents/10508/844563/Cushing.pdf · Jobs are written in JavaScript (WebCL for future browsers) A job is encapsulated in a JavaScript](https://reader036.fdocuments.us/reader036/viewer/2022062607/60571043bb5c020027545dd3/html5/thumbnails/14.jpg)
Weevil Jobs - 2
Listing 1: A simple JavaScript matrix Multiplication function.
![Page 15: Distributed Computing on Browserscrowdcomputing.eu/documents/10508/844563/Cushing.pdf · Jobs are written in JavaScript (WebCL for future browsers) A job is encapsulated in a JavaScript](https://reader036.fdocuments.us/reader036/viewer/2022062607/60571043bb5c020027545dd3/html5/thumbnails/15.jpg)
Weevil Jobs - 3
![Page 16: Distributed Computing on Browserscrowdcomputing.eu/documents/10508/844563/Cushing.pdf · Jobs are written in JavaScript (WebCL for future browsers) A job is encapsulated in a JavaScript](https://reader036.fdocuments.us/reader036/viewer/2022062607/60571043bb5c020027545dd3/html5/thumbnails/16.jpg)
Some Results - 1
As an example that proves Internet browsers are quite capable of distributed computing, we present a typical scientific study from bio-informatics domain.
This study performs protein sequence alignments using the Needleman-Wunsch algorithm implemented in JavaScript (http://opal.przyjaznycms.pl).
Sequence alignment is a common method employed in bioinformatics as a way to order sequences of proteins and DNA to identify areas of similarity that could be attributed to some relationship between the sequences.
The data for the alignments was obtained from the UniProtKB http://www.uniprot.org/
The experiment was set to perform 33,000 alignments
![Page 17: Distributed Computing on Browserscrowdcomputing.eu/documents/10508/844563/Cushing.pdf · Jobs are written in JavaScript (WebCL for future browsers) A job is encapsulated in a JavaScript](https://reader036.fdocuments.us/reader036/viewer/2022062607/60571043bb5c020027545dd3/html5/thumbnails/17.jpg)
Some Results - 2
![Page 18: Distributed Computing on Browserscrowdcomputing.eu/documents/10508/844563/Cushing.pdf · Jobs are written in JavaScript (WebCL for future browsers) A job is encapsulated in a JavaScript](https://reader036.fdocuments.us/reader036/viewer/2022062607/60571043bb5c020027545dd3/html5/thumbnails/18.jpg)
Some Results - 3
0.4
0.6
0.8
1
1.2
1.4
00:00 01:00 02:00 03:00 04:00 05:000.0e+00
5.0e+03
1.0e+04
1.5e+04
2.0e+04
2.5e+04
3.0e+04
3.5e+04
4.0e+04
Estim
ated
GFL
OPS
Com
plet
ed T
asks
Time HH:MM
TasksAggregated Power (GFLOPS)
![Page 19: Distributed Computing on Browserscrowdcomputing.eu/documents/10508/844563/Cushing.pdf · Jobs are written in JavaScript (WebCL for future browsers) A job is encapsulated in a JavaScript](https://reader036.fdocuments.us/reader036/viewer/2022062607/60571043bb5c020027545dd3/html5/thumbnails/19.jpg)
Work Done But Not Online
Workflows in Browsers
![Page 20: Distributed Computing on Browserscrowdcomputing.eu/documents/10508/844563/Cushing.pdf · Jobs are written in JavaScript (WebCL for future browsers) A job is encapsulated in a JavaScript](https://reader036.fdocuments.us/reader036/viewer/2022062607/60571043bb5c020027545dd3/html5/thumbnails/20.jpg)
Workflows in Browsers
Executing a large number of independent of jobs is not meaningful
It is better if jobs can communicate their result in a structured way (coordination)
A workflow structure is a graph-based structure composed of a set of ‘value’ and ‘job’ nodes
![Page 21: Distributed Computing on Browserscrowdcomputing.eu/documents/10508/844563/Cushing.pdf · Jobs are written in JavaScript (WebCL for future browsers) A job is encapsulated in a JavaScript](https://reader036.fdocuments.us/reader036/viewer/2022062607/60571043bb5c020027545dd3/html5/thumbnails/21.jpg)
Parsing
![Page 22: Distributed Computing on Browserscrowdcomputing.eu/documents/10508/844563/Cushing.pdf · Jobs are written in JavaScript (WebCL for future browsers) A job is encapsulated in a JavaScript](https://reader036.fdocuments.us/reader036/viewer/2022062607/60571043bb5c020027545dd3/html5/thumbnails/22.jpg)
Scheduling Step - 1
![Page 23: Distributed Computing on Browserscrowdcomputing.eu/documents/10508/844563/Cushing.pdf · Jobs are written in JavaScript (WebCL for future browsers) A job is encapsulated in a JavaScript](https://reader036.fdocuments.us/reader036/viewer/2022062607/60571043bb5c020027545dd3/html5/thumbnails/23.jpg)
Scheduling Step - 2
![Page 24: Distributed Computing on Browserscrowdcomputing.eu/documents/10508/844563/Cushing.pdf · Jobs are written in JavaScript (WebCL for future browsers) A job is encapsulated in a JavaScript](https://reader036.fdocuments.us/reader036/viewer/2022062607/60571043bb5c020027545dd3/html5/thumbnails/24.jpg)
Scheduling Step - 3
![Page 25: Distributed Computing on Browserscrowdcomputing.eu/documents/10508/844563/Cushing.pdf · Jobs are written in JavaScript (WebCL for future browsers) A job is encapsulated in a JavaScript](https://reader036.fdocuments.us/reader036/viewer/2022062607/60571043bb5c020027545dd3/html5/thumbnails/25.jpg)
Scheduling Step - 4
![Page 26: Distributed Computing on Browserscrowdcomputing.eu/documents/10508/844563/Cushing.pdf · Jobs are written in JavaScript (WebCL for future browsers) A job is encapsulated in a JavaScript](https://reader036.fdocuments.us/reader036/viewer/2022062607/60571043bb5c020027545dd3/html5/thumbnails/26.jpg)
Scheduling Step - 5
![Page 27: Distributed Computing on Browserscrowdcomputing.eu/documents/10508/844563/Cushing.pdf · Jobs are written in JavaScript (WebCL for future browsers) A job is encapsulated in a JavaScript](https://reader036.fdocuments.us/reader036/viewer/2022062607/60571043bb5c020027545dd3/html5/thumbnails/27.jpg)
Scheduling Step - 6
![Page 28: Distributed Computing on Browserscrowdcomputing.eu/documents/10508/844563/Cushing.pdf · Jobs are written in JavaScript (WebCL for future browsers) A job is encapsulated in a JavaScript](https://reader036.fdocuments.us/reader036/viewer/2022062607/60571043bb5c020027545dd3/html5/thumbnails/28.jpg)
Scheduling Step - 7
![Page 29: Distributed Computing on Browserscrowdcomputing.eu/documents/10508/844563/Cushing.pdf · Jobs are written in JavaScript (WebCL for future browsers) A job is encapsulated in a JavaScript](https://reader036.fdocuments.us/reader036/viewer/2022062607/60571043bb5c020027545dd3/html5/thumbnails/29.jpg)
Scheduling Step - 8
![Page 30: Distributed Computing on Browserscrowdcomputing.eu/documents/10508/844563/Cushing.pdf · Jobs are written in JavaScript (WebCL for future browsers) A job is encapsulated in a JavaScript](https://reader036.fdocuments.us/reader036/viewer/2022062607/60571043bb5c020027545dd3/html5/thumbnails/30.jpg)
Scheduling Step - 9
![Page 31: Distributed Computing on Browserscrowdcomputing.eu/documents/10508/844563/Cushing.pdf · Jobs are written in JavaScript (WebCL for future browsers) A job is encapsulated in a JavaScript](https://reader036.fdocuments.us/reader036/viewer/2022062607/60571043bb5c020027545dd3/html5/thumbnails/31.jpg)
Scheduling Step - 10
![Page 32: Distributed Computing on Browserscrowdcomputing.eu/documents/10508/844563/Cushing.pdf · Jobs are written in JavaScript (WebCL for future browsers) A job is encapsulated in a JavaScript](https://reader036.fdocuments.us/reader036/viewer/2022062607/60571043bb5c020027545dd3/html5/thumbnails/32.jpg)
Scheduling Step - 11
![Page 33: Distributed Computing on Browserscrowdcomputing.eu/documents/10508/844563/Cushing.pdf · Jobs are written in JavaScript (WebCL for future browsers) A job is encapsulated in a JavaScript](https://reader036.fdocuments.us/reader036/viewer/2022062607/60571043bb5c020027545dd3/html5/thumbnails/33.jpg)
Scheduling Step - 12
![Page 34: Distributed Computing on Browserscrowdcomputing.eu/documents/10508/844563/Cushing.pdf · Jobs are written in JavaScript (WebCL for future browsers) A job is encapsulated in a JavaScript](https://reader036.fdocuments.us/reader036/viewer/2022062607/60571043bb5c020027545dd3/html5/thumbnails/34.jpg)
Url
goo.gl/RD1LtT
![Page 35: Distributed Computing on Browserscrowdcomputing.eu/documents/10508/844563/Cushing.pdf · Jobs are written in JavaScript (WebCL for future browsers) A job is encapsulated in a JavaScript](https://reader036.fdocuments.us/reader036/viewer/2022062607/60571043bb5c020027545dd3/html5/thumbnails/35.jpg)
WeevilScout UI
![Page 36: Distributed Computing on Browserscrowdcomputing.eu/documents/10508/844563/Cushing.pdf · Jobs are written in JavaScript (WebCL for future browsers) A job is encapsulated in a JavaScript](https://reader036.fdocuments.us/reader036/viewer/2022062607/60571043bb5c020027545dd3/html5/thumbnails/36.jpg)
WeevilScout UI - 2
![Page 37: Distributed Computing on Browserscrowdcomputing.eu/documents/10508/844563/Cushing.pdf · Jobs are written in JavaScript (WebCL for future browsers) A job is encapsulated in a JavaScript](https://reader036.fdocuments.us/reader036/viewer/2022062607/60571043bb5c020027545dd3/html5/thumbnails/37.jpg)
WeevilScout UI - 3
![Page 38: Distributed Computing on Browserscrowdcomputing.eu/documents/10508/844563/Cushing.pdf · Jobs are written in JavaScript (WebCL for future browsers) A job is encapsulated in a JavaScript](https://reader036.fdocuments.us/reader036/viewer/2022062607/60571043bb5c020027545dd3/html5/thumbnails/38.jpg)
What Next?
● Extension to “traditional” resources– Cloud, Desktop....