~piotr-machura/pad-programming

Problems from "Introduction to parallel and distributed programming" class
Add introduction in the README

refs

master
browse  log 

clone

read-only
https://git.sr.ht/~piotr-machura/pad-programming
read/write
git@git.sr.ht:~piotr-machura/pad-programming

You can also use your local clone with git send-email.

#Parallel & distributed programming

Problems from "Introduction to parallel and distributed programming" class, conducted by Maciej MrowiĊ„ski, PhD in the winter semester of 2022 at Faculty of Physics, Warsaw University of Technology.

Each problem is described in ./doc/problem*.md (in Polish) and solved in a separate workspace using various programming tools.

#Problem 1 & 2: Mandelbrot set generator

Workspace: ./mandelbrot/

Maven project that generates an image of the Mandelbrot set.

Compile and run with

mvn clean compile exec:java

Build a distributable JAR (including dependencies) with

mvn clean compile package

#Example

Mandelbrot set

The calcualtions have O(N^2) complexity, where N is the side length of the image. Different types of multithreading strategies are possible - visualized on the image below.

Plot of time vs width

The plot is generated using

python3 doc/mandelbrot.py # requires Pandas and pyplot

#Problem 3: parallel mergesort in Rust

Workspace: ./pms/

Rust implementation of a parallel mergesort algorithm.

Each merger for a given block size is done in parrallel using rayon.

A comparision with the Rust builitn [T]::sort() can be performed by running

cargo test --release

The results for Ryzen 4500U hexa-core processor are presented below.

Time plot

#Problem 4: RabbitMQ chat

Workspace: ./rabbit-chat/

Simple python chat program with absoultely ZERO security (impersonation is as easy as choosing someone's nick).

#Usage

Start the RabbitMQ server locally with docker compose up -d.

usage: rabbit-chat [-h] [-r ROOM] [--host HOST] NICK

Simple line-based chat client using RabbitMQ.

Connects to the server and starts a chat by reading/writing to the specified queue (or
"global" if unspecified).

positional arguments:
  NICK                  Nick used for indentification in chat

options:
  -h, --help            show this help message and exit
  -r ROOM, --room ROOM  Chatroom to join (default 'global')
  --host HOST           RabbitMQ host to connect to (default 'localhost')

Join a room and send some messages!

Example conversation

To exit, simpy Ctrl+C.

#Problem 5: Game of Life using CUDA

Workspace: conway_cuda.ipynb

The notebook can be run in Google Colab if a local Nvidia GPU is not available.