# changes of settings.xml to make new openmc work?

**URL:** <https://openmc.discourse.group/t/changes-of-settings-xml-to-make-new-openmc-work/271>\
**Category:** User Support\
**Created:** [May 11, 2017, 9:08pm UTC](https://openmc.discourse.group/t/changes-of-settings-xml-to-make-new-openmc-work/271 "2017-05-11T21:08:00Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jilang\_Miao](https://avatars.discourse-cdn.com/v4/letter/j/6f9a4e/32.png) [@Jilang\_Miao](https://openmc.discourse.group/u/Jilang_Miao)\
**Post date:** [May 11, 2017, 9:08pm UTC](https://openmc.discourse.group/t/changes-of-settings-xml-to-make-new-openmc-work/271/1 "2017-05-11T21:08:00Z")

</div>

Hello All,

I didn’t update my openmc branch until the new version. I have some questions about settings.xml:

1. How to get statepointxxx.h5 for each active generation?  
I used to write the below tags.  
But now after simulation, I only have statepointxxx.h5 for the last generation. And xml parser didn’t report error for the tags below.

\<state\_point\>  
 1   
\</state\_point\>

1. How to get source file for a specific generation?  
I used to write the below tags.

\<source\_point\>  
 1000   
 true   
 true   
\</source\_point\>

But the new version does not even allow the 1000 and gives error as:

Reading settings XML file…  
ERROR: Sourcepoint batches are not a subset of statepoint batches.

The changes may not result from the latest update. I’m sorry to be stuck with older versions for long.

Thanks!  
Jilang

---

<div class="post-metadata">

**Author:** ![paulromano](https://yyz2.discourse-cdn.com/free1/user_avatar/openmc.discourse.group/paulromano/32/486_2.png) [@paulromano](https://openmc.discourse.group/u/paulromano)\
**Post date:** [May 12, 2017, 2:31am UTC](https://openmc.discourse.group/t/changes-of-settings-xml-to-make-new-openmc-work/271/2 "2017-05-12T02:31:43Z")

</div>

Hi Jilang,

The ‘interval’ option for specifying statepoints was removed because the same effect can be achieved easily from the Python API. For example, if you wanted to specify that a statepoint be written every 5 batches, from the Python API this would look like:

settings = openmc.Settings()  
settings.statepoint = {‘batches’: range(1, n, 5)}

If you are writing XML directly, you will now have to explicitly write out all the batch numbers.

For the sourcepoint issue, there is a constraint that a statepoint be written whenever you want the source to be written. So, in your particular case, you just need to specify that a statepoint be written at batch 1000 as well. The ‘separate’ feature should still work fine.

Best,  
Paul

---

<div class="post-metadata">

**Author:** ![Jilang\_Miao](https://avatars.discourse-cdn.com/v4/letter/j/6f9a4e/32.png) [@Jilang\_Miao](https://openmc.discourse.group/u/Jilang_Miao)\
**Post date:** [May 12, 2017, 3:06am UTC](https://openmc.discourse.group/t/changes-of-settings-xml-to-make-new-openmc-work/271/3 "2017-05-12T03:06:22Z")

</div>

Hi Paul,

Thanks for the quick response!  
The python API works perfectly for the ‘interval’ option by writing explicitly the batch numbers.

For the sourcepoint issue, how can I let some batches write statepoint but not write sourcepoint?

Thanks!  
Jilang

---

<div class="post-metadata">

**Author:** ![paulromano](https://yyz2.discourse-cdn.com/free1/user_avatar/openmc.discourse.group/paulromano/32/486_2.png) [@paulromano](https://openmc.discourse.group/u/paulromano)\
**Post date:** [May 12, 2017, 11:33am UTC](https://openmc.discourse.group/t/changes-of-settings-xml-to-make-new-openmc-work/271/4 "2017-05-12T11:33:58Z")

</div>

If you want some batches to write a statepoint file but not a sourcepoint file, just specify those batches under \<state\_point\> but not \<source\_point\>, e.g.

\<state\_point\>  
10 20  
\</state\_point\>  
\<source\_point\>  
10  
\</source\_point\>

This would create a statepoint at batch 20 that doesn’t include the source (if you used true, then you would get a sourcepoint file only at batch 10).

Best,  
Paul

---

<div class="post-metadata">

**Author:** ![Jilang\_Miao](https://avatars.discourse-cdn.com/v4/letter/j/6f9a4e/32.png) [@Jilang\_Miao](https://openmc.discourse.group/u/Jilang_Miao)\
**Post date:** [May 12, 2017, 11:51am UTC](https://openmc.discourse.group/t/changes-of-settings-xml-to-make-new-openmc-work/271/5 "2017-05-12T11:51:34Z")

</div>

It turns out I didn’t understand this sentence well: “For the sourcepoint issue, there is a constraint that a statepoint be written whenever you want the source to be written.”  
I got the sourcepoint error because “Sourcepoint batches are not a subset of statepoint batches.”

Thanks!  
Jilang
