Cross Section not found in certain file

Hello,

I am new to OpenMC and I was trying out the “Pincell Depletion” Jupyter example notebook. When I am trying to run the line

operator = openmc.deplete.Operator(geometry, settings, chain_file)

I get an error telling me “No cross_section.xml specified in materials”. But a couple lines above the operator line I set:

xsec_path = ‘path to cross section directory/1cross_section.xml’
materials.cross_sections = xsec_path
materials.export_to_xml()

I checked the materials.xml file and the path to the 1cross_section.xml file shows up. Also using the exact same code for the “Modeling a Pin-Cell” example works without any issue.
I am using the official LANL-Based Data Library (ENDF/B-VII.1) and I am on version 0.12 of OpenMC

Does anybody know what the issue might be?
Thank you for your help!

Can you try setting the OPENMC_CROSS_SECTION environment variable? This thread has a similar issue and (possible) solution

Thank you! It fixed my issue.
EDIT: Do you know if it is possible to use OMP in Depletion caclulations? I’d assume that it works, but I couldn’t figure out how to activate it, as there is no instance of “openmc.run()” in the example notebook where I could specify the thread count.
Using

os.environ[‘OMP_NUM_THREADS’] = ‘26’

didn’t activate multi-core calculation.

Thank you

OpenMP is activated by default, so your depletion calculation should be using all cores/threads on your machine without needing to specify anything.

That is strange. I was looking at my thread use and only one core was actually loaded to 100%. The rest was at idle.
Maybe I am missing something obvious, but do you have an idea as to what might be the issue?
Thank you a lot!

It depends on when you look at the usage. During the actual transport of particles, it will be running in parallel, but between batches and during initialization/finalization, generally only one core is active. If you look at the CPU usage when, e.g., cross sections are being loaded, you will only see one core active. Are you looking at CPU usage during the transport simulation? Also, the number of threads should be reported at the beginning of a simulation (after seeing the OpenMC logo).