Modernization of legacy scientific codes is often necessary to keep up with the ever-evolving changes in the compute resource ecosystem. Parallelization and migration from poorly supported software ecosystems are two of the most time-consuming activities in the research software engineering field. This paper presents our experience in the successful, two-phase AI-assisted modernization of NMAP-RKPM, a roughly 60,000-line, 3D explicit solid mechanics physics engine based on the Reproducing Kernel Particle Method (RKPM). We converted this single-threaded, Fortran based MPI application into a OpenMP-parallel C++ based MPI tool in the span of a few months. While Large Language Model (LLM) based tools on their own proved inadequate, we developed a highly structured "hand-holding" agentic AI methodology, like providing manually created examples, ensuring continuous buildability and limiting session scope, that was instead highly effective. The paper provides both the AI-assisted steps that were successful and the problems that we had to overcome, alongside the reasoning behind the chosen path.
翻译:遗留科学代码的现代化通常是必要的,以跟上计算资源生态系统的不断变化。并行化和从支持不佳的软件生态系统迁移是研究软件工程领域中最耗时的两项活动。本文介绍了我们在将基于再生核粒子法(RKPM)的约6万行三维显式固体力学物理引擎NMAP-RKPM成功进行两阶段AI辅助现代化的经验。我们在几个月内将这款基于Fortran的单线程MPI应用转换为基于C++的OpenMP并行MPI工具。虽然基于大语言模型(LLM)的工具本身被证明不够充分,但我们开发了一种高度结构化的“手把手”代理AI方法论,例如提供手动创建的示例、确保可持续构建性以及限制会话范围,这种方法反而非常有效。本文提供了成功的AI辅助步骤和必须克服的问题,以及所选路径背后的推理。