OpenMC "freezes" when simulating batches


When running a multi-layer shield, about 10% of the time my program will “freeze.” It does not crash, however, it will sit seemingly indefinitely without doing much. I am currently working in Jupyter and have tried running it manually outside of Jupyter, commenting out tallies and other non-essential operations, and my simulation will always “die” at the same batch. I have also tried only running one batch (fixed source simulation) and it often does not even get through the one. My task manager shows that the CPU is close to 100% power for OpenMC, so I am convinced it’s still trying to run calculations, it’s just not getting anywhere. I am having issues debugging this issue and would like some advice.

  1. Is the random number seed changed for each run/batch? If not, is there a way I can change it to see if I have some small inconsistency that is being “triggered” each time?

  2. Is there some kind of “verbose” run setting where OpenMC will specify what it is doing in each batch? Since no error is thrown I am trying to dig down into where it is actually getting stuck, but I can’t seem to find any way to tell what it’s doing within each batch.

Thanks in advance for the help.

@madhofs Sorry to hear you’re running into some trouble with your multi-layer shield.

The starting seed for each run will always be the same unless you explicitly ask for a different one. The seed can be changed via:

settings = openmc.Settings()
settings.seed = ...  # Any positive integer

Yes, there is indeed:

settings = openmc.Settings()
settings.verbosity = ... # Number between 1 and 10

The default setting is 7, so you can try bumping it up to 8, 9, and 10. Note that you will probably want to run with only a single thread (openmc -s 1 from a command line or from Python) or else you’ll get multiple threads writing output simultaneously.