Abstract
We present a C++14 library for performance portability of scientific computing codes across CPU and GPU architectures. Our library combines generic data structures like vectors, multi-dimensional arrays, maps, graphs, and sparse grids with basic, reusable algorithms like convolutions, sorting, prefix sum, reductions, and scan. The memory layout of the data structures is adapted at compile-time using tuples with optional memory mirroring between CPU and GPU. We combine this transparent memory mapping with generic algorithms under two alternative programming interfaces: a CUDA-like kernel interface for multi-core CPUs, Nvidia GPUs, and AMD GPUs, as well as a lambda interface. We validate and benchmark the presented library using micro-benchmarks, showing that the abstractions introduce negligible performance overhead, and we compare performance against the current state of the art.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Notes
References
Beckingsale, D.A., et al.: RAJA: portable performance for large-scale scientific applications. In: 2019 IEEE/ACM International Workshop on Performance, Portability and Productivity in HPC (P3HPC), pp. 71–81 (2019). https://doi.org/10.1109/P3HPC49587.2019.00012
Gruber, B.M., Amadio, G., Blomer, J., Matthes, A., Widera, R., Bussmann, M.: LLAMA: the low-level abstraction for memory access. In: Software: Practice and Experience, pp. 1–27 (2022). https://doi.org/10.1002/spe.3077
Incardona, P., Bianucci, T., Sbalzarini, I.F.: Distributed sparse block grids on GPUs. In: Chamberlain, B.L., Varbanescu, A.-L., Ltaief, H., Luszczek, P. (eds.) ISC High Performance 2021. LNCS, vol. 12728, pp. 272–290. Springer, Cham (2021). https://doi.org/10.1007/978-3-030-78713-4_15
Incardona, P., Leo, A., Zaluzhnyi, Y., Ramaswamy, R., Sbalzarini, I.F.: OpenFPM: a scalable open framework for particle and particle-mesh codes on parallel computers. Comput. Phys. Commun. 241, 155–177 (2019). https://doi.org/10.1016/j.cpc.2019.03.007
Poenaru, A., Lin, W.-C., McIntosh-Smith, S.: A performance analysis of modern parallel programming models using a compute-bound application. In: Chamberlain, B.L., Varbanescu, A.-L., Ltaief, H., Luszczek, P. (eds.) ISC High Performance 2021. LNCS, vol. 12728, pp. 332–350. Springer, Cham (2021). https://doi.org/10.1007/978-3-030-78713-4_18
Reyes, R., Lomüller, V.: SYCL: Single-source C++ accelerator programming. In: Parallel Computing: On the Road to Exascale, pp. 673–682. IOS Press (2016). https://doi.org/10.3233/978-1-61499-621-7-673
Sbalzarini, I.F.: Abstractions and middleware for petascale computing and beyond. Intl. J. Distr. Syst. Technol. 1(2), 40–56 (2010). https://doi.org/10.4018/jdst.2010040103
Trott, C.R., et al.: Kokkos 3: programming model extensions for the exascale era. IEEE Trans. Parallel Distrib. Syst. 33(4), 805–817 (2022). https://doi.org/10.1109/TPDS.2021.3097283
Zenker, E., et al.: Alpaka-an abstraction library for parallel kernel acceleration. In: 2016 IEEE International Parallel and Distributed Processing Symposium Workshops (IPDPSW), pp. 631–640. IEEE (2016). https://doi.org/10.1109/IPDPSW.2016.50
Acknowledgments
We thank Christian Trott from the Kokkos project for his help and advise in tuning the Kokkos benchmarks for optimal performance. The authors are grateful to the Centre for Information Services and High Performance Computing (ZIH) of TU Dresden and the Scientific Computing Facility of MPI-CBG for providing their facilities for the benchmarks. This work was supported by the Federal Ministry of Education and Research (Bundesministerium für Bildung und Forschung, BMBF) under grants 01/S18026A-F (competence center for Big Data and AI “ScaDS.AI Dresden/Leipzig”) and 031L0160 (project “SPlaT-DM – computer simulation platform for topology-driven morphogenesis”).
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Ethics declarations
Code availability
The source code of the presented library is available under the GPLv3 license as part of the OpenFPM project for scalable scientific computing (http://openfpm.mpi-cbg.de/) at: https://git.mpi-cbg.de/mosaic/software/parallel-computing/openfpm.
Rights and permissions
Copyright information
© 2023 The Author(s), under exclusive license to Springer Nature Switzerland AG
About this paper
Cite this paper
Incardona, P., Gupta, A., Yaskovets, S., Sbalzarini, I.F. (2023). A C++ Library for Memory Layout and Performance Portability of Scientific Applications. In: Singer, J., Elkhatib, Y., Blanco Heras, D., Diehl, P., Brown, N., Ilic, A. (eds) Euro-Par 2022: Parallel Processing Workshops. Euro-Par 2022. Lecture Notes in Computer Science, vol 13835. Springer, Cham. https://doi.org/10.1007/978-3-031-31209-0_8
Download citation
DOI: https://doi.org/10.1007/978-3-031-31209-0_8
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-031-31208-3
Online ISBN: 978-3-031-31209-0
eBook Packages: Computer ScienceComputer Science (R0)