摘要
针对目前大多数计算流体力学程序对系统的单核计算能力利用不足,提出一种针对计算流体力学程序的单核指令级优化方法。该方法首先分析程序的性能指标存在潜在的性能不足,根据分析结果进行优化;依据容器的存储特性和系统的访存特性,对程序的存储结构和访存顺序进行调整,以优化空间开销和访存性能;对CPU的流水机制进行分析,在循环和分支中消除指令的控制相关和数据相关从而达到减少流水中断率的目的;分析编译器对高级语言的处理特点并结合系统中的运行时栈在指令级作出分析,优化指令结构从而减少指令冗余和降低指令复杂度。实验结果表明,在TIANHE-1A超级计算机系统上进行测试,与优化前程序相比,优化后的程序执行时间约减少68.34%,空间消耗约减少55.43%。通过对程序性能各项指标进行分析的结果表明,程序在流水中断率、缓存命中率及机器指令数等性能指标上均有大幅地提升,该方法优化覆盖范围多于目前其他优化方法,有较好的优化效果,在计算流体力学程序优化研究中具有一定的借鉴价值。
A single-core instruction-level optimization method for computational fluid dynamics(CFD)programs is proposed to overcome the shortage of most current CFD programs in utilizing the single-core computing power of a system.The method first analyzes the performance indicators of a program to find potential performance deficiencies,and then optimizes them according to the analysis results.Then the memory structure and memory access sequence are adjusted according to the memory access characteristics of the system and the container to optimize memory access performance and space overhead.The pipeline mechanism of CPU is analyzed,and the control correlation and data correlation of instructions in loops and branches are eliminated to reduce the pipeline interruption rate.Both the characteristics of a compiler processing the high-level language and the runtime stack at the instruction level are analyzed to optimize the instruction structure and to reduce instruction redundancy and duplication.Experimental results show that the performance of the optimized program is greatly improved.Testings on TIANHE-1A supercomputer system show that the execution time of the program reduces by 68.34%and the space consumption reduces by 55.43%.Analyses show that the performance of the program is greatly improved in pipeline interruption rate,cache hit rate and number of machine instructions.It shows that the proposed method has more coverage than other existing optimization methods and better optimization effect,and has a good reference value.
作者
刘闯
何峰
肖兮
董小社
张兴军
LIU Chuang;HE Feng;XIAO Xi;DONG Xiaoshe;ZHANG Xingjun(Department of Computer Science and Technology,Xi'an Jiaotong University, Xi'an 710049,China)
出处
《西安交通大学学报》
EI
CAS
CSCD
北大核心
2018年第12期77-83,共7页
Journal of Xi'an Jiaotong University
基金
国家重点研发计划资助项目(2016YFB0200902)
关键词
流体力学程序
指令级优化
访存优化
流水优化
computational fluid dynamics program
instruction-level optimization
memory-access optimization
pipeline optimization