Abstract
This paper considers how to use program shaping and algorithmic skeletons to parallelise a multi-agent system that is written in Erlang. Program shaping is the process of transforming a program to better enable the introduction of parallelism. Whilst algorithmic skeletons abstract away the low-level aspects of parallel programming that often plague traditional techniques, it is not always easy to introduce them into an arbitrary program, especially one that has not been written with parallelism in mind. Amongst other issues, data may not always be in a compatible format, function calls may need to be replicated to support alternative uses, side-effects may need to be isolated, or there may be dependencies between functions and data that obstruct the introduction of parallelism. Program shaping can be used to transform such code to a form that allows skeletons to be more easily introduced. In this paper, we present a series of generic program shaping rewrite rules, provide their implementation as refactorings, and show how they can be used to parallelise an Evolutionary Multi-Agent System (MAS) written in Erlang. We show that we can significantly speed up this application, obtaining super-linear speedups of over 70 times the original sequential performance on a 64-core shared-memory machine.
Cite this article
@article{cai-3378,
author = {Adam D. Barwell and Christopher Brown and Kevin Hammond and Wojciech Turek and Aleksander Byrski},
title = {Using Program Shaping and Algorithmic Skeletons to Parallelise an Evolutionary Multi-Agent System in Erlang},
journal = {Computing and Informatics},
volume = {35},
number = {4},
pages = {792--818},
year = {2016},
issn = {1335-9150},
url = {https://cai.type.sk/content/2016/4/using-program-shaping-and-algorithmic-skeletons-to-parallelise-an-evolutionary-multi-agent-system-in-erlang/}
}
TY - JOUR AU - Adam D. Barwell AU - Christopher Brown AU - Kevin Hammond AU - Wojciech Turek AU - Aleksander Byrski TI - Using Program Shaping and Algorithmic Skeletons to Parallelise an Evolutionary Multi-Agent System in Erlang JO - Computing and Informatics VL - 35 IS - 4 SP - 792 EP - 818 PY - 2016 SN - 1335-9150 UR - https://cai.type.sk/content/2016/4/using-program-shaping-and-algorithmic-skeletons-to-parallelise-an-evolutionary-multi-agent-system-in-erlang/ ER -
Barwell, A. D., Brown, C., Hammond, K., Turek, W., & Byrski, A. (2016). Using Program Shaping and Algorithmic Skeletons to Parallelise an Evolutionary Multi-Agent System in Erlang. Computing and Informatics, 35(4), 792–818. https://cai.type.sk/content/2016/4/using-program-shaping-and-algorithmic-skeletons-to-parallelise-an-evolutionary-multi-agent-system-in-erlang/