Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reset timers at correct place in deplete #2821

Merged
merged 2 commits into from
Jan 11, 2024

Conversation

gridley
Copy link
Contributor

@gridley gridley commented Jan 5, 2024

Description

The particle/second and overall time reports in openmc.deplete are always wrong when using the CoupledOperator. It turns out that we're only resetting the simulation timers when beginning-of-step material compositions are written, but this causes the run times to be summed as the simulation goes. We call openmc.lib.reset() after each transport solve, but don't reset the timers for some reason. As a result, you see a reported steadily decreasing particle tracking rate in each depletion step. For CECM with its two steps, it looks like:

 Total time for initialization     = 0.0000e+00 seconds
   Reading cross sections          = 0.0000e+00 seconds
 Total time in simulation          = 2.5036e+01 seconds
   Time in transport only          = 2.4877e+01 seconds
   Time in inactive batches        = 2.4421e+00 seconds
   Time in active batches          = 2.2594e+01 seconds
   Time synchronizing fission bank = 3.0581e-02 seconds
     Sampling source sites         = 2.6034e-02 seconds
     SEND/RECV source sites        = 4.4951e-03 seconds
   Time accumulating tallies       = 1.0246e-01 seconds
   Time writing statepoints        = 3.1361e-03 seconds
 Total time for finalization       = 5.0679e-05 seconds
 Total time elapsed                = 2.5147e+01 seconds
 Calculation Rate (inactive)       = 40947.9 particles/second
 Calculation Rate (active)         = 39834 particles/second

<BLAH BLAH TRANSPORT SOLVE OUTPUT>

 Total time for initialization     = 0.0000e+00 seconds
   Reading cross sections          = 0.0000e+00 seconds
 Total time in simulation          = 5.0078e+01 seconds
   Time in transport only          = 4.9802e+01 seconds
   Time in inactive batches        = 4.9050e+00 seconds
   Time in active batches          = 4.5173e+01 seconds
   Time synchronizing fission bank = 6.2849e-02 seconds
     Sampling source sites         = 5.2417e-02 seconds
     SEND/RECV source sites        = 1.0335e-02 seconds
   Time accumulating tallies       = 1.6187e-01 seconds
   Time writing statepoints        = 5.7461e-03 seconds
 Total time for finalization       = 1.1893e-04 seconds
 Total time elapsed                = 5.0306e+01 seconds
 Calculation Rate (inactive)       = 20387.5 particles/second
 Calculation Rate (active)         = 19923.2 particles/second

even though the tracking rate is not actually slowing down. This was quite confusing to me, as it seemed like we were somehow slowing down the simulation in the intermediate depletion steps!

After making the change here, the correct particle tracking rates are reported at each substep.

@gridley gridley requested a review from drewejohnson as a code owner January 5, 2024 22:44
@gridley gridley force-pushed the correct_depletion_timer_reset branch from cec0962 to 3a1d55f Compare January 6, 2024 20:13
Copy link
Contributor

@paulromano paulromano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix!

@paulromano paulromano merged commit d8e9d58 into openmc-dev:develop Jan 11, 2024
18 checks passed
@gridley gridley deleted the correct_depletion_timer_reset branch July 10, 2024 18:24
church89 pushed a commit to openmsr/openmc that referenced this pull request Jul 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants