speeding up OpenMC for rapid small simulations

I am using the Python API to run lots of low NPS simulations.

The loading of the nuclear data has become the dominate time consuming part of the simulation.

Within my python loop I create new models but actually use the same nuclear data isotopes for each simulation.

I was wondering if it is possible to load up the h5 files just once at the start and then run many simulations without having to reload the h5 files each time?

Many thanks for developing the code it is most useful.

Maxime and Jon

Hi Maxime,

A few things you may want to consider:

  1. If possible, make sure your data is on a SSD.
  2. You can try using a tool like vmtouch to “lock” the cross section files in the filesystem cache (note that this may require admin privileges).
  3. Depending on what changes you’re making to the model, you might be able to make those changes directly in memory through the C API Python bindings, which means you wouldn’t be stopping/starting the executable each time. This is what we use for depletion and for thermal-hydraulic coupling to avoid excessive filesystem I/O.

Best,
Paul

1 Like

Thanks Paul much appreciated