SoAx: A generic C plus plus Structure of Arrays for handling particles in HPC codes

被引:11
|
作者
Homann, Holger [1 ]
Laenen, Francois [1 ]
机构
[1] Univ Cote Azur, Lab JL Lagrange, Observ Cote Azur, CNRS, F-06304 Nice, France
基金
欧洲研究理事会;
关键词
C plus; Heterogeneous data; Template metaprogramming; Generic programming; IMPLEMENTATION;
D O I
10.1016/j.cpc.2017.11.015
中图分类号
TP39 [计算机的应用];
学科分类号
081203 ; 0835 ;
摘要
The numerical study of physical problems often require integrating the dynamics of a large number of particles evolving according to a given set of equations. Particles are characterized by the information they are carrying such as an identity, a position other. There are generally speaking two different possibilities for handling particles in high performance computing (HPC) codes. The concept of an Array of Structures (AoS) is in the spirit of the object -oriented programming (OOP) paradigm in that the particle information is implemented as a structure. Here, an object (realization of the structure) represents one particle and a set of many particles is stored in an array. In contrast, using the concept of a Structure of Arrays (SoA), a single structure holds several arrays each representing one property (such as the identity) of the whole set of particles. The AoS approach is often implemented in HPC codes due to its handiness and flexibility. For a class of problems, however, it is known that the performance of SoA is much better than that of AoS. We confirm this observation for our particle problem. Using a benchmark we show that on modern Intel Xeon processors the SoA implementation is typically several times faster than the AoS one. On Intel's MIC co-processors the performance gap even attains a factor often. The same is true for GPU computing, using both computational and multi-purpose CPUs. Combining performance and handiness, we present the library SoAx that has optimal performance (on CPUs, MICs, and GPUs) while providing the same handiness as AoS. For this, SoAx uses modern C++ design techniques such template meta programming that allows to automatically generate code for user defined heterogeneous data structures. Program summary Program Title: SoAx Program Files doi: http://dx.doi.org/10.176320463pc4mv8.1 Licensing provisions: GPLv3 Programming language: C++ Nature of problem: Structures of arrays (SoA) are generally faster than arrays of structures (AoS) while AoS are more handy. This library (SoAx) combines the advantages of both. By means of C++( 11) meta-template programming SoAx achieves maximal performance (efficient use of vector units and cache of modern CPUs) while providing a very convenient user interface (including object-oriented element handling) and flexibility. It has been designed to handle list-like sets of particles (similar to struct int id; double[3] pos; float[3] vel;;) in the context of high-performance numerical simulations. It can be applied to many other problems. Solution method: Template Metaprogramming, Expression Templates (C) 2017 Elsevier B.V. All rights reserved.
引用
收藏
页码:325 / 332
页数:8
相关论文
共 50 条
  • [1] Testing C plus plus Generic Libraries
    Sutton, Andrew
    Zalewski, Marcin
    [J]. 2012 28TH IEEE INTERNATIONAL CONFERENCE ON SOFTWARE MAINTENANCE (ICSM), 2012, : 36 - 45
  • [2] Designing HPC libraries in the modern C plus plus world
    Falcou, Joel
    [J]. PROCEEDINGS OF THE 2015 INTERNATIONAL CONFERENCE ON HIGH PERFORMANCE COMPUTING & SIMULATION (HPCS 2015), 2015, : 458 - 459
  • [3] Support for the Evolution of C plus plus Generic Functions
    Pirkelbauer, Peter
    Dechev, Damian
    Stroustrup, Bjarne
    [J]. SOFTWARE LANGUAGE ENGINEERING, 2011, 6563 : 123 - +
  • [4] BES plus plus : HPC Profile Open Source C Implementation
    Ruiz-Alvarez, Arkaitz
    Smith, Christopher
    Humphrey, Marty
    [J]. 2008 9TH IEEE/ACM INTERNATIONAL CONFERENCE ON GRID COMPUTING, 2008, : 41 - +
  • [5] Axioms as generic rewrite rules in C plus plus with concepts
    Tang, Xiaolong
    Jaervi, Jaakko
    [J]. SCIENCE OF COMPUTER PROGRAMMING, 2015, 97 : 320 - 330
  • [6] Detecting Exception Handling Bugs in C plus plus Programs
    Zhang, Hao
    Luo, Ji
    Hu, Mengze
    Yan, Jun
    Zhang, Jian
    Qiu, Zongyan
    [J]. 2023 IEEE/ACM 45TH INTERNATIONAL CONFERENCE ON SOFTWARE ENGINEERING, ICSE, 2023, : 1084 - 1095
  • [7] Using C plus plus AMP to Accelerate HPC Applications on Multiple Platforms
    Lopez, M. Graham
    Bergstrom, Christopher
    Li, Ying Wai
    Elwasif, Wael
    Hernandez, Oscar
    [J]. HIGH PERFORMANCE COMPUTING, ISC HIGH PERFORMANCE 2016 INTERNATIONAL WORKSHOPS, 2016, 9945 : 563 - 576
  • [8] Distributed & Heterogeneous Programming in C plus plus for HPC at SC17
    Wong, Michael
    Finkel, Hal
    [J]. IWOCL'18: PROCEEDINGS OF THE INTERNATIONAL WORKSHOP ON OPENCL, 2018, : 76 - 82
  • [9] Evaluating ISO C plus plus Parallel Algorithms on Heterogeneous HPC Systems
    Lin, Wei-Chen
    Deakin, Tom
    McIntosh-Smith, Simon
    [J]. 2022 IEEE/ACM INTERNATIONAL WORKSHOP ON PERFORMANCE MODELING, BENCHMARKING AND SIMULATION OF HIGH PERFORMANCE COMPUTER SYSTEMS (PMBS), 2022, : 36 - 47
  • [10] Checking C plus plus Codes for Compatibility with Operator Overloading
    Hueck, Alexander
    Bischof, Christian
    Utke, Jean
    [J]. 2015 IEEE 15TH INTERNATIONAL WORKING CONFERENCE ON SOURCE CODE ANALYSIS AND MANIPULATION (SCAM), 2015, : 91 - 100