A collection of projects demonstrating distributed computing techniques in Python — from simple single-machine multiprocessing to browser-based WebAssembly workers.
| Project | Description |
|---|---|
| 0-local_primes_single_process | Baseline: single-threaded prime search |
| 1-local_primes_multi_process | Multi-core prime search on one machine |
| 2-net_primes_multi_process | Distributed prime search across multiple machines |
| 3-net_mandelbrot | Distributed Mandelbrot rendering over network |
| 4-web_primes | Browser-based distributed computing (primes via Pyodide) |
| 5-web_mandelbrot | Browser-based distributed Mandelbrot rendering |
Before using these projects, you'll need to configure a few values:
Edit the worker.py file in each project and replace the placeholders:
# In worker.py
master_ip_vpn = '<YOUR_MASTER_IP>' # ← Your master machine's IP address
port = 50000 # ← Default port (change if needed)
authkey = b'your_secret_password' # ← Shared secret (must match master)Finding your IP address:
# Linux/macOS
ip addr show # or hostname -I
# Windows
ipconfigThe default ports are:
4-web_primes: Port55545-web_mandelbrot: Port5555
To change, edit the app.run() call at the bottom of each server.py:
app.run(host='0.0.0.0', port=YOUR_PORT, debug=True, threaded=True)- Clone the repo
- Configure values as described above
- Install dependencies:
pip install -r requirements.txt(in relevant project folder) - Run the project — see each project's README for specific instructions
MIT