CodingTrain / CodingTrain/Suggestion-Box

Demonstrating parallel computing on a dual core chomebook with javascript

Open
#1,219 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
No language data
Stars
570
Forks
85
PR merge metrics
No merged PRs in 30d

Description

It would be really cool to have a simple p5.js-based activity that demonstrates how to accelerate a computation with parallelism even if the only parallelism you have is a dual core chromebook.

There are a couple different javascript libraries that people use to do parallel computing. These are parallel.js, threads.js, hamsters.js and parallel.es

These libraries are compared in this pdf
https://raw.githubusercontent.com/MichaReiser/parallel-es-report/master/parallel-es.pdf

I have built a lot of content in p5.js but it is hard for me to tell which of these libraries would play the nicest with p5.js or if there are things about p5.js that would prevent something like this.

Sometimes students ask us about doing parallel computations, but we typically can't help them because it requires a linux account, linux familiarity and MPI or OpenMP. It would make life much easier for a lot of educators to have a demo that works even on dual core chromebooks.

For example here is a demo that should work:
https://www.hamsters.io/examples/squareroot

It would be nice to see something like this in p5.js. The code for the example above is not particularly readable by novice coders. It's the kind of thing p5.js was invented to simplify.

I am told that this may be harder than it sounds because when you only have two cores, sometimes it is difficult to get a good speedup even if it is an embarassingly parallel operation. One of the cores has to be both captain and do computations, so the speedup from 1 to 2 is not always that great. Getting something simple like this to work even on a chromebook would be a feat worthy of the coding train.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.