Frontiers of Data and Computing ›› 2022, Vol. 4 ›› Issue (5): 108-119.

CSTR: 32002.14.jfdc.CN10-1649/TP.2022.05.012

doi: 10.11871/jfdc.issn.2096-742X.2022.05.012

• Technology and Application • Previous Articles     Next Articles

Porting and Optimizing Gadget-2 on a Heterogeneous Accelerator Platform

ZHAO Wenlong1,2,WANG Wu1,*()   

  1. 1. Computer Network Information Center, Chinese Academy of Sciences, Beijing 100083, China
    2. University of Chinese Academy of Sciences, Beijing 100049, China
  • Received:2021-11-23 Online:2022-10-20 Published:2022-10-27
  • Contact: WANG Wu E-mail:wangwu@sccas.cn

Abstract:

[Objective] In this paper, we present the work on porting the parallel cosmological N-body simulation software Gadget-2 to a homegrown heterogeneous accelerator platform, based on the BH-Tree and the Particle-Mesh methods. [Methods] The most time-consuming part, computation of short-range force, is ported to the accelerator with HIP, including the traversal of the local tree. The Structure of Arrays is reconstructed, the register and shared memory are fully utilized to improve the efficiency of memory access on the device. [Results] Numerical results show that the performance of the optimized software and the part of short-range force computation are accelerated up to 13.27 times and 35.67 times, respectively. The parallel efficiency reaches 57.29%. The optimized version is validated by the power spectrum. [Conclusions] The cosmological N-body simulations software Gadget-2 is ported and optimized on a heterogeneous accelerator platform, which can support large-scale cosmological simulation.

Key words: N-body problem, TreePM method, Heterogeneous Accelerator Platform, HIP