luiz787

luiz787

The Problem-Based Benchmark Suite in Elixir

Hi! For the last few months, I worked in the implementation of the Problem-Based Benchmark Suite (PBBS) in Elixir, as part of my final CS BSc project. The PBBS is a set of problems designed to benchmark parallel implementations, and it is composed with problems such as sorting, ray tracing, remove duplicates, and word counting. One of the constraints is that the input data has to start on the same process, and the output has to end on that same process.

My goal is to compare parallel and sequential implementations of these problems in Elixir, and mostly analyze what kind of speedups are achievable in Elixir (comparing performance with other programming languages is a non-goal). I’ve implemented 8 of the 22 PBBS problems here: GitHub - lac-dcc/elixir-pbbs: Rewrite the Problem-Based Benchmark Suite in Elixir · GitHub

I’ve ran some experiments in an 40-core machine, and overall, results were mixed : for very cheap problems like removing duplicates from a list or histogram, speedups are very low, if at all (communication costs dominate). However, for more expensive problems like ray casting, where communication stops being the bottleneck, we can achieve pretty good speedups as we increase the level of parallelism.

The main strategies I used to implement the parallel algorithms was the use of Task.async, Task.async_stream, and in some cases, I found the use of :ets to be beneficial as a way to “broadcast” input to worker processes. Almost all of them are implemented in a divide-and-conquer manner: divide the problem to workers, each worker solves their part (but workers do not divide recursively to other workers), and merge the results at the end. This is the way that minimizes communication, but there might be better ways.

As a newcomer to the language and to the actor model - been programming in Elixir for only 8 months - I think that there’s probably a lot of room for improvement. So, I would like to ask for help on how to improve the the parallel implementations. Thanks in advance!

Most Liked

whatyouhide

whatyouhide

Elixir Core Team

Hey @luiz787, welcome and great work on the PBBS set!

I took a (very) quick look and one thing I can mention is GitHub - dashbitco/flow: Computational parallel flows on top of GenStage · GitHub, which should help with map-reduce type problems (by sharding the “reduce” part too when possible). I don’t know if you’re allowed to use external libraries :smile:

Where Next?

Popular in Questions Top

nobody
Hi! In PHP: $_SERVER[‘SERVER_ADDR’] - in Elixir? Searched the docs for ip address and the web, no good results. Thanks!
New
baxterw3b
Hi guys, i’m new in the Elixir world, and i have to say, that i love it! i’m having some problem to understand anonymous functions with ...
New
greenz1
I have a phoenix application from which a user can download multiple(5-6) files of size 1MB. I couldn’t find anything related to sending ...
New
marius95
Hello everyone, I try to use an Javascript Event Handler in my root.html.leex file. Therefore I created a function in the app.js file: ...
New
Patoshizzle
After calling mix ecto.create I get this error: 17:00:32.162 [error] GenServer #PID<0.412.0> terminating ** (Postgrex.Error) FATAL...
New
JorisKok
I have a server on AWS, and was running a load test using artillery. When looking at the Phoenix dashboard I see the Ports going to 100% ...
New
senggen
Erlang/OTP 25 [erts-13.2.2] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] 15:22:35.803 [error] gen_event {lager_file_backend...
New

Other popular topics Top

KronicDeth
Elixir plugin for JetBrain’s IntelliJ Platform (including Rubymine) This is a plugin that adds support for Elixir to JetBrains IntelliJ...
289 36689 110
New
jononomo
I am trying to figure out how Mix knows whether the environment is test, dev, or prod – where is this set? Thanks.
New
Qqwy
Original source of discussion: This topic on the Pragmatic Programmers’ Functional Web Development with Elixir, OTP, and Phoenix forum. ...
New
jononomo
For some reason my phoenix channels are working for me in my local dev environment, but as soon as I deploy via Docker, I get a 403 error...
New
Darmani72
If I have a post route which an argument: post /my_post_route/:my_param1, MyController.my_post_handler How would get the post params ...
New
romenigld
I am trying to run a deploy with docker and I successfully runned with this command: docker build -t romenigld/blog-prod . but when I t...
New

We're in Beta

About us Mission Statement