Search papers, labs, and topics across Lattice.
This paper introduces a systematic refactoring approach that leverages Claude agentic AI to optimize discrete-event project-scheduling simulations in Python, addressing performance bottlenecks that hinder scalability in scientific research. By utilizing representative benchmarks and correctness checks, the AI identifies and implements targeted optimizations, significantly enhancing runtime efficiency. The results demonstrate a reduction in execution time from 1,298 seconds to under 200 seconds, yielding substantial cost savings of four million core-hours annually.
Runtime for complex project-scheduling simulations can be slashed from over 1,200 seconds to under 200 seconds using agentic AI optimizations, saving researchers significant computational resources.
Python is widely used in scientific research because it enables rapid development and provides rich ecosystems for data analysis, artificial intelligence (AI), and machine learning. However, customized research code can become prohibitively slow as experiments scale. This challenge is particularly acute in discrete-event project-scheduling simulations, where sequential state updates, nested loops, conditional evaluations, and object-oriented structures limit the benefits of compiled numerical and GPU-accelerated libraries. Addressing these bottlenecks typically requires iterative profiling, refactoring, testing, and validation, yet researchers may lack the time or specialized software-engineering expertise for low-level optimization. This paper presents a systematic refactoring approach using Claude agentic AI on real-world project-scheduling workloads in a high-performance computing (HPC) environment. Guided by representative benchmarks and correctness checks, the agent identifies bottlenecks, implements targeted optimizations, and evaluates their effects, while the researcher retains final control. Testing runtime reduced from 1,298 seconds to under 200 seconds without changing outputs, saving four million core-hours (NZ\$320,000) annually.