MaReCo: Configurable Map and Reduce Algorithmic Skeletons with Closure Support for GPUs in Elixir

  • Frederico Peixoto Antunes UFPel
  • André Rauber Du Bois UFPel
  • Gerson Geraldo Homrich Cavalheiro UFPel

Resumo


The rising demand for high-performance computing has boosted the adoption of abstractions that simplify parallel programming. One such abstraction is the use of algorithmic skeletons, which encapsulate recurring patterns such as Map and Reduce. This work presents MaReCo, a configurable Map and Reduce algorithmic skeleton library for GPUs in the Elixir language, providing skeletons whose behavior can be customized through parameters and whose computations can capture values from the surrounding Elixir environment through closures. This work seeks to reconcile expressiveness and efficiency by evaluating its performance against handwritten CUDA and CPU-based Elixir implementations across five benchmark applications. Results show that MaReCo achieves competitive performance compared with handwritten CUDA, with differences close to 1% for N-Body, while consistently outperforming the CPU-based Elixir implementations.

Referências

Bird, R. and Wadler, P. (1988). Introduction to Functional Programming. Prentice Hall International, Hertfordshire, UK.

Cardoso, F. J. S. d. F. (2022). Extending, improving and optimizing Marrow. Master’s thesis, Faculdade de Ciências e Tecnologia, Universidade Nova de Lisboa, Lisboa, Portugal.

Chakravarty, M. M., Keller, G., Lee, S., McDonell, T. L., and Grover, V. (2011). Accelerating Haskell array codes with multicore GPUs. In Proceedings of the sixth workshop on Declarative aspects of multicore programming, pages 3–14.

Che, S., Boyer, M., Meng, J., Tarjan, D., Sheaffer, J. W., Lee, S.-H., and Skadron, K. (2009). Rodinia: A benchmark suite for heterogeneous computing. In 2009 IEEE international symposium on workload characterization (IISWC), pages 44–54. Ieee.

Ciechanowicz, P., Poldner, M., and Kuchen, H. (2009). The Münster skeleton library Muesli: A comprehensive overview. In J. Becker, K. Backhaus, H. L. G., editor, Working Papers, European Research Center for Information Systems.

Cole, M. I. (1989). Algorithmic skeletons: structured management of parallel computation. Pitman, London, UK.

Dongarra, J. J., Du Croz, J., Hammarling, S., and Hanson, R. J. (1988). An extended set of FORTRAN basic linear algebra subprograms. ACM Trans. Math. Softw., 14(1).

Du Bois, A., Perlin, T., Antunes, F. P., and Cavalheiro, G. (2024). Hok: Higher-order GPU kernels in Elixir. In Anais do XXVIII Simpósio Brasileiro de Linguagens de Programação, pages 71–80, Porto Alegre, RS, Brasil. SBC.

Du Bois, A. R. and Cavalheiro, G. (2023). GPotion: An embedded DSL for GPU programming in Elixir. In Proceedings of the XXVII Brazilian Symposium on Programming Languages, pages 1–8.

Du Bois, A. R. and Cavalheiro, G. (2025). Polymorphic higher-order GPU kernels. In European Conference on Parallel Processing, pages 100–113. Springer.

Enmyren, J. and Kessler, C. W. (2010). SkePU: a multi-backend skeleton programming library for multi-GPU systems. In Fourth International Workshop on High-level parallel programming and applications, pages 5–14.

Ernsting, S. and Kuchen, H. (2012). Algorithmic skeletons for multi-core, multi-GPU systems and clusters. International Journal of High Performance Computing and Networking, 7(2):129–138.

Ernsting, S. and Kuchen, H. (2017). Data parallel algorithmic skeletons with accelerator support. International Journal of Parallel Programming, 45(2):283–299.

Ernstsson, A., Ahlqvist, J., Zouzoula, S., and Kessler, C. (2021). SkePU 3: Portable high-level programming of heterogeneous systems and HPC clusters. International Journal of Parallel Programming, 49(6):846–866.

Ernstsson, A., Li, L., and Kessler, C. (2018). SkePU 2: Flexible and type-safe skeleton programming for heterogeneous parallel systems. International Journal of Parallel Programming, 46(1):62–80.

Fonseca, A. and Cabral, B. (2013). ÆminiumGPU: An Intelligent Framework for GPU Programming, pages 96–107. Springer Berlin Heidelberg, Berlin, Heidelberg.

Henriksen, T., Serup, N. G., Elsman, M., Henglein, F., and Oancea, C. E. (2017). Futhark: purely functional GPU-programming with nested parallelism and in-place array updates. In Proceedings of the 38th ACM SIGPLAN Conference on Programming Language Design and Implementation, pages 556–571.

Herrmann, N. (2024). The Algorithmic Skeleton Library Revisited: The Münster Skeleton Library. PhD thesis, Westfälische Wilhelms-Universität Münster, Münster, Germany. Dissertation, Deutsche Nationalbibliothek IDN 1355252458.

Herrmann, N., Dieckmann, J., and Kuchen, H. (2024). Optimizing three-dimensional stencil-operations on heterogeneous computing environments. International Journal of Parallel Programming, 52(4):274–297.

Lam, S. K., Pitrou, A., and Seibert, S. (2015). Numba: A LLVM-based Python JIT compiler. In Proceedings of the Second Workshop on the LLVM Compiler Infrastructure in HPC, pages 1–6.

Mann, H. B. and Whitney, D. R. (1947). On a test of whether one of two random variables is stochastically larger than the other. The Annals of Mathematical Statistics, 18(1):50–60.

Marques, R., Paulino, H., Alexandre, F., and Medeiros, P. D. (2013). Algorithmic skeleton framework for the orchestration of GPU computations. In Euro-Par 2013 Parallel Processing, pages 874–885. Springer Berlin Heidelberg.

Nickolls, J., Buck, I., Garland, M., and Skadron, K. (2008). Scalable parallel programming with CUDA: Is CUDA the parallel programming model that application developers have been waiting for? Queue, 6(2):40–53.

NVIDIA (2023). Fundamentals of accelerated computing with CUDA C/C++. Online course, NVIDIA Deep Learning Institute. Accessed: 2026-06-01.

Owens, J. D., Houston, M., Luebke, D., Green, S., Stone, J. E., and Phillips, J. C. (2008). GPU computing. Proceedings of the IEEE, 96(5):879–899.

Qummar, S., Ernstsson, A., Kessler, C., and Sysoev, O. (2025). SkePU-DNN: Algorithmic skeleton programming for deep learning on heterogeneous systems. In 2025 IEEE International Parallel and Distributed Processing Symposium Workshops (IPDPSW), pages 423–432.

Rodrigues, H. G., Du Bois, A. R., and Cavalheiro, G. G. H. (2026). Kernels de ordem superior para GPUs compatíveis com OpenCL utilizando metaprogramação em Elixir. In Seminário Integrado de Software e Hardware (SEMISH), pages 422–433. SBC.

Sanders, J. and Kandrot, E. (2010). CUDA by example: an introduction to general-purpose GPU programming. Addison-Wesley Professional, Boston, MA.

Tillet, P., Kung, H.-T., and Cox, D. (2019). Triton: an intermediate language and compiler for tiled neural network computations. In Proceedings of the 3rd ACM SIGPLAN International Workshop on Machine Learning and Programming Languages, pages 10–19.

Valim, J., Moriarity, S., and contributors (2021). Nx: Multi-dimensional arrays (tensors) and numerical definitions for Elixir. [link].

Valim, J. and the Elixir Team (2026). Elixir programming language. Version 1.20.
Publicado
03/11/2026
ANTUNES, Frederico Peixoto; DU BOIS, André Rauber; CAVALHEIRO, Gerson Geraldo Homrich. MaReCo: Configurable Map and Reduce Algorithmic Skeletons with Closure Support for GPUs in Elixir. In: SIMPÓSIO EM SISTEMAS COMPUTACIONAIS DE ALTO DESEMPENHO (SSCAD), 27. , 2026, Natal/RN. Anais [...]. Porto Alegre: Sociedade Brasileira de Computação, 2026 . p. 357-370. DOI: https://doi.org/10.5753/sscad.2026.34953.