# Restarting depletion performance issue

**URL:** <https://openmc.discourse.group/t/restarting-depletion-performance-issue/5075>\
**Category:** User Support\
**Created:** [December 20, 2024, 3:47am UTC](https://openmc.discourse.group/t/restarting-depletion-performance-issue/5075 "2024-12-20T03:47:30Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![qq1049161694](https://avatars.discourse-cdn.com/v4/letter/q/45deac/32.png) [@qq1049161694](https://openmc.discourse.group/u/qq1049161694)\
**Post date:** [December 20, 2024, 3:47am UTC](https://openmc.discourse.group/t/restarting-depletion-performance-issue/5075/1 "2024-12-20T03:47:30Z")

</div>

Dear experts,

I’m trying to run multiple depletion simulations in one script by looping over 2 variables. Each run is almost the same ,except for the variables. In pseudocode it works like this:

```auto
for var1 in var1_list:
    for var2 in var2_list:
        run_burn_simulation(var1,var2,time_step=[30]*72)
        for t in every 3 months:
            stepRes=read_from_burn_results(t)
            run_decay_simulation(stepRes,time_step=[30]*120)

```

As can be seen, there are a lot of depletion simulations in one looping step of var1 and var2. In the decay simulations, I try to run a “pure” decay simulation(all isotopes included, no transport) as I understand it. I expect it to run at a fast speed(several minutes per decay simulation) since there are no transport simulations at all. At first it does, but as every new round of simulations start, it becomes slower and slower(to several hours per decay simulation). When I ctrl+C the program, I have to hit it multiple times to kill the program(multiple “KeyboardInterrupted” outputed). I think that suggests unknown recursions? And when I restart the progarm, the previous slow performance vanishes, and it’s able to run at a fast speed again, until it worsens. I tried to reload the openmc module via importlib.reload(), but the performance issue persists.

So here are my questions: What caused the performance issue above? Does the issue affect my simulation results? Is there a way to “cleanly” restart/reload openmc?

I attach my script in the attachments. To make things clear, function burn\_model\_run() handles the burn simulation, with geometry, material and other definiotions. Function decay\_model\_run() handles decay simulation, where an openmc.deplete IndependentOperator is used to avoid calling the openmc executable at all. Function dpl\_proc() is for automatic data processing. The main loop is at the bottom of the script. The paths are edited, fyi.  
[main\_all.py](https://openmc.discourse.group/uploads/short-url/xY5FD2jMscYLyWlKL2rT0I1tKV1.py) (12.4 KB)

---

<div class="post-metadata">

**Author:** ![L.Bernard](https://avatars.discourse-cdn.com/v4/letter/l/74df32/32.png) [@L.Bernard](https://openmc.discourse.group/u/L.Bernard)\
**Post date:** [May 1, 2026, 9:14pm UTC](https://openmc.discourse.group/t/restarting-depletion-performance-issue/5075/2 "2026-05-01T21:14:47Z")

</div>

Taking a look at this and had a few quick quick questions. Is the double-call to integrator.integrate on line 326 intentional?

I’m fairly certain that the importlib.reload approach will not help, its resetting the python bindings and any global state in the openmc python code but not the underlying C++ objects.

When you run the script, are you seeing excessive memory usage, maxing out system ram when it slows down?

If this is still an issue, and still of interest I’m happy to investigate further and work on a fix.
