arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2512.17023cs.DCcs.SE
收藏

LLM-HPC++: 评估LLM生成的现代C++和MPI+OpenMP代码用于可扩展的曼德勃罗集计算

LLM-HPC++: Evaluating LLM-Generated Modern C++ and MPI+OpenMP Codes for Scalable Mandelbrot Set Computation

Los Alamos National Laboratory(洛斯阿拉莫斯国家实验室);Louisiana State University(路易斯安那州立大学);Texas A&M University-Central Texas(德克萨斯农工大学中央得克萨斯分校)

Patrick Diehl, Noujoud Nader, Deepti Gupta

AI总结:

本文评估了LLM生成的C++和MPI+OpenMP代码在曼德勃罗集计算中的性能,发现ChatGPT-4和5在语法精度和可扩展性方面表现突出。

摘要:

并行编程仍然是高性能计算(HPC)中最具挑战性的方面之一,需要深入理解同步、通信和内存模型的知识。尽管现代C++标准和框架如OpenMP和MPI简化了并行性,但掌握这些范式仍然复杂。最近,大型语言模型(LLMs)在自动化代码生成方面显示出潜力,但其在生成正确且高效的HPC代码方面的有效性尚不明确。在本工作中,我们系统地评估了包括ChatGPT 4和5、Claude和LLaMA在内的领先LLMs,在生成使用共享内存、指令基于和分布式内存范式的曼德勃罗集C++实现的任务上的表现。每个生成的程序都使用GCC 11.5.0进行编译和执行,以评估其正确性、鲁棒性和可扩展性。结果表明,ChatGPT-4和ChatGPT-5在语法精度和可扩展性能方面表现强劲。

英文摘要:

Parallel programming remains one of the most challenging aspects of High-Performance Computing (HPC), requiring deep knowledge of synchronization, communication, and memory models. While modern C++ standards and frameworks like OpenMP and MPI have simplified parallelism, mastering these paradigms is still complex. Recently, Large Language Models (LLMs) have shown promise in automating code generation, but their effectiveness in producing correct and efficient HPC code is not well understood. In this work, we systematically evaluate leading LLMs including ChatGPT 4 and 5, Claude, and LLaMA on the task of generating C++ implementations of the Mandelbrot set using shared-memory, directive-based, and distributed-memory paradigms. Each generated program is compiled and executed with GCC 11.5.0 to assess its correctness, robustness, and scalability. Results show that ChatGPT-4 and ChatGPT-5 achieve strong syntactic precision and scalable performance.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑