openmc icon indicating copy to clipboard operation
openmc copied to clipboard

Feature Enhancement: Regular Statepoint Dumps

Open yrrepy opened this issue 2 months ago • 4 comments

Description

Right now, usually OpenMC dumps the last statepoint as statepoint.10.h5 One can ask in the settings to dump at several interval in which case one will get multiple sps e.g.: statepoint.2.h5 statepoint.5.h5 statepoint.10.h5

It would be nice to be able to tell OpenMC to dump regularly (every batch) to the final statepoint.

This allows one to work with the currently accumulated results, resume (continue calc) when something unexpected happens (much longer calc than expected, system crash, perhaps a particle lost or super long history etc).

I see it as the most recently finished batch being dumped to a sp (and then the subsequent batches overwriting it)

Alternatives

  1. I suppose the Python workflow could be used to parameterize the dumping of intermediate statepoints and then in final clean-up.

  2. Dump to another intermediate statepoint (statepoint.running.h5, etc)

Compatibility

Don't think there are any compatibility issues.

yrrepy avatar Nov 10 '25 19:11 yrrepy

Hi @yrrepy , it seems that state-point dumps at custom intervals is already supported (?): https://docs.openmc.org/en/v0.15.0/usersguide/settings.html#generation-of-output-files (section 7.6).

pranavkantgaur avatar Nov 17 '25 17:11 pranavkantgaur

Yes, I am aware. 100 statepoints in my run directory, that need to be cleaned up at the end of calculation is messy and not very practical. Some sps get to be huge. You can't predict when a job will crash or something goes awry. Or if you miss-mathed how long a job will take over the weekend and you'd just like to get the most recent result.

The idea is that the last finished batch is dumped to an sp and kept (until overwritten), or perhaps even the last 2 successfully completed batches.

think: PRDMP j j j 2 j

yrrepy avatar Nov 17 '25 18:11 yrrepy

Hi @yrrepy ,

I have added a PR for this, kindly let me know your thoughts on how to improve it.

pranavkantgaur avatar Nov 25 '25 10:11 pranavkantgaur

Thanks, I like the use of -1. That's a common thing elsewhere, though I don't think in OpenMC we do that too much (I'm quite happy with such a toggle).

Could use a bit of sp touch ups here and there. The code implementation itself one of the primes can better affirm.

yrrepy avatar Nov 26 '25 21:11 yrrepy