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

rms.mrcs
Hi, I need to transform a list of numbers into a map where the keys are the indexes and the values are the original values of the list. ...
New
electic
Hi, I am new to Elixir. I am trying to use the DateTime component to insert a date into MySQL however the there seems to be no way to fo...
New
dokuzbir
I want to highlight html closing tags when i click a html tag. That works in .html files but doesnt work for html.eex templates. How can...
New
sergio_101
I am VERY much an elixir newbie. I have taken one elixir course and one phoenix course on Udemy. During that course, I saw the instructor...
New
komlanvi
Hi everyone, I was playing with phoenix liveView but I run into an issue. I have a form and want to validate each input text when the te...
New
aalberti333
As the title describes, I’m trying to run Enum.map() over a list of key/value pairs, where the value is a map. My data looks like this: ...
New
svb
Hi! Currently I want to submit a form by pressing the Enter key. However, since my input field is of type “textarea” this is just adds a...
New

Other popular topics Top

ashish173
I am using Ecto timestamps with postgres, I can see the timestamps() use the :naive_dateime but for my use case I wanted to store the ti...
New
dogweather
I wrote this comment on r/haskell, and it’s not popular there. :wink: But I think I’m on to something… Haskell reminds me of Java, and e...
New
sergio_101
I am VERY much an elixir newbie. I have taken one elixir course and one phoenix course on Udemy. During that course, I saw the instructor...
New
saif
Hello everyone, Long time lurker first time poster here. I’ve recently begun working on Elixir full-time again! :raised_hands: It’s been...
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
jason.o
In the code below, if the create action is not set to accept “extra_key” as an input, it errors out with a message shown above. Is there ...
New

We're in Beta

About us Mission Statement