• 中国计算机学会会刊
  • 中国科技核心期刊
  • 中文核心期刊

计算机工程与科学 ›› 2021, Vol. 43 ›› Issue (04): 634-640.

• 高性能计算 • 上一篇    下一篇

基于RMC的蒙特卡罗程序性能优化

徐海坤1,匡邓晖1,刘杰1,2,龚春叶1,2   

  1. (1.国防科技大学并行与分布处理国家重点实验室,湖南 长沙 410073;

    2.国防科技大学复杂系统软件工程湖南省重点实验室,湖南 长沙 410073)

  • 收稿日期:2020-06-11 修回日期:2020-07-23 接受日期:2021-04-25 出版日期:2021-04-25 发布日期:2021-04-21
  • 基金资助:
    国家重点研发计划(2017YFB0202104,2018YFB0204301)

RMC based performance optimization of Monte Carlo program

XU Hai-kun1,KUANG Deng-hui1,LIU Jie1,2,GONG Chun-ye1,2#br#

#br#
  

  1. (1.Science and Technology on Parallel and Distributed Processing Laboratory,

    National University of Defense Technology,Changsha 410073;

    2.Laboratory of Software Engineering for Complex Systems,
    National University of Defense Technology,Changsha 410073,China)

  • Received:2020-06-11 Revised:2020-07-23 Accepted:2021-04-25 Online:2021-04-25 Published:2021-04-21

摘要: 蒙特卡罗MC方法是核反应堆设计和分析中重要的粒子输运模拟方法。MC方法能够模拟复杂几何形状且计算结果精度高,缺点是需要耗费大量时间进行上亿规模粒子模拟。如何提高蒙特卡罗程序的性能成为大规模蒙特卡罗数值模拟的挑战。基于堆用蒙特卡罗分析程序RMC,先后开展了基于TCMalloc动态内存分配优化、OpenMP线程调度策略优化、vector内存对齐优化和基于HDF5的并行I/O优化等一系列优化手段,对于200万粒子的算例,使其总体性能提高26.45%以上。

关键词: 蒙特卡罗方法, 性能优化, 内存管理, 并行I/O

Abstract: Monte Carlo method (Monte Carlo, MC) is an important particle transport simulation method in nuclear reactor design and analysis. The MC method can simulate complex geometric shapes and the calculation results have high accuracy. The disadvantage is that it takes a lot of time to simulate hundreds of millions of particles to obtain accurate results. How to improve the performance of the Monte Carlo program has become a challenge for large-scale Monte Carlo numerical simulation. Based on the heap MC analysis program RMC, this paper has successively carried out a series of optimization methods such as dynamic memory allocation optimization based on TCMalloc, OpenMP thread scheduling strategy optimization, and vector memory alignment optimization, and parallel I/O optimization based on HDF5. Under the example of calculating 2 million particles, the overall program performance is improved by more than 26.45%.

Key words: Monte Carlo method, performance optimization, memory management, parallel I/O