数据与计算发展前沿 ›› 2025, Vol. 7 ›› Issue (5): 54-64.

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

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

• 专刊:国产算力新力量,助力科学计算应用新发展 • 上一篇    下一篇

LIBXC在国产异构加速平台上的移植优化

沈敖(),颜宇琪,别丽华*()   

  1. 华中农业大学,农业生物信息湖北省重点实验室,湖北 武汉 430070
  • 收稿日期:2025-02-17 出版日期:2025-10-20 发布日期:2025-10-23
  • 通讯作者: 别丽华
  • 作者简介:沈敖,华中农业大学,硕士研究生,主要研究方向为高性能计算。
    本文承担工作为:移植优化的代码实现,测试数据及图片的提供。
    SHEN Ao is a master’s student at Huazhong Agricultural University. His main research interest is high performance computing.
    In this paper, he is mainly responsible for the code implementation of porting and optimization, as well as providing the test data and figures.
    E-mail: shen_ao@webmail.hzau.ed-u.cn|别丽华,华中农业大学,硕士研究生导师,主要研究方向为高性能计算、分子动力学模拟。
    本文承担工作为:指导移植优化、论文撰写和数据分析。
    BIE Lihua is a master’s supervisor at Huazhong Agricultural University. Her main research interests include high-performance computing and molecular dynamics simulation.
    In this paper, she is mainly responsible for supervising the porting and optimization, manuscript writing, and data analysis.
    E-mail: biebie@mail.hzau.edu.cn
  • 基金资助:
    光合基金(ghfund202202012353);中央高校基本科研业务费专项资金(2662024XXPY003);中央高校基本科研业务费专项资金(2662023XXPY006)

Porting and Optimization of LIBXC on the Domestic Heterogeneous Platform

SHEN Ao(),YAN Yuqi,BIE Lihua*()   

  1. Hua Zhong Agricultural University, Hubei Key Laboratory of Agricultural Bioinformatics, Wuhan, Hubei 430070, China
  • Received:2025-02-17 Online:2025-10-20 Published:2025-10-23
  • Contact: BIE Lihua

摘要:

【目的】 LIBXC是量子化学软件中广泛使用的交换-相关泛函库,已被集成于主流的量化程序包中。将LIBXC适配于国产超算平台上,对于提升量子化学计算能力、推动相关研究的发展具有重要意义。【方法】 本研究基于HIP架构,对LIBXC源码进行了自动转码并采用跨平台工具CMake重新配置和生成了项目的构建系统,针对平台不支持的特性,通过手工编程进行了修改,从而成功实现了LIBXC在国产异构加速平台的移植。同时,引入锁页内存和流技术进一步提升了程序的性能。【结果】 移植优化后的LIBXC库通过了回归测试,且计算结果均达到精度要求。性能测试结果表明,相较于单线程CPU,LDA类泛函的计算加速比可超1,000倍,GGA类泛函的能量计算加速比可达1,699倍。同等测试条件下,该加速卡单卡计算性能与NVIDIA Tesla V100相当。【结论】 该研究成果为量子化学软件的国产化移植提供了底层技术支撑,有助于推动量子化学软件在国产平台的移植和优化,进一步完善国产超算平台的软件生态。

关键词: 交换-相关泛函, 异构计算, 统一内存管理, 流, HIP

Abstract:

[Objective] LLIBXC is a widely used exchange-correlation functional library in quantum chemistry software and has been integrated into mainstream quantum chemistry program packages. Porting and optimizing LIBXC on a homegrown acceleration platform is of great significance for enhancing the computational capabilities of quantum chemistry software and advancing related research. [Methods] Based on the HIP architecture, this study automated the source code translation of LIBXC and reconfigured the building system using the cross-platform tool CMake. Manual optimizations and code modifications were performed to address unsupported platform-specific features, successfully enabling LIBXC’s porting to the domestic heterogeneous platform. Additionally, optimizations such as pinned memory and stream technology were introduced to further improve the performance. [Results] The ported and optimized LIBXC library passes regression testing, achieving full compliance with accuracy requirements. Performance evaluations demonstrate that the speedup of LDA functionals can exceed 1,000 times, and GGA functionals for energy calculations can reach up to 1,699 times speedup compared to the single-threaded CPU version. Under the same testing conditions, the performance of a single acceleration card is comparable to that of the NVIDIA Tesla V100. [Conclusions] This work provides a foundational technical support for the localization of quantum chemistry software, facilitating the porting and optimization of such software on domestic platforms. It contributes to the ongoing development of the software ecosystem for China’s homegrown supercomputing platforms.

Key words: exchange-correlation functional, heterogeneous computing, unified virtual memory, stream, Heterogeneous-compute Interface for Portability