Skip to content

Research at St Andrews

Using “program shaping” and algorithmic skeletons to parallelise an evolutionary multi-agent system in Erlang

Research output: Contribution to journalArticle


Adam David Barwell, Christopher Mark Brown, Kevin Hammond, Wojciech Turek, Aleksander Byrski

School/Research organisations


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 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× the original sequential performance on a 64-core shared-memory machine.


Original languageEnglish
Number of pages37
JournalComputing and Informatics
Issue number4
Publication statusPublished - 2016

Discover related content
Find related publications, people, projects and more using interactive charts.

View graph of relations

Related by author

  1. A hybrid approach to parallel pattern discovery in C++

    Brown, C. M., Janjic, V., Barwell, A. D., Thomson, J. D., Castañeda Lozano, R., Cole, M., Franke, B., Garcia-Sanchez, J. D., Del Rio Astorga, D. & MacKenzie, K., 1 Dec 2019, (Accepted/In press) 2020 28th Euromicro International Conference on Parallel, Distributed and Network-Based Processing (PDP). IEEE Computer Society

    Research output: Chapter in Book/Report/Conference proceedingConference contribution

  2. Reasoning about non-functional properties using compiler intrinsic function annotations

    Jadhav, S., Roth, M., Falk, H., Brown, C. M. & Barwell, A. D., 6 Nov 2019, Proceedings of the 13th Junior Researcher Workshop on Real-Time Computing. INP ENSEEIHT/IRIT, p. 25-28 4 p.

    Research output: Chapter in Book/Report/Conference proceedingConference contribution

  3. Type-driven verification of non-functional properties

    Brown, C. M., Barwell, A. D., Marquer, Y., Minh, C. & Zendra, O., 7 Oct 2019, Proceedings of the 21st International Symposium on Principles and Practice of Programming Languages 2019 (PPDP '19). New York: ACM, p. 1-15 15 p. 6

    Research output: Chapter in Book/Report/Conference proceedingConference contribution

  4. Refactoring for introducing and tuning parallelism for heterogeneous multicore machines in Erlang

    Janjic, V., Brown, C., Barwell, A. & Hammond, K., 24 Jun 2019, In : Concurrency and Computation : Practice and Experience. Early View, p. 1-25 25 p., e5420.

    Research output: Contribution to journalArticle

ID: 241609256