Skip to content

Commit 8d36b9b

Browse files
committed
Add a note about unable to write errors for summary/statepoint files on OpenMC re-runs from Python API.
1 parent d331410 commit 8d36b9b

2 files changed

Lines changed: 18 additions & 0 deletions

File tree

‎docs/source/usersguide/troubleshoot.rst‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,23 @@ with the :envvar:`OPENMC_CROSS_SECTIONS` environment variable. It is recommended
4545
to add a line in your ``.profile`` or ``.bash_profile`` setting the
4646
:envvar:`OPENMC_CROSS_SECTIONS` environment variable.
4747

48+
RuntimeError: Failed to open HDF5 file with mode 'w': summary.h5
49+
****************************************************************
50+
51+
This often occurs when working with the Python API and executing multiple OpenMC
52+
runs in a script. If an :class:`openmc.StatePoint` is open in the Python interpreter,
53+
the file handle of the statpoint file as well as the linked `summary.h5` file will
54+
be unavailable for writing, causing this error to appear. To avoid the situation,
55+
it is recommended that data be extracted from statepoint files in a context manager:
56+
57+
.. code-block:: python
58+
59+
with openmc.StatePoint('statepoint.10.h5') as sp:
60+
k_eff = sp.k_combined
61+
62+
or that the :meth:`StatePoint.close` method is called before executing a subsequent
63+
OpenMC run.
64+
4865
Geometry Debugging
4966
******************
5067

‎examples/jupyter/chain_simple.xml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../tests/chain_simple.xml

0 commit comments

Comments
 (0)