Search papers, labs, and topics across Lattice.
This paper details a two-phase AI-assisted modernization of the NMAP-RKPM, a 60,000-line 3D explicit solid mechanics physics engine, transitioning it from a single-threaded Fortran MPI application to an OpenMP-parallel C++ MPI tool. The authors highlight the limitations of existing LLM-based tools, instead employing a structured "hand-holding" agentic AI methodology that included manually created examples and session scope limitations, which proved to be effective in overcoming modernization challenges. Key results indicate that this approach significantly accelerated the modernization process, addressing the critical need for legacy code adaptation in evolving computational environments.
A structured "hand-holding" AI methodology outperformed traditional LLM tools in modernizing a complex legacy physics engine, revealing new pathways for efficient code adaptation.
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.